Automatic Diagnostic Repository (ADR)
In Oracle 11g database New dimension fault diagnosability infrastructure added to Oracle self managing concept to reduce time for resolving problem/bug/SR and round trip between end-user and Oracle Support. Trace file, dump file , core file ADR, ADRCI etc are components of fault diagnosability infrastructure.
In early version of oracle, When ever critical error such as code bug , data corruption occur end user need to collect diagnostic data such as process dump , data structure dump etc. In oracle 11g database end user need to worry about what kind of dump need to collect , need not to search trace file which need to send to Oracle Support Oracle 11g Database proactively collect ,tagged and store diagnostic data in file based repository known as ADR. 11g used file based repository because even your database is down, you have diagnostic data to send to oracle support.
Key Components for Fault Diagnosability Infrastructure
- ADR
- ADRCI ( ADR Command line utility )
- Alert log
- Trace ,Dumps etc.
ADR (Automatic Diagnostic Repository)
ADR is file based repository for diagn
ostic data like trace file,process dump,data structure dump etc.
In oracle 11g trace. alert
not saved in *_DUMP_DEST directory even you set those parameters in init.ora.11g ignore *_DUMP_DEST and store data in new format , directory structure is given below
Diag/product_type/database_name/instance_name |
Click on figure for clear view
|
Note : ADR_HOME is user define variable , I have define this variable make life easier
ADR root where ADR directory structure start.11g New initialize parameter DIAGNOSTIC_DEST decide location of ADR root,
- By default location of DIAGNOSTIC_DEST is $ORACLE_HOME/log,
- if ORACLE_BASE is set in environment then DIAGNOSTIC_DEST is set to $ORACLE_BASE
In 11g alert file is saved in 2 location, one is in alert directory ( in XML format) and old style alert file in trace directory. Within ADR base, there can be many ADR homes, where each ADR home is the root directory for all diagnostic data for a particular instance. The location of an ADR home for a database is shown on the above graphic.
Note :- I have created on environment variable ADR_HOME= . I am using same in all my this document
SQL> show parameter diag |
Data | Old location | ADR location |
Core Dump | CORE_DUMP_DEST | $ADR_HOME/cdump |
Alert log data | BACKGROUND_DUMP_DEST | $ADR_HOME/trace $ADR_HOME/alert (XML) |
Background process trace | BACKGROUND_DUMP_DEST | $ADR_HOME/trace |
User process trace | USER_DUMP_DEST | $ADR_HOME/trace |
SQL> select * from v$diag_info; |
Retention policy
There is retention policy for ADR that allow to specify how long to keep the data
ADR incidents are controlled by two different policies:
- The incident metadata retention policy ( default is 1 year )
- The incident files and dumps retention policy ( Default is one month)
We can change retention policy using “adrci” MMON purge data automatically on expired ADR data.
adrci> show control ADRID SHORTP_POLICY LONGP_POLICY LAST_MOD_TIME LAST_AUTOPRG_TIME LAST_MANUPRG_TIME ADRDIR_VERSION ADRSCHM_VERSION ADRSCHMV_SUMMARY ADRALERT_VERSION CREATE_TIME -------------------- -------------------- -------------------- ---------------------------------------- ---------------------------------------- ---------------------------------------- -------------------- -------------------- -------------------- -------------------- ---------------------------------------- 3667832353 720 8760 2008-07-02 13:24:01.088681 -07:00 2008-07-22 00:20:04.113441 -07:00 1 2 0 1 2008-07-02 13:24:01.088681 -07:00 1 rows fetched |
Change Retention
adrci> set control (SHORTP_POLICY = 360 ) |
Automatic Diagnostic Repository (ADRCI)
Oracle 11g introduce new tool/utility called ADRCI known as ADR command line tool. This tool
allow user to interact with ADR ,check alert log, check health monitor(HM) status , create report
on HM, Package incident and problem information into a zip file for send to Oracle Support. etc.
No username/password need to log in to ADRCI, ADRCI interact with file system and ADR data
is secured only by operating system permissions on the ADR directories.
[Click Here for Oracle Documenation on adrci]
[oracle@apps001 ~] $ adrci 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> adrci> SHOW INCIDENT |
Checking alert log with ADRCI
One can see alert log content with the help of ADRCI
adrci>>show alert |
If just want to tail content of alert log
$adrci |
Content of xml alert log ( log.xml )
|
Since alert log saved as XML format ( log.xml ) , you can query xml file as well
Below is example to check all “ORA-“ in alert log
adrci>SHOW ALERT -P "MESSAGE_TEXT LIKE '%ORA-%'"
|
You can spool output for ADRCI using spool command same as we use in sqlplus
Problem and Incident
Problem
AD introduce new concept of problem and incident, problem is critical error in database and in ADR problem is identified by problem key. Problem key is consist of oracle error number, error parameter value etc
for example ORA600kci
Incident
Incident is single occurrence of problem , each incident is identified by unique number called incident id ,
which is unique in ADR home, all incident data stored in ADR. Each incident has a problem key and is
mapped to a single problem. When error occurred backup ground process make entry in alert.log and
collect data about incident (like process dump, data structure dump etc)
If similar incident happen more frequently , oracle will not collect data for all incident
By default only five dumps per hour for a given problem are allowed for single given problem and
this call flood control in 11g , some time you see "flood control" messages in alert
Incident can be created as manual as well, if needed.
adrci>>SHOW INCIDENT |
IPS ( Incident package service )
diagnostic data are tagged with incident id and IPS identified trace and dump for particular incident
and allow end user to create package from ADR to send to Oracle Support. Using IPS end user can
add some more file to package if needed.
How to create package
- Create logical package
- Add files to package
- Create zip file to send to oracle support
Create logical package
Check incidents for which you want to create package
adrci>SHOW INCIDENT |
We can use IPS CREATE PACKAGE command to create a logical package for above incident
adrci>ips create package incident 9817 |
Add files to package
Adding diagnostic information for a particular (9817) incident
adrci>ips create package incident 9817 |
You can add additional files if needed, But file should be in ADR, below in example we adding alert log to package.
adrci> ips add file |
Create zip file to send to oracle support
adrci> ips generate package 4 in /tmp [root@apps001 tmp]#ls –l /tmp/*.zip -rw-r--r-- 1 oracle oinstall 584410 May 14 18:50 ORA600kci_20080814184516_COM_1.zip |
[root@apps001 tmp]# unzip -l ORA600kci_20080814184516_COM_1.zip |
Log a SR and upload this zip file to Oracle Support for diagnose and resolution.
IPS in Summary
$ adrci adrci>>ips add file Added file /u01/app/oracle/diag/rdbms/orcl2/orcl2/trace/alert_orcl2.log to adrci>>ips generate package 4 in /tmp |
Health Monitor (HM)
Health Monitor run diagnostic checks on various components of the database. Health Monitor checks
examine various components of the database, including files, memory, transaction integrity, metadata,
and process usage. In order to collect more data after critical error (incident) , oracle invoke health
monitoring implicitly. If need end-user can also run health monitoring procedure manually
Health Monitor checks run in two ways:
- Reactive: The fault diagnosability infrastructure can invoke Health Monitor checks automatically
in response to critical errors. - Manual: DBA can manually run Health Monitor health checks Manually
Kinds of health monitoring
Please look at the V$HM_CHECK view , it will list all Health monitoring checks
SQL> desc v$hm_check SQL> select name from v$hm_check ; 25 rows selected. High Lighted HM , we going to run Manually in next step |
Health monitoring report
You can view these reports using either V$HM_RUN, DBMS_HM, ADRCI, or Enterprise Manager.
Run Health Check ManuallySQL> exec dbms_HM.RUN_CHECK('Database Dictionary Check'); PL/SQL procedure successfully completed. |
$adrci ADR Home = /u01/app/oracle/diag/rdbms/orcl2/orcl2: ************************************************************************* ---------------------------------------------------------- RUN_ID 1 ---------------------------------------------------------- RUN_ID 21 RUN_NAME HM_RUN_21CHECK_NAME Database Dictionary Check 2 rows fetched |
Create HM Reportadrci>>CREATE REPORT HM_RUN HM_RUN_21 |
You can create and view Health Monitor checker reports using the ADRCI utility. Make sure that Oracle environment variables are set properly, The ADRCI utility starts and displays its prompt as shown above.
You then enter the SHOW HM_RUN command to list all the checker runs registered in the ADR repository. Locate the checker run for which you want to create a report and note the checker run name using the corresponding RUN_NAME field. you can generate the report using the CREATE REPORT HM_RUN command. You view the report using the SHOW REPORT HM_RUN command or by running dbms_hm.get_run_report on sql prompt
View HM generated reports on SQL promptSQL> set long 1000000 DBMS_HM.GET_RUN_REPORT('HM_RUN_21') -------------------------------------------------------------------------------- |
View HM generated reports on adrci prompt adrci>>show report hm_run HM_RUN_21 |
View HM generated reports on OS level ( In ADR repository ) $cd $ADR_HOME/hm $ ls HMREPORT_HM_RUN_21.hm $ more HMREPORT_HM_RUN_21.hm |
Hi Virag,
ReplyDeleteI am not sure which version you are on but 11GR1 fails with
SQL> exec dbms_HM.RUN_CHECK('Database Dictionary Check');
BEGIN dbms_HM.RUN_CHECK('Database Dictionary Check'); END;
*
ERROR at line 1:
ORA-51001: check [Database Dictionary Check] not found in HM catalog
ORA-06512: at "SYS.DBMS_HM", line 191
ORA-06512: at line 1
but works with
SQL> exec dbms_HM.RUN_CHECK('DB Structure Integrity Check');
PL/SQL procedure successfully completed.
sorry the working one is
ReplyDeleteSQL> exec dbms_HM.RUN_CHECK(' Dictionary Integrity Check');
PL/SQL procedure successfully completed.