How To Restore 12cR1DB to New Host File System using RMAN(二)

容器数据库(CDB$ROOT)包含system,sysaux,undo和temp表空间,控制文件和redofile;
而种子数据库(PDB$SEED)包含system,sysaux,temp,example表空间,用来作为一个临时模板来创建新的插件库;
临时表空间对于所有的容器库都是必需的,但是每个插件数据库都拥有自己local用户(In a multitenant container database (CDB),
any user that is not )的临时表空间。每个插件库拥有system,sysaux,temp表空间,同时包含应用用户创建的数据表空间;

并且按照应用需要在插件数据库内创建应用数据表空间;写信息到容器库的undo表空间和控制文件和redo文件。并且按照应用需要在插件数据库内创建应用数据表空间;
所有的在同一个容器库的插件库都共享归档模式。
每个容器库最多容纳253个插件数据库(包括种子库),512个service;

先看看备份:
RMAN> report schema;

using target database control file instead of recovery catalog
Report of database schema for database with db_unique_name PRD12CDB

List of Permanent Datafiles
===========================
File Size(MB) Tablespace           RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1    790      SYSTEM               ***     /data01/1.dbf     ----->container db
3    2730     SYSAUX               ***     /data01/3.dbf     ----->container db
4    260      UNDOTBS1             ***     /data01/4.dbf     ----->container db
5    260      PDB$SEED:SYSTEM      ***     /data01/5.dbf     ----->container db
6    5        USERS                ***     /data01/6.dbf     ----->container db
7    640      PDB$SEED:SYSAUX      ***     /data01/7.dbf     ----->container db
8    75       UNDOTBS2             ***     /data01/8.dbf     ----->container db
9    270      ZSKMSDB:SYSTEM       ***     /data01/9.dbf     ----->pdb
10   690      ZSKMSDB:SYSAUX       ***     /data01/10.dbf
11   5        ZSKMSDB:USERS        ***     /data01/11.dbf
12   270      OSSPORTALDB:SYSTEM   ***     /data01/12.dbf
13   690      OSSPORTALDB:SYSAUX   ***     /data01/13.dbf
16   10240    ZSKMSDB:RESALE_DATA  ***     /data01/16.dbf
17   100      ZSKMSDB:JTITSM       ***     /data01/17.dbf
18   100      OSSPORTALDB:JTITSM   ***     /data01/18.dbf
19   2048     ZSKMSDB:SYSTEM       ***     /data01/19.dbf
20   2048     ZSKMSDB:SYSAUX       ***     /data01/20.dbf

List of Temporary Files
=======================
File Size(MB) Tablespace           Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1    60       TEMP                 32767       /data01/PRD12CDB/datafile/o1_mf_temp_9rf9626t_.tmp
2    20       PDB$SEED:TEMP        32767       +SYSDATA/PRD12CDB/DD7C48AA5A4404A2E04325AAE80A403C/DATAFILE/pdbseed_temp01.dbf
3    20       ZSKMSDB:TEMP         32767       /data01/PRD12CDB/F6ACAF06A0755467E0430254800A2839/datafile/o1_mf_temp_9rf96cpk_.tmp
4    20       OSSPORTALDB:TEMP     32767       /data01/PRD12CDB/F6ACE29ECAE0576BE0430254800A9CD6/datafile/o1_mf_temp_9rf96dmk_.tmp

完全cdb备份:
[oracle@orat3 ~]$ rman target /

Recovery Manager: Release 12.1.0.1.0 - Production on Wed Jun 4 12:55:57 2014

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

connected to target database: PRD12CDB (DBID=3299715205)

RMAN> BACKUP DATABASE PLUS ARCHIVELOG DELETE  ALL  INPUT; 


Starting backup at 04-JUN-14
current log archived
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=9238 device type=DISK
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=1 RECID=111 STAMP=849129262
input archived log thread=2 sequence=1 RECID=110 STAMP=848833726
input archived log thread=1 sequence=2 RECID=112 STAMP=849358461
input archived log thread=1 sequence=3 RECID=113 STAMP=849358565
channel ORA_DISK_1: starting piece 1 at 04-JUN-14
channel ORA_DISK_1: finished piece 1 at 04-JUN-14
piece handle=/data01/PRD12CDB/backupset/2014_06_04/o1_mf_annnn_TAG20140604T125605_9rx9q645_.bkp tag=TAG20140604T125605 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:25
channel ORA_DISK_1: deleting archived log(s)
archived log file name=/data01/PRD12CDB/archivelog/2014_06_01/o1_mf_1_1_9rp9s6v3_.arc RECID=111 STAMP=849129262
archived log file name=/data01/PRD12CDB/archivelog/2014_05_29/o1_mf_2_1_9rf95yqn_.arc RECID=110 STAMP=848833726
archived log file name=/data01/PRD12CDB/archivelog/2014_06_04/o1_mf_1_2_9rx9mqt7_.arc RECID=112 STAMP=849358461
archived log file name=/data01/PRD12CDB/archivelog/2014_06_04/o1_mf_1_3_9rx9q59t_.arc RECID=113 STAMP=849358565
Finished backup at 04-JUN-14

Starting backup at 04-JUN-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=00016 name=/data01/16.dbf
input datafile file number=00019 name=/data01/19.dbf
input datafile file number=00020 name=/data01/20.dbf
input datafile file number=00010 name=/data01/10.dbf
input datafile file number=00009 name=/data01/9.dbf
input datafile file number=00017 name=/data01/17.dbf
input datafile file number=00011 name=/data01/11.dbf
channel ORA_DISK_1: starting piece 1 at 04-JUN-14
channel ORA_DISK_1: finished piece 1 at 04-JUN-14
piece handle=/data01/PRD12CDB/F6ACAF06A0755467E0430254800A2839/backupset/2014_06_04/o1_mf_nnndf_TAG20140604T125631_9rx9qzvy_.bkp tag=TAG20140604T125631 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:35
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 04-JUN-14
channel ORA_DISK_1: finished piece 1 at 04-JUN-14
piece handle=/data01/PRD12CDB/backupset/2014_06_04/o1_mf_nnndf_TAG20140604T125631_9rx9s32p_.bkp tag=TAG20140604T125631 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:55
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00013 name=/data01/13.dbf
input datafile file number=00012 name=/data01/12.dbf
input datafile file number=00018 name=/data01/18.dbf
channel ORA_DISK_1: starting piece 1 at 04-JUN-14
channel ORA_DISK_1: finished piece 1 at 04-JUN-14
piece handle=/data01/PRD12CDB/F6ACE29ECAE0576BE0430254800A9CD6/backupset/2014_06_04/o1_mf_nnndf_TAG20140604T125631_9rx9tt7l_.bkp tag=TAG20140604T125631 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00007 name=/data01/7.dbf
input datafile file number=00005 name=/data01/5.dbf
channel ORA_DISK_1: starting piece 1 at 04-JUN-14
channel ORA_DISK_1: finished piece 1 at 04-JUN-14
piece handle=/data01/PRD12CDB/F6AC7D86579C49A9E0430254800A174B/backupset/2014_06_04/o1_mf_nnndf_TAG20140604T125631_9rx9v9c5_.bkp tag=TAG20140604T125631 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15
Finished backup at 04-JUN-14

Starting backup at 04-JUN-14
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=4 RECID=114 STAMP=849358712
channel ORA_DISK_1: starting piece 1 at 04-JUN-14
channel ORA_DISK_1: finished piece 1 at 04-JUN-14
piece handle=/data01/PRD12CDB/backupset/2014_06_04/o1_mf_annnn_TAG20140604T125832_9rx9vrml_.bkp tag=TAG20140604T125832 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_1: deleting archived log(s)
archived log file name=/data01/PRD12CDB/archivelog/2014_06_04/o1_mf_1_4_9rx9vrfy_.arc RECID=114 STAMP=849358712
Finished backup at 04-JUN-14

Starting Control File and SPFILE Autobackup at 04-JUN-14
piece handle=/bak/orabakdata/controlfile/controlc-3299715205-20140604-00 comment=NONE
Finished Control File and SPFILE Autobackup at 04-JUN-14

RMAN> BACKUP PLUGGABLE DATABASE ZSKMSDB  TAG '12cZSKMSDB_pdb';

Starting backup at 04-JUN-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=00016 name=/data01/16.dbf
input datafile file number=00019 name=/data01/19.dbf
input datafile file number=00020 name=/data01/20.dbf
input datafile file number=00010 name=/data01/10.dbf
input datafile file number=00009 name=/data01/9.dbf
input datafile file number=00017 name=/data01/17.dbf
input datafile file number=00011 name=/data01/11.dbf
channel ORA_DISK_1: starting piece 1 at 04-JUN-14
channel ORA_DISK_1: finished piece 1 at 04-JUN-14
piece handle=/data01/PRD12CDB/F6ACAF06A0755467E0430254800A2839/backupset/2014_06_04/o1_mf_nnndf_12CZSKMSDB_PDB_9rxbfrgz_.bkp tag=12CZSKMSDB_PDB comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15
Finished backup at 04-JUN-14

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

 

RMAN>  LIST BACKUP OF DATABASE;


List of Backup Sets
===================


BS Key  Type LV Size
------- ---- -- ----------
196     Incr 0  2.04M
  List of Datafiles in backup set 196
  Container ID: 3, PDB Name: ZSKMSDB
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  17   0  Incr 7411633    25-MAY-14 /data01/17.dbf
  19   0  Incr 7411633    25-MAY-14 /data01/19.dbf

  Backup Set Copy #1 of backup set 196
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:00:02     25-MAY-14       NO         HOT_DB_BK_LEVEL0

    List of Backup Pieces for backup set 196 Copy #1
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    196     1   EXPIRED     /bak/orabakdata/backupdata/d-20140525-848449818-198-1.dbf

  Backup Set Copy #2 of backup set 196
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:00:02     29-MAY-14       NO         HOT_DB_BK_LEVEL0

    List of Backup Pieces for backup set 196 Copy #2
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    226     1   AVAILABLE   /data01/bak/bak/d-20140525-848449818-198-1.dbf

BS Key  Type LV Size
------- ---- -- ----------
197     Incr 0  3.51M
  List of Datafiles in backup set 197
  Container ID: 3, PDB Name: ZSKMSDB
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  11   0  Incr 7411635    25-MAY-14 /data01/11.dbf
  20   0  Incr 7411635    25-MAY-14 /data01/20.dbf

  Backup Set Copy #1 of backup set 197
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:00:02     25-MAY-14       NO         HOT_DB_BK_LEVEL0

    List of Backup Pieces for backup set 197 Copy #1
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    197     1   EXPIRED     /bak/orabakdata/backupdata/d-20140525-848449818-199-1.dbf

  Backup Set Copy #2 of backup set 197
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:00:02     29-MAY-14       NO         HOT_DB_BK_LEVEL0

    List of Backup Pieces for backup set 197 Copy #2
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    230     1   AVAILABLE   /data01/bak/bak/d-20140525-848449818-199-1.dbf

BS Key  Type LV Size
------- ---- -- ----------
198     Incr 0  672.11M
  List of Datafiles in backup set 198
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  1    0  Incr 7411637    25-MAY-14 /data01/1.dbf

  Backup Set Copy #1 of backup set 198
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:00:08     25-MAY-14       NO         HOT_DB_BK_LEVEL0

    List of Backup Pieces for backup set 198 Copy #1
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    198     1   EXPIRED     /bak/orabakdata/backupdata/d-20140525-848449820-201-1.dbf

  Backup Set Copy #2 of backup set 198
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:00:08     29-MAY-14       NO         HOT_DB_BK_LEVEL0

    List of Backup Pieces for backup set 198 Copy #2
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    231     1   AVAILABLE   /data01/bak/bak/d-20140525-848449820-201-1.dbf

BS Key  Type LV Size
------- ---- -- ----------
199     Incr 0  69.59M
  List of Datafiles in backup set 199
  Container ID: 3, PDB Name: ZSKMSDB
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  16   0  Incr 7411631    25-MAY-14 /data01/16.dbf

  Backup Set Copy #1 of backup set 199
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:00:11     25-MAY-14       NO         HOT_DB_BK_LEVEL0

    List of Backup Pieces for backup set 199 Copy #1
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    199     1   EXPIRED     /bak/orabakdata/backupdata/d-20140525-848449817-196-1.dbf

  Backup Set Copy #2 of backup set 199
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:00:11     29-MAY-14       NO         HOT_DB_BK_LEVEL0

    List of Backup Pieces for backup set 199 Copy #2
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    229     1   AVAILABLE   /data01/bak/bak/d-20140525-848449817-196-1.dbf

BS Key  Type LV Size
------- ---- -- ----------
200     Incr 0  548.52M
  List of Datafiles in backup set 200
  Container ID: 4, PDB Name: OSSPORTALDB
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  13   0  Incr 7411639    25-MAY-14 /data01/13.dbf

  Backup Set Copy #1 of backup set 200
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:00:11     25-MAY-14       NO         HOT_DB_BK_LEVEL0

    List of Backup Pieces for backup set 200 Copy #1
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    200     1   EXPIRED     /bak/orabakdata/backupdata/d-20140525-848449820-202-1.dbf

  Backup Set Copy #2 of backup set 200
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:00:11     29-MAY-14       NO         HOT_DB_BK_LEVEL0

    List of Backup Pieces for backup set 200 Copy #2
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    234     1   AVAILABLE   /data01/bak/bak/d-20140525-848449820-202-1.dbf

BS Key  Type LV Size
------- ---- -- ----------
201     Incr 0  769.01M
  List of Datafiles in backup set 201
  Container ID: 3, PDB Name: ZSKMSDB
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  9    0  Incr 7411636    25-MAY-14 /data01/9.dbf
  10   0  Incr 7411636    25-MAY-14 /data01/10.dbf

  Backup Set Copy #1 of backup set 201
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:00:14     25-MAY-14       NO         HOT_DB_BK_LEVEL0

    List of Backup Pieces for backup set 201 Copy #1
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    201     1   EXPIRED     /bak/orabakdata/backupdata/d-20140525-848449819-200-1.dbf

  Backup Set Copy #2 of backup set 201
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:00:14     29-MAY-14       NO         HOT_DB_BK_LEVEL0

    List of Backup Pieces for backup set 201 Copy #2
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    232     1   AVAILABLE   /data01/bak/bak/d-20140525-848449819-200-1.dbf

BS Key  Type LV Size
------- ---- -- ----------
202     Incr 0  531.05M
  List of Datafiles in backup set 202
  Container ID: 2, PDB Name: PDB$SEED
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  7    0  Incr 1921022    10-APR-14 /data01/7.dbf

  Backup Set Copy #1 of backup set 202
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:00:12     25-MAY-14       NO         HOT_DB_BK_LEVEL0

    List of Backup Pieces for backup set 202 Copy #1
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    202     1   EXPIRED     /bak/orabakdata/backupdata/d-20140525-848449821-203-1.dbf

  Backup Set Copy #2 of backup set 202
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:00:12     29-MAY-14       NO         HOT_DB_BK_LEVEL0

    List of Backup Pieces for backup set 202 Copy #2
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    228     1   AVAILABLE   /data01/bak/bak/d-20140525-848449821-203-1.dbf

BS Key  Type LV Size
------- ---- -- ----------
203     Incr 0  1.03M
  List of Datafiles in backup set 203
  Container ID: 4, PDB Name: OSSPORTALDB
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  18   0  Incr 7411656    25-MAY-14 /data01/18.dbf

  Backup Set Copy #1 of backup set 203
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:00:01     25-MAY-14       NO         HOT_DB_BK_LEVEL0

    List of Backup Pieces for backup set 203 Copy #1
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    203     1   EXPIRED     /bak/orabakdata/backupdata/d-20140525-848449833-207-1.dbf

  Backup Set Copy #2 of backup set 203
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:00:01     29-MAY-14       NO         HOT_DB_BK_LEVEL0

    List of Backup Pieces for backup set 203 Copy #2
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    243     1   AVAILABLE   /data01/bak/bak/d-20140525-848449833-207-1.dbf

BS Key  Type LV Size
------- ---- -- ----------
204     Incr 0  209.90M
  List of Datafiles in backup set 204
  Container ID: 2, PDB Name: PDB$SEED
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  5    0  Incr 1921022    10-APR-14 /data01/5.dbf

  Backup Set Copy #1 of backup set 204
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:00:02     25-MAY-14       NO         HOT_DB_BK_LEVEL0

    List of Backup Pieces for backup set 204 Copy #1
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    204     1   EXPIRED     /bak/orabakdata/backupdata/d-20140525-848449832-206-1.dbf

  Backup Set Copy #2 of backup set 204
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:00:02     29-MAY-14       NO         HOT_DB_BK_LEVEL0

    List of Backup Pieces for backup set 204 Copy #2
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    246     1   AVAILABLE   /data01/bak/bak/d-20140525-848449832-206-1.dbf

BS Key  Type LV Size
------- ---- -- ----------
205     Incr 0  15.74M
  List of Datafiles in backup set 205
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  8    0  Incr 7411657    25-MAY-14 /data01/8.dbf

  Backup Set Copy #1 of backup set 205
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:00:01     25-MAY-14       NO         HOT_DB_BK_LEVEL0

    List of Backup Pieces for backup set 205 Copy #1
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    205     1   EXPIRED     /bak/orabakdata/backupdata/d-20140525-848449833-208-1.dbf

  Backup Set Copy #2 of backup set 205
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:00:01     29-MAY-14       NO         HOT_DB_BK_LEVEL0

    List of Backup Pieces for backup set 205 Copy #2
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    227     1   AVAILABLE   /data01/bak/bak/d-20140525-848449833-208-1.dbf

BS Key  Type LV Size
------- ---- -- ----------
206     Incr 0  1.34M
  List of Datafiles in backup set 206
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  6    0  Incr 7411660    25-MAY-14 /data01/6.dbf

  Backup Set Copy #1 of backup set 206
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:00:01     25-MAY-14       NO         HOT_DB_BK_LEVEL0

    List of Backup Pieces for backup set 206 Copy #1
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    206     1   EXPIRED     /bak/orabakdata/backupdata/d-20140525-848449834-209-1.dbf

  Backup Set Copy #2 of backup set 206
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:00:01     29-MAY-14       NO         HOT_DB_BK_LEVEL0

    List of Backup Pieces for backup set 206 Copy #2
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    225     1   AVAILABLE   /data01/bak/bak/d-20140525-848449834-209-1.dbf

BS Key  Type LV Size
------- ---- -- ----------
207     Incr 0  2.13G
  List of Datafiles in backup set 207
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  3    0  Incr 7411632    25-MAY-14 /data01/3.dbf

  Backup Set Copy #1 of backup set 207
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:00:19     25-MAY-14       NO         HOT_DB_BK_LEVEL0

    List of Backup Pieces for backup set 207 Copy #1
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    207     1   EXPIRED     /bak/orabakdata/backupdata/d-20140525-848449817-197-1.dbf

  Backup Set Copy #2 of backup set 207
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:00:19     29-MAY-14       NO         HOT_DB_BK_LEVEL0

    List of Backup Pieces for backup set 207 Copy #2
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    241     1   AVAILABLE   /data01/bak/bak/d-20140525-848449817-197-1.dbf

BS Key  Type LV Size
------- ---- -- ----------
208     Incr 0  20.71M
  List of Datafiles in backup set 208
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  4    0  Incr 7411652    25-MAY-14 /data01/4.dbf

  Backup Set Copy #1 of backup set 208
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:00:07     25-MAY-14       NO         HOT_DB_BK_LEVEL0

    List of Backup Pieces for backup set 208 Copy #1
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    208     1   EXPIRED     /bak/orabakdata/backupdata/d-20140525-848449829-205-1.dbf

  Backup Set Copy #2 of backup set 208
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:00:07     29-MAY-14       NO         HOT_DB_BK_LEVEL0

    List of Backup Pieces for backup set 208 Copy #2
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    244     1   AVAILABLE   /data01/bak/bak/d-20140525-848449829-205-1.dbf

BS Key  Type LV Size
------- ---- -- ----------
209     Incr 0  216.70M
  List of Datafiles in backup set 209
  Container ID: 4, PDB Name: OSSPORTALDB
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  12   0  Incr 7411649    25-MAY-14 /data01/12.dbf

  Backup Set Copy #1 of backup set 209
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:00:08     25-MAY-14       NO         HOT_DB_BK_LEVEL0

    List of Backup Pieces for backup set 209 Copy #1
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    209     1   EXPIRED     /bak/orabakdata/backupdata/d-20140525-848449829-204-1.dbf

  Backup Set Copy #2 of backup set 209
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:00:08     29-MAY-14       NO         HOT_DB_BK_LEVEL0

    List of Backup Pieces for backup set 209 Copy #2
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    242     1   AVAILABLE   /data01/bak/bak/d-20140525-848449829-204-1.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
229     Full    845.80M    DISK        00:00:32     04-JUN-14     
        BP Key: 253   Status: AVAILABLE  Compressed: NO  Tag: TAG20140604T125631
        Piece Name: /data01/PRD12CDB/F6ACAF06A0755467E0430254800A2839/backupset/2014_06_04/o1_mf_nnndf_TAG20140604T125631_9rx9qzvy_.bkp
  List of Datafiles in backup set 229
  Container ID: 3, PDB Name: ZSKMSDB
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  9       Full 8216714    04-JUN-14 /data01/9.dbf
  10      Full 8216714    04-JUN-14 /data01/10.dbf
  11      Full 8216714    04-JUN-14 /data01/11.dbf
  16      Full 8216714    04-JUN-14 /data01/16.dbf
  17      Full 8216714    04-JUN-14 /data01/17.dbf
  19      Full 8216714    04-JUN-14 /data01/19.dbf
  20      Full 8216714    04-JUN-14 /data01/20.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
230     Full    3.03G      DISK        00:00:54     04-JUN-14     
        BP Key: 254   Status: AVAILABLE  Compressed: NO  Tag: TAG20140604T125631
        Piece Name: /data01/PRD12CDB/backupset/2014_06_04/o1_mf_nnndf_TAG20140604T125631_9rx9s32p_.bkp
  List of Datafiles in backup set 230
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  1       Full 8216727    04-JUN-14 /data01/1.dbf
  3       Full 8216727    04-JUN-14 /data01/3.dbf
  4       Full 8216727    04-JUN-14 /data01/4.dbf
  6       Full 8216727    04-JUN-14 /data01/6.dbf
  8       Full 8216727    04-JUN-14 /data01/8.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
231     Full    766.41M    DISK        00:00:13     04-JUN-14     
        BP Key: 255   Status: AVAILABLE  Compressed: NO  Tag: TAG20140604T125631
        Piece Name: /data01/PRD12CDB/F6ACE29ECAE0576BE0430254800A9CD6/backupset/2014_06_04/o1_mf_nnndf_TAG20140604T125631_9rx9tt7l_.bkp
  List of Datafiles in backup set 231
  Container ID: 4, PDB Name: OSSPORTALDB
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  12      Full 8216749    04-JUN-14 /data01/12.dbf
  13      Full 8216749    04-JUN-14 /data01/13.dbf
  18      Full 8216749    04-JUN-14 /data01/18.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
232     Full    740.93M    DISK        00:00:14     04-JUN-14     
        BP Key: 256   Status: AVAILABLE  Compressed: NO  Tag: TAG20140604T125631
        Piece Name: /data01/PRD12CDB/F6AC7D86579C49A9E0430254800A174B/backupset/2014_06_04/o1_mf_nnndf_TAG20140604T125631_9rx9v9c5_.bkp
  List of Datafiles in backup set 232
  Container ID: 2, PDB Name: PDB$SEED
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  5       Full 1921022    10-APR-14 /data01/5.dbf
  7       Full 1921022    10-APR-14 /data01/7.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
235     Full    845.90M    DISK        00:00:11     04-JUN-14     
        BP Key: 259   Status: AVAILABLE  Compressed: NO  Tag: 12CZSKMSDB_PDB
        Piece Name: /data01/PRD12CDB/F6ACAF06A0755467E0430254800A2839/backupset/2014_06_04/o1_mf_nnndf_12CZSKMSDB_PDB_9rxbfrgz_.bkp
  List of Datafiles in backup set 235
  Container ID: 3, PDB Name: ZSKMSDB-----这里就是pdb ZSKMSDB的备份!
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  9       Full 8220311    04-JUN-14 /data01/9.dbf
  10      Full 8220311    04-JUN-14 /data01/10.dbf
  11      Full 8220311    04-JUN-14 /data01/11.dbf
  16      Full 8220311    04-JUN-14 /data01/16.dbf
  17      Full 8220311    04-JUN-14 /data01/17.dbf
  19      Full 8220311    04-JUN-14 /data01/19.dbf
  20      Full 8220311    04-JUN-14 /data01/20.dbf

通过guid类识别:
SQL> SET LINES 150
SQL> SELECT CON_ID, DBID, CON_UID, GUID, NAME FROM v$pdbs;

    CON_ID       DBID    CON_UID GUID                             NAME
---------- ---------- ---------- -------------------------------- ------------------------------
         2 4087144141 4087144141 F6AC7D86579C49A9E0430254800A174B PDB$SEED
         3 3158352855 3158352855 F6ACAF06A0755467E0430254800A2839 ZSKMSDB
         4 2712832312 2712832312 F6ACE29ECAE0576BE0430254800A9CD6 OSSPORTALDB

备份某个pdb的表空间:
RMAN> BACKUP TABLESPACE  ZSKMSDB:system,sysaux;  

Starting backup at 04-JUN-14
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=3088 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
channel ORA_DISK_1: starting piece 1 at 04-JUN-14
channel ORA_DISK_1: finished piece 1 at 04-JUN-14
piece handle=/data01/PRD12CDB/backupset/2014_06_04/o1_mf_nnndf_TAG20140604T132426_9rxcdbdg_.bkp tag=TAG20140604T132426 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:35
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00019 name=/data01/19.dbf
input datafile file number=00009 name=/data01/9.dbf
channel ORA_DISK_1: starting piece 1 at 04-JUN-14
channel ORA_DISK_1: finished piece 1 at 04-JUN-14
piece handle=/data01/PRD12CDB/F6ACAF06A0755467E0430254800A2839/backupset/2014_06_04/o1_mf_nnndf_TAG20140604T132426_9rxcffkz_.bkp tag=TAG20140604T132426 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 04-JUN-14

Starting Control File and SPFILE Autobackup at 04-JUN-14
piece handle=/bak/orabakdata/controlfile/controlc-3299715205-20140604-02 comment=NONE
Finished Control File and SPFILE Autobackup at 04-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 9.dbf
rm: remove regular file `9.dbf'? y
[root@orat3 data01]# rm 10.dbf
rm: remove regular file `10.dbf'? y
[root@orat3 data01]#
[root@orat3 data01]#
[root@orat3 data01]# ls
11.dbf  13.dbf  17.dbf  19.dbf  20.dbf  4.dbf  6.dbf  8.dbf  current.256.844530693  lost+found  PROD12C
12.dbf  16.dbf  18.dbf  1.dbf   3.dbf   5.dbf  7.dbf  bak    current.261.844530693  PRD12CDB
[root@orat3 data01]#

SQL> shut abort
startupORACLE instance shut down.

SQL>


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 9 - see DBWR trace file
ORA-01110: data file 9: '/data01/9.dbf'


SQL> SQL> SQL> SQL> SQL> SQL>
SQL>
SQL> show padbs;
SP2-0158: unknown SHOW option "padbs"
SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       MOUNTED
         3 ZSKMSDB                        MOUNTED
         4 OSSPORTALDB                    MOUNTED
SQL> alter PLUGGABLE database all open;
alter PLUGGABLE database all open
*
ERROR at line 1:
ORA-01109: database not open


SQL>

恢复:

Recovery Manager: Release 12.1.0.1.0 - Production on Wed Jun 4 13:31:08 2014

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

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

RMAN>  RESTORE TABLESPACE system;;

Starting restore at 04-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: reading from backup piece /data01/PRD12CDB/backupset/2014_06_04/o1_mf_nnndf_TAG20140604T125631_9rx9s32p_.bkp
channel ORA_DISK_1: piece handle=/data01/PRD12CDB/backupset/2014_06_04/o1_mf_nnndf_TAG20140604T125631_9rx9s32p_.bkp tag=TAG20140604T125631
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:16
Finished restore at 04-JUN-14

RMAN> recover tablespace system;

Starting recover at 04-JUN-14
using channel ORA_DISK_1

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

Finished recover at 04-JUN-14

RMAN> RESTORE TABLESPACE sysaux;

Starting restore at 04-JUN-14
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=1543 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 00003 to /data01/3.dbf
channel ORA_DISK_1: reading from backup piece /data01/PRD12CDB/backupset/2014_06_04/o1_mf_nnndf_TAG20140604T132426_9rxcdbdg_.bkp
 recover tablespace sysaux;

 

channel ORA_DISK_1: piece handle=/data01/PRD12CDB/backupset/2014_06_04/o1_mf_nnndf_TAG20140604T132426_9rxcdbdg_.bkp tag=TAG20140604T132426
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:25
Finished restore at 04-JUN-14

RMAN>
Starting recover at 04-JUN-14
using channel ORA_DISK_1

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

Finished recover at 04-JUN-14

报错仍然:
startup
SQL>
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 9 - see DBWR trace file
ORA-01110: data file 9: '/data01/9.dbf'
---这里默认是恢复的容器库的表空间。
加pdbname重新恢复:
RMAN> RESTORE TABLESPACE  ZSKMSDB:system,sysaux; 

Starting restore at 04-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 00003 to /data01/3.dbf
channel ORA_DISK_1: reading from backup piece /data01/PRD12CDB/backupset/2014_06_04/o1_mf_nnndf_TAG20140604T132426_9rxcdbdg_.bkp
channel ORA_DISK_1: piece handle=/data01/PRD12CDB/backupset/2014_06_04/o1_mf_nnndf_TAG20140604T132426_9rxcdbdg_.bkp tag=TAG20140604T132426
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:25
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 00009 to /data01/9.dbf
channel ORA_DISK_1: restoring datafile 00019 to /data01/19.dbf
channel ORA_DISK_1: reading from backup piece /data01/PRD12CDB/F6ACAF06A0755467E0430254800A2839/backupset/2014_06_04/o1_mf_nnndf_TAG20140604T132426_9rxcffkz_.bkp
channel ORA_DISK_1: piece handle=/data01/PRD12CDB/F6ACAF06A0755467E0430254800A2839/backupset/2014_06_04/o1_mf_nnndf_TAG20140604T132426_9rxcffkz_.bkp tag=TAG20140604T132426
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:15
Finished restore at 04-JUN-14

RMAN> recover  TABLESPACE  ZSKMSDB:system,sysaux; 

Starting recover at 04-JUN-14
using channel ORA_DISK_1

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

Finished recover at 04-JUN-14

RMAN>

RMAN-06900: WARNING: unable to generate V$RMAN_STATUS or V$RMAN_OUTPUT row
RMAN-06901: WARNING: disabling update of the V$RMAN_STATUS and V$RMAN_OUTPUT rows
ORACLE error from target database:
ORA-03135: connection lost contact
Process ID: 30684
Session ID: 10775 Serial number: 11

RMAN>

RMAN>

RMAN> exit


Recovery Manager complete.
[oracle@orat3 ~]$ rman target /

Recovery Manager: Release 12.1.0.1.0 - Production on Wed Jun 4 13:43:10 2014

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

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

RMAN> RESTORE TABLESPACE  ZSKMSDB:sysaux; 

Starting restore at 04-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 00010 to /data01/10.dbf
channel ORA_DISK_1: restoring datafile 00020 to /data01/20.dbf
channel ORA_DISK_1: reading from backup piece /data01/PRD12CDB/F6ACAF06A0755467E0430254800A2839/backupset/2014_06_04/o1_mf_nnndf_12CZSKMSDB_PDB_9rxbfrgz_.bkp
channel ORA_DISK_1: piece handle=/data01/PRD12CDB/F6ACAF06A0755467E0430254800A2839/backupset/2014_06_04/o1_mf_nnndf_12CZSKMSDB_PDB_9rxbfrgz_.bkp tag=12CZSKMSDB_PDB
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:15
Finished restore at 04-JUN-14

RMAN>  recover  TABLESPACE  ZSKMSDB:sysaux;

Starting recover at 04-JUN-14
using channel ORA_DISK_1

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

Finished recover at 04-JUN-14

RMAN>


SQL> startup force;
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.
Database opened.
SQL>
Pdb数据文件恢复同上,这里不再说明,现在看看整个pdb的恢复:
删除pdb:
SQL> drop PLUGGABLE database ZSKMSDB;

Pluggable database dropped.
SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         4 OSSPORTALDB                    MOUNTED
SQL>
只能全容器库恢复了:

 

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

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值