How to debug Backup, Restore Session in RMAN
In many cases in RMAN we need to debug the session to find and investigate the session about what is happening there. Also to obtain and check the correct diagnostic evidence we sometimes need the debug the rman session.
The most common use of debugging RMAN session is whenever we fail RMAN operation. In fact if any failure in RMAN operation RMAN log and debug files are NOT generated by default and we explicitly need to enable it.
We can log and debug session whichever operation we do in RMAN. Like Backup, Restore, TSPITR, DBPITR, Duplicate Database, Restore to a new host etc.
The commnad is simple,
The syntax is,
$ rman target [un/pwd@target_db] catalog [un/pwd@catalog_db] debug trace rman.trc log rman.log
RMAN>[RMAN Commands Here]
Where un indicates username and pwd indicates password.
In my system I used debugging and logging RMAN session by,
$ rman target / log=/backup03/webkey/rmanlog.txt trace=/backup03/webkey/rmantrace.log
RMAN> debug on
RMAN> @/backup03/webkey/rman_script
RMAN> debug off;
RMAN> exit;
Where my restore commands was inside the /backup03/webkey/rman_script file. And don't confuse with the sequence 2,3,4 here printed. It is line number inside my script of backup.
Later we can see the log information from file rmanlog.txt by,
$ less /backup03/webkey/rmanlog.txt (On Unix System)
We can see debug information from rmantrace.log by,
$ less /backup03/webkey/rmantrace.log (On my Unix System)
.
.
.
.
DBGMISC: command to be compiled and executed is: DEBUG [03:13:27.795] (krmice)
DBGMISC: command after this command is: NONE [03:13:27.795] (krmice)
DBGMISC: current incarnation does not matter for DEBUG [03:13:27.795] (krmice)
Debugging turned off
Above is the sample output of the file of /backup03/webkey/rmantrace.log
The most common use of debugging RMAN session is whenever we fail RMAN operation. In fact if any failure in RMAN operation RMAN log and debug files are NOT generated by default and we explicitly need to enable it.
We can log and debug session whichever operation we do in RMAN. Like Backup, Restore, TSPITR, DBPITR, Duplicate Database, Restore to a new host etc.
The commnad is simple,
The syntax is,
$ rman target [un/pwd@target_db] catalog [un/pwd@catalog_db] debug trace rman.trc log rman.log
RMAN>[RMAN Commands Here]
Where un indicates username and pwd indicates password.
In my system I used debugging and logging RMAN session by,
$ rman target / log=/backup03/webkey/rmanlog.txt trace=/backup03/webkey/rmantrace.log
RMAN> debug on
RMAN> @/backup03/webkey/rman_script
RMAN> debug off;
RMAN> exit;
Where my restore commands was inside the /backup03/webkey/rman_script file. And don't confuse with the sequence 2,3,4 here printed. It is line number inside my script of backup.
Later we can see the log information from file rmanlog.txt by,
$ less /backup03/webkey/rmanlog.txt (On Unix System)
We can see debug information from rmantrace.log by,
$ less /backup03/webkey/rmantrace.log (On my Unix System)
.
.
.
.
DBGMISC: command to be compiled and executed is: DEBUG [03:13:27.795] (krmice)
DBGMISC: command after this command is: NONE [03:13:27.795] (krmice)
DBGMISC: current incarnation does not matter for DEBUG [03:13:27.795] (krmice)
Debugging turned off
Above is the sample output of the file of /backup03/webkey/rmantrace.log
Comments
Post a Comment