Showing posts with label COPY. Show all posts
Showing posts with label COPY. Show all posts

Sunday, May 18, 2014

change and delete copy



RMAN> change copy
 tag="CPY_DB"
 delete ;

released channel: ORA_DISK_1
released channel: ORA_DISK_2
released channel: ORA_DISK_3
released channel: ORA_DISK_4
released channel: ORA_DISK_5
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=20 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=24 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=25 device type=DISK
allocated channel: ORA_DISK_4
channel ORA_DISK_4: SID=58 device type=DISK
allocated channel: ORA_DISK_5
channel ORA_DISK_5: SID=60 device type=DISK
specification does not match any control file copy in the repository
List of Datafile Copies
=======================

Key     File S Completion Time Ckp SCN    Ckp Time
------- ---- - --------------- ---------- ---------------
74      1    A 17-MAY-14       1246558    17-MAY-14
        Name: +DATA/cvrman/datafile/system.314.847802947
        Tag: CPY_DB

73      2    A 17-MAY-14       1246561    17-MAY-14
        Name: +DATA/cvrman/datafile/sysaux.344.847802947
        Tag: CPY_DB

71      3    A 17-MAY-14       1246567    17-MAY-14
        Name: +DATA/cvrman/datafile/undotbs1.342.847802951
        Tag: CPY_DB

78      4    A 18-MAY-14       1246607    17-MAY-14
        Name: +DATA/cvrman/datafile/users.dbf
        Tag: CPY_DB

75      4    A 17-MAY-14       1246607    17-MAY-14
        Name: +DATA/cvrman/datafile/users.340.847803041
        Tag: CPY_DB

72      5    A 17-MAY-14       1246564    17-MAY-14
        Name: +DATA/cvrman/datafile/example.273.847802947
        Tag: CPY_DB

70      6    A 17-MAY-14       1246570    17-MAY-14
        Name: +DATA/cvrman/datafile/tbs1.341.847802953
        Tag: CPY_DB


Do you really want to delete the above objects (enter YES or NO)?

Delete Copy using LIKE clause


Like clause should be used only for copy

RMAN> delete copy of database like
2> '+DATA/cvrman/datafile/us%'
3> device type disk;

released channel: ORA_DISK_1
released channel: ORA_DISK_2
released channel: ORA_DISK_3
released channel: ORA_DISK_4
released channel: ORA_DISK_5
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=20 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=24 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=25 device type=DISK
allocated channel: ORA_DISK_4
channel ORA_DISK_4: SID=58 device type=DISK
allocated channel: ORA_DISK_5
channel ORA_DISK_5: SID=60 device type=DISK
List of Datafile Copies
=======================

Key     File S Completion Time Ckp SCN    Ckp Time
------- ---- - --------------- ---------- ---------------
78      4    A 18-MAY-14       1246607    17-MAY-14
        Name: +DATA/cvrman/datafile/users.dbf
        Tag: CPY_DB

75      4    A 17-MAY-14       1246607    17-MAY-14
        Name: +DATA/cvrman/datafile/users.340.847803041
        Tag: CPY_DB


Do you really want to delete the above objects (enter YES or NO)?

Tuesday, May 13, 2014

RMAN Copy from image copy using tag at database level and tablespace level



1.Script file to take copy from image copy at database level and tablespace level

cat rman_6.cmd
# To take a copy of the image copy with specific tag for copy of database as well as tablespace level copy
run
{
backup as copy
tag="NEW_REDIRECT_COPY"
COPY OF DATABASE
FROM TAG ="REDIRECT_COPY"; # Database level copy
BACKUP AS COPY
TAG="NEW_REDIRECT_TBS_COPY"  #Tablespace level copy
COPY OF TABLESPACE EXAMPLE FROM TAG="REDIRECT_COPY"
COPY OF TABLESPACE SYSTEM FROM TAG="NEW_DIRECT_COPY";
}

2.script called from the RMAN command line

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

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

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

connected to target database: CVRMAN (DBID=657566608)

RMAN> # To take a copy of the image copy with specific tag for copy of database as well as tablespace level copy
2> run
3> {
4> backup as copy
5> tag="NEW_REDIRECT_COPY"
6> COPY OF DATABASE
7> FROM TAG ="REDIRECT_COPY";
8> BACKUP AS COPY
9> TAG="NEW_REDIRECT_TBS_COPY"
10> COPY OF TABLESPACE EXAMPLE FROM TAG="REDIRECT_COPY"
11> COPY OF TABLESPACE SYSTEM FROM TAG="NEW_REDIRECT_COPY";
12> }
13>
14>
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 is copy of datafile 00001: /SHARED/backup1/system.256.847354793
output file name=+DATA/cvrman/datafile/system.315.847504011 tag=NEW_REDIRECT_COPY RECID=22 STAMP=847504027
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:25
channel ORA_DISK_1: starting datafile copy
input is copy of datafile 00002: /SHARED/backup1/sysaux.257.847354793
output file name=+DATA/cvrman/datafile/sysaux.316.847504037 tag=NEW_REDIRECT_COPY RECID=23 STAMP=847504049
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting datafile copy
input is copy of datafile 00005: /SHARED/backup1/example.dbf
output file name=+DATA/cvrman/datafile/example.274.847504053 tag=NEW_REDIRECT_COPY RECID=24 STAMP=847504060
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting datafile copy
input is copy of datafile 00003: /SHARED/backup1/undotbs1.258.847354795
output file name=+DATA/cvrman/datafile/undotbs1.279.847504069 tag=NEW_REDIRECT_COPY RECID=25 STAMP=847504069
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:04
channel ORA_DISK_1: starting datafile copy
input is copy of datafile 00006: /SHARED/backup1/tbs1.294.847433665
output file name=+DATA/cvrman/datafile/tbs1.277.847504071 tag=NEW_REDIRECT_COPY RECID=26 STAMP=847504071
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting datafile copy
input is copy of datafile 00004: /SHARED/backup1/users.259.847354795
output file name=+DATA/cvrman/datafile/users.278.847504073 tag=NEW_REDIRECT_COPY RECID=27 STAMP=847504073
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 14-MAY-14