Oracle工具——ADRCI(三)

yangtingkun發表於2009-04-01

ADRCI工具是Oracle11g才推出的新工具,主要用來管理alert檔案、trace檔案、dump檔案、健康監事報告等。

這一篇介紹ADRCI工具的打包命令。

Oracle工具——ADRCI(一):http://yangtingkun.itpub.net/post/468/481227

Oracle工具——ADRCI(二):http://yangtingkun.itpub.net/post/468/481381

 

 

利用ADRCIIPS命令,可以將問題相關的trace檔案,打包為一個zip檔案,以提供給Oracle的支援人員。

adrci> help ips

 HELP IPS [topic]
   Available Topics:
        ADD
        ADD FILE
        ADD NEW INCIDENTS
        CHECK REMOTE KEYS
        COPY IN FILE
        COPY OUT FILE
        CREATE PACKAGE
        DELETE PACKAGE
        FINALIZE PACKAGE
        GENERATE PACKAGE
        GET MANIFEST
        GET METADATA
        GET REMOTE KEYS
        PACK
        REMOVE
        REMOVE FILE
        SET CONFIGURATION
        SHOW CONFIGURATION
        SHOW FILES
        SHOW INCIDENTS
        UNPACK FILE
        USE REMOTE KEYS

IPS包括的命令很多,介紹兩種常用的打包方法。

最簡單的方法莫過於直接使用PACK命令:

adrci> set home diag/rdbms/ora11g_p/ora11g
adrci> show problem -p "problem_id = 1"

ADR Home = /data/oracle/diag/rdbms/ora11g_p/ora11g:
*************************************************************************
PROBLEM_ID PROBLEM_KEY                LAST_INCIDENT LASTINC_TIME                      
---------- -------------------------- ------------- ----------------------------------
1          ORA 7445 [koioapm()+254]   14503         2007-09-06 02:50:52.122404 +08:00 
1 rows fetched

adrci> ips pack problem 1
Generated package 1 in file /home/oracle/IPSPKG_20090215012523_COM_1.zip, mode complete

另一種方法是利用CREATE PACKAGE命令,然後新增相關的INCIDENT,最後透過GENERATE PACKAGE命令來生成PACKAGE

adrci> ips create package
Created package 2 without any contents, correlation level typical
adrci> ips create package problemkey "ORA 7445 [koioapm()+254]"
Created package 3 based on problem key ORA 7445 [koioapm()+254], correlation level typical
adrci> ips add incident 172231 package 3
Added incident 172231 to package 3
adrci> ips add file /trace/ora11g_ora_4582.trc package 3
Added file /trace/ora11g_ora_4582.trc to package 3
adrci> ips generate package 3
Generated package 3 in file /home/oracle/IPSPKG_20090215013006_COM_1.zip, mode complete

還可以追加檔案到PACKAGE 3

adrci> ips add new incidents package 3
Added new incidents to package 3
adrci> ips add problem 12 package 3
Added problem 12 to package 3
adrci> ips generate package 3
Generated package 3 in file /home/oracle/IPSPKG_20090215013006_COM_2.zip, mode complete

最後簡單介紹一下UNPACK命令,這個命令可以將得到的zip檔案解壓到指定目錄:

adrci> ips get metadata from file /home/oracle/IPSPKG_20090215012523_COM_1.zip
IPS metadata from file /home/oracle/IPSPKG_20090215012523_COM_1.zip:
----------------------------------------------------------


    1
    IPSPKG_20090215012523
    Complete
    1
    1
    2009-02-15 01:25:27.179103 +08:00
    /data/oracle
    /data/oracle/diag/rdbms/ora11g_p/ora11g
    rdbms
    ora11g_p
    ora11g
   

----------------------------------------------------------
adrci> ips unpack file /home/oracle/IPSPKG_20090215012523_COM_1.zip into /home/oracle
Unpacking file /home/oracle/IPSPKG_20090215012523_COM_1.zip into target /home/oracle
adrci> host
[oracle@yangtk ~]$ cd /home/oracle/diag/rdbms/ora11g_p/ora11g/
[oracle@yangtk ora11g]$ ls -l
total 44
drwxr-xr-x 2 oracle oinstall 4096 Feb 15 02:21 alert
drwxr-xr-x 2 oracle oinstall 4096 Feb 15 02:21 cdump
drwxr-xr-x 2 oracle oinstall 4096 Feb 15 02:21 hm
drwxr-xr-x 2 oracle oinstall 4096 Feb 15 02:21 incident
drwxr-xr-x 3 oracle oinstall 4096 Feb 15 02:21 incpkg
drwxr-xr-x 2 oracle oinstall 4096 Feb 15 02:21 ir
drwxr-xr-x 2 oracle oinstall 4096 Feb 15 02:21 lck
drwxr-xr-x 2 oracle oinstall 4096 Feb 15 02:21 metadata
drwxr-xr-x 2 oracle oinstall 4096 Feb 15 02:21 stage
drwxr-xr-x 2 oracle oinstall 4096 Feb 15 02:21 sweep
drwxr-xr-x 2 oracle oinstall 4096 Feb 15 02:21 trace
[oracle@yangtk ora11g]$ ls trace/
alert_ora11g.log
[oracle@yangtk ora11g]$ ls alert
log.xml

 

 

 

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

相關文章