Tuesday, May 13, 2014

Redirect RMAN Copies of Tablespace to Different Location



1. RMAN script file to run from the commandline

# redirect the copy of database to different location
run
{
backup
as copy
db_file_name_convert=('+DATA/CVRman/Datafile/','/SHARED/backup1/')
tag="redirect_copy"
database;
}

2. Script called in the command line to run the redirect copy to different location
rman target="/" @ rman_5.cmd | tee -a rman_5.log
Recovery Manager: Release 11.2.0.4.0 - Production on Wed May 14 01:26:49 2014

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

connected to target database: CVRMAN (DBID=657566608)

RMAN> # redirect the copy of database to different location
2> run
3> {
4> backup
5> as copy
6> db_file_name_convert=('+DATA/CVRman/Datafile/','/SHARED/backup1/')
7> tag="redirect_copy"
8> database;
9> }
10>
Starting backup at 14-MAY-14
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=24 device type=DISK
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=+DATA/cvrman/datafile/system.256.847354793
output file name=/SHARED/backup1/system.256.847354793 tag=REDIRECT_COPY RECID=15 STAMP=847502867
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:55
channel ORA_DISK_1: starting datafile copy
input datafile file number=00002 name=+DATA/cvrman/datafile/sysaux.257.847354793
output file name=/SHARED/backup1/sysaux.257.847354793 tag=REDIRECT_COPY RECID=16 STAMP=847502910
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:35
channel ORA_DISK_1: starting datafile copy
input datafile file number=00005 name=+DATA/cvrman/datafile/example.dbf
output file name=/SHARED/backup1/example.dbf tag=REDIRECT_COPY RECID=17 STAMP=847502934
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:25
channel ORA_DISK_1: starting datafile copy
input datafile file number=00003 name=+DATA/cvrman/datafile/undotbs1.258.847354795
output file name=/SHARED/backup1/undotbs1.258.847354795 tag=REDIRECT_COPY RECID=18 STAMP=847502940
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07
channel ORA_DISK_1: starting datafile copy
input datafile file number=00006 name=+DATA/cvrman/datafile/tbs1.294.847433665
output file name=/SHARED/backup1/tbs1.294.847433665 tag=REDIRECT_COPY RECID=19 STAMP=847502944
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting datafile copy
copying current control file
output file name=+DATA/cvrman/controlfile/backup.306.847502945 tag=REDIRECT_COPY RECID=20 STAMP=847502946
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting datafile copy
input datafile file number=00004 name=+DATA/cvrman/datafile/users.259.847354795
output file name=/SHARED/backup1/users.259.847354795 tag=REDIRECT_COPY RECID=21 STAMP=847502948
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 14-MAY-14
channel ORA_DISK_1: finished piece 1 at 14-MAY-14
piece handle=+DATA/cvrman/backupset/2014_05_14/nnsnf0_redirect_copy_0.314.847502949 tag=REDIRECT_COPY comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 14-MAY-14

Recovery Manager complete.


3.List the copy of the database with tag "REDIRECT_COPY"

rman target="/"

Recovery Manager: Release 11.2.0.4.0 - Production on Wed May 14 01:32:01 2014

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

connected to target database: CVRMAN (DBID=657566608)

RMAN> list copy of database tag="REDIRECT_COPY"
2> ;

using target database control file instead of recovery catalog
List of Datafile Copies
=======================

Key     File S Completion Time Ckp SCN    Ckp Time
------- ---- - --------------- ---------- ---------------
15      1    A 14-MAY-14       1053021    14-MAY-14
        Name: /SHARED/backup1/system.256.847354793
        Tag: REDIRECT_COPY

16      2    A 14-MAY-14       1053042    14-MAY-14
        Name: /SHARED/backup1/sysaux.257.847354793
        Tag: REDIRECT_COPY

18      3    A 14-MAY-14       1053064    14-MAY-14
        Name: /SHARED/backup1/undotbs1.258.847354795
        Tag: REDIRECT_COPY

21      4    A 14-MAY-14       1053072    14-MAY-14
        Name: /SHARED/backup1/users.259.847354795
        Tag: REDIRECT_COPY

17      5    A 14-MAY-14       1053055    14-MAY-14
        Name: /SHARED/backup1/example.dbf
        Tag: REDIRECT_COPY

19      6    A 14-MAY-14       1053070    14-MAY-14
        Name: /SHARED/backup1/tbs1.294.847433665
        Tag: REDIRECT_COPY






No comments: