Working with RMAN Stored Scripts

Creating Stored Scripts: CREATE SCRIPT

 

Make sure RMAN is connected to the right target database and the recovery catalog. Then run the CREATE SCRIPT command, as shown in this example:

 
 
CREATE SCRIPT full_backup 
{
BACKUP DATABASE PLUS ARCHIVELOG;
DELETE OBSOLETE;
 
 

 you can also provide a COMMENT with descriptive information:

CREATE GLOBAL SCRIPT global_full_backup 
COMMENT 'use only with ARCHIVELOG mode databases'
{
BACKUP DATABASE PLUS ARCHIVELOG;
DELETE OBSOLETE;
}

Running Stored Scripts: EXECUTE SCRIPT

 

RUN { EXECUTE SCRIPT full_backup; }

Displaying a Stored Script: PRINT SCRIPT

PRINT SCRIPT full_backup;
PRINT SCRIPT full_backup TO FILE 'my_backup.txt'; 

Listing Stored Scripts: LIST SCRIPT NAMES

LIST SCRIPT NAMES;

LIST ALL SCRIPT NAMES;

Updating Stored Scripts: REPLACE SCRIPT

REPLACE SCRIPT full_backup 
{
BACKUP DATABASE PLUS ARCHIVELOG;
}

Deleting Stored Scripts: DELETE SCRIPT

 

DELETE SCRIPT 'full_backup';
DELETE GLOBAL SCRIPT 'global_full_backup'; 

 

 

 

 Thank you 

Osama mustafa

 

 

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.