Hello, friends in this article we are going to discussed how to store RMAN outputs in the log file.
What is the RMAN log file?
RMAN log file is a just text file which is store complete output of RMAN commands. Generally, this file is used to check the backup has been done successfully or not.
If there is any error occurs during a backup it will be captured in this log file.
Start storing RMAN outputs in a log file.
Connect with RMAN and run the following commands.
$rman target / log='/u01/rmab_bkp.log' RMAN> show all;
The above query will output will not showing on screen because the output goes in the log file, check the log file.
How to restore archive logs from rman backup Read here.
How to reuse the existing RMAN log for a new query?
If you want to store more outputs in the existing log file, then we can use the existing log file. To use the existing log file we need to use the append keyword with the rman same as in the below query.
$rman target / log='/u01/rmab_bkp.log' append RMAN> show all; RMAN> backup current controlfile;
This time you will see the above query output also stored in the same log file.
How to spool RMAN log?
We can start spooling also on RMAN prompt, check the below query.
$rman target/ RMAN>spool log to '/u01/rman_bkp2.log' RMAN>show all; RMAN>backup datafile 1; RMAN>spool log off;
I hope now you understand how to store rman output in the log file.
You Can subscribe my YouTube channel