【11g】使用ADRCI工具的“show alert”命令快速检索出alert中所有“ORA-”错误信息

来源:互联网 发布:哥特电影知乎 编辑:程序博客网 时间:2024/06/05 20:17
ADRCI工具是Oracle11g才推出的新工具,主要用来管理alert文件、trace文件、dump文件、健康监事报告等。
这一篇简单介绍ADRCI工具。
 
 
用过11g的人都会发现,11g中alert文件以及trace文件的存放位置都发生了变化。从原来的ORACLE_BASE/admin/INSTANCE_NAME目录变成了
ORACLE_BASE/diag/rdbms/DBNAME/INSTANCE_NAME目录。
Oracle之所以修改了这个跨越多个版本都没有修改过的参数设置,就是因为Oracle在11g中推出了ADRCI。这个工具可以统一管理ASM实例和多个数据库实例的alert文件、
后台trace文件、用户trace文件,dump文件等等。
而且这个工具可以快速查询错误相关的所有trace文件,并将这些文件打包到一个zip文件,以便将问题相关的信息提供给Oracle的技术支持。
看一下ADRCI工具的简单命令:
C:Documents and Settingsytk>adrci
ADRCI: Release 11.1.0.6.0 - Beta on星期日 3 29 21:23:57 2009
Copyright (c) 1982, 2007, Oracle. All rights reserved.
ADR base = "e:oracle"adrci> help
HELP [topic]Available Topics:CREATE REPORTECHOEXITHELPHOSTIPSPURGERUNSET BASESET BROWSERSET CONTROLSET ECHOSET EDITORSET HOMES | HOME | HOMEPATHSET TERMOUTSHOW ALERTSHOW BASESHOW CONTROLSHOW HM_RUNSHOW HOMES | HOME | HOMEPATHSHOW INCDIRSHOW INCIDENTSHOW PROBLEMSHOW REPORTSHOW TRACEFILESPOOL
There are other commands intended to be used directly by Oracle, type"HELP EXTENDED" to see the list
HELP列出了ADRCI工具的所有命令,还可以通过HELP加个别命令的方式来列出这个命令的具体语法,比如:
adrci> HELP IPS
HELP IPS [topic]Available Topics:ADDADD FILEADD NEW INCIDENTSCHECK REMOTE KEYSCOPY IN FILECOPY OUT FILECREATE PACKAGEDELETE PACKAGEFINALIZE PACKAGEGENERATE PACKAGEGET MANIFESTGET METADATAGET REMOTE KEYSPACKREMOVEREMOVE FILESET CONFIGURATIONSHOW CONFIGURATIONSHOW FILESSHOW INCIDENTSUNPACK FILEUSE REMOTE KEYSadrci> HELP IPS ADD
Usage: IPS ADD[INCIDENT <incid> | PROBLEM <prob_id> | PROBLEMKEY <prob_key> |SECONDS <seconds> | TIME <start_time> TO <end_time>]PACKAGE <package_id>
Purpose: Add incidents to an existing package.
Arguments:<incid>: ID of incident to add to package contents.<prob_id>: ID of problem to add to package contents.<prob_key>: Problem key to add to package contents.<seconds>: Number of seconds before now for adding package contents .<start_time>: Start of time range to look for incidents in.<end_time>: End of time range to look for incidents in.Example:ips add incident 22 package 12
adrci> HELP SHOW PROBLEM
Usage: SHOW PROBLEM [-p <predicate_string>][-last <num> | -all][-orderby (field1, field2, ...) [ASC|DSC]]
Purpose: Show the problem information. By default, this command willonly show the last 50 problems.
Options:[-p <predicate_string>]: The predicate string must be double-quoted.The field names that users can specify in the predicate are:PROBLEM_ID numberPROBLEM_KEY text(550)FIRST_INCIDENT numberFIRSTINC_TIME timestampLAST_INCIDENT numberLASTINC_TIME timestampIMPACT1 numberIMPACT2 numberIMPACT3 numberIMPACT4 numberSERVICE_REQUEST text(64)BUG_NUMBER text(64)
[-last <num> | -all]: This option allows users to either selectthe last <num> of qualified problems to show or to show all thequalified problems. If this option is not specified, this commandwill only show 50 incidents.
[-orderby (field1, field2, ...) [ASC|DSC]]: If specified, the resultswill be ordered by the specified fields' values. By default, it will bein the ascending order unless "DSC" is specified. Note that the fieldnames that can be specified here are from the "PROBLEM" relation.
Examples:show problemshow problem -p "problem_id>123"
下面是查询数据库中错误的几个小例子:
adrci> show baseADR base is "e:oracle"adrci> show homeADR Homes:diagclientsuser_systemhost_3414944083_11diagclientsuser_unknownhost_3414944083_11diagclientsuser_unknownhost_411310321_11diagclientsuser_ytkhost_3414944083_11diagrdbmsytk1110ytk1110diagtnslsnrytk-thinkpadlisteneradrci> set home diagrdbmsytk1110ytk1110adrci> show alert -tail 52009-02-25 22:51:17.640000 +08:00Completed: alter database open2009-02-25 22:55:26.171000 +08:00Starting background process CJQ0CJQ0 started with pid=7, OS id=144282009-02-25 22:55:49.796000 +08:00Errors in file e:oraclediagrdbmsytk1110ytk1110traceytk1110_j008_15220.trc:ORA-12012: 自动执行作业 11689出错ORA-01403: 未找到任何数据2009-02-25 23:20:39.828000 +08:00Thread 1 advanced to log sequence 75Current log# 3 seq# 75 mem# 0: E:ORACLEORADATAYTK111REDO03.LOG2009-02-26 08:31:51.296000 +08:00
***********************************************************************
Fatal NI connect error 12638, connecting to:(DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
VERSION INFORMATION:TNS for 32-bit Windows: Version 11.1.0.6.0 - ProductionOracle Bequeath NT Protocol Adapter for 32-bit Windows: Version 11.1.0.6.0 - ProductionTime: 26-2 -2009 08:31:51Tracing not turned on.Tns error struct:ns main err code: 12638
TNS-12638:身份证明检索失败ns secondary err code: 0nt main err code: 0nt secondary err code: 0nt OS err code: 0
除了上面交互式的方式外,还可以调用脚本,或者指定一系列命令来批量执行命令:
C:Documents and Settingsytk>adrci -helpSyntax: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)-----------------------------------------------------------------
比如:
C:Documents and Settingsytk>adrci exec="show base;show home;set home diagrdbmsytk1110ytk1110;show home"ADR base is "e:oracle"ADR Homes:diagclientsuser_systemhost_3414944083_11diagclientsuser_unknownhost_3414944083_11diagclientsuser_unknownhost_411310321_11diagclientsuser_ytkhost_3414944083_11diagrdbmsytk1110ytk1110diagtnslsnrytk-thinkpadlistenerADR Homes:diagrdbmsytk1110ytk1110
 
 
 
 
 
原创粉丝点击