Logging Command Line RMAN outputs

Running RMAN commands through a  Command File  :

In the below command, there are some RMAN commands are already written in ‘/home/oracle/Desktop/rmancmd.txt’ file. RMAN read all commands from this file

 [oracle@localhost ~]$ rman target sys cmdfile /home/oracle/rmancmd.txt

Recovery Manager: Release 11.2.0.1.0 – Production on Fri Aug 29 17:54:19 2014

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

target database Password:

connected to target database: ORCL (DBID=1395709026)

RMAN> backup database plus archivelog;

2> delete noprompt obsolete;

We can also execute a command file by placing the @ sign in front of the command file, as shown in the following example:

[oracle@localhost ~]$ rman target / @ rmancmd.txt

[oracle@localhost ~]$ rman target /

RMAN> @ rmancmd.txt

If we want the RMAN output will go into a log file then:

 [oracle@localhost ~]$ rman target sys cmdfile /home/oracle/rmancmd.txt log /home/oracle/Desktop/rmanlog.log

[oracle@localhost ~]$ rman target / cmdfile /home/oracle/rmancmd.txt log /home/oracle/Desktop/rmanlog.log append

In above command, there are some RMAN commands are already written in ‘/home/oracle/Desktop/rmancmd.txt’ file.

RMAN read all commands from this file and run and place the output in the log file ‘/home/oracle/Desktop/rmanlog.log’ ,no output will display on the screen.

 Logging Command Line RMAN outputs:–

 If we want the RMAN output will go into a log file as well as show on console then:

 [oracle@localhost ~]$ rman target sys | tee /home/oracle/Desktop/rmanlog.log

 Recovery Manager: Release 11.2.0.1.0 – Production on Sun JAN 31 15:24:01 2015

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

target database Password:

connected to target database: ORCL (DBID=1395709026)

Creating a TRACE file for RMAN OutPuts :

 [oracle@localhost ~]$ rman target / trace=’/home/oracle/desktop/cold_back.log’

Thank you for Reading…This is Airy… Enjoy  🙂

 

Storing RMAN Output in a log file

Storing RMAN Output in a log file: –

[oracle@localhost ~]$ rman target / log=”/home/oracle/Desktop/rman_log.log”

RMAN> BACKUP DATABASE TAG ‘FULL’;

RMAN> BACKUP DATABASE PLUS ARCHIVELOG;

RMAN>BACKUP DATABASE PLUS ARCHIVELOG DELETE ALL INPUT;

The output will not show on screen , it will go into the log file /home/oracle/Desktop/rman_log.log”

 

RMAN>EXIT;

 

[oracle@localhost ~]$ rman target sys log=”/home/oracle/Desktop/rman_log.log” append

target database Password: sys

 

RMAN> BACKUP DATABASE TAG ‘Appended_backup’;

RMAN> spool log to ‘/home/oracle/Desktop/rman_log2.log’

RMAN> backup datafile 1 tag “Data_file1”;

RMAN> spool log off;

Spooling for log turned off

Recovery Manager11.2.0.1.0

 

RMAN> spool log to ‘/home/oracle/Desktop/rman_log2.log’ append

RMAN> backup datafile 2 tag “Data_file2”;

RMAN> spool log off;

Spooling for log turned off

Recovery Manager11.2.0.1.0

 

Thank you for Reading…This is Airy… Enjoy  🙂