Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

get size of an empty column in oracle

Posted on 2010-11-17
5
Medium Priority
?
330 Views
Last Modified: 2012-05-10
Hi there,

 I have a heap of tables in a new database that are all blank with some changes dripping in every now and again to the design.

I want to get the size in bytes of the columns in each table... not the length of the data in the column as there is none. So I need to add up the size of number, size of nvarchar 100 etc for a table.  I can only see Avg row size and functions to give me the size of data contained in the row.

PS.. a nice cursor or something that would take in table names and do this would be cool

thanks M
0
Comment
Question by:MickyMc
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 143

Assisted Solution

by:Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3] earned 2000 total points
ID: 34153594
would you be happy querying this system view:
http://ss64.com/orad/DBA_TAB_COLUMNS.html

which has the information you are asking for?
0
 

Accepted Solution

by:
MickyMc earned 0 total points
ID: 34153643
ok,

I did this but not sure if its correct...

select TABLE_NAME, SUM(DATA_LENGTH) from all_tab_Columns
where TABLE_NAME like 'New_%'
GROUP BY TABLE_NAME

I use Like 'New' as all the new tables are prefixed with this but later this will be removed...

Is this the correct way to do it... thanks M
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 34153677
yes, that sounds like a good start :)
0
 

Author Comment

by:MickyMc
ID: 34153726
Cool Angel... this was easier than working out the data size in a row..lol  so this is correct... if so I will award the points... thanks for the link...rgds m
0
 

Author Closing Comment

by:MickyMc
ID: 34186410
thanks Angel
0

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question