viernes, 2 de agosto de 2013

Oracle 11 - RMAN Creating scripts inside catalog

A few examples creating, deleting and listing scripts stored inside an RMAN catalog.

Creating RMAN scripts inside rman catalog. 

GLOBAL scripts are available for all database instances connected to rman catalog.

RMAN> create global script
2> global_backup_db {backup database plus archivelog;}

created global script blobal_backup_db

Running previous script.

RMAN> run {execute global script global_backup_db;}

executing global script: global_backup_db


Starting backup at 30-JUL-2013 23:03:28
current log archived
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=63 instance=RACDB1 device type=DISK
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=2 sequence=11 RECID=1 STAMP=821038151
input archived log thread=1 sequence=83 RECID=2 STAMP=821038215
input archived log thread=1 sequence=84 RECID=3 STAMP=821043970
.
.
.
channel ORA_DISK_1: finished piece 1 at 30-JUL-2013 23:30:44
piece handle=+FRA/racdb/backupset/2013_07_30/annnf0_tag20130730t233041_0.300.822180641 tag=TAG20130730T233041 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 30-JUL-2013 23:30:44

Creating global script including tablespace variable

RMAN> create global script backup_ts
2> { backup tablespace &1; }

Enter value for 1: users

created global script backup_ts

Running global script with variable backup_ts

RMAN> run {execute global script backup_ts;}

executing global script: backup_ts

Enter value for 1: system

Starting backup at 30-JUL-2013 23:43:39
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=+DATA/racdb/datafile/system.259.820185587
channel ORA_DISK_1: starting piece 1 at 30-JUL-2013 23:43:43

Listing scripts stored inside catalog. 

RMAN> list script names;

List of Stored Scripts in Recovery Catalog


    Global Scripts


       Script Name
       Description
       -----------------------------------------------------------------------
       backup_ts

       global_backup_db


Listing description

RMAN> print global script global_backup_db;

printing stored global script: global_backup_db
{backup database plus archivelog;}

Deleting script from catalog.

RMAN> delete global script backup_ts;

deleted global script: backup_ts


No hay comentarios:

Publicar un comentario