Restore datafile from service: A cool #Oracle 12c Feature

You can restore a datafile directly from a physical standby database to the primary. Over the network. With compressed backupsets. How cool is that?

Here’s a demo from my present class Oracle Database 12c: Data Guard Administration. prima is the primary database on host01, physt is a physical standby database on host03. There is an Oracle Net configuration on both hosts that enable host01 to tnsping physt and host03 to tnsping prima

 

[oracle@host01 ~]$ rman target sys/oracle@prima

Recovery Manager: Release 12.1.0.1.0 - Production on Wed Jul 2 16:43:39 2014

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

connected to target database: PRIMA (DBID=2084081935)

RMAN> run
{
set newname for datafile 4 to '/home/oracle/stage/users01.dbf';
restore (datafile 4 from service physt) using compressed backupset;
catalog datafilecopy '/home/oracle/stage/users01.dbf';
}

executing command: SET NEWNAME

Starting restore at 02-JUL-14
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=47 device type=DISK

channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: using compressed network backup set from service physt
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00004 to /home/oracle/stage/users01.dbf
channel ORA_DISK_1: restore complete, elapsed time: 00:00:07
Finished restore at 02-JUL-14

cataloged datafile copy
datafile copy file name=/home/oracle/stage/users01.dbf RECID=8 STAMP=851877850

This does not require backups taken on the physical standby database.

About these ads

, ,

  1. #1 by Karlheinz on July 4, 2014 - 07:16

    Hello Uwe, thats a really nice feature ! Is this functionality also useable if there is a ASM storage behind and you are using OMF filenames instead of “regular” filenames ? Thanks ! Best regards, Karlheinz

  2. #2 by Pure Nitrate on September 9, 2014 - 18:59

    Wonderful beat ! I would like to apprentice while you amend your site, how can i subscribe for a blog site?
    The account helped me a acceptable deal.

    I had been tiny bit acquainted of this your broadcast offered bright clear idea

  3. #3 by twitter on September 16, 2014 - 11:37

    It’s actually a cool and useful piece of info. I’m happy that you
    shared this useful information with us. Please keep us informed like
    this. Thanks for sharing.

  4. #4 by Monowar Mukul on October 24, 2014 - 15:08

    Thanks, Uwe. We can now restore datafile into primary side even without backup by using standby service name
    SQL> !rm /u01/app/oracle/oradata/cdb1/pdb1/example01.dbf
    !ls -lt /u01/app/oracle/oradata/cdb1/pdb1/exam*
    Step2: Connect to rman for primary and auxialiary (standby) database
    [oracle@cloud ~]$ rman
    Recovery Manager: Release 12.1.0.2.0 – Production on Fri Oct 24 06:46:09 2014
    Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.
    RMAN> connect target sys/oracle123@cdb1
    connected to target database: CDB1 (DBID=834450112)
    RMAN> connect auxiliary sys/oracle123@sbcdb1
    connected to auxiliary database: CDB1 (DBID=834450112, not open)
    RMAN> RESTORE DATAFILE ‘/u01/app/oracle/oradata/cdb1/pdb1/example01.dbf’ FROM SERVICE sbcdb1;
    Starting restore at 24-OCT-14
    using target database control file instead of recovery catalog
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: SID=50 device type=DISK
    channel ORA_DISK_1: starting datafile backup set restore
    channel ORA_DISK_1: using network backup set from service sbcdb1
    channel ORA_DISK_1: specifying datafile(s) to restore from backup set
    channel ORA_DISK_1: restoring datafile 00011 to /u01/app/oracle/oradata/cdb1/pdb1/example01.dbf
    channel ORA_DISK_1: restore complete, elapsed time: 00:00:26
    Finished restore at 24-OCT-14
    RMAN> exit
    Recovery Manager complete.
    [oracle@cloud ~]$ ls -lt /u01/app/oracle/oradata/cdb1/pdb1/exam*
    -rw-r—– 1 oracle dba 338829312 Oct 24 06:52 /u01/app/oracle/oradata/cdb1/pdb1/example01.dbf

  1. cheap michael kors

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 2,802 other followers

%d bloggers like this: