Storing scripts in the catalog is another common technique saves RMAN commands for reuse. To use this method you must have a catalog database.
Storing a Script
============
> To store a script you need to connect to both the catalog and the target.
> You can store a script using either the create script or replace script commands.
For example :
RMAN> create script full_back
2> {
3> backup database plus archivelog;
4> }
created script full_back
Executing a Script
===============
Once connections have been established to both the catalog and target database, you can call the stored script via the execute script command:
RMAN> run
2> {
3> execute script full_back;
4> }
executing script: full_back
Starting backup at 06-NOV-11
using channel ORA_DISK_1
Viewing a Stored Script
===================
RMAN> print script full_back;
printing stored script: full_back
{backup database;
}
Deleting a Stored Script
===================
To delete a stored script from the catalog, use the command:
RMAN> delete script script_name;
##################################################################################################################
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
##################################################################################################################
1) Full database Offline Backup
========================
For offline backups :
> The database needs to be shut down and restarted in mount mode.
> The database does not have to be in archivelog mode.
Full database offline backup
#!/bin/ksh
rman target / <<EOF
shutdown immediate;
startup mount;
backup database format
'+RECOVERYDEST/rman_%d_%t_%U.bus';
alter database open;
EOF
exit