@REM $Header: cold_database_backup.cmd,v 1.1 2002/05/28 13:52:48 $
@REM 以下是针对oracle 10.2版本做的修改,最主要注意TARGET_TNS值,一定要设为空,主要修改红色部分即可,完整的代码请查看C:\Program Files\VERITAS\NetBackup\DbExt\Oracle\Samples\rman\cold_database_backup.cmd
@REM bcpyrght
@REM ***************************************************************************
@REM * $VRTScprght: Copyright 1993 - 2005 VERITAS Software Corporation, All Rights Reserved $ *
@REM ***************************************************************************
@REM ecpyrght
@REM ---------------------------------------------------------------------------
@REM cold_database_backup.cmd
@REM ---------------------------------------------------------------------------
@REM This script uses Recovery Manager to take a cold (consistent) database
@REM backup. A cold backup is one where the database is shutdown cleanly before
@REM performing the backup.
@REM ---------------------------------------------------------------------------
@setlocal ENABLEEXTENSIONS
@REM ---------------------------------------------------------------------------
@REM No need to echo the commands.
@REM ---------------------------------------------------------------------------
@echo off
@REM ---------------------------------------------------------------------------
@REM Put output in the same filename, different extension.
@REM ---------------------------------------------------------------------------
@set RMAN_LOG_FILE="%~dpn0.out"
@REM ---------------------------------------------------------------------------
@REM You may want to delete the previous output file so that backup information
@REM does not accumulate. If not, delete the following command.
@REM ---------------------------------------------------------------------------
@if exist %RMAN_LOG_FILE% del %RMAN_LOG_FILE%
@REM ---------------------------------------------------------------------------
@REM Log the start of this script.
@REM ---------------------------------------------------------------------------
@for /F "tokens=1*" %%p in ('date /T') do @set DATE=%%p %%q
@for /F %%p in ('time /T') do @set DATE=%DATE% %%p
@echo ==== started on %DATE% ==== >> %RMAN_LOG_FILE%
@echo Script name: %0 >> %RMAN_LOG_FILE%
@REM ---------------------------------------------------------------------------
@REM Replace H:\oracle\ora81, below, with the Oracle home path.
@REM ---------------------------------------------------------------------------
@set ORACLE_HOME=D:\Oracle
@REM ---------------------------------------------------------------------------
@REM Replace ora81, below, with the Oracle SID of the target database.
@REM ---------------------------------------------------------------------------
@set ORACLE_SID=orcl
@REM ---------------------------------------------------------------------------
@REM Several RMAN commands use time parameters that require NLS_LANG and
@REM NLS_DATE_FORMAT to be set. This example uses the standard date format.
@REM Replace below with the desired language values.
@REM ---------------------------------------------------------------------------
@set NLS_LANG=american
@set NLS_DATE_FORMAT=YYYY-MM-DD:hh24:mi:ss
@REM ---------------------------------------------------------------------------
@REM Replace the following with the fully qualified path name of the init file
@REM for the target database.
@REM ---------------------------------------------------------------------------
@set TARGET_INIT_FILE=D:\Oracle\database\initorcl.ora
@REM ---------------------------------------------------------------------------
@REM Replace productionDB, below, with the target database TNS alias (service)
@REM 如果在本机执行,这个参数的值删除
@REM name from the tnsnames.ora file.
@REM ---------------------------------------------------------------------------
@set TARGET_TNS=