Solved

get size of an empty column in oracle

Posted on 2010-11-17
5
328 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 500 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…

688 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