一些轉儲和清除記憶體物件和物理物件的命令(轉)

zhouwf0726發表於2019-04-02

9i清buffer cache
alter session set events 'immediate trace name flush_cache level 1';

alter session set events = 'immediate trace name flush_cache';

10g中清buffer cache
alter system flush buffer_cache;

清shared pool

alter system flush shared_pool;

轉儲sga

alter session set events 'immediate trace name heapdump level 2';

轉儲library cache

ALTER SESSION SET EVENTS 'immediate trace name LIBRARY_CACHE level n';

Level =1 ,轉儲Library cache統計資訊
Level =2 ,轉儲hash table概要
Level =4 ,轉儲Library cache物件,只包含基本資訊
Level =8 ,轉儲Library cache物件,包含詳細資訊(包括child references,pin waiters等)
Level =16,增加heap sizes資訊
Level =32,增加heap資訊

轉儲控制檔案、日誌檔案、資料檔案:

alter session set events 'immediate trace name controlf level 10';
alter session set events 'immediate trace name redohdr level 3';

alter system dump logfile '...redo01.log';

alter session set events 'immediate trace name file_hdrs level 10';
ALTER SYSTEM DUMP LOGFILE '/opt/oracle9/oradata/testora9/redo01.log';
alter system dump datafile 3 block max 2 block min 4;

轉儲系統狀態

ALTER SESSION SET EVENTS 'IMMEDIATE TRACE NAME SYSTEMSTATE LEVEL 10';


常見的有
  1、分析資料檔案塊,轉儲資料檔案n的塊m
  alter system dump datafile n block m

  2、分析日誌檔案
  alter system dump logfile logfilename;

  3、分析控制檔案的內容
  alter session set events 'immediate trace name CONTROLF level 10'

  4、分析所有資料檔案頭
  alter session set events 'immediate trace name FILE_HDRS level 10'

  5、分析日誌檔案頭
  alter session set events 'immediate trace name REDOHDR level 10'

  6、分析系統狀態,最好每10分鐘一次,做三次對比
  alter session set events 'immediate trace name SYSTEMSTATE level 10'

  7、分析程式狀態
  alter session set events 'immediate trace name PROCESSSTATE level 10'

  8、分析Library Cache的詳細情況
  alter session set events 'immediate trace name library_cache level 10'

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/756652/viewspace-242148/,如需轉載,請註明出處,否則將追究法律責任。

相關文章