使用RMAN对CDB的root执行完全恢复
发表于:2025-01-21 作者:千家信息网编辑
千家信息网最后更新 2025年01月21日,如果数据损坏或用户错误只影响CDB的root容器,那么可能只会考虑恢复root容器。然而,Oracle强烈建议你在恢复root容器后恢复所有的PDB来阻止root与PDB中的元数据不一致的情况。在这种
千家信息网最后更新 2025年01月21日使用RMAN对CDB的root执行完全恢复
如果数据损坏或用户错误只影响CDB的root容器,那么可能只会考虑恢复root容器。然而,Oracle强烈建议你在恢复root容器后恢复所有的PDB来阻止root与PDB中的元数据不一致的情况。在这种情况下,更好的方法是对整个CDB执行恢复操作。
使用RMAN对root执行完全恢复的操作如下:
1.启动RMAN并以有sysdba或sysbackup权限的公共用户连接到root容器。
[oracle@jytest1 ~]$ rman target/ catalog rco/xxxxxx@jypdb Recovery Manager: Release 12.2.0.1.0 - Production on Mon Dec 11 15:55:18 2017Copyright (c) 1982, 2017, Oracle and/or its affiliates. All rights reserved.connected to target database: JY (DBID=979425723, not open)connected to recovery catalog database
2.将整个CDB启动到mount状态
SQL> shutdown immediateDatabase closed.Database dismounted.ORACLE instance shut down.SQL> startup mountORACLE instance started.Total System Global Area 6442450944 bytesFixed Size 8807168 bytesVariable Size 1895828736 bytesDatabase Buffers 4529848320 bytesRedo Buffers 7966720 bytesDatabase mounted.SQL> select name from v$pdbs;NAME--------------------------------------------------------------------------------PDB$SEEDJYPDB
3.可选操作,使用configure命令来配置缺省的设备类型与自动通道。
4.执行以下命令来还原与恢复root容器
RMAN> restore database root;Starting restore at 11-DEC-17starting full resync of recovery catalogfull resync completeallocated channel: ORA_DISK_1channel ORA_DISK_1: SID=1521 instance=jy1 device type=DISKchannel ORA_DISK_1: starting datafile backup set restorechannel ORA_DISK_1: specifying datafile(s) to restore from backup setchannel ORA_DISK_1: restoring datafile 00001 to +DATA/JY/DATAFILE/system.317.962209603channel ORA_DISK_1: restoring datafile 00003 to +DATA/JY/DATAFILE/sysaux.298.962209605channel ORA_DISK_1: restoring datafile 00004 to +DATA/JY/DATAFILE/undotbs1.277.962209605channel ORA_DISK_1: restoring datafile 00007 to +DATA/JY/DATAFILE/users.301.962209605channel ORA_DISK_1: restoring datafile 00009 to +DATA/JY/DATAFILE/undotbs2.312.962209605channel ORA_DISK_1: reading from backup piece +TEST/rman_backup/jy_979425723_20171208_0fslkbg2_1_1channel ORA_DISK_1: piece handle=+TEST/rman_backup/jy_979425723_20171208_0fslkbg2_1_1 tag=TAG20171208T165528channel ORA_DISK_1: restored backup piece 1channel ORA_DISK_1: restore complete, elapsed time: 00:00:45Finished restore at 11-DEC-17RMAN> recover database root;Starting recover at 11-DEC-17using channel ORA_DISK_1starting media recoveryarchived log for thread 1 with sequence 14 is already on disk as file +TEST/arch/1_14_961976319.dbfarchived log for thread 1 with sequence 15 is already on disk as file +TEST/arch/1_15_961976319.dbfarchived log for thread 1 with sequence 16 is already on disk as file +TEST/arch/1_16_961976319.dbfarchived log for thread 1 with sequence 17 is already on disk as file +TEST/arch/1_17_961976319.dbfarchived log for thread 1 with sequence 18 is already on disk as file +TEST/arch/1_18_961976319.dbfarchived log for thread 1 with sequence 19 is already on disk as file +TEST/arch/1_19_961976319.dbfarchived log for thread 1 with sequence 20 is already on disk as file +TEST/arch/1_20_961976319.dbfarchived log for thread 1 with sequence 21 is already on disk as file +TEST/arch/1_21_961976319.dbfarchived log for thread 1 with sequence 22 is already on disk as file +TEST/arch/1_22_961976319.dbfarchived log for thread 1 with sequence 23 is already on disk as file +TEST/arch/1_23_961976319.dbfarchived log for thread 1 with sequence 24 is already on disk as file +TEST/arch/1_24_961976319.dbfarchived log for thread 1 with sequence 25 is already on disk as file +TEST/arch/1_25_961976319.dbfarchived log for thread 1 with sequence 26 is already on disk as file +TEST/arch/1_26_961976319.dbfarchived log for thread 1 with sequence 27 is already on disk as file +TEST/arch/1_27_961976319.dbfarchived log for thread 2 with sequence 12 is already on disk as file +TEST/arch/2_12_961976319.dbfarchived log for thread 2 with sequence 13 is already on disk as file +TEST/arch/2_13_961976319.dbfarchived log for thread 2 with sequence 14 is already on disk as file +TEST/arch/2_14_961976319.dbfarchived log for thread 2 with sequence 15 is already on disk as file +TEST/arch/2_15_961976319.dbfarchived log for thread 2 with sequence 16 is already on disk as file +TEST/arch/2_16_961976319.dbfarchived log for thread 2 with sequence 17 is already on disk as file +TEST/arch/2_17_961976319.dbfarchived log for thread 2 with sequence 18 is already on disk as file +TEST/arch/2_18_961976319.dbfarchived log for thread 2 with sequence 19 is already on disk as file +TEST/arch/2_19_961976319.dbfarchived log for thread 2 with sequence 20 is already on disk as file +TEST/arch/2_20_961976319.dbfarchived log file name=+TEST/arch/1_14_961976319.dbf thread=1 sequence=14archived log file name=+TEST/arch/2_12_961976319.dbf thread=2 sequence=12archived log file name=+TEST/arch/1_15_961976319.dbf thread=1 sequence=15archived log file name=+TEST/arch/2_13_961976319.dbf thread=2 sequence=13archived log file name=+TEST/arch/1_16_961976319.dbf thread=1 sequence=16archived log file name=+TEST/arch/1_17_961976319.dbf thread=1 sequence=17archived log file name=+TEST/arch/2_14_961976319.dbf thread=2 sequence=14archived log file name=+TEST/arch/1_18_961976319.dbf thread=1 sequence=18archived log file name=+TEST/arch/1_19_961976319.dbf thread=1 sequence=19archived log file name=+TEST/arch/1_20_961976319.dbf thread=1 sequence=20archived log file name=+TEST/arch/2_15_961976319.dbf thread=2 sequence=15archived log file name=+TEST/arch/1_21_961976319.dbf thread=1 sequence=21archived log file name=+TEST/arch/1_22_961976319.dbf thread=1 sequence=22archived log file name=+TEST/arch/2_16_961976319.dbf thread=2 sequence=16archived log file name=+TEST/arch/1_23_961976319.dbf thread=1 sequence=23archived log file name=+TEST/arch/1_24_961976319.dbf thread=1 sequence=24archived log file name=+TEST/arch/2_17_961976319.dbf thread=2 sequence=17archived log file name=+TEST/arch/1_25_961976319.dbf thread=1 sequence=25archived log file name=+TEST/arch/2_18_961976319.dbf thread=2 sequence=18archived log file name=+TEST/arch/1_26_961976319.dbf thread=1 sequence=26media recovery complete, elapsed time: 00:06:07Finished recover at 11-DEC-17starting full resync of recovery catalogfull resync complete
5.检查输出结果查看是否介质恢复成功。如果介质恢复成功继续下面的操作
6.强烈建议的操作,恢复所有PDB,包括CDB seed
RMAN> restore pluggable database 'PDB$SEED',jypdb;Starting restore at 11-DEC-17using channel ORA_DISK_1skipping datafile 5; already restored to file +DATA/JY/5F9AA264B21F3ED9E053AB828A0A6088/DATAFILE/system.256.962209675skipping datafile 6; already restored to file +DATA/JY/5F9AA264B21F3ED9E053AB828A0A6088/DATAFILE/sysaux.270.962209675skipping datafile 8; already restored to file +DATA/JY/5F9AA264B21F3ED9E053AB828A0A6088/DATAFILE/undotbs1.296.962209675channel ORA_DISK_1: starting datafile backup set restorechannel ORA_DISK_1: specifying datafile(s) to restore from backup setchannel ORA_DISK_1: restoring datafile 00010 to +DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/system.271.962209649channel ORA_DISK_1: restoring datafile 00011 to +DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/sysaux.316.962209649channel ORA_DISK_1: restoring datafile 00012 to +DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/undotbs1.264.962209649channel ORA_DISK_1: restoring datafile 00013 to +DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/undo_2.268.962209649channel ORA_DISK_1: restoring datafile 00014 to +DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/users.278.962209649channel ORA_DISK_1: restoring datafile 00015 to +DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/test.275.962210609channel ORA_DISK_1: reading from backup piece +TEST/rman_backup/jy_979425723_20171208_0gslkbie_1_1channel ORA_DISK_1: piece handle=+TEST/rman_backup/jy_979425723_20171208_0gslkbie_1_1 tag=TAG20171208T165528channel ORA_DISK_1: restored backup piece 1channel ORA_DISK_1: restore complete, elapsed time: 00:00:25Finished restore at 11-DEC-17RMAN> recover pluggable database 'PDB$SEED',jypdb;Starting recover at 11-DEC-17using channel ORA_DISK_1starting media recoveryarchived log for thread 1 with sequence 14 is already on disk as file +TEST/arch/1_14_961976319.dbfarchived log for thread 1 with sequence 15 is already on disk as file +TEST/arch/1_15_961976319.dbfarchived log for thread 1 with sequence 16 is already on disk as file +TEST/arch/1_16_961976319.dbfarchived log for thread 1 with sequence 17 is already on disk as file +TEST/arch/1_17_961976319.dbfarchived log for thread 1 with sequence 18 is already on disk as file +TEST/arch/1_18_961976319.dbfarchived log for thread 1 with sequence 19 is already on disk as file +TEST/arch/1_19_961976319.dbfarchived log for thread 1 with sequence 20 is already on disk as file +TEST/arch/1_20_961976319.dbfarchived log for thread 1 with sequence 21 is already on disk as file +TEST/arch/1_21_961976319.dbfarchived log for thread 1 with sequence 22 is already on disk as file +TEST/arch/1_22_961976319.dbfarchived log for thread 1 with sequence 23 is already on disk as file +TEST/arch/1_23_961976319.dbfarchived log for thread 1 with sequence 24 is already on disk as file +TEST/arch/1_24_961976319.dbfarchived log for thread 1 with sequence 25 is already on disk as file +TEST/arch/1_25_961976319.dbfarchived log for thread 1 with sequence 26 is already on disk as file +TEST/arch/1_26_961976319.dbfarchived log for thread 1 with sequence 27 is already on disk as file +TEST/arch/1_27_961976319.dbfarchived log for thread 2 with sequence 12 is already on disk as file +TEST/arch/2_12_961976319.dbfarchived log for thread 2 with sequence 13 is already on disk as file +TEST/arch/2_13_961976319.dbfarchived log for thread 2 with sequence 14 is already on disk as file +TEST/arch/2_14_961976319.dbfarchived log for thread 2 with sequence 15 is already on disk as file +TEST/arch/2_15_961976319.dbfarchived log for thread 2 with sequence 16 is already on disk as file +TEST/arch/2_16_961976319.dbfarchived log for thread 2 with sequence 17 is already on disk as file +TEST/arch/2_17_961976319.dbfarchived log for thread 2 with sequence 18 is already on disk as file +TEST/arch/2_18_961976319.dbfarchived log for thread 2 with sequence 19 is already on disk as file +TEST/arch/2_19_961976319.dbfarchived log for thread 2 with sequence 20 is already on disk as file +TEST/arch/2_20_961976319.dbfarchived log file name=+TEST/arch/1_14_961976319.dbf thread=1 sequence=14archived log file name=+TEST/arch/2_12_961976319.dbf thread=2 sequence=12archived log file name=+TEST/arch/1_15_961976319.dbf thread=1 sequence=15archived log file name=+TEST/arch/2_13_961976319.dbf thread=2 sequence=13archived log file name=+TEST/arch/1_16_961976319.dbf thread=1 sequence=16archived log file name=+TEST/arch/1_17_961976319.dbf thread=1 sequence=17archived log file name=+TEST/arch/2_14_961976319.dbf thread=2 sequence=14archived log file name=+TEST/arch/1_18_961976319.dbf thread=1 sequence=18archived log file name=+TEST/arch/1_19_961976319.dbf thread=1 sequence=19archived log file name=+TEST/arch/1_20_961976319.dbf thread=1 sequence=20archived log file name=+TEST/arch/2_15_961976319.dbf thread=2 sequence=15archived log file name=+TEST/arch/1_21_961976319.dbf thread=1 sequence=21archived log file name=+TEST/arch/1_22_961976319.dbf thread=1 sequence=22archived log file name=+TEST/arch/2_16_961976319.dbf thread=2 sequence=16archived log file name=+TEST/arch/1_23_961976319.dbf thread=1 sequence=23archived log file name=+TEST/arch/1_24_961976319.dbf thread=1 sequence=24archived log file name=+TEST/arch/2_17_961976319.dbf thread=2 sequence=17archived log file name=+TEST/arch/1_25_961976319.dbf thread=1 sequence=25archived log file name=+TEST/arch/2_18_961976319.dbf thread=2 sequence=18archived log file name=+TEST/arch/1_26_961976319.dbf thread=1 sequence=26media recovery complete, elapsed time: 00:02:52Finished recover at 11-DEC-17starting full resync of recovery catalogfull resync complete
检查输出结果查看是否介质恢复成功。如果介质恢复成功继续下面的操作
7.open CDB与所有的PDB
RMAN> alter database open;Statement processedRMAN> alter pluggable database all open;Statement processedstarting full resync of recovery catalogfull resync complete
容器
成功
介质
命令
建议
情况
数据
用户
结果
面的
检查
输出
一致
方法
权限
状态
类型
设备
通道
错误
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
耀魄宝互联网科技
戴尔服务器拆卸内部硬盘
北京网络技术咨询常见问题
结构化的软件开发特点
派博软件网络安全管理系统
学校网络技术处职责
软件开发软件测试开发难
宁波手机游戏软件开发定制
数据库若要得到著作权法的保护
电脑软件开发方案
服务器上安装虚拟桌面
油卡网络技术有限公司
广州黄石软件开发
煜臻网络技术
成都软件开发室
连接指定的数据库实列
金华网络安全准入控制系统多少钱
重庆出库管理erp软件开发
数据库系统工程师下午真题及答案
服务器密码有期限吗
服务器租用是啥意思
oracle数据库连接器
国家网络安全基地长沙
支部网络安全安全主题党日活动
内蒙古信息网络安全
2u 塔式服务器
csgo匹配显示韩国服务器
政府专题数据库有哪些
云栖大会阿里云服务器
电路设计软件开发学哪个专业