Thursday, February 27, 2014

RMAN feature TO DESTINATION Keyword

Hi   Guys,


Oracle 11g Release 2 introduced new feature in RMAN utility i.e TO DESTINATION keyword.

Generally while taking RMAN backup either we have to configure the channel or allocate the channel to store backup pieces.  You can bypass these locations ,to store  backup in new location.

Note there is no format string like %U in the above command as we have been using in the backup commands earlier. Here is the output:

Your database should be in archivelog mode.

[oracle@prodserver ~]$ rman target /

Recovery Manager: Release 11.2.0.3.0 - Production on Thu Feb 27 22:27:00 2014

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

connected to target database: OCP (DBID=2733899832)

RMAN> backup tablespace USERS to destination '/tmp/backup';

Starting backup at 27-FEB-14
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=35 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00004 name=/u01/app/oracle/oradata/OCP/users01.dbf
channel ORA_DISK_1: starting piece 1 at 27-FEB-14
channel ORA_DISK_1: finished piece 1 at 27-FEB-14
piece handle=/tmp/backup/OCP/backupset/2014_02_27/o1_mf_nnndf_TAG20140227T222746_9jyxdmkd_.bkp tag=TAG20140227T222746 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 27-FEB-14

RMAN> backup datafile 1 to destination '/tmp/backup';

Starting backup at 27-FEB-14
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=/u01/app/oracle/oradata/OCP/system01.dbf
channel ORA_DISK_1: starting piece 1 at 27-FEB-14
channel ORA_DISK_1: finished piece 1 at 27-FEB-14
piece handle=/tmp/backup/OCP/backupset/2014_02_27/o1_mf_nnndf_TAG20140227T222819_9jyxfmqw_.bkp tag=TAG20140227T222819 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:45
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 27-FEB-14
channel ORA_DISK_1: finished piece 1 at 27-FEB-14
piece handle=/tmp/backup/OCP/backupset/2014_02_27/o1_mf_ncsnf_TAG20140227T222819_9jyxh270_.bkp tag=TAG20140227T222819 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 27-FEB-14

RMAN> backup database to destination '/tmp/backup';

Starting backup at 27-FEB-14
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=00006 name=/u01/app/oracle/oradata/OCP/mgmt.dbf
input datafile file number=00002 name=/u01/app/oracle/oradata/OCP/sysaux01.dbf
input datafile file number=00001 name=/u01/app/oracle/oradata/OCP/system01.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/OCP/undotbs01.dbf
input datafile file number=00009 name=/u01/app/oracle/oradata/OCP/rman01.dbf
input datafile file number=00007 name=/u01/app/oracle/oradata/OCP/mgmt_ad4j.dbf
input datafile file number=00008 name=/u01/app/oracle/oradata/OCP/stab01.dbf
input datafile file number=00005 name=/u01/app/oracle/oradata/OCP/mgmt_ecm_depot1.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/OCP/users01.dbf
channel ORA_DISK_1: starting piece 1 at 27-FEB-14
channel ORA_DISK_1: finished piece 1 at 27-FEB-14
piece handle=/tmp/backup/OCP/backupset/2014_02_27/o1_mf_nnndf_TAG20140227T223322_9jyxq3go_.bkp tag=TAG20140227T223322 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:45
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 27-FEB-14
channel ORA_DISK_1: finished piece 1 at 27-FEB-14
piece handle=/tmp/backup/OCP/backupset/2014_02_27/o1_mf_ncsnf_TAG20140227T223322_9jyxtfpr_.bkp tag=TAG20140227T223322 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 27-FEB-14

RMAN>


This clause creates backup files in an organized manner. The above command creates a directory OCP (the name of the instance), under which it creates a directory called backupset, under which another directory with the name as the date of the file creation. Finally the backuppiece is created with a system generated tag. When you use this to backup archived logs, that backuppiece goes under the subdirectory archivelogs and so on.
You an also use this clause in ALLOCATE CHANNEL command as well:
RMAN> run {
 allocate channel c1 device type disk to destination '/tmp/backup';
backup tablespace USERS;
 release channel c1;
}

released channel: ORA_DISK_1
allocated channel: c1
channel c1: SID=35 device type=DISK

Starting backup at 27-FEB-14
channel c1: starting full datafile backup set
channel c1: specifying datafile(s) in backup set
input datafile file number=00004 name=/u01/app/oracle/oradata/OCP/users01.dbf
channel c1: starting piece 1 at 27-FEB-14
channel c1: finished piece 1 at 27-FEB-14
piece handle=/tmp/backup/OCP/backupset/2014_02_27/o1_mf_nnndf_TAG20140227T224553_9jyygkvg_.bkp tag=TAG20140227T224553 comment=NONE
channel c1: backup set complete, elapsed time: 00:00:01
Finished backup at 27-FEB-14

released channel: c1

RMAN> run {
 allocate channel c1 device type disk to destination '/tmp/backup';
 }

allocated channel: c1
channel c1: SID=35 device type=DISK
released channel: c1

Note:  If you have any query , please send a mail to dbaclass4u@gmail.com

1 comment:

  1. κατασκευή eshop
    Με εξειδίκευση στην κατασκευή ιστοσελίδων και την στοχευμένη προώθηση. Αναλαμβάνουμε την κατασκευή και προώθηση όλων των τύπων ιστοσελίδων.

    ReplyDelete

Share your knowledge it really improves, don't show off...