ADR

Automatic Diagnostics Repository

The Automatic Diagnostics Repository (ADR) is simply the file structure under /u01/app/oracle/diag.
Using the ADRCI tool it is possible to query the files. Some examples are provided on this page...

SHOW ALERT

To tail the last 10 lines of the current alert log...

adrci exec="set homepath diag/rdbms/$(echo $ORACLE_SID | tr '[:upper:]' '[:lower:]')/$ORACLE_SID;show alert -tail"

To tail the last 50 lines of the current alert log...

adrci exec="set homepath diag/rdbms/$(echo $ORACLE_SID | tr '[:upper:]' '[:lower:]')/$ORACLE_SID;show alert -tail 50"

To tail the last 10 lines of the current alert log and show more lines as they arrive...

adrci exec="set homepath diag/rdbms/$(echo $ORACLE_SID | tr '[:upper:]' '[:lower:]')/$ORACLE_SID;show alert -tail -F"

To show an entry at a specific timestamp...

adrci

show alert -term -p "ORIGINATING_TIMESTAMP = '2021-07-16 09:55:37.840343 -01:00'"

To show all entries between specific timestamps...

adrci

show alert -term -p "ORIGINATING_TIMESTAMP > '2021-07-16 09:55:00.000000 -01:00' AND ORIGINATING_TIMESTAMP < '2021-07-16 09:58:00.000000 -01:00'

Startup/Shutdown times

Using current alert.log

adrci

show alert -p "originating_timestamp > systimestamp-1 and message_group like '%ddl%'" -term

Using older alert.log

echo show alert -p "message_group like '%ddl%'" -term -file /u01/app/oracle/diag/rdbms/$(echo $ORACLE_SID | tr '[:upper:]' '[:lower:]')/${ORACLE_SID}/alert/log.xml.2018-09-15_23:59

adrci

cut and paste the output from the command above

Using nawk to simplify output

Shutdown...

adrci exec=show alert -p "originating_timestamp > systimestamp-1 and message_group like '%ddl%'" -term | \

nawk 'c-->0;$0~s{if(b)for(c=b+1;c>1;c--)print r[(NR-c+1)%b];print;c=a}b{r[NR%b]=$0}' b=1 a=0 s="^ALTER DATABASE CLOSE"

Startup...

adrci exec=show alert -p "originating_timestamp > systimestamp-1 and message_group like '%ddl%'" -term | \

nawk 'c-->0;$0~s{if(b)for(c=b+1;c>1;c--)print r[(NR-c+1)%b];print;c=a}b{r[NR%b]=$0}' b=1 a=0 s="^Completed: ALTER DATABASE OPEN"

Startup/Shutodown Shell script

Querying the Listener Log

This script show all TNS errors complete with failed connection information...

adrci exec=show alert -p "message_text like '%TNS-%' or message_text like '% * 1%'" -file /u01/app/oracle/diag/tnslsnr/$(hostname -s)/${LISTENER_NAME}/alert/log.xml -term

Example Output

2020-04-21 19:36:40.743000 +01:0021-APR-2020 19:36:40 * (CONNECT_DATA=(COMMAND=VERSION)) * version * 1189TNS-01189: The listener could not authenticate the user2020-04-21 23:16:57.169000 +01:0021-APR-2020 23:16:57 * (ADDRESS=(PROTOCOL=tcp)(HOST=xxxxxxxx)(PORT=46906)) * <unknown connect data> * 12537TNS-12537: TNS:connection closed TNS-12560: TNS:protocol adapter error TNS-00507: Connection closed IBM/AIX RISC System/6000 Error: 55: Operation now in progress2020-04-21 23:26:15.443000 +01:0021-APR-2020 23:26:15 * (CONNECT_DATA=(COMMAND=VERSION)) * version * 1189TNS-01189: The listener could not authenticate the user21-APR-2020 23:26:15 * (CONNECT_DATA=(COMMAND=VERSION)) * version * 1189TNS-01189: The listener could not authenticate the user21-APR-2020 23:26:16 * (CONNECT_DATA=(PASSWORD=xxxxxxxx)(COMMAND=STATUS)(VERSION=203424000)) * status * 1189TNS-01189: The listener could not authenticate the user2020-04-21 23:26:16.542000 +01:0021-APR-2020 23:26:16 * (CONNECT_DATA=(COMMAND=VERSION)) * version * 1189TNS-01189: The listener could not authenticate the user21-APR-2020 23:26:16 * (CONNECT_DATA=(PASSWORD=xxxxxxxx)(COMMAND=SERVICES)(VERSION=203424000)) * services * 1189TNS-01189: The listener could not authenticate the user2020-04-21 23:26:42.302000 +01:0021-APR-2020 23:26:42 * (CONNECT_DATA=(SID=762CCFDC2E)(CID=(PROGRAM=JDBC Thin Client)(HOST=__jdbc__)(USER=xxxxxxxx))) * (ADDRESS=(PROTOCOL=tcp)(HOST=10.79.130.90)(PORT=54242)) * establish * 762CCFDC2E * 12505TNS-12505: TNS:listener does not currently know of SID given in connect descriptor21-APR-2020 23:26:42 * (CONNECT_DATA=(SID=ORCL)(CID=(PROGRAM=JDBC Thin Client)(HOST=__jdbc__)(USER=xxxxxxxx))) * (ADDRESS=(PROTOCOL=tcp)(HOST=xxxxxxxx)(PORT=54244)) * establish * ORCL * 12505TNS-12505: TNS:listener does not currently know of SID given in connect descriptor21-APR-2020 23:26:42 * (CONNECT_DATA=(SID=IASDB)(CID=(PROGRAM=JDBC Thin Client)(HOST=__jdbc__)(USER=xxxxxxxx))) * (ADDRESS=(PROTOCOL=tcp)(HOST=xxxxxxxx)(PORT=54246)) * establish * IASDB * 12505TNS-12505: TNS:listener does not currently know of SID given in connect descriptor21-APR-2020 23:26:42 * (CONNECT_DATA=(SID=OEMREP)(CID=(PROGRAM=JDBC Thin Client)(HOST=__jdbc__)(USER=xxxxxxxx))) * (ADDRESS=(PROTOCOL=tcp)(HOST=xxxxxxxx)(PORT=54248)) * establish * OEMREP * 12505TNS-12505: TNS:listener does not currently know of SID given in connect descriptor21-APR-2020 23:26:43 * (CONNECT_DATA=(SID=XE)(CID=(PROGRAM=JDBC Thin Client)(HOST=__jdbc__)(USER=xxxxxxxx))) * (ADDRESS=(PROTOCOL=tcp)(HOST=xxxxxxxx)(PORT=54250)) * establish * XE * 12505TNS-12505: TNS:listener does not currently know of SID given in connect descriptor

Purge

To check Autopurge settings use...

adrci

select SHORTP_POLICY,LONGP_POLICY,LAST_AUTOPRG_TIME,LAST_MANUPRG_TIME from ADR_CONTROL;

Incident Packaging Service (IPS)

adrci

show home

set homepath /my/home

show problem

show incident -p "problem_key='ORA 1578'"

show incident -p "problem_key='ORA 1578'" -all

ips pack incident 99999 in /tmp

Other usage for ips...

ips pack problem 999 in /tmp

ips pack problemkey "ORA 1578" in /tmp

ips pack seconds 8 in /tmp

ips pack time '2021-07-01 10:00:00.00' to '2021-07-01 23:00:00.00'

Launch adrci

Show list of locations that may contain log files

Set preferred location

Show Problems

Show Incidents related to the Problem Key

Show all Incidents related to the Problem Key

Create a zipfile of all relevant log files


Pack at problem level

Pack at problem level based on key

Pack incidents occurring in next 8 seconds

Pack incidents occurring between timestamps

Bibliography


12.1 - Oracle Database Net Services Reference - ADR Diagnostic Parameters in sqlnet.ora
12.1 Database Utilitieshttps://docs.oracle.com/database/121/SUTIL/GUID-8D62D6A0-99F4-465C-B088-5CCF259B7D80.htm#SUTIL1519https://docs.oracle.com/database/121/SUTIL/GUID-AA8EA548-8756-4A18-9F93-4F2C27FFD81D.htm#SUTIL1472
My Oracle Support (https://support.oracle.com)DIA-48448 Is Raised When Executing PURGE command in ADRCI Utility (Doc ID 951023.1)ADR Different Methods to Create IPS Package (Doc ID 411.1)How To Filter ADRCI 'Show Alert' Output By Date and Time (Doc ID 1221773.1)Database 11g / 12c: Quick Steps to Package and Send Critical Error Diagnostic Information to Support (Doc ID 443529.1)Understanding Automatic Diagnostic Repository (Doc ID 422893.1)ADR Different Methods to Create IPS Package (Doc ID 738732.1) - deprecated - use 411.1 instead
Otherhttps://oracle-base.com/articles/11g/automatic-diagnostics-repository-11gr1 https://www.morganslibrary.org/reference/adr.html https://uhesse.com/2011/06/01/adrci-a-survival-guide-for-the-dba/ https://askdba.org/weblog/oracle11g/adrci/https://stepintooracledba.blogspot.com/2014/05/adrci-command-ouput-is-not-fully.html