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 🙂