ADR Command Interpreter (ADRCI) is a command-line tool in the fault detection infrastructure of Oracle databases.
With ADRCI;
- We can see the diagnostic data in the Automatic Diagnostic Repository (ADR).
- We can view Health Monitoring reports.
- For Oracle Support, we can create packages containing accident and problem information in the form of a zip file.
Fault detection data includes information such as accident and problem descriptions, trace files, dumps , health monitoring reports , alert log records.
Use of ADRCI tool:
To start ;
1 2 3 4 5 6 7 | -bash-4.3$ adrci ADRCI: Release 11.2.0.4.0 - Production on Mon Dec 26 16:22:27 2016 Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved. ADR base = "/u01/app/oracle" |
You can view the related incident homes as follows.
1 2 3 4 5 6 7 8 | adrci> show homes ADR Homes: diag/asm/+asm/+ASM1 diag/clients/user_oracle/host_2585172500_11 diag/clients/user_oracle/host_2585172500_80 diag/diagtool/user_oracle/host_2585172500_11 diag/rdbms/orcl/ORCL1 diag/tnslsnr/oradb1/listener |
We’re setting home which concerns our database.
1 | adrci> set homepath diag/rdbms/orcl/ORCL1 |
List all accidents under this home:
1 2 3 4 5 6 7 8 9 10 11 12 13 | adrci> show incident ADR Home = /u01/app/oracle/diag/rdbms/orcl/ORCL1: ************************************************************************* INCIDENT_ID PROBLEM_KEY CREATE_TIME -------------------- ----------------------------------------------------------- ---------------------------------------- 36425 ORA 603 2016-08-27 02:44:06.781000 +03:00 36649 ORA 603 2016-08-27 13:38:05.170000 +03:00 36481 ORA 603 2016-09-20 17:20:22.191000 +03:00 108476 ORA 603 2016-10-06 20:11:17.110000 +03:00 300829 ORA 603 2016-12-16 21:02:09.763000 +03:00 300861 ORA 603 2016-12-17 22:28:50.895000 +03:00 6 rows fetched |
Detailed display is also possible. A detailed display can be provided with the command below.
1 | adrci> SHOW INCIDENT -MODE DETAIL |
For detailed information about an accident, we can use the following command.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | adrci> SHOW INCIDENT -MODE DETAIL -P "INCIDENT_ID=36425" ADR Home = /u01/app/oracle/diag/rdbms/orcl/ORCL1: ************************************************************************* ********************************************************** INCIDENT INFO RECORD 1 ********************************************************** INCIDENT_ID 36425 STATUS ready CREATE_TIME 2016-08-27 02:44:06.781000 +03:00 PROBLEM_ID 1 CLOSE_TIME <NULL> FLOOD_CONTROLLED none ERROR_FACILITY ORA ERROR_NUMBER 603 ERROR_ARG1 <NULL> 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> IMPACTS 0 PROBLEM_KEY ORA 603 FIRST_INCIDENT 36425 FIRSTINC_TIME 2016-08-27 02:44:06.781000 +03:00 LAST_INCIDENT 300861 LASTINC_TIME 2016-12-17 22:28:50.895000 +03:00 IMPACT1 0 IMPACT2 0 IMPACT3 0 IMPACT4 0 KEY_NAME Client ProcId KEY_VALUE oracle@oradb1 (TNS V1-V3).40894802_1 KEY_NAME ProcId KEY_VALUE 53.43 KEY_NAME PQ KEY_VALUE (0, 1472194814) KEY_NAME SID KEY_VALUE 955.4678 OWNER_ID 1 INCIDENT_FILE /u01/app/oracle/diag/rdbms/orcl/ORCL1/trace/ORCL1_j000_40894802.trc OWNER_ID 1 INCIDENT_FILE /u01/app/oracle/diag/rdbms/orcl/ORCL1/incident/incdir_36425/ORCL1_j000_40894802_i36425.trc 1 rows fetched |
We can use the following command to display existing problems.
1 2 3 4 5 6 7 8 | adrci> SHOW PROBLEM ADR Home = /u01/app/oracle/diag/rdbms/orcl/ORCL1: ************************************************************************* PROBLEM_ID PROBLEM_KEY LAST_INCIDENT LASTINC_TIME -------------------- ----------------------------------------------------------- -------------------- ---------------------------------------- 1 ORA 603 300861 2016-12-17 22:28:50.895000 +03:00 1 rows fetched |
When we open the call for any accidents on the Oracle Support side, they request the package related to the accident. We can create this file as zip in the following steps.
After setting home path for the related database, we list all accidents and determine the id information of the related accident. These processes are described above. Then we create the logical accident package, then physical accident package.
Creating the logical package: We create the package by specifying the Incident ID.
1 2 | adrci> IPS CREATE PACKAGE INCIDENT 36425 Created package 1 based on incident id 36425, correlation level typical |
Then we create the physical state of this package. We create the zip file by specifying the directory information to create the files, and the logical packet number with the following command.
1 2 3 4 5 | adrci> IPS GENERATE PACKAGE 1 IN /home/oracle/ips1 Generated package 1 in file /home/oracle/ips1/ORA603_20161226162604_COM_1.zip, mode complete Additional incremental files: /home/oracle/ips1/ORA603_20161226162604_INC_2.zip |
It is possible to use the adrci tool in interactive mode as above, and it can also be used in Batch mode.
Using ADRCI in Batch Mode:
It is possible to run in batch mode as follows.
1 | -bash-4.3$ adrci exec="command[; command]..." |
Example commands:
1 2 3 4 5 6 7 8 | -bash-4.3$ adrci exec="SHOW HOMES" ADR Homes: diag/asm/+asm/+ASM1 diag/clients/user_oracle/host_2585172500_11 diag/clients/user_oracle/host_2585172500_80 diag/diagtool/user_oracle/host_2585172500_11 diag/rdbms/orcl/ORCL1 diag/tnslsnr/oradb1/listener |
In batch mode, it is possible to run consecutive commands as follows.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | -bash-4.3$ adrci exec="SHOW HOMES; SHOW INCIDENT" ADR Homes: diag/asm/+asm/+ASM1 diag/clients/user_oracle/host_2585172500_11 diag/clients/user_oracle/host_2585172500_80 diag/diagtool/user_oracle/host_2585172500_11 diag/rdbms/orcl/ORCL1 diag/tnslsnr/oradb1/listener ADR Home = /u01/app/oracle/diag/asm/+asm/+ASM1: ************************************************************************* INCIDENT_ID PROBLEM_KEY CREATE_TIME -------------------- ----------------------------------------------------------- ---------------------------------------- 208001 ORA 445 2016-09-26 14:27:06.598000 +03:00 ADR Home = /u01/app/oracle/diag/clients/user_oracle/host_2585172500_11: ************************************************************************* 0 rows fetched ADR Home = /u01/app/oracle/diag/clients/user_oracle/host_2585172500_80: ************************************************************************* 0 rows fetched ADR Home = /u01/app/oracle/diag/diagtool/user_oracle/host_2585172500_11: ************************************************************************* 0 rows fetched ADR Home = /u01/app/oracle/diag/rdbms/orcl/ORCL1: ************************************************************************* INCIDENT_ID PROBLEM_KEY CREATE_TIME -------------------- ----------------------------------------------------------- ---------------------------------------- 36425 ORA 603 2016-08-27 02:44:06.781000 +03:00 36649 ORA 603 2016-08-27 13:38:05.170000 +03:00 36481 ORA 603 2016-09-20 17:20:22.191000 +03:00 108476 ORA 603 2016-10-06 20:11:17.110000 +03:00 300829 ORA 603 2016-12-16 21:02:09.763000 +03:00 300861 ORA 603 2016-12-17 22:28:50.895000 +03:00 ADR Home = /u01/app/oracle/diag/tnslsnr/oradb1/listener: ************************************************************************* First 0 rows fetched (*** more available ***) |
You may want to read the below article for deleting trace files, listener logs, alert logs.
“How To Delete Trace Files, listener log etc with ADRCI“