友人给的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. Android Studio 使用ViewPager + Fragment实现滑动菜单Tab效果 --简易版

    描述: 之前有做过一个记账本APP,拿来练手的,做的很简单,是用Eclipse开发的: 最近想把这个APP重新完善一下,添加了一些新的功能,并选用Android Studio来开发: APP已经完善了 ...

  2. (网页)20个JS 小技巧超级实用

    转自CSDN: 1. 将彻底屏蔽鼠标右键 oncontextmenu=”window.event.returnValue=false”< table border oncontextmenu=r ...

  3. 获取元素的最终background-color

    一.题目  用JS代码求出页面上一个元素的最终的background-color,不考虑IE浏览器,不考虑元素float情况.(题目copy自网上) 二.题目解析  1.考察底层JavaScript基 ...

  4. ext与xfs文件系统比较与总结

    centos7.0开始默认文件系统是xfs,centos6是ext4,centos5是ext3 1.EXT2简介 EXT2第二代扩展文件系统(英语:second extended filesystem ...

  5. oracle FLASHBACK TABLE

    闪回表 -- 开启行迁移 ALTER TABLE employees_test ENABLE ROW MOVEMENT; UPDATE employees_test SET salary = sala ...

  6. JQuery实现1024小游戏

    最近用Jqery写了一个1024小游戏,由于是第一次写小游戏,所以就选了一个基础的没什么难度游戏.具体实现如下: 首先在开发时将整个游戏分成两层(自认为),底层是游戏的数据结构以及对数据的操作,上层是 ...

  7. Github API

    Web API web api是网站的一部分,用于与使用非常具体的URL请求特定信息的程序交互,这种请求被称为API调用.请求的数据将以易于处理的格式(如JSON或CSV)返回:依赖于外部数据源的大多 ...

  8. windows下编写shell脚本执行错误

    在 windows 下,换行符是 \r\n,在linux下,换行符是 \n.如果你在IDEA里写sh脚本,可以手动设置脚本的换行符为 \n,如果你用notepad++写脚本,可以显示所有字符,以便明确 ...

  9. java web,从零开始,一步一步配置ssm(Spring+SpringMVC+MyBatis)框架

    1.安装JDK: 安装之后要配置环境变量,在系统变量里: 新建变量名JAVA_HOME,变量值C:\Program Files\Java\jdk1.8.0_77: 新建变量名CLASSPATH,变量值 ...

  10. 安装eclipse、maven等JAVA开发环境

    一 下载JAVA,这是官方JAVA8的下载地址,包含了JDK和JRE: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-dow ...