Modify the script for cold backup of Oracle10g by using NETBACKUP

Source: Internet
Author: User

@ REM $ header: cold_database_backup.cmd, v 1.1 13:52:48 $
@ REM The following is a change made to Oracle 10.2. Note the target_tns value, which must be left blank. Modify the red part. For the complete code, see 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 Deming 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 if it is executed on the local machine, the value of this parameter is deleted.
@ REM name from the tnsnames. ora file.
@ REM ---------------------------------------------------------------------------
 
@ Set target_tns =
 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.