Get Table Details of all tables in RDS Oracle

 

Collect stats for database

select value   from v$parameter where name = 'cpu_count';


Based on count of CPU, modify the DEGREE in the below SQL:-

exec dbms_stats.gather_database_stats(estimate_percent => 100, degree => 2, cascade => TRUE);


 


Get Table Details of all tables in RDS Oracle

select DT.owner||'.'|| DT.table_name, DT.num_rows,BYTES/1024/1024 "IN MB" from dba_tables DT, DBA_SEGMENTS DS 
WHERE DT.OWNER not in ('SYS','SYSTEM', 'DBSNMP','SYSMAN','OUTLN','MDSYS','ORDSYS','EXFSYS','DMSYS','WMSYS','CTXSYS','ANONYMOUS','XDB','ORDPLUGINS','OLAPSYS','PUBLIC','RDSADMIN') 
AND DT.OWNER=DS.OWNER 
AND DT.TABLE_NAME=DS.SEGMENT_NAME 
ORDER BY 3 DESC ;

No comments:

Post a Comment