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

网友投稿 428 2023-11-27

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

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

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、ASM2节点,单实例服务器:RHEL4u7oracle 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 1to /app/oracle/oradata/system.257.779207027;

set newname for datafile 3to /app/oracle/oradata/sysaux.262.779207043;

set newname for datafile 4to /app/oracle/oradata/users.260.779207053;

set newname for datafile 2to /app/oracle/oradata/undotbs1.264.779207043;

set newname for datafile 15to /app/oracle/oradata/pptest_tbs.282.793979093;

set newname for datafile 5to/app/oracle/oradata/undotbs2.268.779207507;

set newname for datafile 8to/app/oracle/oradata/tbs_p3w.271.780396123;

set newname for datafile 9to/app/oracle/oradata/tbs_p4w.274.780396125;

set newname for datafile 6to/app/oracle/oradata/tbs_p1w.270.780396121;

set newname for datafile 7to/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打开数据库;但是,实际操作中遇到bug7207932Rman 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" RESETLOGSARCHIVELOG

MAXLOGFILES 50

MAXLOGMEMBERS 2

MAXDATAFILES 2000

MAXINSTANCES 8

MAXLOGHISTORY 292

LOGFILE

GROUP 1 /app/oracle/oradata/group_1.263.779207025SIZE 10M,

GROUP 2 /app/oracle/oradata/group_2.259.779207027SIZE 10M,

GROUP 3 /app/oracle/oradata/group_3.258.779207027SIZE 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;

来自 “ ITPUB博客 ” ,链接:http://blog.itpub-/16976507/viewspace-1251569/,如需转载,请注明出处,否则将追究法律责任。

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:怎么用docker中logs命令显示最后几行
下一篇:Redis Bitmaps怎么用
相关文章

 发表评论

暂时没有评论,来抢沙发吧~