New Feature of Oracle11g: replace variables in the RMAN script

Source: Internet
Author: User

New Feature of Oracle11g: a new feature is provided in the RMAN script using the replace variable Oracle11g, which is used in the RMAN script. Today, I did a small experiment on the server and tried this feature. Although some errors have been made, all of them have been solved! I feel that this feature is still good. Let's start with the question below. 1. create a directory for storing scripts and backup files $ cd/u01 $ mkdir-p oraclescripts/backup/dynamic $ mkdir/u01/backupfiles 2. create related scripts $ cd/u01/oraclescripts/backup/dynamic $ vi backup. cmd Add the following command: [python] # backup. cmd connect target/run {backup datafile 5 tag = & 1 format' & 2';} exit; this is an RMAN command, which will be called using a shell script later. The following creates a shell script: $ vi nightly_backup.sh Add the following command: [python] #! /Bin/bash tag = $1 format = $2 rman @ backup. cmd using $ tag $ format OK. Let's execute this shell script. $ sh nightly_backup.sh testtag \ '/u01/backupfiles/file5.bk \' I use two parameters. The first one is Tag, the second is the path to be backed up. After obtaining two parameters, the shell script executes @ backup. when cmd is used, the two parameters are passed in to & 1 and & 2. In this experiment, we back up the data file no. 5. You can customize the backup policy.

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.