Example NetBackup for SAP backup script (Windows)
This topic includes an example backup script that was created for Windows.
For example, the sap_offline_backup.cmd script contains the following lines:
@REM @REM $Header: sap_offline_backup.cmd,v 1.2 2002/11/20 00:47:59 $ @REM @echo off 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% REM --------------------------------------------------------------------------- REM Replace cer below with the Oracle SID of the target database. REM --------------------------------------------------------------------------- set ORACLE_SID=cer REM --------------------------------------------------------------------------- REM Replace c:\oracle below with the Oracle home path. REM --------------------------------------------------------------------------- set ORACLE_HOME=c:\oracle REM --------------------------------------------------------------------------- REM Replace C:\oracle\CER with SAPData Home Path REM --------------------------------------------------------------------------- set SAPDATA_HOME=C:\oracle\CER 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=C:\usr\sap\%ORACLE_SID%\sys\exe\run REM --------------------------------------------------------------------------- REM Replace path with the correct BRBACKUP path. REM --------------------------------------------------------------------------- set BRBACKUP=c:\usr\sap\%ORACLE_SID%\sys\exe\run\brbackup REM Full offline backup set CMD_LINE=%BRBACKUP% -u internal/ -c -d util_file -t offline -m all %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