@REM @REM $Header: sap_rman_backup.cmd,v 1.4 2006/02/02 07:21:51 $ @REM @echo off @REM bcpyrght @REM ************************************************************************** @REM * $VRTScprght: Copyright 2013 Symantec Corporation, All Rights Reserved $ @REM ************************************************************************** REM ecpyrght REM This environment variable are created by Netbackup (bphdb) echo SAP_SCHEDULED = %SAP_SCHEDULED% echo SAP_USER_INITIATED = %SAP_USER_INITIATED% echo SAP_SERVER = %SAP_SERVER% echo SAP_POLICY = %SAP_POLICY% echo SAP_FULL = %SAP_FULL% echo SAP_CINC = %SAP_CINC% echo SAP_SCHED = %SAP_SCHED% REM --------------------------------------------------------------------------- REM Replace cer below with the Oracle SID of the target database. REM --------------------------------------------------------------------------- set ORACLE_SID=Q41 REM --------------------------------------------------------------------------- REM Replace c:\oracle below with the Oracle home path. REM --------------------------------------------------------------------------- set ORACLE_HOME=d:\oracle\Q41\11202 REM --------------------------------------------------------------------------- REM Replace C:\oracle\CER with SAPData Home Path REM --------------------------------------------------------------------------- set SAPDATA_HOME=E:\oracle\Q41 REM --------------------------------------------------------------------------- REM Replace path with the correct sap archive path. REM --------------------------------------------------------------------------- set SAPARCH=%SAPDATA_HOME%\saparch REM --------------------------------------------------------------------------- REM Replace path with the correct sap backup path. REM --------------------------------------------------------------------------- set SAPBACKUP=%SAPDATA_HOME%\sapbackup REM --------------------------------------------------------------------------- REM Replace path with the correct sap reorg path. REM --------------------------------------------------------------------------- set SAPREORG=%SAPDATA_HOME%\sapreorg REM --------------------------------------------------------------------------- REM Replace path with the correct Path to Brtools REM --------------------------------------------------------------------------- set SAPEXE=D:\usr\sap\%ORACLE_SID%\sys\exe\uc\NTAMD64 REM --------------------------------------------------------------------------- REM Replace path with the correct BRBACKUP path. REM --------------------------------------------------------------------------- set BRBACKUP=c:\usr\sap\%ORACLE_SID%\sys\exe\uc\NTAMD64\brbackup REM Run backup if [ $SAP_FULL -eq 1 ]; then CMD_LINE="$SAP_ENV brbackup -d rman_util -t online -p D:\oracle\Q41\11202\database\initQ41.sap -r D:\oracle\Q41\11202\database\initQ41.utl -m full -c" elif [ $SAP_CINC -eq 1 ]; then CMD_LINE="$SAP_ENV brbackup -d rman_util -t online -p D:\oracle\Q41\11202\database\initQ41.sap -r D:\oracle\Q41\11202\database\initQ41.utl -m incr -c" fi REM @if "%SAP_FULL%" EQU "1" @set CMD_LINE=%BRBACKUP% -u internal/ -c -d rman_util -t offline -m full REM @if "%SAP_CINC%" EQU "1" @set CMD_LINE=%BRBACKUP% -u internal/ -c -d rman_util -t offline -m incr %CMD_LINE% REM --------------------------------------------------------------------------- REM To communicate with NetBackup's job monitor for an automatic schedule REM a "STATUS_FILE" variable is created by NetBackup (bphdb) that contains REM a path to a file. This file is check by Netbackup to determine if the REM automatic schedule was successful. It is up to the script to write REM a 0 (passed) or 1 (failure) to the status file to communicate to NetBackup REM the status of the execution of the script. The following code echo a 0 REM to %STATUS_FILE% if succcessful and echo a 1 to %STATUS_FILE% for a REM failure. REM --------------------------------------------------------------------------- if errorlevel 1 goto errormsg echo BRBACKUP successful if "%STATUS_FILE%" == "" goto end if exist "%STATUS_FILE%" echo 0 > "%STATUS_FILE%" goto end :errormsg echo Execution of BRBACKUP command failed - exiting if "%STATUS_FILE%" == "" goto end if exist "%STATUS_FILE%" echo 1 > "%STATUS_FILE%" :end