SQL> show parameter diagnostic_dest
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
diagnostic_dest string /usr/app/oracle
● 查询V$DIAG_INFO视图,找出所有与ADR有关的位置
SQL> desc v$diag_info
Name Null? Type
----------------------------------------- -------- ----------------------------
INST_ID NUMBER
NAME VARCHAR2(64)
VALUE VARCHAR2(512)
SQL> column name format a40
SQL> column value format a60
SQL> select name, value from v$diag_info;
NAME VALUE
---------------------------------------- ------------------------------------------------------------
Diag Enabled TRUE
ADR Base /usr/app/oracle
ADR Home /usr/app/oracle/diag/rdbms/orcl/ORCL
Diag Trace /usr/app/oracle/diag/rdbms/orcl/ORCL/trace
Diag Alert /usr/app/oracle/diag/rdbms/orcl/ORCL/alert
Diag Incident /usr/app/oracle/diag/rdbms/orcl/ORCL/incident
Diag Cdump /usr/app/oracle/diag/rdbms/orcl/ORCL/cdump
Health Monitor /usr/app/oracle/diag/rdbms/orcl/ORCL/hm
Default Trace File /usr/app/oracle/diag/rdbms/orcl/ORCL/trace/ORCL_ora_3533.trc
Active Problem Count 0
Active Incident Count 0
11 rows selected.
●
[oracle@teapot ~]$ adrci
ADRCI: Release 11.2.0.1.0 - Production on Sun Nov 1 17:18:04 2009
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
ADR base = "/usr/app/oracle"
adrci>
● 帮助
[oracle@teapot ~]$ adrci -help
Syntax:
adrci [-help] [script=script_filename]
[exec = "one_command [;one_command;...]"]
Options Description (Default)
-----------------------------------------------------------------
script script file name (None)
help help on the command options (None)
exec exec a set of commands (None)
-----------------------------------------------------------------
[oracle@teapot ~]$
● 以脚本或批处理方式使用adrci
一个脚本中执行两条命令
adrci exec="show homes; show incident"
[oracle@teapot ~]$ adrci exec="show homes; show incident"
ADR Homes:
diag/rdbms/orcl/ORCL
diag/tnslsnr/teapot/listener
ADR Home = /usr/app/oracle/diag/rdbms/orcl/ORCL:
*************************************************************************
0 rows fetched
ADR Home = /usr/app/oracle/diag/tnslsnr/teapot/listener:
*************************************************************************
0 rows fetched
在文本编辑器中读取预警日志
adrci exec="set homepath diag/rdbms/orcl/ORCL; set editor vi; show alert"
● 设置homepath
如果没有明确设置homepath(主目录路径),则ADR基目录下的所有ADR主目录都是当前的
当执行 show tracefile,adrci将显示每个ADR主目录中的所有跟踪文件
[oracle@teapot ~]$ adrci
ADRCI: Release 11.2.0.1.0 - Production on Sun Nov 1 09:33:12 2009
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
ADR base = "/usr/app/oracle"
adrci> show base
ADR base is "/usr/app/oracle"
adrci> show home
ADR Homes:
diag/rdbms/orcl/ORCL
diag/tnslsnr/teapot/listener
adrci> set homepath diag/rdbms/orcl/ORCL
adrci> show home
ADR Homes:
diag/rdbms/orcl/ORCL
adrci> set homepath diag/tnslsnr/teapot/listener
adrci> show tracefile
diag/tnslsnr/teapot/listener/trace/listener.log
adrci> show home
ADR Homes:
diag/tnslsnr/teapot/listener
adrci> show homepath
ADR Homes:
diag/tnslsnr/teapot/listener
可以将ADR主目录路径设置为多个ADR主目录。这样,可以使多个ADR主目录的那些adrci命令(如show incident和show alert)
在当前ADR路径定义的所有ADR主目录下搜索诊断数据。但ips命令(意外事件打包),将会出错
阅读(1296) | 评论(0) | 转发(0) |