[Oracle][PDB]PDB restore/recover 过程记录

简介:

友人给的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







本文转自健哥的数据花园博客园博客,原文链接:http://www.cnblogs.com/gaojian/p/7609901.html,如需转载请自行联系原作者

目录
相关文章
|
Oracle 关系型数据库 数据库
百度搜索:蓝易云【docker部署并配置oracle12c的cdb和pdb教程!】
以上是使用Docker部署和配置Oracle 12c CDB和PDB的简要教程。请注意,这只是一个概述,并且可能需要根据你的实际情况进行适当的调整和配置。建议参考Oracle官方文档和相关资源,以获得更详细和全面的指导。
140 2
|
6月前
|
Oracle 关系型数据库 数据库
|
SQL Oracle 关系型数据库
Oracle 19c 启动和关闭实例保存PDB状态
十年以上 MySQL Oracle DBA从业者,MySQL 5.7 OCP, 微信号: jinjushuke
330 0
|
Oracle 关系型数据库
oracle 12c新功能 recover table恢复单个表
不支持sys用户和system表空间的表
141 0
|
Oracle 关系型数据库
Oracle重命名PDB
Oracle重命名PDB
125 0
|
SQL 存储 Oracle
Oracle学习笔记之Oracle19c中的CDB与PDB
Oracle学习笔记之Oracle19c中的CDB与PDB
14830 0
Oracle学习笔记之Oracle19c中的CDB与PDB
|
存储 Oracle 关系型数据库
Oracle学习笔记之Oracle 12C 使用seed创建PDB
Oracle学习笔记之Oracle 12C 使用seed创建PDB
4820 0
Oracle学习笔记之Oracle 12C 使用seed创建PDB
|
Oracle 关系型数据库
Oracle学习笔记之12C中的PDB自启动
Oracle学习笔记之12C中的PDB自启动
1046 0
|
SQL 监控 Oracle
Oracle 12c之后CDB上创建公共用户无法访问PDB 上v$session表内容
Oracle 12c CDB模式下,创建公共用户,登录到CDB,无法查看PDB下一些表的信息,如v$session,登录到具体PDB才能看到,这篇文章将介绍如何给公共用户授权解决这个问题。
1741 0
|
运维 监控 Oracle
3月19日直播【从12c到20c,Oracle多租户之10046跟踪PDB关库案例原理解析】
本次分享将针对DevOps代码质量审核、监控、开发环境测试、生产环境测试这四个方面存在的问题进行剖析并给出解决之道,希望能助您全面转型DevOps。
699 0