Skip Headers

Oracle9i Recovery Manager Reference
Release 2 (9.2)

Part Number A96565-01
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback

Go to previous page Go to beginning of chapter Go to next page

RMAN Commands , 43 of 59


REPLACE SCRIPT

Syntax

Text description of replaceScript.gif follows
Text description of the illustration replaceScript.gif


See Also:

The syntax diagrams for "RUN" to determine which commands are included in the backupCommands, restoreCommands, maintenanceCommands, and miscellaneousCommands clauses

Purpose

To replace an existing script stored in the recovery catalog. If the script does not exist, then REPLACE SCRIPT creates it.

The stored script feature is provided primarily to provide a common repository for frequently executed collections of RMAN commands: use any command legal within a RUN command in the script. The script is not executed immediately; use the EXECUTE SCRIPT command to run it.

See Also:
  • For descriptions of the individual commands that you can use in a stored script, see the appropriate entry, for example, "BACKUP"
  • For information about the @ and @@ arguments, see "CREATE SCRIPT"
  • For information about the EXECUTE SCRIPT command, see "EXECUTE SCRIPT"

Restrictions and Usage Notes

Keywords and Parameters

For descriptions of the individual commands that you can use in a stored script, refer to the appropriate entry, for example, "BACKUP".

Syntax Element Description

REPLACE SCRIPT 'script_name'

Replaces the specified stored script with the new commands. The statements allowable within the parentheses of the REPLACE SCRIPT 'script_name' ( ... ) command are the same allowable within the RUN command.

To obtain a listing of all stored scripts, use SQL*Plus to connect to the recovery catalog database as the catalog owner and issue the following query:

SELECT * FROM RC_STORED_SCRIPT;

Note: To run the script, issue EXECUTE SCRIPT within the braces of the RUN command.

See Also: "RC_STORED_SCRIPT" for more information about RC_STORED_SCRIPT

Example

Replacing a Recovery Catalog Script: Example

This example creates two distinct recovery catalog scripts called backup_full. Each script has different content and is associated with a different target database:

#!/usr/bin/tcsh
rman TARGET SYS/oracle@prod1 CATALOG rman/rman@catdb << SCRIPT1
# Create a script called backup_full that you can use to back up target
# database prod1. If a script already exists with the name backup_full,
# then this command overwrites it.
REPLACE SCRIPT backup_full 
{
   # uses configured channel for default device type
   BACKUP DATABASE;
}
EXIT
SCRIPT1

rman TARGET SYS/oracle2@prod2 CATALOG rman/rman@catdb <<SCRIPT2
# Creates a new script backup_full on database prod2. Even though it has the same name,
# this script is different from the backup_full script created on prod1 in the preceding 
# example. Each catalog script is associated with one and only one target database.
REPLACE SCRIPT backup_full
{
   # uses configured sbt channel
   BACKUP DEVICE TYPE sbt DATABASE PLUS ARCHIVELOG;
}
# runs the backup_full script
RUN { EXECUTE SCRIPT backup_full; }
EXIT
SCRIPT2

Go to previous page Go to beginning of chapter Go to next page
Oracle
Copyright © 1996, 2002 Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback