a survival guide for the dba

22
7/27/2019 A Survival Guide for the DBA http://slidepdf.com/reader/full/a-survival-guide-for-the-dba 1/22 adrci: A survival guide for the DBA Starting with 11gR1, we have a new way to deal with Oracle Errors & Tracefiles: There is now a special command line utility dedicated for that purpose called adrci (Automatic Diagnostic Repository Command Interpreter). This posting is intended to show you the (in my view) essential commands, a DBA ought to know in order to use it. We will look at 1. Viewing the alert.log 2. The relation between incident & problem 3. Creation of Packages & ZIP files to send to Oracle Support 4. Managing, especially purging tracefiles I will at first create a problem. Don’t do that with your Production Database! Especially:  Never do DML on dictionary tables! [oracle@uhesse ~]$ sqlplus / as sysdba SQL*Plus: Release 11.2.0.2.0 Production on Wed Jun 1 10:25:06 2011 Copyright (c) 1982, 2010, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL> select * from v$version; BANNER ---------------------------------------------------------------------- ---------- Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production PL/SQL Release 11.2.0.2.0 - Production CORE 11.2.0.2.0 Production TNS for Linux: Version 11.2.0.2.0 - Production NLSRTL Version 11.2.0.2.0 - Production SQL> show parameter diagnostic NAME TYPE VALUE ------------------------------------ ----------- --------------------- --------- diagnostic_dest string /u01/app/oracle SQL> grant dba to adam identified by adam; Grant succeeded. SQL> connect adam/adam  Connected. SQL> create table t (n number); Table created.

Upload: carlos-perez

Post on 14-Apr-2018

221 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: A Survival Guide for the DBA

7/27/2019 A Survival Guide for the DBA

http://slidepdf.com/reader/full/a-survival-guide-for-the-dba 1/22

adrci: A survival guide for the DBA

Starting with 11gR1, we have a new way to deal with Oracle Errors & Tracefiles: Thereis now a special command line utility dedicated for that purpose called adrci (AutomaticDiagnostic Repository Command Interpreter). This posting is intended to show you the(in my view) essential commands, a DBA ought to know in order to use it. We will look at

1.  Viewing the alert.log2.  The relation between incident & problem3.  Creation of Packages & ZIP files to send to Oracle Support4.  Managing, especially purging tracefiles

I will at first create a problem. Don’t do that with your Production Database! Especially:

 Never do DML on dictionary tables!

[oracle@uhesse ~]$ sqlplus / as sysdba 

SQL*Plus: Release 11.2.0.2.0 Production on Wed Jun 1 10:25:06 2011

Copyright (c) 1982, 2010, Oracle. All rights reserved.

Connected to:Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bitProductionWith the Partitioning, OLAP, Data Mining and Real Application Testingoptions

SQL> select * from v$version; 

BANNER--------------------------------------------------------------------------------Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bitProductionPL/SQL Release 11.2.0.2.0 - ProductionCORE 11.2.0.2.0 ProductionTNS for Linux: Version 11.2.0.2.0 - ProductionNLSRTL Version 11.2.0.2.0 - Production

SQL> show parameter diagnostic 

NAME TYPE VALUE------------------------------------ ----------- ------------------------------diagnostic_dest string /u01/app/oracle

SQL> grant dba to adam identified by adam; 

Grant succeeded.

SQL> connect adam/adam  Connected.SQL> create table t (n number); 

Table created.

Page 2: A Survival Guide for the DBA

7/27/2019 A Survival Guide for the DBA

http://slidepdf.com/reader/full/a-survival-guide-for-the-dba 2/22

SQL> select object_id from user_objects; 

OBJECT_ID----------

75719

SQL> connect / as sysdba Connected.SQL> update tab$ set cols=2 where obj#=75719; 

1 row updated.

SQL> commit; 

Commit complete.

SQL> alter system flush shared_pool; 

System altered.

SQL> connect adam/adam  Connected.SQL> select * from t; select * from t

*ERROR at line 1:ORA-03113: end-of-file on communication channelProcess ID: 2236Session ID: 29 Serial number: 9

I flushed the Shared Pool to get the Data Dictionary Cache empty. Else the select maynot crash the session as it did. Imagine the user calls me now on the phone. Our first

idea as an experienced DBA: We look at the alert.log! Right so. Please notice that wenow have two different kinds of the alert.log.

One is present in the conventional text format, per OFA in$ORACLE_BASE/diag/rdbms/name of the db/name of the instance/trace This locationis determined by the new initialization parameter DIAGNOSTIC_DEST, whileBACKGROUND_DUMP_DEST is deprecated in 11g.

1. Viewing the alert.log 

The other one is in XML format placed in $ORACLE_BASE/diag/rdbms/name of thedb/name of the instance/alert This version of the alert.log is accessed by adrci:

[oracle@uhesse ~]$ adrci 

ADRCI: Release 11.2.0.2.0 - Production on Wed Jun 1 10:20:08 2011

Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rightsreserved.

ADR base = "/u01/app/oracle"adrci> show home ADR Homes:

diag/tnslsnr/uhesse/listenerdiag/rdbms/orcl/orcl

Page 3: A Survival Guide for the DBA

7/27/2019 A Survival Guide for the DBA

http://slidepdf.com/reader/full/a-survival-guide-for-the-dba 3/22

Please notice that we have different ADR Homes. In my case only two, because I amnot using Grid Infrastructure on this Demo System, else there would be another one. Ispecify my Database Home first. Then I look at the alert.log. Good news if you are on

Windows: Finally, you can tail -f your alert.log also

adrci> set home diag/rdbms/orcl/orcl adrci> show alert -tail -f 2011-06-01 10:16:35.337000 +02:00db_recovery_file_dest_size of 4032 MB is 0.00% used. This is auser-specified limit on the amount of space that will be used by thisdatabase for recovery-related files, and does not reflect the amountofspace available in the underlying filesystem or ASM diskgroup.Starting background process CJQ0CJQ0 started with pid=21, OS id=22042011-06-01 10:18:42.668000 +02:00Exception [type: SIGSEGV, Address not mapped to object] [ADDR:0x0]

[PC:0x90D891A, qcstda()+702] [flags: 0x0, count: 1]Errors in file/u01/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_ora_2236.trc(incident=6153):ORA-07445: exception encountered: core dump [qcstda()+702] [SIGSEGV][ADDR:0x0] [PC:0x90D891A] [Address not mapped to object] []Incident details in:/u01/app/oracle/diag/rdbms/orcl/orcl/incident/incdir_6153/orcl_ora_2236_i6153.trcUse ADRCI or Support Workbench to package the incident. See Note 411.1 at My Oracle Support for error and packaging details.2011-06-01 10:18:47.518000 +02:00Dumping diagnostic data in directory=[cdmp_20110601101847], requested

by (instance=1, osid=2236), summary=[incident=6153].2011-06-01 10:18:48.727000 +02:00Sweep [inc][6153]: completedSweep [inc2][6153]: completed

2. The relation between Incident & Problem 

You see the incident was recorded in the alert.log. And it tells you “Use ADRCI or 

Support Workbench to package the incident.” We will soon  see how to do that. First I’d

like to explain the relation between incident and problem: An incident is the concreteoccurrence of a problem. In other words: The same problem may have multipleincidents. To show that, I will open another terminal and do again a select against thetable t, while still tailing the alert log from the first session.

Second terminal:

[oracle@uhesse ~]$ sqlplus adam/adam  

SQL*Plus: Release 11.2.0.2.0 Production on Wed Jun 1 10:21:52 2011

Copyright (c) 1982, 2010, Oracle. All rights reserved.

Connected to:Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit

Production

Page 4: A Survival Guide for the DBA

7/27/2019 A Survival Guide for the DBA

http://slidepdf.com/reader/full/a-survival-guide-for-the-dba 4/22

With the Partitioning, OLAP, Data Mining and Real Application Testingoptions

SQL> select * from t where n=42; select * from t where n=42

*

ERROR at line 1:ORA-03113: end-of-file on communication channelProcess ID: 2299Session ID: 36 Serial number: 11

First terminal:

2011-06-01 10:21:31.367000 +02:00Starting background process SMCOSMCO started with pid=19, OS id=22682011-06-01 10:22:08.781000 +02:00Exception [type: SIGSEGV, Address not mapped to object] [ADDR:0x0][PC:0x90D891A, qcstda()+702] [flags: 0x0, count: 1]

Errors in file/u01/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_ora_2299.trc(incident=6201):ORA-07445: exception encountered: core dump [qcstda()+702] [SIGSEGV][ADDR:0x0] [PC:0x90D891A] [Address not mapped to object] []Incident details in:/u01/app/oracle/diag/rdbms/orcl/orcl/incident/incdir_6201/orcl_ora_2299_i6201.trcUse ADRCI or Support Workbench to package the incident.See Note 411.1 at My Oracle Support for error and packaging details.2011-06-01 10:22:11.135000 +02:00Dumping diagnostic data in directory=[cdmp_20110601102211], requestedby (instance=1, osid=2299), summary=[incident=6201].

2011-06-01 10:22:13.370000 +02:00Sweep [inc][6201]: completedSweep [inc2][6201]: completed

I have seen the second incident recorded. I exit out of the tail -f with CTRL+C andcontinue:

adrci> show problem  

ADR Home = /u01/app/oracle/diag/rdbms/orcl/orcl:*************************************************************************

PROBLEM_IDPROBLEM_KEYLAST_INCIDENT LASTINC_TIME-------------------- ----------------------------------------------------------- -------------------- ----------------------------------------1 ORA 7445[qcstda()+702]6201 2011-06-01 10:22:08.924000 +02:001 rows fetched

So I have one problem with the ID 1 and the last incident occurred at 10:22. Are theremore?

adrci> show incident 

Page 5: A Survival Guide for the DBA

7/27/2019 A Survival Guide for the DBA

http://slidepdf.com/reader/full/a-survival-guide-for-the-dba 5/22

 ADR Home = /u01/app/oracle/diag/rdbms/orcl/orcl:*************************************************************************INCIDENT_IDPROBLEM_KEY

CREATE_TIME-------------------- ----------------------------------------------------------- ----------------------------------------6153 ORA 7445[qcstda()+702] 2011-06-0110:18:42.995000 +02:006201 ORA 7445[qcstda()+702] 2011-06-0110:22:08.924000 +02:002 rows fetched

I want to see some more detail about the incidents:

adrci> show incident -mode detail -p "incident_id=6201" 

ADR Home = /u01/app/oracle/diag/rdbms/orcl/orcl:*************************************************************************

**********************************************************INCIDENT INFO RECORD 1**********************************************************

INCIDENT_ID 6201STATUS readyCREATE_TIME 2011-06-01 10:22:08.924000 +02:00PROBLEM_ID 1 

CLOSE_TIMEFLOOD_CONTROLLED noneERROR_FACILITY ORAERROR_NUMBER 7445ERROR_ARG1 qcstda()+702ERROR_ARG2 SIGSEGVERROR_ARG3 ADDR:0x0ERROR_ARG4 PC:0x90D891AERROR_ARG5 Address not mapped to objectERROR_ARG6ERROR_ARG7ERROR_ARG8ERROR_ARG9

ERROR_ARG10ERROR_ARG11ERROR_ARG12SIGNALLING_COMPONENT SQL_ParserSIGNALLING_SUBCOMPONENTSUSPECT_COMPONENTSUSPECT_SUBCOMPONENTECIDIMPACTS 0PROBLEM_KEY ORA 7445 [qcstda()+702]FIRST_INCIDENT 6153FIRSTINC_TIME 2011-06-01 10:18:42.995000 +02:00LAST_INCIDENT 6201

LASTINC_TIME 2011-06-01 10:22:08.924000 +02:00IMPACT1 0IMPACT2 0

Page 6: A Survival Guide for the DBA

7/27/2019 A Survival Guide for the DBA

http://slidepdf.com/reader/full/a-survival-guide-for-the-dba 6/22

IMPACT3 0IMPACT4 0KEY_NAME ProcIdKEY_VALUE 25.3KEY_NAME Client ProcIdKEY_VALUE oracle@uhesse (TNS V1-

V3).2299_140262306875136KEY_NAME PQKEY_VALUE (0, 1306916528)KEY_NAME SIDKEY_VALUE 36.11OWNER_ID 1INCIDENT_FILE

/u01/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_ora_2299.trcOWNER_ID 1INCIDENT_FILE

/u01/app/oracle/diag/rdbms/orcl/orcl/incident/incdir_6201/orcl_ora_2299_i6201.trc 1 rows fetched

I want to look at the incident tracefile mentioned above:

adrci> show trace/u01/app/oracle/diag/rdbms/orcl/orcl/incident/incdir_6201/orcl_ora_2299_i6201.trc /u01/app/oracle/diag/rdbms/orcl/orcl/incident/incdir_6201/orcl_ora_2299_i6201.trc----------------------------------------------------------LEVEL PAYLOAD----- ---------------------------------------------------------------

---------------------------------------------------------------------------------

Dump file/u01/app/oracle/diag/rdbms/orcl/orcl/incident/incdir_6201/orcl_ora_2299_i6201.trcOracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit

ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing

optionsORACLE_HOME = /u01/app/oracle/product/11.2.0/db_1System name: LinuxNode name: uhesseRelease: 2.6.32-100.28.5.el6.x86_64Version: #1 SMP Wed Feb 2 18:40:23 EST 2011Machine: x86_64

Instance name: orclRedo thread mounted by this instance: 1Oracle process number: 25Unix process pid: 2299, image: oracle@uhesse (TNS V1-V3)

*** 2011-06-01 10:22:08.929*** SESSION ID:(36.11) 2011-06-01 10:22:08.929*** CLIENT ID:() 2011-06-01 10:22:08.929*** SERVICE NAME:(SYS$USERS) 2011-06-01 10:22:08.929*** MODULE NAME:(SQL*Plus) 2011-06-01 10:22:08.929*** ACTION NAME:() 2011-06-01 10:22:08.929

Dump continued from file:/u01/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_ora_2299.trc1> ***** Error Stack *****

ORA-07445: exception encountered: core dump [qcstda()+702] [SIGSEGV][ADDR:0x0] [PC:0x90D891A] [Address not mapped to object] []1< ***** Error Stack *****

Page 7: A Survival Guide for the DBA

7/27/2019 A Survival Guide for the DBA

http://slidepdf.com/reader/full/a-survival-guide-for-the-dba 7/22

1> ***** Dump for incident 6201 (ORA 7445 [qcstda()+702]) *****2> ***** Beginning of Customized Incident Dump(s) *****2> ***** Beginning of Customized Incident Dump(s) *****Exception [type: SIGSEGV, Address not mapped to object] [ADDR:0x0]

[PC:0x90D891A, qcstda()+702] [flags: 0x0, count: 1]Registers:

%rax: 0x0000000000000000 %rbx: 0x00007f915c77f0e0 %rcx:0x0000000000000007%rdx: 0x0000000000000000 %rdi: 0x00007f915c77be98 %rsi:

0x0000000000000000%rsp: 0x00007fffc65178e0 %rbp: 0x00007fffc6517960 %r8:

0x0000000000000028%r9: 0x0000000000002000 %r10: 0x00000000093849c0 %r11:

0x0000000000000168%r12: 0x00007f915c77ade8 %r13: 0x000000008edbb178 %r14:

0x00007f915c777da0%r15: 0x00007f915c77ae28 %rip: 0x00000000090d891a %efl:

0x0000000000010246qcstda()+686 (0x90d890a) mov -0x40(%rbp),%rdi

qcstda()+690 (0x90d890e) mov %rdx,0x18(%rbx)qcstda()+694 (0x90d8912) mov 0x60(%r15),%rsiqcstda()+698 (0x90d8916) mov %ecx,0x8(%r15)> qcstda()+702 (0x90d891a) mov %ecx,(%rsi)qcstda()+704 (0x90d891c) mov 0x78(%rdi),%rdxqcstda()+708 (0x90d8920) test %rdx,%rdxqcstda()+711 (0x90d8923) jnz 0x90d8d03qcstda()+717 (0x90d8929) mov -0x70(%rbp),%rdi

*** 2011-06-01 10:22:08.963dbkedDefDump(): Starting a non-incident diagnostic dump (flags=0x3,

level=3, mask=0x0)3> ***** Current SQL Statement for this session

(sql_id=8r222qucmawdt) ***** select * from t where n=42 

3< ***** current_sql_statement ***** 3

3. Creation of Packages & ZIP files to send to Oracle Support  

I may not be able to solve the problem myself. Oracle Support will help me with thatone. I gather all the required information with a method called “Incident Packaging

Service” (IPS): 

adrci> ips create package problem 1 correlate all Created package 2 based on problem id 1, correlation level all

This did not yet create a ZIP file and is therefore referred to as “Logical Package”. TheZIP file is generated from the Logical Package that was created :

adrci> ips generate package 2 in "/home/oracle" Generated package 2 in file/home/oracle/ORA7445qc_20110601112533_COM_1.zip, mode complete

4. Managing, especially purging of tracefiles 

 Now to the management of tracefiles. You may notice that 11g creates lots of tracefilesthat need to be purged from time to time. In fact, this is done automatically, but you

may want to change the default purge policy:

Page 8: A Survival Guide for the DBA

7/27/2019 A Survival Guide for the DBA

http://slidepdf.com/reader/full/a-survival-guide-for-the-dba 8/22

adrci> show tracefile -rt 01-JUN-11 10:31:48 diag/rdbms/orcl/orcl/trace/orcl_mmon_2106.trc01-JUN-11 09:43:43 diag/rdbms/orcl/orcl/trace/orcl_ckpt_2100.trc01-JUN-11 09:22:13 diag/rdbms/orcl/orcl/trace/alert_orcl.log01-JUN-11 09:22:11 diag/rdbms/orcl/orcl/trace/orcl_diag_2088.trc01-JUN-11 09:22:10 diag/rdbms/orcl/orcl/trace/orcl_ora_2299.trc

01-JUN-11 09:22:10diag/rdbms/orcl/orcl/incident/incdir_6201/orcl_ora_2299_i6201.trc01-JUN-11 09:18:47 diag/rdbms/orcl/orcl/trace/orcl_ora_2236.trc01-JUN-11 09:18:47

diag/rdbms/orcl/orcl/incident/incdir_6153/orcl_ora_2236_i6153.trc01-JUN-11 09:17:19 diag/rdbms/orcl/orcl/trace/orcl_dbrm_2090.trc01-JUN-11 09:16:44 diag/rdbms/orcl/orcl/trace/orcl_j002_2210.trc01-JUN-11 09:16:30 diag/rdbms/orcl/orcl/trace/orcl_ora_2187.trc01-JUN-11 09:16:19 diag/rdbms/orcl/orcl/trace/orcl_mman_2094.trc01-JUN-11 09:16:16 diag/rdbms/orcl/orcl/trace/orcl_vktm_2082.trc01-JUN-11 09:16:14 diag/rdbms/orcl/orcl/trace/orcl_ora_2016.trc30-MAY-11 14:07:02 diag/rdbms/orcl/orcl/trace/orcl_mmon_2093.trc30-MAY-11 11:15:30 diag/rdbms/orcl/orcl/trace/orcl_ora_3414.trc

30-MAY-11 11:00:01 diag/rdbms/orcl/orcl/trace/orcl_j000_2245.trc30-MAY-11 10:56:58 diag/rdbms/orcl/orcl/trace/orcl_dbrm_2077.trc30-MAY-11 10:56:20 diag/rdbms/orcl/orcl/trace/orcl_j002_2201.trc30-MAY-11 10:56:06 diag/rdbms/orcl/orcl/trace/orcl_ora_2178.trc30-MAY-11 10:55:58 diag/rdbms/orcl/orcl/trace/orcl_mman_2081.trc30-MAY-11 10:55:55 diag/rdbms/orcl/orcl/trace/orcl_vktm_2069.trc30-MAY-11 10:55:53 diag/rdbms/orcl/orcl/trace/orcl_ora_2006.trc27-MAY-11 10:53:25 diag/rdbms/orcl/orcl/trace/orcl_mmon_8589.trc27-MAY-11 10:17:05 diag/rdbms/orcl/orcl/trace/orcl_ora_11390.trc27-MAY-11 09:26:41 diag/rdbms/orcl/orcl/trace/orcl_ora_10739.trc27-MAY-11 09:23:53 diag/rdbms/orcl/orcl/trace/orcl_dbrm_8573.trc27-MAY-11 09:22:58 diag/rdbms/orcl/orcl/trace/orcl_ora_8687.trc27-MAY-11 09:22:54 diag/rdbms/orcl/orcl/trace/orcl_mman_8577.trc27-MAY-11 09:22:50 diag/rdbms/orcl/orcl/trace/orcl_vktm_8565.trc27-MAY-11 09:22:48 diag/rdbms/orcl/orcl/trace/orcl_ora_8516.trc27-MAY-11 09:22:44 diag/rdbms/orcl/orcl/trace/orcl_ora_8515.trc27-MAY-11 09:22:44 diag/rdbms/orcl/orcl/trace/orcl_vktm_8347.trc27-MAY-11 09:21:24 diag/rdbms/orcl/orcl/trace/orcl_dbrm_8355.trc27-MAY-11 09:20:29 diag/rdbms/orcl/orcl/trace/orcl_ora_8470.trc27-MAY-11 09:20:28 diag/rdbms/orcl/orcl/trace/orcl_mmon_8371.trc27-MAY-11 09:20:28 diag/rdbms/orcl/orcl/trace/orcl_ora_8381.trc27-MAY-11 09:20:26 diag/rdbms/orcl/orcl/trace/orcl_mman_8359.trc27-MAY-11 09:20:20 diag/rdbms/orcl/orcl/trace/orcl_ora_8299.trc27-MAY-11 09:20:15 diag/rdbms/orcl/orcl/trace/orcl_ora_8297.trc27-MAY-11 09:20:15 diag/rdbms/orcl/orcl/trace/orcl_vktm_8096.trc27-MAY-11 09:20:07 diag/rdbms/orcl/orcl/trace/orcl_ora_8296.trc27-MAY-11 09:19:42 diag/rdbms/orcl/orcl/trace/orcl_ora_8285.trc

27-MAY-11 09:19:33 diag/rdbms/orcl/orcl/trace/orcl_dm00_8271.trc27-MAY-11 09:19:33 diag/rdbms/orcl/orcl/trace/orcl_dw00_8273.trc27-MAY-11 09:19:11 diag/rdbms/orcl/orcl/trace/orcl_dbrm_8104.trc27-MAY-11 09:18:53 diag/rdbms/orcl/orcl/trace/orcl_ora_8267.trc27-MAY-11 09:18:33 diag/rdbms/orcl/orcl/trace/orcl_j001_8237.trc27-MAY-11 09:18:26 diag/rdbms/orcl/orcl/trace/orcl_mmon_8219.trc27-MAY-11 09:18:23 diag/rdbms/orcl/orcl/trace/orcl_ora_8231.trc27-MAY-11 09:18:22 diag/rdbms/orcl/orcl/trace/orcl_cjq0_8229.trc27-MAY-11 09:18:16 diag/rdbms/orcl/orcl/trace/orcl_ora_8131.trc27-MAY-11 09:18:14 diag/rdbms/orcl/orcl/trace/orcl_m000_8223.trc27-MAY-11 09:18:13 diag/rdbms/orcl/orcl/trace/orcl_mman_8108.trc27-MAY-11 09:18:05 diag/rdbms/orcl/orcl/trace/orcl_ora_8048.trc27-MAY-11 09:17:59 diag/rdbms/orcl/orcl/trace/orcl_vktm_7920.trc

27-MAY-11 09:17:59 diag/rdbms/orcl/orcl/trace/orcl_ora_8046.trc27-MAY-11 09:17:00 diag/rdbms/orcl/orcl/trace/orcl_mman_7932.trc

Page 9: A Survival Guide for the DBA

7/27/2019 A Survival Guide for the DBA

http://slidepdf.com/reader/full/a-survival-guide-for-the-dba 9/22

27-MAY-11 09:16:56 diag/rdbms/orcl/orcl/trace/orcl_ora_7954.trc27-MAY-11 09:16:51 diag/rdbms/orcl/orcl/trace/orcl_ora_7871.trc

I have already got some tracefiles. How long are they going to stay?

adrci> show control 

ADR Home = /u01/app/oracle/diag/rdbms/orcl/orcl:*************************************************************************ADRID SHORTP_POLICY  LONGP_POLICY LAST_MOD_TIMELAST_AUTOPRG_TIMELAST_MANUPRG_TIME ADRDIR_VERSIONADRSCHM_VERSION ADRSCHMV_SUMMARY ADRALERT_VERSIONCREATE_TIME-------------------- -------------------- -------------------- ---------------------------------------- ---------------------------------------- ---------------------------------------- -------------------- ---

----------------- -------------------- -------------------- ----------------------------------------1335663986 720  8760 2011-05-27 10:16:46.997118+02:00

1 280 1 2011-05-27 10:16:46.997118+02:001 rows fetched

The ordinary tracefiles will stay for 30 days (720 hours), while files like incident filesstay one year (8760 hours) by default. We can change that policy with for example:

adrci> set control (SHORTP_POLICY = 360) 

adrci> set control (LONGP_POLICY = 2190) 

adrci> show control ADR Home = /u01/app/oracle/diag/rdbms/orcl/orcl:*************************************************************************ADRID SHORTP_POLICY LONGP_POLICYLAST_MOD_TIMELAST_AUTOPRG_TIMELAST_MANUPRG_TIME ADRDIR_VERSION

ADRSCHM_VERSION ADRSCHMV_SUMMARY ADRALERT_VERSIONCREATE_TIME-------------------- -------------------- -------------------- ---------------------------------------- ---------------------------------------- ---------------------------------------- -------------------- -------------------- -------------------- -------------------- ----------------------------------------1335663986 360 2190 2011-06-01 11:42:17.208064+02:00

1 280 1 2011-05-27 10:16:46.997118+02:00

1 rows fetched

Page 10: A Survival Guide for the DBA

7/27/2019 A Survival Guide for the DBA

http://slidepdf.com/reader/full/a-survival-guide-for-the-dba 10/22

Also, we may want to purge tracefiles manually. Following command will manually purge all tracefiles older than 2 days (2880 minutes):

adrci> purge -age 2880 -type trace adrci> show tracefile -rt 

01-JUN-11 10:46:54 diag/rdbms/orcl/orcl/trace/orcl_mmon_2106.trc01-JUN-11 09:43:43 diag/rdbms/orcl/orcl/trace/orcl_ckpt_2100.trc01-JUN-11 09:22:13 diag/rdbms/orcl/orcl/trace/alert_orcl.log01-JUN-11 09:22:11 diag/rdbms/orcl/orcl/trace/orcl_diag_2088.trc01-JUN-11 09:22:10

diag/rdbms/orcl/orcl/incident/incdir_6201/orcl_ora_2299_i6201.trc01-JUN-11 09:22:10 diag/rdbms/orcl/orcl/trace/orcl_ora_2299.trc01-JUN-11 09:18:47

diag/rdbms/orcl/orcl/incident/incdir_6153/orcl_ora_2236_i6153.trc01-JUN-11 09:18:47 diag/rdbms/orcl/orcl/trace/orcl_ora_2236.trc01-JUN-11 09:17:19 diag/rdbms/orcl/orcl/trace/orcl_dbrm_2090.trc01-JUN-11 09:16:44 diag/rdbms/orcl/orcl/trace/orcl_j002_2210.trc01-JUN-11 09:16:30 diag/rdbms/orcl/orcl/trace/orcl_ora_2187.trc01-JUN-11 09:16:19 diag/rdbms/orcl/orcl/trace/orcl_mman_2094.trc

01-JUN-11 09:16:16 diag/rdbms/orcl/orcl/trace/orcl_vktm_2082.trc01-JUN-11 09:16:14 diag/rdbms/orcl/orcl/trace/orcl_ora_2016.trc30-MAY-11 14:07:02 diag/rdbms/orcl/orcl/trace/orcl_mmon_2093.trc30-MAY-11 11:15:30 diag/rdbms/orcl/orcl/trace/orcl_ora_3414.trc30-MAY-11 11:00:01 diag/rdbms/orcl/orcl/trace/orcl_j000_2245.trc30-MAY-11 10:56:58 diag/rdbms/orcl/orcl/trace/orcl_dbrm_2077.trc30-MAY-11 10:56:20 diag/rdbms/orcl/orcl/trace/orcl_j002_2201.trc30-MAY-11 10:56:06 diag/rdbms/orcl/orcl/trace/orcl_ora_2178.trc30-MAY-11 10:55:58 diag/rdbms/orcl/orcl/trace/orcl_mman_2081.trc30-MAY-11 10:55:55 diag/rdbms/orcl/orcl/trace/orcl_vktm_2069.trc30-MAY-11 10:55:53 diag/rdbms/orcl/orcl/trace/orcl_ora_2006.trc

Conclusion: With adrci, we have a new and efficient utility to deal with Oracle Errors  –  especially for collecting information to send them to Oracle Support. This functionalityis called Incident Packaging Service. 11g is generating lots of tracefiles. We can controlthe purging policy of them with adrci. Finally, we can now tail -f our alert.log from anyOS.

 About these ads 

  Twitter6   Google +1   Facebook    LinkedIn1   StumbleUpon   Email   Reddit   Digg   Tumblr    Pinterest  

Like this:

Like 2 bloggers like this.

Page 11: A Survival Guide for the DBA

7/27/2019 A Survival Guide for the DBA

http://slidepdf.com/reader/full/a-survival-guide-for-the-dba 11/22

 

 

11g New Features, adrci, OU EMEA Newsletter  

This entry was posted on June 1, 2011, 12:14 and is filed under  TOI. You can follow any responses tothis entry through RSS 2.0. You can leave a response, or  trackback  from your own site.

  Comments ( 50 )   Trackbacks ( 8 ) 

1. 

#1  by Asif Momen on June 1, 2011 - 12:39

Precisely written and worth reading

2. 

#2  by LewisC on June 1, 2011 - 13:56

Uwe,

 Nice post. Concise and very useful. Thanks.

LewisC

3. 

#3  by Uwe Hesse on June 1, 2011 - 21:41

Thank you Asif and Lewis for your nice feedback! I really appreciate it

Lewis,for some reason the built-in spam detector thought your comment was spam, so Ihad to approve it manually. Sorry for that.

Page 12: A Survival Guide for the DBA

7/27/2019 A Survival Guide for the DBA

http://slidepdf.com/reader/full/a-survival-guide-for-the-dba 12/22

4. 

#4  by Sadeq on June 2, 2011 - 00:09

Thank you for this info, I learnt today something new that really helps meespecially I have incident today and i was tracing it manule, now i have this toolwhich will help me a lots.

5. 

#5  by mdinh on June 2, 2011 - 03:50

Wanted to supplement your post with mine “Alert Log Monitoring usingADRCI” http://j.mp/kvGK3g 

6. 

#6  by Anand on June 2, 2011 - 09:12

Hi Uwe,

 Nice and simple again

Anand

7. 

#7  by Uwe Hesse on June 3, 2011 - 08:50

@mdinh, thanks for the supplement! Reminds me to add to my disclaimer that I

am not responsible for any comments content/link Sadeq & Anand,thank you guys for the nice feedback! Glad if you found the posting helpful

Page 13: A Survival Guide for the DBA

7/27/2019 A Survival Guide for the DBA

http://slidepdf.com/reader/full/a-survival-guide-for-the-dba 13/22

8. 

#8  by Rochak  on June 9, 2011 - 11:45

Perfect

9. 

#9  by Rafi on June 9, 2011 - 15:58

Hi Uwe,

Came to know about many concepts.Thanks very much.

Best regards,

Rafi.

10. 

#10  by Uwe Hesse on June 9, 2011 - 16:13

Hi Rafi,

thank YOU! You’re welcome

11. 

#11  by neeraj on June 10, 2011 - 14:04

It is very useful and nice post.all the best……. 

12. 

#12  by sunil on June 14, 2011 - 04:48

too good..

Page 14: A Survival Guide for the DBA

7/27/2019 A Survival Guide for the DBA

http://slidepdf.com/reader/full/a-survival-guide-for-the-dba 14/22

13. 

#13  by Uwe Hesse on June 15, 2011 - 17:40

Thank you, Neeraj and Sunil!

14. 

#14  by Ramanoudjame TIROUMALAI on June 17, 2011 - 15:53

Hi Uwe,

I’m dealing with 11g R2 since more than three months. This article has provided

me something new and easy for maintenance tasks on databases.

Thanks a lot.

For further information about adrci, I went through Chapter 16 of OracleUtilities on the following link.

http://download.oracle.com/docs/cd/E11882_01/server.112/e16536.pdf  

Regards,Tirou

15. 

#15  by [email protected] on June 17, 2011 - 16:05

Hi

Anyone have issues with the autmatic and manual purge of the tracesubdirectory not working as expected?

One of our servers has entries under the trace subdirectories for a number of databases going back to October 2010.

show tracefile -rt only shows some of the tracefile history (last couple of weeks)and performing a manual ADRCI purge will remove the files listed in showtracefile output but no further back than that so we have to manually delete thetracefiles using OS commands

Page 15: A Survival Guide for the DBA

7/27/2019 A Survival Guide for the DBA

http://slidepdf.com/reader/full/a-survival-guide-for-the-dba 15/22

16. 

#16  by Krish Sridhara on July 28, 2011 - 18:10

Hi Uwe,Your post on Exadata and adrci (my favorite resolution, rca tool in 11g) issimply superb.I have one question though similar to purging the trace files, can the listener.log

 be purged or is there any other to do logrotate.

I highly appreciate your response.

Thanks and Regards,

17. 

#17  by Uwe Hesse on July 29, 2011 - 04:40

Krish, presently, it seems not to be possible to purge the listener.log with adrci. Youmay still use logrotate until that works with adrci also.

18. 

#18  by Krish Sridhara on August 3, 2011 - 18:30

Hi Uwe,I highly appreciate your response.I wish that could be done.Thanks and Regards,

Ram

19. 

#19  by Pavel Ermakov on September 2, 2011 - 10:03

HiGood post!Thanks!

Page 16: A Survival Guide for the DBA

7/27/2019 A Survival Guide for the DBA

http://slidepdf.com/reader/full/a-survival-guide-for-the-dba 16/22

Regards,Pavel.

20. 

#20  by Greg Cook on September 2, 2011 - 10:26

 Nice post Uwe.

If you didn’t know already Fusion Middleware also uses ADR for the creation of 

incidents and storage of associated diagnostic dumps. I’ve posted an

introductory article on it here:

http://blogs.oracle.com/fmwdiag/entry/introduction_to_fmw_diagnostic  

21. 

#21  by shrikant rao on September 3, 2011 - 09:20

Hi Uwe,

As usual great pleasure reading your article and this one was a nice post.

Shrikant.

22. 

#22  by Uwe Hesse on September 3, 2011 - 09:28

Pavel, Shrikant: Thank you for the nice feedback! Very much appreciated

Greg,I must admit that I don’t know much about Fusion Middleware – that includesthe presence of ADR there. Thank you for the information!

23. 

#23  by neerajvasudeva on September 6, 2011 - 06:34

Page 17: A Survival Guide for the DBA

7/27/2019 A Survival Guide for the DBA

http://slidepdf.com/reader/full/a-survival-guide-for-the-dba 17/22

very nicely documented.

24. 

#24  by Mark Heckler on September 6, 2011 - 19:35

Well-stated and nicely illustrated, as always. Thanks, Uwe!

25. 

#25  by Uwe Hesse on September 6, 2011 - 21:19

Thank you, Neeraj and Mark! Very much appreciated

26. 

#26  by Mubeenubeen on September 18, 2011 - 09:19

excellentent article again. very clear & very useful.

thanks for great work here.

27. 

#27  by Uwe Hesse on September 20, 2011 - 18:53

Thanks for the nice feedback! You’re welcome

28. 

#28  by Ram on February 5, 2012 - 18:19

Hi

can you please explain the awr report

Page 18: A Survival Guide for the DBA

7/27/2019 A Survival Guide for the DBA

http://slidepdf.com/reader/full/a-survival-guide-for-the-dba 18/22

29. 

#29  by Uwe Hesse on February 7, 2012 - 13:26

Ram, there is no direct relation to AWR reports here.

30. 

#30  by Phil on February 15, 2012 - 17:24

Thanks for the info, used it today to upload a package to Oracle.

31. 

#31  by Uwe Hesse on February 21, 2012 - 20:19

You’re welcome, Phil, thanks for stopping by

32. 

#32  by Saurabh Gupta on February 22, 2012 - 08:03

Great tip to monitor trace files

33. 

#33  by jaygee on February 22, 2012 - 13:22

Have you ever come across the error “DIA-48110: error encountered whileattempting to remove a file, DIA-48190: OS unlink system callfailure…………”??? 

34. 

Page 19: A Survival Guide for the DBA

7/27/2019 A Survival Guide for the DBA

http://slidepdf.com/reader/full/a-survival-guide-for-the-dba 19/22

#34  by Uwe Hesse on February 22, 2012 - 18:49

Saurabh Gupta, thanks for the nice comment!

Jaygee, no, I did not encounter that, but I recall that error mentioned in some

other Blog where they created files with reserved names manually in the diagsubfolders.

35. 

#35  by Vijay Dwivedi on February 26, 2012 - 08:38

Very nicely written article, any idea how to change Alert Log file location. I am

using Windows 2008 R2 as OS for 11gR2.

36. 

#36  by newbie01oracle on March 29, 2012 - 01:07

Hi

Absolutely love all your posts. Would be nice if there is printer friendly version

though -

37. 

#37  by Pankaj on May 23, 2012 - 15:21

Hi,

 Nice post…

ThanksPankaj Gupta

38. 

#38  by Uwe Hesse on June 1, 2012 - 08:43

Page 20: A Survival Guide for the DBA

7/27/2019 A Survival Guide for the DBA

http://slidepdf.com/reader/full/a-survival-guide-for-the-dba 20/22

Pankaj, thanks for leaving this nice comment

39. 

#39  by Samir on July 29, 2012 - 16:33

A little late on reading this, Excellent post, I really wonder how and when you people get all the time to keep up with this ever evolving technology

40. 

#40  by Narayan on July 30, 2012 - 07:14

Hello Uwe

Its really helpful for analysis

Regards Narayan

41. 

#41  by Uwe Hesse on July 30, 2012 - 17:21

Samir, thank you! Fortunately, it’s part of my job to keep up with Oracle

Database New Features

 Narayan, you’re welcome

42. 

#42  by Sam on July 31, 2012 - 05:06

This post is really useful.

43. 

Page 21: A Survival Guide for the DBA

7/27/2019 A Survival Guide for the DBA

http://slidepdf.com/reader/full/a-survival-guide-for-the-dba 21/22

#43  by Uwe Hesse on August 2, 2012 - 09:11

Thank you, Sam, for leaving the nice feedback 

44. 

#44  by Amit Sanghvi on September 12, 2012 - 06:06

Hey Uwe, I find your posts very helpful. Please keep writing more of them.They make the topics interesting and simple to understand.- Amit

45. 

#45  by sai on September 29, 2012 - 07:26

Hi uwe,

Please guide me how to start the Oracle Tuning.

Regards,Sai

46. 

#46  by Reddy on October 8, 2012 - 12:25

Very nice post Sir.. Thank you

47. 

#47  by Uwe Hesse on October 9, 2012 - 21:31

You’re welcome

48. 

Page 22: A Survival Guide for the DBA

7/27/2019 A Survival Guide for the DBA

http://slidepdf.com/reader/full/a-survival-guide-for-the-dba 22/22

#48  by Yasir  on October 15, 2012 - 07:45

Exellent!! You explain complex things in simpler ways..

49. 

#49  by sendtoshailesh on October 16, 2012 - 13:18

nice explanation !!

Keep posting. This is helpful for lot more than DBAs !!

50. 

#50  by Uwe Hesse on October 23, 2012 - 16:49

Thank you guys

1.  Log Buffer #224, A Carnival of the Vanities for DBAs | The Pythian Blog 2.  adrci: A survival guide for the DBA (via The Oracle Instructor) « Little bit

technical 3.  My adrci posting is published in the OU EMEA Newsletter « The Oracle

Instructor  4.  Usn's IT Blog » Oracle: Manage the lifetime of trace files et al. with ADRCI

(purge interval) 5.  Using the ADRCI utility with Oracle Weblogic « Jan van Zoggel  6.  Merry Christmas & A Happy New Year 2012! « The Oracle Instructor  7.  Merry Christmas & A Happy New Year 2012! | Oracle Administrators Blog - by

Aman Sood 8.  ADRCI and listener purging « ORAganism 

Leave a Reply