Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

This article is not yet completed and verified, so caution is advised on its contents.

CMD (or BAT) file for full backup

rem
rem rmanFULL.cmd
rem
rem %1% is the ORACLE_SID
rem
set NLS_DATE_FORMAT=YYYY-MM-DD-HH24:MI:SS
set NLS_LANG=AMERICAN_AMERICA
set ORACLE_SID=%1%
set BACKUP_DIR=E:\BACKUP

rem
rem Do the backup and save the result status from RMAN
rem
rman cmdfile=rmanFULL.rcv log=rmanFULL_%ORACLE_SID%.log
set RMANRC=%ERRORLEVEL%
sqlplus monitor/******** @rman_report %RMANRC% FULL <Customer>

rem
rem Delete any files older than the retention period
rem
if %RMANRC% NEQ 0 goto exitlabel
forfiles /p %BACKUP_DIR%\%ORACLE_SID% /m *.DMP /d -1 /c "cmd /c del @path"
:exitlabel

CMD (or BAT) file for archive backup

rem
rem rmanARCH.cmd
rem
rem %1% is the ORACLE_SID
rem
set NLS_DATE_FORMAT=YYYY-MM-DD-HH24:MI:SS
set NLS_LANG=AMERICAN_AMERICA
set ORACLE_SID=%1%
set BACKUP_DIR=E:\BACKUP

rem
rem Do the backup and save the result status from RMAN
rem
rman cmdfile=rmanARCH.rcv log=rmanARCH_%ORACLE_SID%.log
set RMANRC=%ERRORLEVEL%
sqlplus monitor/******** @rman_report %RMANRC% ARCH <Customer>
  • No labels