Showing posts with label DB STARTUP. Show all posts
Showing posts with label DB STARTUP. Show all posts

Thursday, February 28, 2019

Large Table of Oracle Database

col owner for a15
col SEGMENT_NAME for a35
col SizeGB for 999,999,999 heading "Size GB"
set linesize 132
set pagesize 200
set feedback off
break on report
col fn new_value filename
compute sum of SizeGB on report
select '/home/oracle/scripts/out/large_tables_report_'||to_char(sysdate, 'yyyymmdd')||'.log' as fn from dual;
spool &filename
select owner,segment_type,segment_name,bytes/1024/1024/1024 SizeGB
from dba_segments
where segment_type='TABLE' and
bytes/1024/1024/1024 > 1
order by 1,4 desc
/
spool off
set feedback on
exit

Large Index Of Table in Oracle

col owner for a15
col SEGMENT_NAME for a35
col SizeGB for 999,999,999 heading "Size GB"
set linesize 132
set pagesize 200
set feedback off
break on report
col fn new_value filename
compute sum of SizeGB on report
select '/home/oracle/scripts/out/large_tables_report_'||to_char(sysdate, 'yyyymmdd')||'.log' as fn from dual;
spool &filename
select owner,segment_type,segment_name,bytes/1024/1024/1024 SizeGB
from dba_segments
where segment_type='INDEX' and
bytes/1024/1024/1024 > 1
order by 1,4 desc
/
spool off
set feedback on
exit