Thursday, May 15, 2014

Updating image copies using incremental level 1 backups


1. Day 1 of Updating Image copy with the script
Recover  copy of database will not recovery any thing in the first day and the backup incremental level 1 database will take image copies of the database.

cat rman_14.cmd
run
{
recover copy of database
with tag="full_backup_database";
backup incremental level 1
for recover of copy with tag="full_backup_database"
database;
}

$ rman target="/" @rman_14.cmd

Recovery Manager: Release 11.2.0.4.0 - Production on Thu May 15 08:52:59 2014

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: CVRMAN (DBID=657566608)

RMAN> run
2> {
3> recover copy of database
4> with tag="full_backup_database";
5> backup incremental level 1
6> for recover of copy with tag="full_backup_database"
7> database;
8> }
9>
Starting recover at 15-MAY-2014 08:53:05
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=25 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=23 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=56 device type=DISK
allocated channel: ORA_DISK_4
channel ORA_DISK_4: SID=49 device type=DISK
allocated channel: ORA_DISK_5
channel ORA_DISK_5: SID=40 device type=DISK
no copy of datafile 1 found to recover
no copy of datafile 2 found to recover
no copy of datafile 3 found to recover
no copy of datafile 4 found to recover
no copy of datafile 5 found to recover
no copy of datafile 6 found to recover
Finished recover at 15-MAY-2014 08:53:15

Starting backup at 15-MAY-2014 08:53:15
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4
using channel ORA_DISK_5
no parent backup or copy of datafile 1 found
no parent backup or copy of datafile 2 found
no parent backup or copy of datafile 5 found
no parent backup or copy of datafile 3 found
no parent backup or copy of datafile 6 found
no parent backup or copy of datafile 4 found
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=+DATA/cvrman/datafile/system.256.847354793
channel ORA_DISK_2: starting datafile copy
input datafile file number=00002 name=+DATA/cvrman/datafile/sysaux.257.847354793
channel ORA_DISK_3: starting datafile copy
input datafile file number=00005 name=+DATA/cvrman/datafile/example.308.847525493
channel ORA_DISK_4: starting datafile copy
input datafile file number=00003 name=+DATA/cvrman/datafile/undotbs1.258.847354795
channel ORA_DISK_5: starting datafile copy
input datafile file number=00006 name=+DATA/cvrman/datafile/tbs1.294.847433665
output file name=+DATA/cvrman/datafile/undotbs1.309.847616011 tag=FULL_BACKUP_DATABASE RECID=39 STAMP=847616056
channel ORA_DISK_4: datafile copy complete, elapsed time: 00:01:18
channel ORA_DISK_4: starting datafile copy
input datafile file number=00004 name=+DATA/cvrman/datafile/users.259.847354795
output file name=+DATA/cvrman/datafile/tbs1.260.847616011 tag=FULL_BACKUP_DATABASE RECID=40 STAMP=847616063
channel ORA_DISK_5: datafile copy complete, elapsed time: 00:01:28
output file name=+DATA/cvrman/datafile/example.297.847616019 tag=FULL_BACKUP_DATABASE RECID=41 STAMP=847616079
channel ORA_DISK_3: datafile copy complete, elapsed time: 00:01:32
output file name=+DATA/cvrman/datafile/system.314.847616009 tag=FULL_BACKUP_DATABASE RECID=43 STAMP=847616103
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:01:48
output file name=+DATA/cvrman/datafile/sysaux.284.847616027 tag=FULL_BACKUP_DATABASE RECID=42 STAMP=847616101
channel ORA_DISK_2: datafile copy complete, elapsed time: 00:01:48
output file name=+DATA/cvrman/datafile/users.281.847616105 tag=FULL_BACKUP_DATABASE RECID=44 STAMP=847616105
channel ORA_DISK_4: datafile copy complete, elapsed time: 00:00:21
Finished backup at 15-MAY-2014 08:55:06

Starting Control File and SPFILE Autobackup at 15-MAY-2014 08:55:06
piece handle=+DATA/cvrman/autobackup/2014_05_15/s_847616107.285.847616109 comment=NONE
Finished Control File and SPFILE Autobackup at 15-MAY-2014 08:55:10

Recovery Manager complete.


2.Image copies of the database will be created for the first day run of the script..
RMAN> list copy of database ;

List of Datafile Copies
=======================

Key     File S Completion Time      Ckp SCN    Ckp Time
------- ---- - -------------------- ---------- --------------------
43      1    A 15-MAY-2014 08:55:03 1136426    15-MAY-2014 08:53:18
        Name: +DATA/cvrman/datafile/system.314.847616009
        Tag: FULL_BACKUP_DATABASE

37      1    A 15-MAY-2014 08:44:46 1136135    15-MAY-2014 08:43:30
        Name: +DATA/cvrman/datafile/system.320.847615423
        Tag: FULL_BACKUP_DATABASE

42      2    A 15-MAY-2014 08:55:01 1136429    15-MAY-2014 08:53:19
        Name: +DATA/cvrman/datafile/sysaux.284.847616027
        Tag: FULL_BACKUP_DATABASE

38      2    A 15-MAY-2014 08:45:11 1136145    15-MAY-2014 08:43:55
        Name: +DATA/cvrman/datafile/sysaux.322.847615483
        Tag: FULL_BACKUP_DATABASE

39      3    A 15-MAY-2014 08:54:16 1136433    15-MAY-2014 08:53:20
        Name: +DATA/cvrman/datafile/undotbs1.309.847616011
        Tag: FULL_BACKUP_DATABASE

36      3    A 15-MAY-2014 08:44:35 1136128    15-MAY-2014 08:43:28
        Name: +DATA/cvrman/datafile/undotbs1.321.847615469
        Tag: FULL_BACKUP_DATABASE

44      4    A 15-MAY-2014 08:55:05 1136473    15-MAY-2014 08:54:54
        Name: +DATA/cvrman/datafile/users.281.847616105
        Tag: FULL_BACKUP_DATABASE

34      4    A 15-MAY-2014 08:43:41 1136133    15-MAY-2014 08:43:29
        Name: +DATA/cvrman/datafile/users.319.847615419
        Tag: FULL_BACKUP_DATABASE

41      5    A 15-MAY-2014 08:54:39 1127176    15-MAY-2014 03:49:47
        Name: +DATA/cvrman/datafile/example.297.847616019
        Tag: FULL_BACKUP_DATABASE

40      6    A 15-MAY-2014 08:54:23 1136436    15-MAY-2014 08:53:21
        Name: +DATA/cvrman/datafile/tbs1.260.847616011
        Tag: FULL_BACKUP_DATABASE

33      6    A 15-MAY-2014 08:43:41 1136130    15-MAY-2014 08:43:28
        Name: +DATA/cvrman/datafile/tbs1.318.847615417
        Tag: FULL_BACKUP_DATABASE


3. Day 2 of Updating Image copy with the script
The backup incremental level 1 database will create incremental level 1 copies of the database and no recovery happens.
cat rman_14.cmd
run
{
recover copy of database
with tag="full_backup_database";
backup incremental level 1
for recover of copy with tag="full_backup_database"
database;
}

[oracle@mfa-solcomp-poc05 rman]$ rman target="/" @rman_14.cmd |tee -a rman_14.log

Recovery Manager: Release 11.2.0.4.0 - Production on Thu May 15 09:14:23 2014

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: CVRMAN (DBID=657566608)

RMAN> run
2> {
3> recover copy of database
4> with tag="full_backup_database";
5> backup incremental level 1
6> for recover of copy with tag="full_backup_database"
7> database;
8> }
9>
Starting recover at 15-MAY-2014 09:14:29
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=50 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=51 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=47 device type=DISK
allocated channel: ORA_DISK_4
channel ORA_DISK_4: SID=1 device type=DISK
allocated channel: ORA_DISK_5
channel ORA_DISK_5: SID=30 device type=DISK
no copy of datafile 1 found to recover
no copy of datafile 2 found to recover
no copy of datafile 3 found to recover
no copy of datafile 4 found to recover
no copy of datafile 5 found to recover
no copy of datafile 6 found to recover
Finished recover at 15-MAY-2014 09:14:39

Starting backup at 15-MAY-2014 09:14:39
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4
using channel ORA_DISK_5
channel ORA_DISK_1: starting incremental level 1 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=+DATA/cvrman/datafile/system.256.847354793
input datafile file number=00004 name=+DATA/cvrman/datafile/users.259.847354795
channel ORA_DISK_1: starting piece 1 at 15-MAY-2014 09:14:42
channel ORA_DISK_2: starting incremental level 1 datafile backup set
channel ORA_DISK_2: specifying datafile(s) in backup set
input datafile file number=00002 name=+DATA/cvrman/datafile/sysaux.257.847354793
input datafile file number=00006 name=+DATA/cvrman/datafile/tbs1.294.847433665
channel ORA_DISK_2: starting piece 1 at 15-MAY-2014 09:14:42
channel ORA_DISK_3: starting incremental level 1 datafile backup set
channel ORA_DISK_3: specifying datafile(s) in backup set
input datafile file number=00005 name=+DATA/cvrman/datafile/example.308.847525493
skipping datafile 00005 because it has not changed
input datafile file number=00003 name=+DATA/cvrman/datafile/undotbs1.258.847354795
channel ORA_DISK_3: starting piece 1 at 15-MAY-2014 09:14:43
channel ORA_DISK_1: finished piece 1 at 15-MAY-2014 09:14:59
piece handle=+DATA/cvrman/backupset/2014_05_15/nnndn1_full_backup_database_0.318.847617291 tag=FULL_BACKUP_DATABASE comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:17
channel ORA_DISK_2: finished piece 1 at 15-MAY-2014 09:14:59
piece handle=+DATA/cvrman/backupset/2014_05_15/nnndn1_full_backup_database_0.319.847617291 tag=FULL_BACKUP_DATABASE comment=NONE
channel ORA_DISK_2: backup set complete, elapsed time: 00:00:17
channel ORA_DISK_3: finished piece 1 at 15-MAY-2014 09:14:59
piece handle=+DATA/cvrman/backupset/2014_05_15/nnndn1_full_backup_database_0.321.847617291 tag=FULL_BACKUP_DATABASE comment=NONE
channel ORA_DISK_3: backup set complete, elapsed time: 00:00:16
Finished backup at 15-MAY-2014 09:14:59

Starting Control File and SPFILE Autobackup at 15-MAY-2014 09:14:59
piece handle=+DATA/cvrman/autobackup/2014_05_15/s_847617300.322.847617301 comment=NONE
Finished Control File and SPFILE Autobackup at 15-MAY-2014 09:15:03

Recovery Manager complete.


3. Day 3  of Updating Image copy with the script
From day3 the script will perform both the recovery of the datafile using the incremental level 1 backups and incremental backups will be created.This process will continue subsequent run of the script.

cat rman_14.cmd
run
{
recover copy of database
with tag="full_backup_database";
backup incremental level 1
for recover of copy with tag="full_backup_database"
database;
}

$ rman target="/" @rman_14.cmd |tee -a rman_14.log

Recovery Manager: Release 11.2.0.4.0 - Production on Thu May 15 09:18:46 2014

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: CVRMAN (DBID=657566608)

RMAN> run
2> {
3> recover copy of database
4> with tag="full_backup_database";
5> backup incremental level 1
6> for recover of copy with tag="full_backup_database"
7> database;
8> }
9>
Starting recover at 15-MAY-2014 09:18:52
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=23 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=25 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=24 device type=DISK
allocated channel: ORA_DISK_4
channel ORA_DISK_4: SID=56 device type=DISK
allocated channel: ORA_DISK_5
channel ORA_DISK_5: SID=47 device type=DISK
no copy of datafile 5 found to recover
channel ORA_DISK_1: starting incremental datafile backup set restore
channel ORA_DISK_1: specifying datafile copies to recover
recovering datafile copy file number=00001 name=+DATA/cvrman/datafile/system.314.847616009
recovering datafile copy file number=00004 name=+DATA/cvrman/datafile/users.281.847616105
channel ORA_DISK_1: reading from backup piece +DATA/cvrman/backupset/2014_05_15/nnndn1_full_backup_database_0.318.847617291
channel ORA_DISK_2: starting incremental datafile backup set restore
channel ORA_DISK_2: specifying datafile copies to recover
recovering datafile copy file number=00002 name=+DATA/cvrman/datafile/sysaux.284.847616027
recovering datafile copy file number=00006 name=+DATA/cvrman/datafile/tbs1.260.847616011
channel ORA_DISK_2: reading from backup piece +DATA/cvrman/backupset/2014_05_15/nnndn1_full_backup_database_0.319.847617291
channel ORA_DISK_3: starting incremental datafile backup set restore
channel ORA_DISK_3: specifying datafile copies to recover
recovering datafile copy file number=00003 name=+DATA/cvrman/datafile/undotbs1.309.847616011
channel ORA_DISK_3: reading from backup piece +DATA/cvrman/backupset/2014_05_15/nnndn1_full_backup_database_0.321.847617291
channel ORA_DISK_3: piece handle=+DATA/cvrman/backupset/2014_05_15/nnndn1_full_backup_database_0.321.847617291 tag=FULL_BACKUP_DATABAS
E
channel ORA_DISK_3: restored backup piece 1
channel ORA_DISK_3: restore complete, elapsed time: 00:00:01
channel ORA_DISK_1: piece handle=+DATA/cvrman/backupset/2014_05_15/nnndn1_full_backup_database_0.318.847617291 tag=FULL_BACKUP_DATABAS
E
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
channel ORA_DISK_2: piece handle=+DATA/cvrman/backupset/2014_05_15/nnndn1_full_backup_database_0.319.847617291 tag=FULL_BACKUP_DATABAS
E
channel ORA_DISK_2: restored backup piece 1
channel ORA_DISK_2: restore complete, elapsed time: 00:00:03
Finished recover at 15-MAY-2014 09:19:07

Starting backup at 15-MAY-2014 09:19:09
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4
using channel ORA_DISK_5
no parent backup or copy of datafile 5 found  #datafile 5 is in read only status 
channel ORA_DISK_1: starting incremental level 1 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=+DATA/cvrman/datafile/system.256.847354793
channel ORA_DISK_1: starting piece 1 at 15-MAY-2014 09:19:12
channel ORA_DISK_2: starting incremental level 1 datafile backup set
channel ORA_DISK_2: specifying datafile(s) in backup set
input datafile file number=00002 name=+DATA/cvrman/datafile/sysaux.257.847354793
input datafile file number=00004 name=+DATA/cvrman/datafile/users.259.847354795
channel ORA_DISK_2: starting piece 1 at 15-MAY-2014 09:19:12
channel ORA_DISK_3: starting datafile copy
input datafile file number=00005 name=+DATA/cvrman/datafile/example.308.847525493
channel ORA_DISK_4: starting incremental level 1 datafile backup set
channel ORA_DISK_4: specifying datafile(s) in backup set
input datafile file number=00003 name=+DATA/cvrman/datafile/undotbs1.258.847354795
input datafile file number=00006 name=+DATA/cvrman/datafile/tbs1.294.847433665
channel ORA_DISK_4: starting piece 1 at 15-MAY-2014 09:19:13
channel ORA_DISK_1: finished piece 1 at 15-MAY-2014 09:19:28
piece handle=+DATA/cvrman/backupset/2014_05_15/nnndn1_full_backup_database_0.320.847617561 tag=FULL_BACKUP_DATABASE comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:16
channel ORA_DISK_2: finished piece 1 at 15-MAY-2014 09:19:39
piece handle=+DATA/cvrman/backupset/2014_05_15/nnndn1_full_backup_database_0.278.847617573 tag=FULL_BACKUP_DATABASE comment=NONE
channel ORA_DISK_2: backup set complete, elapsed time: 00:00:27
channel ORA_DISK_4: finished piece 1 at 15-MAY-2014 09:19:39
piece handle=+DATA/cvrman/backupset/2014_05_15/nnndn1_full_backup_database_0.313.847617567 tag=FULL_BACKUP_DATABASE comment=NONE
channel ORA_DISK_4: backup set complete, elapsed time: 00:00:26
output file name=+DATA/cvrman/datafile/example.297.847617559 tag=FULL_BACKUP_DATABASE RECID=50 STAMP=847617579
channel ORA_DISK_3: datafile copy complete, elapsed time: 00:00:37
Finished backup at 15-MAY-2014 09:19:49

Starting Control File and SPFILE Autobackup at 15-MAY-2014 09:19:49
piece handle=+DATA/cvrman/autobackup/2014_05_15/s_847617589.274.847617591 comment=NONE
Finished Control File and SPFILE Autobackup at 15-MAY-2014 09:19:52


Recovery Manager complete.

No comments: