RAC数据库恢复到单实例数据库

Talia ·
更新时间:2024-11-13
· 560 次阅读

  RAC数据库恢复到单实例数据库的基本步骤如下:   a.准备单实例服务器,pfile文件,启动到nomount   b.备份rac数据库   c.将备份文件拷贝到单实例服务器   d.在单实例服务器上还原、恢复   e.resetlogs打开数据库   f.rename redo文件名   g.disable thread 2并删除其redo组   h.增加temp临时表空间数据文件   i.删除不必要的undo表空间   业务需要(比如,测试备份)将RAC数据库通过备份恢复到单实例服务器;下面是实际操作步骤;测试环境:RHEL4u7、oracle 10gR2、ASM、2节点,单实例服务器:RHEL4u7、oracle 10gR2、文件系统;在测试环境下,RAC 数据库文件都在asm时,在rename file操作时会遇到了BUG问题,后的恢复时则需要重建控制文件;上面介绍的步骤是指没有BUG的情况的操作;   另外,备份、拷贝的环节请参考其他文档,不介绍了,下面从第4步在单实例服务器上还原、恢复与打开开始介绍; RMAN> startup nomount RMAN> restore controlfile to '/app/oracle/oradata/ctl01.dbf' from '/app/oracle/backup/ctl_23_1_855331400'; RMAN> run{startup mount; set until sequence 870 thread 1; set newname for datafile 1  to '/app/oracle/oradata/system.257.779207027'; set newname for datafile 3  to '/app/oracle/oradata/sysaux.262.779207043'; set newname for datafile 4  to '/app/oracle/oradata/users.260.779207053'; set newname for datafile 2  to '/app/oracle/oradata/undotbs1.264.779207043'; set newname for datafile 15  to '/app/oracle/oradata/pptest_tbs.282.793979093'; set newname for datafile 5  to'/app/oracle/oradata/undotbs2.268.779207507'; set newname for datafile 8  to'/app/oracle/oradata/tbs_p3w.271.780396123'; set newname for datafile 9  to'/app/oracle/oradata/tbs_p4w.274.780396125'; set newname for datafile 6  to'/app/oracle/oradata/tbs_p1w.270.780396121'; set newname for datafile 7  to'/app/oracle/oradata/tbs_p2w.273.780396123'; set newname for datafile 14 to'/app/oracle/oradata/pptest_tbs.279.781454807'; restore database; switch datafile all; recover database; } sys@racdb3> alter database rename file '+DG/racdb/onlinelog/group_1.263.779207025' to '/app/oracle/oradata/redo1.log';   rename 完所有redo文件后,即可resetlogs打开数据库;但是,实际操作中遇到bug7207932:Rman Restore From RAC ASM To Single Instance Non ASM Fails With ORA-00600 [kgeade_is_0] (文档 ID 1146703.1)   Bug 7207932  ORA-600 [KGEADE_IS_0] WHEN RENAMING A FILE FROM ASM TO FS   要想绕开的方法则是重建控制文件后,再打开数据库   sys@racdb3> alter database backup controlfile to trace as '/tmp/ctl.trc' reuse resetlogs;打开trace文件,修改里面的logfile部分信息;然后重启数据库到nomount状态; sys@racdb3> shutdown immediate SQL> STARTUP NOMOUNT CREATE CONTROLFILE REUSE DATABASE "RACDB" RESETLOGS  ARCHIVELOG MAXLOGFILES 50 MAXLOGMEMBERS 2 MAXDATAFILES 2000 MAXINSTANCES 8 MAXLOGHISTORY 292 LOGFILE GROUP 1 '/app/oracle/oradata/group_1.263.779207025'  SIZE 10M, GROUP 2 '/app/oracle/oradata/group_2.259.779207027'  SIZE 10M, GROUP 3 '/app/oracle/oradata/group_3.258.779207027'  SIZE 10M DATAFILE '/app/oracle/oradata/system.257.779207027', '/app/oracle/oradata/undotbs1.264.779207043', '/app/oracle/oradata/sysaux.262.779207043', '/app/oracle/oradata/users.260.779207053', '/app/oracle/oradata/undotbs2.268.779207507', '/app/oracle/oradata/tbs_p1w.270.780396121', '/app/oracle/oradata/tbs_p2w.273.780396123', '/app/oracle/oradata/tbs_p3w.271.780396123', '/app/oracle/oradata/tbs_p4w.274.780396125', '/app/oracle/oradata/pptest_tbs.279.781454807', '/app/oracle/oradata/pptest_tbs.282.793979093' CHARACTER SET ZHS16GBK ;   创建完成后,用backup controlfile进行恢复; sys@racdb3> RECOVER DATABASE USING BACKUP CONTROLFILE until cancel; sys@racdb3>ALTER DATABASE ADD LOGFILE THREAD 2 GROUP 4 '/app/oracle/oradata/group_4.265.779207453' SIZE 10M REUSE, GROUP 5 '/app/oracle/oradata/group_5.266.779207459' SIZE 10M REUSE, GROUP 6 '/app/oracle/oradata/group_6.267.779207467' SIZE 10M REUSE; sys@racdb3> alter database open resetlogs; 成功resetlogs打开后,还需要做一些去thread 2的操作; sys@racdb3> alter database disable thread 2; sys@racdb3> alter database drop logfile group 4; alter database drop logfile group 4 * ERROR at line 1: ORA-00350: log 4 of instance UNNAMED_INSTANCE_2 (thread 2) needs to be archived ORA-00312: online log 4 thread 2: '/app/oracle/oradata/RACDB/onlinelog/o1_mf_4_9ym2kvgf_.log' sys@racdb3> alter database clear unarchived logfile group 4; sys@racdb3> alter tablespace temp add tempfile '/app/oracle/oradata/temp01.dbf' size 10M reuse; Tablespace altered. sys@racdb3> drop tablespace undotbs2 including contents and datafiles;



rac

需要 登录 后方可回复, 如果你还没有账号请 注册新账号