Create an Incident Package with ADRCI and IPS Commands
Oracle 11g Incident Packaging steps
From the command prompt, the Automatic Diagnostic Repository (ADR) command interface utility is entered by typing “adrci” from the OS prompt:
C:\>adrci </span> ADRCI: Release 11.1.0.6.0 - Beta on Thu Nov 15 22:21:42 2007 </span> Copyright (c) 1982, 2007, Oracle. All rights reserved. </span> ADR base = "c:\oracle\11g" adrci>
ADRCI commands are based on one or more base directories known as ADR homes. Before using the ADRCI commands, it is helpful to set an active ADR home to work with a single instance. The available homes can be seen by typing:
adrci> show homes ADR Homes: diag\clients\user_system\host_1475088825_11 diag\clients\user_varun jain\host_1475088825_11 diag\rdbms\ora11g4\ora11g4 diag\rdbms\ora11gr1\ora11gr1 diag\tnslsnr\dcfx7hb1\listener adrci> </span>
The output above shows that there are several available home directories on which ADR can operate. If a DBA wants to only access diagnostic data from one of the available homes, the active ADR home should be set appropriately. The active home can be set using the set homepath command:
adrci> set homepath diag\rdbms\ora11gr1\ora11gr1 adrci> show homes ADR Homes: diag\rdbms\ora11gr1\ora11gr1 adrci>
The output demonstrates that after setting the active ADR home, only the active home displays.
Creating Incident Packages
Once the incident or problem that should be included in the incident package is identified, two options remain. The DBA can then either create a physical package immediately or create a logical package to verify the package contents and customize the package to include the files that are needed.
Incidents in the ADR home can be viewed by using the “show incident” command:
adrci> set homepath diag\rdbms\ora11gr1\ora11gr1 adrci> show incident ADR Home = c:\oracle\11g\diag\rdbms\ora11gr1\ora11gr1 ************************************************************************* INCIDENT_ID PROBLEM_KEY CREATE_TIME -------------------- ----------------------------------------------------------------- 5138 ORA 7445 [qmxarFindPartition()+15] 2007-11-15 22:53:58.343000 -08:00 5137 ORA 600 [qmxarElemAt2] 2007-11-15 22:53:40.859000 -08:00 2 rows fetched adrci>
NOTE: If an active ADR home has not been set, this will include incidents from all homes listed in the “show homes” command.
If the problem reported has not been captured as an incident in ADR, then it is best to create a logical package and add the necessary files before generating the zip file.
If the physical package needs to be generated immediately based on an incident, problem, problem key, or time interval without the opportunity to customize the logical package, the “ips pack” command can be used as follows:
ips pack [incident |problem |problemkey prob_key|seconds secs|time to ] [correlate {basic|typical|all}] [in path]
For example:
adrci> ips pack incident 5137 in c:\tmp Generated package 5 in file C:\tmp\ORA600qmx_20071116175948_COM_1.zip, mode complete adrci>
To create the logical incident package, use a variation of the “ips create package” command:
ips create package {incident |problem |problemkey |seconds |time to } [correlate basic|typical|all]
It is possible to create a logical package based on incident number such as:
adrci> ips create package incident 5138 Created package 3 based on incident id 5138, correlation level typical adrci>
This creates a pacakge of the incident 5138 in “incpkg” directory; you can then add diagnostic data to the package.
Finally generate the package for the incident, which then can be uploaded to metalink while seeking support from Oracle.
adrci> ips generate package 3
Generated package 1 in file /app/oracle/product/11.1.0/db_1/dbs/ORA4031_20080407170431_COM_1.zip, mode complete
As reported above a zip file has been created with all relevant logs. Now you can upload this zip file to Oracle support and seek their help in resolving your problem.
You can also view the information generated in “incpkg” directory
$cd /app/oracle/diag/rdbms/11GLAB/incpkg/pkg_3/seq_1 $ ls -ltr -rw-r----- 1 oracle oinstall 499 Apr 7 17:14 metadata.xml -rw-r----- 1 oracle oinstall 21968 Apr 7 17:14 manifest_1_1.xml -rw-r----- 1 oracle oinstall 26270 Apr 7 17:14 manifest_3_1.txt -rw-r----- 1 oracle oinstall 20064 Apr 7 17:14 manifest_3_1.html drwxr-xr-x 2 oracle oinstall 4096 Apr 7 17:14 export drwxr-xr-x 2 oracle oinstall 4096 Apr 7 17:14 crs -rw-r----- 1 oracle oinstall 62789 Apr 7 17:14 config.xml
We used to achieve the same earlier by running some scripts or collecting the logs/trace files manually. But with adrci, this task is pretty simplified; I think this is surely going to reduce the time to diagnose and resolve any problem
To create an incident package based on a problem, it is necessary to find the problem_id by using the “show incident” command:
show incident [-p predicate_string] [-mode {BASIC|BRIEF|DETAIL}]
For example:
adrci> show incident -mode brief -p "incident_id=5137" ADR Home = c:\oracle\11g\diag\rdbms\ora11gr1\ora11gr1: ********************************************************** INCIDENT INFO RECORD 1 ********************************************************** INCIDENT_ID 5137 STATUS ready CREATE_TIME 2007-11-15 22:53:40.859000 -08:00 PROBLEM_ID 1 CLOSE_TIME <NULL> FLOOD_CONTROLLED none ERROR_FACILITY ORA ERROR_NUMBER 600 ERROR_ARG1 qmxarElemAt2 ERROR_ARG2 144 ERROR_ARG3 <NULL> ERROR_ARG4 <NULL> ERROR_ARG5 <NULL> ERROR_ARG6 <NULL> ERROR_ARG7 <NULL> ERROR_ARG8 <NULL> SIGNALLING_COMPONENT <NULL> SIGNALLING_SUBCOMPONENT <NULL> SUSPECT_COMPONENT <NULL> SUSPECT_SUBCOMPONENT <NULL> ECID <NULL> IMPACTS 0 1 rows fetched adrci>
This shows that incident 5137 has been assigned the problem id of 1. Using this problem id, creates the package for this problem:
adrci> ips create package problem 1
Created package 2 based on problem id 1, correlation level typical
adrci>
To create the package based on the problem key, use the problem_key value displayed in the show incident output. For example:
adrci> ips create package problemkey "ORA 7445 [qmxarFindPartition()+15]" Created package 3 based on problem key ORA 7445 [qmxarFindPartition()+15], correlation level typical adrci>
As previously discussed, creating an incident package based on a problem includes diagnostic information for incidents associated to that problem. Since the same problem could potentially include many incidents, only the first and last three incidents associated with the problem will be included. This prevents the inclusion of superfluous information in the package. Additionally, incidents older than 90 days are excluded to prevent the inclusion of incidents that are no longer impacting the database. These settings apply to all generated incident packages except manually created packages. Both of these options are configurable by either using IPS set configuration or the Enterprise Manager Support Workbench.
When creating an incident package based on a time interval, the DBA can either include incidents that occurred relative to the current time, or inside of a specific time interval. To create a package based on incidents that occurred a certain time from the present, use “ips create package seconds [seconds]”. This will include incidents that occurred within secondsfrom the time the command was run. For example, “ips create package seconds 600” will create a package including incidents that occurred within the last 10 minutes.
To use a time interval instead, use the command “ips create package time ‘start_time’ to ‘end_time’”. The start and end times in the command must be in the time format ‘YYYY-MM-DD HH24:MI:SS.FF TZR’ or ‘YYYY-MM-DD HH24:MI:SS TZR’. The colons in the ‘HH24:MI:SS’ can optionally be substituted with periods. To create the package based on the incidents that occurred between November 11, 2007 10PM and November 12, 2007 12AM (2 hour window), the command would be:
adrci> IPS CREATE PACKAGE TIME '2007-11-11 22:00:00 -08:00' to '2007-11-12 00:00:00 -08:00' Created package 4 based on time range 2007-11-11 22:00:00 -08:00 to 2007-11-12 00:00:00 -08:00, correlation level typical adrci>
If the issue that is being reported to Oracle Support has not been captured as an incident, create an empty package using “ips create package” without any options.