12c-How To Recover Root Container

接下来分享一下对root容器的备份与恢复:
root容器的备份其实就是cdb的备份,完全没有pdb的备份:
[oracle@orat3 ~]$ export ORACLE_SID=prd12cdb1
[oracle@orat3 ~]$
[oracle@orat3 ~]$
[oracle@orat3 ~]$ rman target /

Recovery Manager: Release 12.1.0.1.0 - Production on Sat Jun 7 14:38:42 2014

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

connected to target database: PRD12CDB (DBID=3299715205)

RMAN> BACKUP DATABASE ROOT;

Starting backup at 07-JUN-14
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=4624 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=00003 name=/data01/3.dbf
input datafile file number=00001 name=/data01/1.dbf
input datafile file number=00004 name=/data01/4.dbf
input datafile file number=00008 name=/data01/8.dbf
input datafile file number=00006 name=/data01/6.dbf
channel ORA_DISK_1: starting piece 1 at 07-JUN-14
channel ORA_DISK_1: finished piece 1 at 07-JUN-14
piece handle=/data01/PRD12CDB/backupset/2014_06_07/o1_mf_nnndf_TAG20140607T143900_9s5dw4fp_.bkp tag=TAG20140607T143900 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:05
Finished backup at 07-JUN-14

Starting Control File and SPFILE Autobackup at 07-JUN-14
piece handle=/bak/orabakdata/controlfile/controlc-3299715205-20140607-01 comment=NONE
Finished Control File and SPFILE Autobackup at 07-JUN-14

RMAN>
*****************************************************
[root@orat3 ~]# cd /data01
[root@orat3 data01]# ls
10.dbf  12.dbf  16.dbf  18.dbf  1.dbf   3.dbf  5.dbf  7.dbf  9.dbf  current.256.844530693  lost+found  PROD12C
11.dbf  13.dbf  17.dbf  19.dbf  20.dbf  4.dbf  6.dbf  8.dbf  bak    current.261.844530693  PRD12CDB
[root@orat3 data01]# rm 1.dbf
rm: remove regular file `1.dbf'? y
[root@orat3 data01]# ls
******************************************************
[oracle@orat3 ~]$ sqlplus '/ as sysdba'

SQL*Plus: Release 12.1.0.1.0 Production on Sat Jun 7 14:45:20 2014

Copyright (c) 1982, 2013, Oracle.  All rights reserved.


Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL>
SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         4 OSSPORTALDB                    READ WRITE NO
SQL> shut abort
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area 4.0486E+10 bytes
Fixed Size                  2692048 bytes
Variable Size            6979324976 bytes
Database Buffers         3.3420E+10 bytes
Redo Buffers               84176896 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 1 - see DBWR trace file
ORA-01110: data file 1: '/data01/1.dbf'

[oracle@orat3 ~]$ rman target /

Recovery Manager: Release 12.1.0.1.0 - Production on Sat Jun 7 14:47:01 2014

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

connected to target database: PRD12CDB (DBID=3299715205, not open)

RMAN> restore DATABASE ROOT;

Starting restore at 07-JUN-14
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=4 device type=DISK

channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00001 to /data01/1.dbf
channel ORA_DISK_1: restoring datafile 00003 to /data01/3.dbf
channel ORA_DISK_1: restoring datafile 00004 to /data01/4.dbf
channel ORA_DISK_1: restoring datafile 00006 to /data01/6.dbf
channel ORA_DISK_1: restoring datafile 00008 to /data01/8.dbf
channel ORA_DISK_1: reading from backup piece /data01/PRD12CDB/backupset/2014_06_07/o1_mf_nnndf_TAG20140607T143900_9s5dw4fp_.bkp
channel ORA_DISK_1: piece handle=/data01/PRD12CDB/backupset/2014_06_07/o1_mf_nnndf_TAG20140607T143900_9s5dw4fp_.bkp tag=TAG20140607T143900
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:36
Finished restore at 07-JUN-14

RMAN> recover database root;

Starting recover at 07-JUN-14
using channel ORA_DISK_1

starting media recovery
media recovery complete, elapsed time: 00:00:00

Finished recover at 07-JUN-14
RMAN> alter database open;

Statement processed

RMAN> alter pluggable database all open;

Statement processed

************************************************************

SQL> startup
ORA-01081: cannot start already-running ORACLE - shut it down first
SQL>
SQL>
SQL> show pdbs;

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         4 OSSPORTALDB                    READ WRITE NO
SQL> select  sysdate from dual;

SYSDATE
---------
07-JUN-14

root容器的备份就是cdb的备份。

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/13750068/viewspace-1177669/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/13750068/viewspace-1177669/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值