RE: rman log

From: John Hallas <john.hallas_at_bjss.co.uk>
Date: Thu, 20 Mar 2008 15:27:40 -0000
Message-ID: <E02CB9B2777CF8459C86C49B48C48EC6037FE935@exchange.bjss.co.uk>


To add to my fantastically helpful response below it was pointed out to me that there is a log command.  

A quick search of the docs and I found the following  

Using RMAN with Command Files

A command file is a text file which contains RMAN commands as you would enter them at the command line. You can run the a command file by specifying its name on the command line. The contents of the command file will be interpreted as if entered at the command line. If the LOG command line argument is specified, RMAN directs output to the named log file. Command files are one way to automate scheduled backups through an operating system job control facility.

In this example, a sample RMAN script is placed into a command file called commandfile.rcv. You can run this file from the operating system command line and write the output into the log file outfile.txt as follows:  

% rman TARGET / CATALOG rman/cat_at_catdb CMDFILE commandfile.rcv LOG outfile.txt

Directing RMAN Output to a Log File

When you run RMAN in command line mode, it sends the output to the terminal. If you specify the LOG option, then RMAN writes the output to a specified log file instead.

Output for currently executing RMAN jobs is also stored in the V$RMAN_OUTPUT view, which reads only from memory (that is, the information is not stored in the control file). The V$RMAN_STATUS view contains metadata about jobs in progress as well as completed jobs. The metadata for completed jobs is stored in the control file.

www.jhdba.wordpress.com    


From: oracle-l-bounce_at_freelists.org
[mailto:oracle-l-bounce_at_freelists.org] On Behalf Of John Hallas Sent: 20 March 2008 14:45
To: Randy.Steiner_at_nyct.com; oracle_l
Subject: RE: rman log  

I didn't realise it did produce a log file unless you have a msglog command set up  

I have a shell script to run the backup commands and it looks like this :- (ps this script has been used to try out various options which is why there are so many commented out lines)  

#!/bin/ksh
 

export ORACLE_HOME=/u00/app/oracle/product/11.1.0/db_2

export ORACLE_SID=TEST1

export PATH=$PATH:$ORACLE_HOME/bin

export NLS_DATE_FORMAT='DD-MON-YY HH24:MI:SS'  

export DATE=$(date +%Y-%m-%d)  

rman target backup_admin/xxxxxxx catalog rman/xxxxxxx_at_server msglog /export/backups/rman/11g/logs/rman_full_backup_db_online_TEST1_${DATE}.l og <<EOF  

#backup AS COMPRESSED BACKUPSET database ;

#backup AS COMPRESSED BACKUPSET archivelog all delete input ;

backup AS COMPRESSED BACKUPSET database plus archivelog delete input;

#backup AS COMPRESSED BACKUPSET database;

#backup database;

#backup archivelog all delete input;

#BACKUP INCREMENTAL LEVEL 0 TAG = WEEKLY DATABASE;

#delete noprompt force obsolete;
 

#Change archivelog all validate
 

exit;

EOF   exit    

www.jhdba.wordpress.com    

--
http://www.freelists.org/webpage/oracle-l
Received on Thu Mar 20 2008 - 10:27:40 CDT

Original text of this message