ADRCI工具是Oracle11g才推出的新工具,主要用来管理alert文件、trace文件、dump文件、健康监事报告等。
这一篇介绍ADRCI工具的打包命令。
Oracle工具——ADRCI(一):http://yangtingkun.itpub.net/post/468/481227
Oracle工具——ADRCI(二):http://yangtingkun.itpub.net/post/468/481381
利用ADRCI的IPS命令,可以将问题相关的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 <ADR_HOME>/trace/ora11g_ora_4582.trc package 3
Added file <ADR_HOME>/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:
----------------------------------------------------------
<?xml version="1.0" encoding="US-ASCII"?>
<PACKAGE>
<PACKAGE_ID>1</PACKAGE_ID>
<PACKAGE_NAME>IPSPKG_20090215012523</PACKAGE_NAME>
<MODE>Complete</MODE>
<SEQUENCE>1</SEQUENCE>
<LAST_COMPLETE>1</LAST_COMPLETE>
<DATE>2009-02-15 01:25:27.179103 +08:00</DATE>
<ADR_BASE>/data/oracle</ADR_BASE>
<ADR_HOME>/data/oracle/diag/rdbms/ora11g_p/ora11g</ADR_HOME>
<PROD_NAME>rdbms</PROD_NAME>
<PROD_ID>ora11g_p</PROD_ID>
<INST_ID>ora11g</INST_ID>
<OCM_GUID/>
</PACKAGE>
----------------------------------------------------------
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