Rman backup script to backup entire database : level 0

Posted By Sagar Patil

2 Oracle databases – A & B. Server A is available and need to be replicated on server B. We will use rman to backup datafiles including control file and archive logs.

RMAN script

connect rcvcat rmanc/obsequ10us@rcvcat
connect target rmant/obstreper0us@tknwp.yell
run {
 allocate channel tp1 type "sbt_tape";
 allocate channel tp2 type "sbt_tape";
 allocate channel tp3 type "sbt_tape";
 backup current controlfile for standby;
 backup incremental level = 0 database plus archivelog;
 change archivelog until time 'sysdate - 3' delete;
 release channel tp1;
 release channel tp2;
 release channel tp3;
}

Spool of rman script
C:\Documents and Settings\oracle>set oracle_sid=TKNWP
C:\Documents and Settings\oracle>cd S:\nsr
C:\Documents and Settings\oracle>s:
S:\nsr>rman
Recovery Manager: Release 9.2.0.8.0 – Production
Copyright (c) 1995, 2002, Oracle Corporation. All rights reserved.
RMAN> @tknwp_full.rman
RMAN> connect rcvcat rmanc/obsequ10us@rcvcat
connected to recovery catalog database
RMAN> connect target rmant/obstreper0us@tknwp.yell
connected to target database: TKNWP (DBID=38387564)
RMAN> run {
2> allocate channel tp1 type “sbt_tape”;
3> allocate channel tp2 type “sbt_tape”;
4> allocate channel tp3 type “sbt_tape”;
5> send ‘NSR_ENV=(NSR_SERVER=bsbk10,NSR_DATA_VOLUME_POOL=Default)’;
6> backup current controlfile for standby;
7> backup incremental level = 0 database plus archivelog;
8> change archivelog until time ‘sysdate – 3’ delete;
9> release channel tp1;
10> release channel tp2;
11> release channel tp3;
12> }
allocated channel: tp1
channel tp1: sid=17 devtype=SBT_TAPE
channel tp1: NMO v4.1.0.0
allocated channel: tp2
channel tp2: sid=18 devtype=SBT_TAPE
channel tp2: NMO v4.1.0.0
allocated channel: tp3
channel tp3: sid=22 devtype=SBT_TAPE
channel tp3: NMO v4.1.0.0
sent command to channel: tp1
sent command to channel: tp2
sent command to channel: tp3
Starting backup at 28-FEB-2007:11:55:28
channel tp1: starting full datafile backupset
channel tp1: specifying datafile(s) in backupset
including standby controlfile in backupset
channel tp1: starting piece 1 at 28-FEB-2007:11:55:29
channel tp1: finished piece 1 at 28-FEB-2007:11:55:36
piece handle=01ib6i5g_1_1 comment=API Version 2.0,MMS Version 4.1.0.0
channel tp1: backup set complete, elapsed time: 00:00:08
Finished backup at 28-FEB-2007:11:55:36
Starting backup at 28-FEB-2007:11:55:37
current log archived
channel tp1: starting archive log backupset
channel tp1: specifying archive log(s) in backup set
input archive log thread=1 sequence=14 recid=1 stamp=614526721
input archive log thread=1 sequence=15 recid=2 stamp=614526722
input archive log thread=1 sequence=16 recid=3 stamp=614528129
input archive log thread=1 sequence=17 recid=4 stamp=614536625
input archive log thread=1 sequence=18 recid=6 stamp=614536632
input archive log thread=1 sequence=19 recid=8 stamp=614833726
input archive log thread=1 sequence=20 recid=9 stamp=615033366
input archive log thread=1 sequence=21 recid=10 stamp=615042001
input archive log thread=1 sequence=22 recid=11 stamp=615117605
channel tp1: starting piece 1 at 28-FEB-2007:11:55:40
channel tp2: starting archive log backupset
channel tp2: specifying archive log(s) in backup set
input archive log thread=1 sequence=23 recid=12 stamp=615189602
input archive log thread=1 sequence=24 recid=13 stamp=615265205
input archive log thread=1 sequence=25 recid=14 stamp=615337204
input archive log thread=1 sequence=26 recid=15 stamp=615404575
channel tp2: starting piece 1 at 28-FEB-2007:11:55:40
channel tp3: starting archive log backupset
channel tp3: specifying archive log(s) in backup set
input archive log thread=1 sequence=27 recid=16 stamp=615404584
input archive log thread=1 sequence=28 recid=26 stamp=615477606
input archive log thread=1 sequence=29 recid=28 stamp=615553206
input archive log thread=1 sequence=30 recid=29 stamp=615621602
input archive log thread=1 sequence=31 recid=30 stamp=615639537
input archive log thread=1 sequence=32 recid=31 stamp=615639544
input archive log thread=1 sequence=33 recid=32 stamp=615639606
input archive log thread=1 sequence=34 recid=33 stamp=615640180
input archive log thread=1 sequence=35 recid=34 stamp=615640586
channel tp3: starting piece 1 at 28-FEB-2007:11:55:40
channel tp1: finished piece 1 at 28-FEB-2007:11:55:55
piece handle=02ib6i5r_1_1 comment=API Version 2.0,MMS Version 4.1.0.0
channel tp1: backup set complete, elapsed time: 00:00:16
channel tp2: finished piece 1 at 28-FEB-2007:11:55:55
piece handle=03ib6i5r_1_1 comment=API Version 2.0,MMS Version 4.1.0.0
channel tp2: backup set complete, elapsed time: 00:00:16
channel tp3: finished piece 1 at 28-FEB-2007:11:55:55
piece handle=04ib6i5r_1_1 comment=API Version 2.0,MMS Version 4.1.0.0
channel tp3: backup set complete, elapsed time: 00:00:16
channel tp1: starting archive log backupset
channel tp1: specifying archive log(s) in backup set
input archive log thread=1 sequence=36 recid=36 stamp=615640591
input archive log thread=1 sequence=37 recid=44 stamp=615640774
input archive log thread=1 sequence=38 recid=46 stamp=615658800
input archive log thread=1 sequence=39 recid=47 stamp=615658801
input archive log thread=1 sequence=40 recid=48 stamp=615729337
channel tp1: starting piece 1 at 28-FEB-2007:11:55:55
channel tp1: finished piece 1 at 28-FEB-2007:11:56:02
piece handle=05ib6i6b_1_1 comment=API Version 2.0,MMS Version 4.1.0.0
channel tp1: backup set complete, elapsed time: 00:00:07
Finished backup at 28-FEB-2007:11:56:02
Starting backup at 28-FEB-2007:11:56:03
channel tp1: starting incremental level 0 datafile backupset
channel tp1: specifying datafile(s) in backupset
input datafile fno=00007 name=G:\ORACLE\ORADATA\TKNWP\PERFSTAT_01.DBF
input datafile fno=00005 name=H:\ORACLE\ORADATA\TKNWP\TOOLS_01.DBF
input datafile fno=00006 name=H:\ORACLE\ORADATA\TKNWP\USERS_01.DBF
channel tp1: starting piece 1 at 28-FEB-2007:11:56:03
channel tp2: starting incremental level 0 datafile backupset
channel tp2: specifying datafile(s) in backupset
including current controlfile in backupset
input datafile fno=00001 name=G:\ORACLE\ORADATA\TKNWP\SYSTEM01.DBF
input datafile fno=00004 name=G:\ORACLE\ORADATA\TKNWP\GENESYS_LOGS_DATA_01.DBF
channel tp2: starting piece 1 at 28-FEB-2007:11:56:03
channel tp3: starting incremental level 0 datafile backupset
channel tp3: specifying datafile(s) in backupset
input datafile fno=00002 name=G:\ORACLE\ORADATA\TKNWP\UNDOTBS01.DBF
input datafile fno=00003 name=I:\ORACLE\ORADATA\TKNWP\GENESYS_CONFIG_DATA_01.DBF
channel tp3: starting piece 1 at 28-FEB-2007:11:56:04
channel tp1: finished piece 1 at 28-FEB-2007:11:56:29
piece handle=06ib6i6j_1_1 comment=API Version 2.0,MMS Version 4.1.0.0
channel tp1: backup set complete, elapsed time: 00:00:26
channel tp2: finished piece 1 at 28-FEB-2007:11:56:54
piece handle=07ib6i6j_1_1 comment=API Version 2.0,MMS Version 4.1.0.0
channel tp2: backup set complete, elapsed time: 00:00:51
channel tp3: finished piece 1 at 28-FEB-2007:11:56:54
piece handle=08ib6i6j_1_1 comment=API Version 2.0,MMS Version 4.1.0.0
channel tp3: backup set complete, elapsed time: 00:00:51
Finished backup at 28-FEB-2007:11:56:54
Starting backup at 28-FEB-2007:11:56:55
current log archived
channel tp1: starting archive log backupset
channel tp1: specifying archive log(s) in backup set
input archive log thread=1 sequence=41 recid=49 stamp=615729415
channel tp1: starting piece 1 at 28-FEB-2007:11:56:57
channel tp1: finished piece 1 at 28-FEB-2007:11:57:04
piece handle=09ib6i88_1_1 comment=API Version 2.0,MMS Version 4.1.0.0
channel tp1: backup set complete, elapsed time: 00:00:08
Finished backup at 28-FEB-2007:11:57:04
deleted archive log
archive log filename=F:\ORACLE\ORADATA\TKNWP\TKNWP_00014.ARC recid=1 stamp=61452
6721
deleted archive log
archive log filename=F:\ORACLE\ORADATA\TKNWP\TKNWP_00015.ARC recid=2 stamp=61452
6722
deleted archive log
archive log filename=F:\ORACLE\ORADATA\TKNWP\TKNWP_00016.ARC recid=3 stamp=61452
8129
deleted archive log
archive log filename=F:\ORACLE\ORADATA\TKNWP\TKNWP_00017.ARC recid=4 stamp=61453
6625
deleted archive log
archive log filename=F:\ORACLE\ORADATA\TKNWP\TKNWP_00018.ARC recid=6 stamp=61453
6632
deleted archive log
archive log filename=F:\ORACLE\ORADATA\TKNWP\TKNWP_00019.ARC recid=8 stamp=61483
3726
deleted archive log
archive log filename=F:\ORACLE\ORADATA\TKNWP\TKNWP_00020.ARC recid=9 stamp=61503
3366
deleted archive log
archive log filename=F:\ORACLE\ORADATA\TKNWP\TKNWP_00021.ARC recid=10 stamp=6150
42001
deleted archive log
archive log filename=F:\ORACLE\ORADATA\TKNWP\TKNWP_00022.ARC recid=11 stamp=6151
17605
deleted archive log
archive log filename=F:\ORACLE\ORADATA\TKNWP\TKNWP_00023.ARC recid=12 stamp=6151
89602
deleted archive log
archive log filename=F:\ORACLE\ORADATA\TKNWP\TKNWP_00024.ARC recid=13 stamp=6152
65205
deleted archive log
archive log filename=F:\ORACLE\ORADATA\TKNWP\TKNWP_00025.ARC recid=14 stamp=6153
37204
deleted archive log
archive log filename=F:\ORACLE\ORADATA\TKNWP\TKNWP_00026.ARC recid=15 stamp=6154
04575
deleted archive log
archive log filename=F:\ORACLE\ORADATA\TKNWP\TKNWP_00027.ARC recid=16 stamp=6154
04584
deleted archive log
archive log filename=F:\ORACLE\ORADATA\TKNWP\TKNWP_00028.ARC recid=26 stamp=6154
77606
Deleted 15 objects
released channel: tp1
released channel: tp2
released channel: tp3
RMAN>
RMAN>
RMAN>
RMAN>
RMAN> **end-of-file**

Leave a Reply

You must be logged in to post a comment.

Top of Page

Top menu