Home » Oracle » Oracle Database » How to debug Oracle RMAN session

How to debug Oracle RMAN session

Many times RMAN session hangs or gave different types of errors. The investigation cannot be done with log files generated. We need to debug rman session in order the performance issues or the errors. With debugging a detailed trace file is generated where we can easily find the performance issue and errors

The RMAN Debug command generates more extensive output, use debugging for the following purposes.
• To see the actual programs generated by RMAN
• To determine the failure of RMAN Command
The RMAN debug option can be used to trace RMAN session, and it will be very useful to troubleshoot an issue.

rman target / catalog user/pwd@catalog debug trace rman.trc log rman.log

or

rman target /  debug trace rman.trc log rman.log

The rman.trc will contains all the debug information

cat rman.log
Recovery Manager: Release 11.2.0.4.0 - Production on Thu Apr 13 15:21:05 2015
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
RMAN-06005: connected to target database: TEST (DBID=432525555)
RMAN>RMAN-03090: Starting backup at 13-APR-15
RMAN-06009: using target database control file instead of recovery catalog
RMAN-08030: allocated channel: ORA_DISK_1
RMAN-08500: channel ORA_DISK_1: SID=618 device type=DISK
RMAN-08008: channel ORA_DISK_1: starting full datafile backup set
RMAN-08010: channel ORA_DISK_1: specifying datafile(s) in backup set
RMAN-08522: input datafile file number=00031 name=/app/oracle/TEST/oradata/data01.dbf
RMAN-08522: input datafile file number=00033 name=/app/oracle/TEST/oradata/data02.dbf
RMAN-08522: input datafile file number=00038 name=/app/oracle/TEST/oradata/data03.dbf
RMAN-08522: input datafile file number=00039 name=/app/oracle/TEST/oradata/data04.dbf
RMAN-06731: command backup:1.0% complete, time left 03:27:06
RMAN-06731: command backup:1.9% complete, time left 03:32:09

The trace file will have all information running behind the screen.

The “rman.trc” will look like below

cat rman.trc |more
Recovery Manager: Release 11.2.0.4.0 - Production on Thu Apr 13 15:21:05 2015
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
RMAN-06005: connected to target database: TEST (DBID=432525555)
RMAN>System name: SUN
Node name: TESTSERV
Release: 2.6.18-194.17.1.el5
Version: #1 SMP Mon Sep 20 07:12:06 EDT 2010
Machine: x86_64
Starting with debugging set to level=9, types=ALL
DBGMISC: ENTERED krmksimronly [15:21:06.175]
DBGSQL: CHANNEL> alter session set events '19737 trace name context forever'
DBGSQL: sqlcode = 0
DBGSQL: CHANNEL> select decode(archiver, 'FAILED', 1, 0) into :archstuck from v$instance
DBGSQL: sqlcode = 0
DBGSQL: D :archstuck = 0

Trace via the RMAN Channel

See also  Staged APPL_TOP in Oracle Applications R12

Another way to trace RMAN activity would be to configure the trace when configuring the RMAN channel.

1. Make sure timed_statistics = true for all performance testing.

2. set the NLS_DATE_FORMAT = ‘DD-MON-YYYY HH24:MI:SS’.

3. Configure the Channel with Trace/Debug options

trace 1 – general trace info for skg and sbt
trace 5 – verbose channel tracing of skg and sbt calls

CONFIGURE CHANNEL DEVICE TYPE
DISK DEBUG=5 TRACE 1;

or

CONFIGURE CHANNEL DEVICE TYPE SBT PARMS "ENV=(....) DEBUG=5 TRACE 5;

Note: (Trace is only useful for tape backup and restore tracing)

Also Reads
You can read more about RMAN utility at the below links

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top