Use this query first if you want the size of 1 table and it’s indexes: Note that you need to escape the _, because that is usually a wildcard for any character.
select sum(bytes)/(1024*1024) from dba_segments where segment_name = 'F0911' or segment_name like 'F0911!_%' escape '!'
spool a .sql file with the command below, and that will generate all of the statements for you.
set pagesize 0
set echo off
select 'select sum(bytes)/(1024*1024)' || ', ''' || table_name || '''' || ' from dba_segments where segment_name = ' || '''' || table_name || '''' || ' or segment_name like ' || '''' || table_name || '!_%' || '''' || 'escape ' || '''' || '!' || ''';' from all_tables where table_name like 'F%'
This will generate a bunch of statements like:
select sum(bytes)/(1024*1024), 'F0040Z1' from dba_segments where segment_name = 'F0040Z1' or segment_name like 'F0040Z1!_%'escape '!';
Above is tables and indexes
select 'select sum(bytes)/(1024*1024)' || ', ''' || table_name || '''' || ',''' || owner || '''' || ' from dba_segments where segment_name = ' || '''' || table_name || '''' || ';' from all_tables where table_name like 'F%'
Above is tables only
No comments:
Post a Comment