2.4 对adrci进行spool
adrci可以进行spool,spool文件是以.ado 结尾的文件,下面演示操作
$ adrci
adrci> spool /tmp/test //指定spool文件位置
adrci> showhome
|
ADR Homes:
diag/rdbms/orcl/orcl
diag/asm/+asm/+ASM
diag/tnslsnr/Oracle11g/listener
|
adrci> spooloff//最后记得off掉spool
adrci> quit
$ cat /tmp/test.ado
|
ADR Homes:
diag/rdbms/orcl/orcl
diag/asm/+asm/+ASM
diag/tnslsnr/oracle11g/listener
|
2.5 设置editor (set deitor)
如果直接使用show alert 方式可以以vi的方式打开相应home目录中的日志文件,这里可以把打开这一动作发送给其他文本编辑器。例如ed、gedit 等等,这里设置成gedit,由于是图形编辑器,需要服务器能打开图形
adrci> set editor gedit
adrci> set editor vi
2.6 查看报错(show problem | incident)
problem 和 incident 是一种相辅相成的关系, problem指的是大的问题,叫criticial error, 一个大问题会由很多小的incidents所导致。所以他们是1:n的关系.
鉴于格式美观,所以把字体缩小到极限,可以手工把下面这段内容复制到文本文件中查看
2.6.1 查看incident
adrci> show incident
|
ADR Home = /home/db/oracle/diag/rdbms/racdb/racdb1:
*************************************************************************
INCIDENT_IDPROBLEM_KEYCREATE_TIME
-------------------- ----------------------------------------------------------- ----------------------------------------
20657ORA 600 [kkdlgtd1]2014-05-22 16:08:05.778000 +08:00
ADR Home = /home/db/oracle/diag/tnslsnr/racdb1/listenerdb:
*************************************************************************
0 rows fetched
ADR Home = /home/db/oracle/diag/clients/user_oracle/host_805754952_80:
*************************************************************************
0 rows fetched
|
2.6.2 查看problem
adrci> show problem
|
ADR Home = /home/db/oracle/diag/rdbms/racdb/racdb1:
*************************************************************************
PROBLEM_IDPROBLEM_KEYLAST_INCIDENTLASTINC_TIME
-------------------- ----------------------------------------------------------- -------------------- ----------------------------------------
1ORA 600 [kkdlgtd1]206572014-05-22 16:08:05.778000 +08:00
ADR Home = /home/db/oracle/diag/tnslsnr/racdb1/listenerdb:
*************************************************************************
0 rows fetched
ADR Home = /home/db/oracle/diag/clients/user_oracle/host_805754952_80:
*************************************************************************
0 rows fetched
|
2.6.3 查看报错内容
结合前面所演示的查看alert内容看看报错的其他信息
adrci> show alert -p "message_text like '%ORA-%600%'"
Choose the alert log from the following homes to view:
1: diag/rdbms/racdb/racdb1
2: diag/tnslsnr/racdb1/listenerdb
3: diag/clients/user_oracle/host_805754952_80
Q: to quit
Please select option: 1
|
2014-05-22 16:08:05.778000 +08:00
Errors in file /home/db/oracle/diag/rdbms/racdb/racdb1/trace/racdb1_ora_4076.trc (incident=20657):
ORA-00600: internal error code, arguments: [kkdlgtd1], [], [], [], [], [], [], [], [], [], [], []
|
2.6.4 更详细查看incident
adrci> show incident -MODE DETAIL -p "incident_id=20657"
|
ADR Home = /home/db/oracle/diag/rdbms/racdb/racdb1:
*************************************************************************
**********************************************************
INCIDENT INFO RECORD 1
**********************************************************
INCIDENT_ID20657
STATUSready
CREATE_TIME2014-05-22 16:08:05.778000 +08:00
PROBLEM_ID1
CLOSE_TIME<NULL>
FLOOD_CONTROLLEDnone
ERROR_FACILITYORA
ERROR_NUMBER600
ERROR_ARG1kkdlgtd1
ERROR_ARG2<NULL>
ERROR_ARG3<NULL>
ERROR_ARG4<NULL>
ERROR_ARG5<NULL>
ERROR_ARG6<NULL>
ERROR_ARG7<NULL>
ERROR_ARG8<NULL>
ERROR_ARG9<NULL>
ERROR_ARG10<NULL>
ERROR_ARG11<NULL>
ERROR_ARG12<NULL>
SIGNALLING_COMPONENT<NULL>
SIGNALLING_SUBCOMPONENT<NULL>
SUSPECT_COMPONENT<NULL>
SUSPECT_SUBCOMPONENT<NULL>
ECID<NULL>
IMPACTS0
PROBLEM_KEYORA 600 [kkdlgtd1]
FIRST_INCIDENT20657
FIRSTINC_TIME2014-05-22 16:08:05.778000 +08:00
LAST_INCIDENT20657
LASTINC_TIME2014-05-22 16:08:05.778000 +08:00
IMPACT10
IMPACT20
IMPACT30
IMPACT40
KEY_NAMEProcId
KEY_VALUE32.14
KEY_NAMEPQ
KEY_VALUE(0, 1400746084)
KEY_NAMEClient ProcId
KEY_VALUEoracle@racdb1 (TNS V1-V3).4076_139978386978560
KEY_NAMESID
KEY_VALUE48.17
OWNER_ID1
INCIDENT_FILE/home/db/oracle/diag/rdbms/racdb/racdb1/trace/racdb1_ora_4076.trc
OWNER_ID1
INCIDENT_FILE/home/db/oracle/diag/rdbms/racdb/racdb1/incident/incdir_20657/racdb1_ora_4076_i20657.trc
ADR Home = /home/db/oracle/diag/tnslsnr/racdb1/listenerdb:
*************************************************************************
0 rows fetched
</ADR_HOME>
<ADR_HOME name="/home/db/oracle/diag/tnslsnr/racdb1/listenerdb">
ADR Home = /home/db/oracle/diag/clients/user_oracle/host_805754952_80:
*************************************************************************
0 rows fetched
|
2.7 查看相关trace文件
adrci> help show tracefile
Usage: SHOW TRACEFILE [file1 file2 ...] [-rt | -t]
[-i inc1 inc2 ...] [-path path1 path2 ...]
Purpose: List the qualified trace filenames.
Options:
[file1 file2 ...]: The trace files users are interested in to search.
If "-i" or/and "-path" is specified, the trace files are assumed
to be under the specified incidents or paths. Otherwise, the files
will be searched among the trace directory and all incident directories
of the current ADR homes. Filenames allow SQL like condition syntax.
I.e., allowing wildcard search on filenames by using "%". For example,
"%mmon%" means all trace files with the "mmon" substring.
[-rt | -t]: Order the trace filenames. "-t" means in the modified
timestamps order; "-rt" means in the reversed modified timestamps
order. Note that the ordering is only apply to a single directory.
[-i inc1 inc2 ...]: The trace files produced for the listed incidents.
If no files are listed, all trace files produced for the list
incidents are considered.
[-path path1 path2 ...]: The trace files under the given paths will be
queried. If no files are listed, all trace files under these paths
are considered.
Examples:
1. Show all the trace files under the current home
"show tracefile"
2. Show all the mmon trace files in time reverse order
"show tracefile %mmon% -rt"
3. Show all trace files under incidents 123 456, and /home/someone/temp
"show tracefile -i 123 456 -path/home/someone/temp"
2.7.1 查看文件名中包含XX字符的trace文件
adrci> show tracefile %mmon% -rt
adrci> show tracefile %smon% -rt
2.7.2 查看包含incident_id的trace文件
刚刚查出来的id是20657,那么可以根据这个ID来查看有哪些trace文件
adrci> show tracefile -i 20657
diag/rdbms/racdb/racdb1/incident/incdir_20657/racdb1_ora_4076_i20657.trc
2.7.3 查看产生trace文件的时间
adrci> show tracefile -i 20657 -rt
22-MAY-14 16:08:08diag/rdbms/racdb/racdb1/incident/incdir_20657/racdb1_ora_4076_i20657.trc
2.7.4 根据path来查看trace文件
这里的path并不包含子目录
adrci> show tracefile -path diag/rdbms/racdb/racdb1/trace/
2.8 执行系统命令
这个也类似于sqlplus一样,可以在窗口adrci中执行系统命令,但是除了使用cd命令
adrci> help host
Usage:HOST ["host_command_string"]
Purpose:Execute operating system commands without leaving ADRCI.
Use HOST by itself to enter an operating system shell, which
will allow user to enter multiple operating system commands.
Options:
["host_command_string"]: The host commands' string.
Notes:The operating system commands have no impact on the current
ADRCI session. For example change path "cd" will not alter
the current working directory of ADRCI.
Examples:
host
host "pwd"
adrci> host 'pwd'
/home/db/oracle
更多Oracle相关信息见Oracle 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=12
本文永久更新链接地址:http://www.linuxidc.com/Linux/2014-06/103184.htm
