友人给的PDB restore / recover 的过程。

实际上会创建一个辅助Instance,然后抽取出PDB,进行恢复。

(10:31:59) frank.yan: [Administrator.WIN-7ZFXNFKSD8P] ➤ ./rman target /

Recovery Manager: Release 12.1.0.1.0 - Production on Fri May 19 14:44:05 2017

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

connected to target database: ORCL (DBID=1471571033)

RMAN> ALTER PLUGGABLE DATABASE orcl2pdb CLOSE; ★

using target database control file instead of recovery catalog
Statement processed

RMAN> run
{
 set until time "to_date('2017-05-19 11:25:00','yyyy-mm-dd hh24:mi:ss')"; ★
 RESTORE PLUGGABLE DATABASE orcl2pdb; ★
 RECOVER PLUGGABLE DATABASE orcl2pdb; ★
}2> 3> 4> 5> 6>

executing command: SET until clause

Starting restore at 2017-05-19_14:44:41
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=25 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 C:\APP\ORCLHOMEUSER\ORADATA\ORCL\ORCL2PDB\SYSTEM01.DBF
channel ORA_DISK_1: restoring datafile 00011 to C:\APP\ORCLHOMEUSER\ORADATA\ORCL\ORCL2PDB\SYSAUX01.DBF
channel ORA_DISK_1: restoring datafile 00012 to C:\APP\ORCLHOMEUSER\ORADATA\ORCL\ORCL2PDB\ORCL2PDB_USERS01.DBF
channel ORA_DISK_1: reading from backup piece C:\APP\ORCLHOMEUSER\FAST_RECOVERY_AREA\ORCL\12819F783C454B38B6D844D4C0E70DAB\BACKUPSET\2017_05_19\O1_MF_NNNDF_CTGM_DAILY_ORA_20170_DKWOO8NX_.BKP
channel ORA_DISK_1: piece handle=C:\APP\ORCLHOMEUSER\FAST_RECOVERY_AREA\ORCL\12819F783C454B38B6D844D4C0E70DAB\BACKUPSET\2017_05_19\O1_MF_NNNDF_CTGM_DAILY_ORA_20170_DKWOO8NX_.BKP tag=CTGM_DAILY_ORA_201705191020
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:36
Finished restore at 2017-05-19_14:45:17

Starting recover at 2017-05-19_14:45:17
using channel ORA_DISK_1
RMAN-05026: WARNING: presuming following set of tablespaces applies to specified Point-in-Time

List of tablespaces expected to have UNDO segments
Tablespace SYSTEM
Tablespace UNDOTBS1

Creating automatic instance, with SID='xqny'

initialization parameters used for automatic instance:
db_name=ORCL
db_unique_name=xqny_pitr_orcl2pdb_ORCL
compatible=12.1.0.0.0
db_block_size=8192
db_files=200
sga_target=1G
processes=80
diagnostic_dest=C:\APP\ORCLHOMEUSER
_system_trig_enabled=FALSE
#No auxiliary destination in use
enable_pluggable_database=true
_clone_one_pdb_recovery=true
control_files=C:\APP\ORCLHOMEUSER\FAST_RECOVERY_AREA\ORCL\CONTROLFILE\O1_MF_DKX1MFKW_.CTL
#No auxiliary parameter file used

starting up automatic instance ORCL

Oracle instance started

Total System Global Area    1068937216 bytes

Fixed Size                     2973040 bytes
Variable Size                281019024 bytes
Database Buffers             780140544 bytes
Redo Buffers                   4804608 bytes
Automatic instance created

contents of Memory Script:
{
# set requested point in time
set until  time "to_date('2017-05-19 11:25:00','yyyy-mm-dd hh24:mi:ss')";
# restore the controlfile
restore clone controlfile;
# mount the controlfile
sql clone 'alter database mount clone database';
}
executing Memory Script

executing command: SET until clause

Starting restore at 2017-05-19_14:46:09
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=11 device type=DISK

channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: reading from backup piece C:\APP\ORCLHOMEUSER\FAST_RECOVERY_AREA\ORCL\AUTOBACKUP\2017_05_19\O1_MF_S_944392960_DKWOQL42_.BKP
channel ORA_AUX_DISK_1: piece handle=C:\APP\ORCLHOMEUSER\FAST_RECOVERY_AREA\ORCL\AUTOBACKUP\2017_05_19\O1_MF_S_944392960_DKWOQL42_.BKP tag=TAG20170519T112240
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:02
output file name=C:\APP\ORCLHOMEUSER\FAST_RECOVERY_AREA\ORCL\CONTROLFILE\O1_MF_DKX1MFKW_.CTL
Finished restore at 2017-05-19_14:46:11

sql statement: alter database mount clone database

contents of Memory Script:
{
# set requested point in time
set until  time "to_date('2017-05-19 11:25:00','yyyy-mm-dd hh24:mi:ss')";
# switch to valid datafilecopies
switch clone datafile  10 to datafilecopy
"C:\APP\ORCLHOMEUSER\ORADATA\ORCL\ORCL2PDB\SYSTEM01.DBF";
switch clone datafile  11 to datafilecopy
"C:\APP\ORCLHOMEUSER\ORADATA\ORCL\ORCL2PDB\SYSAUX01.DBF";
switch clone datafile  12 to datafilecopy
"C:\APP\ORCLHOMEUSER\ORADATA\ORCL\ORCL2PDB\ORCL2PDB_USERS01.DBF";
# set destinations for recovery set and auxiliary set datafiles
set newname for datafile  1 to
"C:\APP\ORCLHOMEUSER\FAST_RECOVERY_AREA\ORCL\DATAFILE\O1_MF_SYSTEM_DKX1O0XH_.DBF";
set newname for datafile  5 to
"C:\APP\ORCLHOMEUSER\FAST_RECOVERY_AREA\ORCL\DATAFILE\O1_MF_UNDOTBS1_DKX1O0YY_.DBF";
set newname for datafile  3 to
"C:\APP\ORCLHOMEUSER\FAST_RECOVERY_AREA\ORCL\DATAFILE\O1_MF_SYSAUX_DKX1O124_.DBF";
set newname for datafile  6 to
"C:\APP\ORCLHOMEUSER\FAST_RECOVERY_AREA\ORCL\DATAFILE\O1_MF_USERS_DKX1O93O_.DBF";
# restore the tablespaces in the recovery set and the auxiliary set
restore clone datafile  1, 5, 3, 6;
switch clone datafile all;
}
executing Memory Script

executing command: SET until clause

datafile 10 switched to datafile copy
input datafile copy RECID=1 STAMP=944405178 file name=C:\APP\ORCLHOMEUSER\ORADATA\ORCL\ORCL2PDB\SYSTEM01.DBF

datafile 11 switched to datafile copy
input datafile copy RECID=2 STAMP=944405178 file name=C:\APP\ORCLHOMEUSER\ORADATA\ORCL\ORCL2PDB\SYSAUX01.DBF

datafile 12 switched to datafile copy
input datafile copy RECID=3 STAMP=944405178 file name=C:\APP\ORCLHOMEUSER\ORADATA\ORCL\ORCL2PDB\ORCL2PDB_USERS01.DBF

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 2017-05-19_14:46:18
using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00001 to C:\APP\ORCLHOMEUSER\FAST_RECOVERY_AREA\ORCL\DATAFILE\O1_MF_SYSTEM_DKX1O0XH_.DBF
channel ORA_AUX_DISK_1: restoring datafile 00005 to C:\APP\ORCLHOMEUSER\FAST_RECOVERY_AREA\ORCL\DATAFILE\O1_MF_UNDOTBS1_DKX1O0YY_.DBF
channel ORA_AUX_DISK_1: restoring datafile 00003 to C:\APP\ORCLHOMEUSER\FAST_RECOVERY_AREA\ORCL\DATAFILE\O1_MF_SYSAUX_DKX1O124_.DBF
channel ORA_AUX_DISK_1: restoring datafile 00006 to C:\APP\ORCLHOMEUSER\FAST_RECOVERY_AREA\ORCL\DATAFILE\O1_MF_USERS_DKX1O93O_.DBF
channel ORA_AUX_DISK_1: reading from backup piece C:\APP\ORCLHOMEUSER\FAST_RECOVERY_AREA\ORCL\BACKUPSET\2017_05_19\O1_MF_NNNDF_CTGM_DAILY_ORA_20170_DKWOM7FY_.BKP
channel ORA_AUX_DISK_1: piece handle=C:\APP\ORCLHOMEUSER\FAST_RECOVERY_AREA\ORCL\BACKUPSET\2017_05_19\O1_MF_NNNDF_CTGM_DAILY_ORA_20170_DKWOM7FY_.BKP tag=CTGM_DAILY_ORA_201705191020
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:01:36
Finished restore at 2017-05-19_14:47:55

datafile 1 switched to datafile copy
input datafile copy RECID=8 STAMP=944405275 file name=C:\APP\ORCLHOMEUSER\FAST_RECOVERY_AREA\ORCL\DATAFILE\O1_MF_SYSTEM_DKX1O0XH_.DBF
datafile 5 switched to datafile copy
input datafile copy RECID=9 STAMP=944405275 file name=C:\APP\ORCLHOMEUSER\FAST_RECOVERY_AREA\ORCL\DATAFILE\O1_MF_UNDOTBS1_DKX1O0YY_.DBF
datafile 3 switched to datafile copy
input datafile copy RECID=10 STAMP=944405276 file name=C:\APP\ORCLHOMEUSER\FAST_RECOVERY_AREA\ORCL\DATAFILE\O1_MF_SYSAUX_DKX1O124_.DBF
datafile 6 switched to datafile copy
input datafile copy RECID=11 STAMP=944405276 file name=C:\APP\ORCLHOMEUSER\FAST_RECOVERY_AREA\ORCL\DATAFILE\O1_MF_USERS_DKX1O93O_.DBF

contents of Memory Script:
{
# set requested point in time
set until  time "to_date('2017-05-19 11:25:00','yyyy-mm-dd hh24:mi:ss')";
# online the datafiles restored or switched
sql clone "alter database datafile  1 online";
sql clone "alter database datafile  5 online";
sql clone "alter database datafile  3 online";
sql clone 'ORCL2PDB' "alter database datafile
10 online";
sql clone 'ORCL2PDB' "alter database datafile
11 online";
sql clone 'ORCL2PDB' "alter database datafile
12 online";
sql clone "alter database datafile  6 online";
# recover pdb
recover clone database tablespace  "SYSTEM", "UNDOTBS1", "SYSAUX", "USERS" pluggable database
'ORCL2PDB'   delete archivelog;
sql clone 'alter database open read only';
plsql >>;
plsql >>;
# shutdown clone before import
shutdown clone abort
plsql  'ORCL2PDB');
end; >>>;
}
executing Memory Script

executing command: SET until clause

sql statement: alter database datafile  1 online

sql statement: alter database datafile  5 online

sql statement: alter database datafile  3 online

sql statement: alter database datafile  10 online

sql statement: alter database datafile  11 online

sql statement: alter database datafile  12 online

sql statement: alter database datafile  6 online

Starting recover at 2017-05-19_14:47:57
using channel ORA_AUX_DISK_1

starting media recovery

archived log for thread 1 with sequence 197 is already on disk as file C:\APP\ORCLHOMEUSER\FAST_RECOVERY_AREA\ORCL\ARCHIVELOG\2017_05_19\O1_MF_1_197_DKWOQH74_.ARC
archived log for thread 1 with sequence 198 is already on disk as file C:\APP\ORCLHOMEUSER\FAST_RECOVERY_AREA\ORCL\ARCHIVELOG\2017_05_19\O1_MF_1_198_DKWPMJPQ_.ARC
archived log file name=C:\APP\ORCLHOMEUSER\FAST_RECOVERY_AREA\ORCL\ARCHIVELOG\2017_05_19\O1_MF_1_197_DKWOQH74_.ARC thread=1 sequence=197
archived log file name=C:\APP\ORCLHOMEUSER\FAST_RECOVERY_AREA\ORCL\ARCHIVELOG\2017_05_19\O1_MF_1_198_DKWPMJPQ_.ARC thread=1 sequence=198
media recovery complete, elapsed time: 00:00:01
Finished recover at 2017-05-19_14:48:01

sql statement: alter database open read only

Oracle instance shut down

Removing automatic instance
Automatic instance removed
auxiliary instance file C:\APP\ORCLHOMEUSER\FAST_RECOVERY_AREA\ORCL\DATAFILE\O1_MF_SYSAUX_DKX1O124_.DBF deleted
auxiliary instance file C:\APP\ORCLHOMEUSER\FAST_RECOVERY_AREA\ORCL\CONTROLFILE\O1_MF_DKX1MFKW_.CTL deleted
Finished recover at 2017-05-19_14:48:21

RMAN> ALTER PLUGGABLE DATABASE orcl2pdb OPEN RESETLOGS; ★

Statement processed

[Oracle][PDB]PDB restore/recover 过程记录的更多相关文章

  1. Oracle 12c: RMAN restore/recover pluggable database

    查看数据库状态 运行在归档模式,可拔插数据库name=pdborcl SQL> archive log list; Database log mode Archive Mode Automati ...

  2. oracle 12cR2 RAC deconfig CRS过程记录

    已经停了该节点的crs所有服务: [root@jhjzksrv02 install]# ./rootcrs.sh -force -deconfig -verboseUsing configuratio ...

  3. 实验记录:Oracle redo logfile的resize过程

    实验记录:Oracle redo logfile的resize过程. 实验环境:RHEL 6.4 + Oracle 11.2.0.3 单实例 文件系统 实验目的:本实验是修改redo logfile的 ...

  4. [Oracle][Standby][PDB]在PDB中修改参数,设置范围为 SPFILE,报 ORA-65099错误

    [Oracle][Standby][PDB]在PDB中修改参数,设置范围为 SPFILE,报 ORA-65099错误 在Data Gaurd 的 Standby (或 CDB 是 Read Only ...

  5. oracle 12c pdb开启和关闭

    oracle 12c pdb开启和关闭 //开启数据库 sqlplus / as sysdba;                  //登录连接CDB,默认是root container;startu ...

  6. 【12c】12c RMAN新特性之通过网络远程恢复数据库(RESTORE/Recover from Service)

    [12c]12c RMAN新特性之通过网络远程恢复数据库(RESTORE/Recover from Service) 通过网络远程恢复数据库(Restore/Recover from Service) ...

  7. Oracle数据迁移至HBase操作记录

    Oracle数据迁移至HBase操作记录 @(HBase) 近期需要把Oracle数据库中的十几张表T级别的数据迁移至HBase中,过程中遇到了许多苦难和疑惑,在此记录一下希望能帮到一些有同样需求的兄 ...

  8. Windows平台下Oracle监听服务启动过程中日志输出

    Windows平台下Oracle监听服务启动过程中日志输出记录. 日志目录:D:\app\Administrator\diag\tnslsnr\WIN-RU03CB21QGA\listener\tra ...

  9. oracle pl/sql远程连接过程

    之前没用过oracle,现在公司用到就记录下安装过程吧.安装PL/SQL工具,安装oracle11G工具.打开PL/SQL 进行配置.

随机推荐

  1. Linux 学习笔记之超详细基础linux命令 Part 9

    Linux学习笔记之超详细基础linux命令 by:授客 QQ:1033553122 ---------------------------------接Part 8----------------- ...

  2. Android--清除默认桌面设置和设置默认桌面(转)

    http://blog.csdn.net/chaozhung_no_l/article/details/49929177 转自这位大神的博客,感谢这位大神,帮了大忙,谢谢!!

  3. drop all database objects

    /*Use this sql to drop all objects in a database.*/ -- Drop all SPdeclare @dropSp varchar(max)=''sel ...

  4. 关掉 ubuntu bug 报告功能

    想关掉这个: 通过服务加配置文件关掉

  5. MDX 脚本语句 -- Scope

    在多维表达式 (MDX) 中,下列语句用于管理 MDX 脚本中的上下文.作用域和流控制. 主题 说明 calculate语句 计算子多维数据集,还可以确定子多维数据集中所包含的求解次序 case语句 ...

  6. 薛兆丰吴军何帆曾鸣万维刚李笑来罗永浩等得到APP专栏作者的书23本

    最近看了何帆的<大局观>,是他在得到APP的专栏文章的精选.顺便整理以下最近两三年内看过的得到APP其他专栏与课程作者的得到精选文集和他们写过的其他的书共23本. 薛兆丰 4星|<薛 ...

  7. java.lang.RuntimeException: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.demoDao.getXXX;

    java.lang.RuntimeException: org.apache.ibatis.binding.BindingException: Invalid bound statement (not ...

  8. 解决MySQL Workbench导出乱码问题

    1.导出数据 2.默认CSV格式 3.乱码 4.解决 文件->另存为,会发现编码为UTF-8,正是MySQL表的编码方式.我们选择编码方式为ANSI,保存类型为所有,覆盖源文件

  9. 用Python读写Excel文件的方式比较

    虽然天天跟数据打交道,也频繁地使用Excel进行一些简单的数据处理和展示,但长期以来总是小心地避免用Python直接读写Excel文件.通常我都是把数据保存为以TAB分割的文本文件(TSV),再在Ex ...

  10. git 常用命令清单