2 Ways to Set RMAN Log Location

RMAN is a client side utility like sqlplus used to interoperate with DB, we usually compose a script file or a batch file to run via cron job or schedule. If any problems result from RMAN, you can check the log file to debug.

There is no RMAN default log location in PFILE to set, so you must add the log location by yourself, if you are not specify one, you will miss the error messages and other important alerts.

Two ways to reserve the rman log for you to trace:
  1. On Utility-level:
  2. Using the RMAN keyword “LOG” to indicate RMAN to log the operation, but the output will not show on you console.
    $ rman LOG /oracle/backup/rman.log
  3. On OS-level:
  4. Piping out the process to a file and show it in the console as well.
    $ rman | tee -a /oracle/backup/rman.log
The above examples may not be very good practices, because they log everyday’s backup process in the same file. You must empty the file periodically to prevent the log file from growing too large.

A better practice is to log RMAN execution results in separate files based on dates, then you can easily to trace the problem by dates. The following is a sample script that you can use:
LOGFILE=/oracle/backup/logs/rman_`date +%Y%m%d`.log
rman target / @$EXEFILE LOG $LOGFILE

Leave a Reply

Your email address will not be published. Required fields are marked *