Tablolarla İlgili Scriptler
Table Size
|
1 2 3 |
select segment_name,segment_type,bytes/1024/1024 MB from dba_segments where owner='&Owner' order by MB desc |
Girilen kullanıcının tüm tablolarını analiz eder
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
SET PAGESIZE 0 SET FEEDBACK OFF SET VERIFY OFF SPOOL temp.sql SELECT 'ANALYZE TABLE "' || table_name || '" COMPUTE STATISTICS;' FROM all_tables WHERE owner = Upper('&1') ORDER BY 1; SPOOL OFF -- Comment out following line to prevent immediate run @temp.sql SET PAGESIZE 14 SET FEEDBACK ON SET VERIFY ON |
Tree-Style Execution planı gösterir
|
1 2 3 4 5 6 7 8 9 10 11 12 13 |
SET LINESIZE 500 SET PAGESIZE 1000 SET VERIFY OFF SELECT a.ownerid "Owner", Substr(name,1,40) "Name", type "Type", pipe_size "Size" FROM v$db_pipes a ORDER BY 1,2; SET PAGESIZE 14 SET VERIFY ON |
Tabloları monitor eder
|
1 2 3 4 5 6 |
SET VERIFY OFF SELECT table_name, monitoring FROM dba_tables WHERE owner = UPPER('&1') AND table_name = DECODE(UPPER('&2'), 'ALL', table_name, UPPER('&2')); |
Belirlenen tabloların izlenmesini (monitoring) aktif eder
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
SET PAGESIZE 0 SET FEEDBACK OFF SET VERIFY OFF SPOOL temp.sql SELECT 'ALTER TABLE "' || owner || '"."' || table_name || '" MONITORING;' FROM dba_tables WHERE owner = UPPER('&1') AND table_name = DECODE(UPPER('&2'), 'ALL', table_name, UPPER('&2')) AND monitoring != 'YES'; SPOOL OFF SET PAGESIZE 18 SET FEEDBACK ON |
Belirlenen tabloların izlenmesini (monitoring) deaktif eder
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
SET PAGESIZE 0 SET FEEDBACK OFF SET VERIFY OFF SPOOL temp.sql SELECT 'ALTER TABLE "' || owner || '"."' || table_name || '" NOMONITORING;' FROM dba_tables WHERE owner = UPPER('&1') AND table_name = DECODE(UPPER('&2'), 'ALL', table_name, UPPER('&2')) AND monitoring = 'YES'; SPOOL OFF SET PAGESIZE 18 SET FEEDBACK ON |
Kategori seçin...
