12C的PDB使用RMAN不完全恢复drop user场景
来源:互联网 发布:男性保健药品 知乎 编辑:程序博客网 时间:2024/06/09 01:12
模拟故障
SQL> alter session set container=pdb4;Session altered.SQL> select systimestamp from dual;SYSTIMESTAMP---------------------------------------------------------------------------11-JUN-17 10.32.42.670589 PM +08:00SQL> drop user test cascade;User dropped.
恢复
RMAN> run2> {3> set until time "to_date('2017-06-11 22:32:42','YYYY-MM-DD HH24:MI:SS')";4> restore pluggable database pdb4;5> recover pluggable database pdb4;6> }executing command: SET until clauseStarting restore at 11-JUN-17using target database control file instead of recovery catalogallocated channel: ORA_DISK_1channel ORA_DISK_1: SID=26 device type=DISKcreating datafile file number=41 name=/u01/app/oracle/oradata/zylong/pdb4/pdb4/users01.dbfRMAN-00571: ===========================================================RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============RMAN-00571: ===========================================================RMAN-03002: failure of restore command at 06/11/2017 22:39:06ORA-01182: cannot create database file 41 - file is in use or recoveryORA-01110: data file 41: '/u01/app/oracle/oradata/zylong/pdb4/pdb4/users01.dbf'
需要关闭PDB
SQL> conn / as sysdbaConnected.SQL> alter pluggable database pdb4 close;Pluggable database altered.SQL> show pdbs; CON_ID CON_NAME OPEN MODE RESTRICTED---------- ------------------------------ ---------- ---------- 2 PDB$SEED READ ONLY NO 3 SEED_PDB MOUNTED 4 NONCDB_PDP MOUNTED 5 CLON_PDB MOUNTED 6 TEST_PDB READ WRITE NO 7 PDB4 MOUNTED
再次恢复
RMAN> run2> {3> set until time "to_date('2017-06-11 22:32:42','YYYY-MM-DD HH24:MI:SS')";4> restore pluggable database pdb4;5> recover pluggable database pdb4;6> }executing command: SET until clauseStarting restore at 11-JUN-17using channel ORA_DISK_1creating datafile file number=41 name=/u01/app/oracle/oradata/zylong/pdb4/pdb4/users01.dbfchannel ORA_DISK_1: starting datafile backup set restorechannel ORA_DISK_1: specifying datafile(s) to restore from backup setchannel ORA_DISK_1: restoring datafile 00038 to /u01/app/oracle/oradata/zylong/pdb4/pdb4/system01.dbfchannel ORA_DISK_1: restoring datafile 00039 to /u01/app/oracle/oradata/zylong/pdb4/pdb4/sysaux01.dbfchannel ORA_DISK_1: restoring datafile 00040 to /u01/app/oracle/oradata/zylong/pdb4/pdb4/undotbs01.dbfchannel ORA_DISK_1: reading from backup piece /u01/app/oracle/product/12.2.0/db_1/dbs/06s6i7hv_1_1channel ORA_DISK_1: piece handle=/u01/app/oracle/product/12.2.0/db_1/dbs/06s6i7hv_1_1 tag=TAG20170611T202849channel ORA_DISK_1: restored backup piece 1channel ORA_DISK_1: restore complete, elapsed time: 00:00:07Finished restore at 11-JUN-17Starting recover at 11-JUN-17RMAN-00571: ===========================================================RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============RMAN-00571: ===========================================================RMAN-03002: failure of recover command at 06/11/2017 22:41:19RMAN-05107: AUXILIARY DESTINATION option is not specified
需要指定AUXILIARY DESTINATION
RMAN> run2> {3> set until time "to_date('2017-06-11 22:30:42','YYYY-MM-DD HH24:MI:SS')";4> restore pluggable database pdb4;5> recover pluggable database pdb4 AUXILIARY DESTINATION '/tmp';6> }executing command: SET until clauseStarting restore at 11-JUN-17using channel ORA_DISK_1creating datafile file number=41 name=/u01/app/oracle/oradata/zylong/pdb4/pdb4/users01.dbfchannel ORA_DISK_1: starting datafile backup set restorechannel ORA_DISK_1: specifying datafile(s) to restore from backup setchannel ORA_DISK_1: restoring datafile 00038 to /u01/app/oracle/oradata/zylong/pdb4/pdb4/system01.dbfchannel ORA_DISK_1: restoring datafile 00039 to /u01/app/oracle/oradata/zylong/pdb4/pdb4/sysaux01.dbfchannel ORA_DISK_1: restoring datafile 00040 to /u01/app/oracle/oradata/zylong/pdb4/pdb4/undotbs01.dbfchannel ORA_DISK_1: reading from backup piece /u01/app/oracle/product/12.2.0/db_1/dbs/06s6i7hv_1_1channel ORA_DISK_1: piece handle=/u01/app/oracle/product/12.2.0/db_1/dbs/06s6i7hv_1_1 tag=TAG20170611T202849channel ORA_DISK_1: restored backup piece 1channel ORA_DISK_1: restore complete, elapsed time: 00:00:07Finished restore at 11-JUN-17Starting recover at 11-JUN-17using channel ORA_DISK_1starting media recoverymedia recovery complete, elapsed time: 00:00:01Finished recover at 11-JUN-17
启动PDB测试
RMAN> Alter pluggable database pdb4 open resetlogs;Statement processed测试SQL> conn test/oracle@192.168.16.81:1521/pdb4Connected.SQL> select count(*) from test; COUNT(*)---------- 396
阅读全文
0 0
- 12C的PDB使用RMAN不完全恢复drop user场景
- 12C的PDB使用RMAN的4种完全恢复场景
- RMAN的不完全恢复
- 使用RMAN的不完全恢复-基于时间/SCN/日志序列
- 使用RMAN的不完全恢复-基于时间/SCN/日志序列
- rman 时间点的不完全恢复
- RMAN基于时间点的不完全恢复
- RMAN 的向前滚动式不完全恢复
- Oracle基于RMAN的不完全恢复
- RMAN的不完全恢复(归档模式)
- rman 基于时间的不完全恢复
- rman基于SCN的不完全恢复
- RMAN不完全恢复
- rman实现不完全恢复
- Oracle RMAN -不完全恢复
- Oracle 基于 RMAN 的不完全恢复(incomplete recovery by RMAN)
- Oracle 基于 RMAN 的不完全恢复(incomplete recovery by RMAN)
- rman恢复-不完全恢复
- Spring Cloud构建微服务架构:服务消费(Feign)【Dalston版】
- java运行时不跑主函数
- JavaWeb项目缓存从 ehcache 切换到 redis
- Spark SQL之案例实战(四)
- 推荐几种靠谱的离职原因回答策略
- 12C的PDB使用RMAN不完全恢复drop user场景
- 反转链表
- Hibernate 事务
- 用python写的一次爬虫经历
- C语言数据类型32位和64位不同
- html&css的三种结合方式
- Java线程池种类及示例
- redis
- 用Python做数据分析初探(四)