未加星标

ADRCI工具的使用

字体大小 | |
[数据库(综合) 所属分类 数据库(综合) | 发布者 店小二05 | 时间 2016 | 作者 红领巾 ] 0人收藏点击收藏

The Automatic Diagnostic Repository Command Interpreter (ADRCI) utility is a command-line tool that you use to manage Oracle Database diagnostic data.

ADRCI是一个命令行工具用来管理Oracle数据库诊断数据。

ADRCI is a command-line tool that is part of the fault diagnosability infrastructure introduced in Oracle Database 11g. ADRCI enables you to:


View diagnostic data within the Automatic Diagnostic Repository (ADR). -----查看ADR中的诊断信息

View Health Monitor reports. -----查看Health Monitor报告


Package incident and problem information into a zip file for transmission to Oracle Support. -----打包事故和错误信息为zip发送给Oracle Support

Diagnostic data includes incident and problem descriptions, trace files, dumps, health monitor reports, alert log entries, and more.

-----诊断数据包括故障,问题描述,trace文件,dumps,health monitor报告,告警文件等

ADR data is secured by operating system permissions on the ADR directories, hence there is no need to log in to ADRCI.

ADRCI has a rich command set, and can be used in interactive mode or within scripts. -----可以通过编写scripts来使用

[[email protected] ~]$ adrci
ADRCI: Release 11.2.0.3.0 - Production on Tue Oct 11 01:09:20 2016
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
ADR base = "/u01/app/oracle"
adrci> help
HELP [topic]
Available Topics:
CREATE REPORT
ECHO
EXIT
HELP
HOST
IPS
PURGE
RUN
SET BASE
SET BROWSER
SET CONTROL
SET ECHO
SET EDITOR
SET HOMES | HOME | HOMEPATH
SET TERMOUT
SHOW ALERT
SHOW BASE
SHOW CONTROL
SHOW HM_RUN
SHOW HOMES | HOME | HOMEPATH
SHOW INCDIR
SHOW INCIDENT
SHOW PROBLEM
SHOW REPORT
SHOW TRACEFILE
SPOOL
There are other commands intended to be used directly by Oracle, type
"HELP EXTENDED" to see the list
adrci> show homes --查看当前设置的ADR家目录
ADR Homes:
diag/tnslsnr/ocm1/lsnr2
diag/tnslsnr/ocm1/listener
diag/clients/user_oracle/host_522008804_80
diag/rdbms/prod2/PROD2
diag/rdbms/prod1/PROD1
diag/rdbms/dummy/PROD1
diag/rdbms/prod3/PROD3
adrci> set homepath diag/rdbms/prod1/PROD1 --设置家目录为目标库
adrci> show homes --查看设置生效
ADR Homes:
diag/rdbms/prod1/PROD1
adrci> show alert --查看alert log目录
ADR Home = /u01/app/oracle/diag/rdbms/prod1/PROD1:
*************************************************************************
adrci> show tracefile --查看当前家目录所有trace文件
diag/rdbms/prod1/PROD1/trace/PROD1_mmon_3427.trc
diag/rdbms/prod1/PROD1/trace/ALERT_LOG_28424.log
diag/rdbms/prod1/PROD1/trace/5_100_0_788623.bkd
diag/rdbms/prod1/PROD1/trace/PROD1_ora_27310.tr
diag/rdbms/prod1/PROD1/trace/PROD1_dbrm_3411.trc
diag/rdbms/prod1/PROD1/trace/alert_PROD1.log
diag/rdbms/prod1/PROD1/trace/ALERT_LOG_28398.log
adrci> show tracefile %mmon% --查看包含mmon的trace文件
diag/rdbms/prod1/PROD1/trace/PROD1_mmon_3427.trc
adrci> show tracefile -RT --查看当前家目录所有trace文件,并按时间倒序输出
11-OCT-16 01:18:33 diag/rdbms/prod1/PROD1/trace/PROD1_dbrm_3411.trc
11-OCT-16 01:16:02 diag/rdbms/prod1/PROD1/trace/PROD1_mmon_3427.trc
10-OCT-16 22:40:08 diag/rdbms/prod1/PROD1/trace/alert_PROD1.log
03-OCT-16 18:15:22 diag/rdbms/prod1/PROD1/trace/PROD1_ora_27310.tr
03-OCT-16 15:57:43 diag/rdbms/prod1/PROD1/trace/5_100_0_788623.bkd
26-SEP-16 22:03:05 diag/rdbms/prod1/PROD1/trace/ALERT_LOG_28398.log
26-SEP-16 22:00:15 diag/rdbms/prod1/PROD1/trace/ALERT_LOG_28424.log
adrci> show tracefile -I 1681 --查看与incident 1681有关的trace文件
--模拟错误incident/problem
[email protected]> create table eoda.copy as select * from eoda.big_table where rownum<2;
Table created.
[email protected]> commit;
Commit complete.
[email protected]> select object_name, object_id, data_object_id from dba_objects where owner='EODA' and object_name='COPY';
OBJECT_NAME
----------------------------------------------------------------------------------------------------
OBJECT_ID DATA_OBJECT_ID
---------- --------------
COPY
85577 85577
[email protected]> update sys.tab$ set OBJ#=88888 where OBJ#=85577;
1 row updated.
[email protected]> commit;
Commit complete.
[email protected]> alter system checkpoint;
System altered.
[email protected]> startup force
ORACLE instance started.
[email protected]> desc eoda.copy;
ERROR:
ORA-03113: end-of-file on communication channel
Process ID: 29748
Session ID: 1 Serial number: 5 --***模拟完成***
adrci> show incident --查看错误
ADR Home = /u01/app/oracle/diag/rdbms/prod1/PROD1:
*************************************************************************
INCIDENT_ID PROBLEM_KEY CREATE_TIME
-------------------- ----------------------------------------------------------- ----------------------------------------
79605 ORA 7445 [kqldcdp()+58] 2016-10-11 01:52:19.455000 +08:00
1 rows fetched
--SHOW INCIDENT -MODE BRIEF
--SHOW INCIDENT -MODE DETAIL --查看详细信息 These commands produce more detailed versions of the incident report.
--SHOW INCIDENT -MODE DETAIL -P "INCIDENT_ID=1681" --指定错误ID的详细信息
adrci> show incident -mode brief
ADR Home = /u01/app/oracle/diag/rdbms/prod1/PROD1:
*************************************************************************
**********************************************************
INCIDENT INFO RECORD 1
**********************************************************
INCIDENT_ID 79605
STATUS ready
CREATE_TIME 2016-10-11 01:52:19.455000 +08:00
PROBLEM_ID 3
CLOSE_TIME
FLOOD_CONTROLLED none
ERROR_FACILITY ORA
ERROR_NUMBER 7445
ERROR_ARG1 kqldcdp()+58
ERROR_ARG2 SIGSEGV
ERROR_ARG3 ADDR:0x0
ERROR_ARG4 PC:0x95FBD20
ERROR_ARG5 Address not mapped to object
ERROR_ARG6
ERROR_ARG7
ERROR_ARG8
ERROR_ARG9
ERROR_ARG10
ERROR_ARG11
ERROR_ARG12
SIGNALLING_COMPONENT LIBCACHE
SIGNALLING_SUBCOMPONENT
SUSPECT_COMPONENT
SUSPECT_SUBCOMPONENT
ECID
IMPACTS 0
1 rows fetched
adrci> show incident -mode detail
ADR Home = /u01/app/oracle/diag/rdbms/prod1/PROD1:
*************************************************************************
**********************************************************
INCIDENT INFO RECORD 1
**********************************************************
INCIDENT_ID 79605
STATUS ready
CREATE_TIME 2016-10-11 01:52:19.455000 +08:00
PROBLEM_ID 3
CLOSE_TIME
FLOOD_CONTROLLED none
ERROR_FACILITY ORA
ERROR_NUMBER 7445
ERROR_ARG1 kqldcdp()+58
ERROR_ARG2 SIGSEGV
ERROR_ARG3 ADDR:0x0
ERROR_ARG4 PC:0x95FBD20
ERROR_ARG5 Address not mapped to object
ERROR_ARG6
ERROR_ARG7
ERROR_ARG8
ERROR_ARG9
ERROR_ARG10
ERROR_ARG11
ERROR_ARG12
SIGNALLING_COMPONENT LIBCACHE
SIGNALLING_SUBCOMPONENT
SUSPECT_COMPONENT
SUSPECT_SUBCOMPONENT
ECID
IMPACTS 0
PROBLEM_KEY ORA 7445 [kqldcdp()+58]
FIRST_INCIDENT 79605
FIRSTINC_TIME 2016-10-11 01:52:19.455000 +08:00
LAST_INCIDENT 79605
LASTINC_TIME 2016-10-11 01:52:19.455000 +08:00
IMPACT1 0
IMPACT2 0
IMPACT3 0
IMPACT4 0
KEY_NAME ProcId
KEY_VALUE 30.2
KEY_NAME Client ProcId
KEY_VALUE [email protected] (TNS V1-V3).29748_16275136
KEY_NAME SID
KEY_VALUE 1.5
OWNER_ID 1
INCIDENT_FILE /u01/app/oracle/diag/rdbms/prod1/PROD1/trace/PROD1_ora_29748.trc
OWNER_ID 1
INCIDENT_FILE /u01/app/oracle/diag/rdbms/prod1/PROD1/incident/incdir_79605/PROD1_ora_29748_i79605.trc
1 rows fetched
adrci> show problem
ADR Home = /u01/app/oracle/diag/rdbms/prod1/PROD1:
*************************************************************************
PROBLEM_ID PROBLEM_KEY LAST_INCIDENT LASTINC_TIME
-------------------- ----------------------------------------------------------- -------------------- ----------------------------------------
1 ORA 25319 49354 2016-07-10 14:09:42.126000 +08:00
2 ORA 1578 68804 2016-10-04 16:46:42.387000 +08:00
3 ORA 7445 [kqldcdp()+58] 79605 2016-10-11 01:52:19.455000 +08:00
3 rows fetched
adrci> show problem -p "problem_id=3"
ADR Home = /u01/app/oracle/diag/rdbms/prod1/PROD1:
*************************************************************************
PROBLEM_ID PROBLEM_KEY LAST_INCIDENT LASTINC_TIME
-------------------- ----------------------------------------------------------- -------------------- ----------------------------------------
3 ORA 7445 [kqldcdp()+58] 79605 2016-10-11 01:52:19.455000 +08:00
1 rows fetched
--problem和incident的关系我理解为一个incident可能产生多次的problem
Packaging Incidents
You can use ADRCI commands to package one or more incidents for transmission to Oracle Support for analysis. Background information and instructions are presented in the following topics:
--打包incident
adrci> ips create package --创建逻辑package
Created package 1 without any contents, correlation level typical
adrci> ips create package incident 79605 correlate all --指定incident
Created package 2 based on incident id 79605, correlation level all
adrci> ips create package problem 3 --指定problem
Created package 3 based on problem id 3, correlation level typical
[[email protected] PROD1]$ cd /u01/app/oracle/diag/rdbms/prod1/PROD1/
alert/ hm/ incpkg/ lck/ metadata_dgif/ stage/ trace/
cdump/ incident/ ir/ metadata/ metadata_pv/ sweep/
[[email protected] PROD1]$ cd /u01/app/oracle/diag/rdbms/prod1/PROD1/incpkg/
[[email protected] incpkg]$ ls
pkg_1 pkg_2 pkg_3
adrci> ips generate package 2 in /home/oracle/package --建立物理package并指定路径
DIA-49428: No such directory or directory not accessible [/home/oracle/package]
[[email protected] incpkg]$ mkdir /home/oracle/package
adrci> ips generate package 2 in /home/oracle/package
Generated package 2 in file /home/oracle/package/ORA7445kq_20161011020435_COM_1.zip, mode complete
[[email protected] package]$ ls --打包完成可提交SR
ORA7445kq_20161011020435_COM_1.zip
--purge删除ADR文件
purge [-i {id | start_id end_id} | -age mins [-type {ALERT|INCIDENT|TRACE|CDUMP|HM}]]
The SHOW CONTROL command displays the default purging policies for short-lived ADR contents and long-lived ADR contents.
adrci> show control --查看默认的删除策略
ADR Home = /u01/app/oracle/diag/rdbms/prod1/PROD1:
*************************************************************************
ADRID SHORTP_POLICY LONGP_POLICY LAST_MOD_TIME LAST_AUTOPRG_TIME LAST_MANUPRG_TIME ADRDIR_VERSION ADRSCHM_VERSION ADRSCHMV_SUMMARY ADRALERT_VERSION CREATE_TIME
-------------------- -------------------- -------------------- ---------------------------------------- ---------------------------------------- ---------------------------------------- -------------------- -------------------- -------------------- -------------------- ----------------------------------------
2542641053 720 8760 2016-05-21 17:52:52.395490 +08:00 2016-10-10 23:10:46.160362 +08:00 1 2 80 1 2016-05-21 17:52:52.395490 +08:00
1 rows fetched
adrci>purge --this example purges all diagnostic data in the current ADR home based on the default purging policies
adrci>purge -i 123 456 --This example purges all diagnostic data for all incidents between 123 and 456:
adrci>purge -age 60 -type incident --This example purges all incident data from the last hour:

本文数据库(综合)相关术语:系统安全软件

主题: TIRCISUMPAOracle数据库UB数据USPUTPON
分页:12
转载请注明
本文标题:ADRCI工具的使用
本站链接:http://www.codesec.net/view/481534.html
分享请点击:


1.凡CodeSecTeam转载的文章,均出自其它媒体或其他官网介绍,目的在于传递更多的信息,并不代表本站赞同其观点和其真实性负责;
2.转载的文章仅代表原创作者观点,与本站无关。其原创性以及文中陈述文字和内容未经本站证实,本站对该文以及其中全部或者部分内容、文字的真实性、完整性、及时性,不作出任何保证或承若;
3.如本站转载稿涉及版权等问题,请作者及时联系本站,我们会及时处理。
登录后可拥有收藏文章、关注作者等权限...
技术大类 技术大类 | 数据库(综合) | 评论(0) | 阅读(31)