ITPub博客

首页 > Linux操作系统 > Linux操作系统 > RAC+ASM在单机上恢复的过程

RAC+ASM在单机上恢复的过程

原创 Linux操作系统 作者:yanyp 时间:2009-05-19 10:06:36 0 删除 编辑


从rac上生成pfile文件并移除cluster_database_instances,cluster_database的等与RAC相关的参数,移除多余的undo_tablespace,只保留一个undo_tablespace

启动到nomount状态
用rman还原出controfile

要点:
查看日志文件位置:
SQL> select member from v$logfile;
MEMBER
--------------------------------------------------------------------------------
+DATA/rac/onlinelog/group_1.258.686853767
+DATA/rac/onlinelog/group_1.259.686853767
+DATA/rac/onlinelog/group_2.260.686853769
+DATA/rac/onlinelog/group_2.261.686853769
+DATA/rac/onlinelog/group_3.268.686855633
+DATA/rac/onlinelog/group_3.269.686855635
+DATA/rac/onlinelog/group_4.270.686855637
+DATA/rac/onlinelog/group_4.271.686855639
查看数据文件及temp文件的位置:
RMAN> report schema;

using target database control file instead of recovery catalog
Report of database schema

List of Permanent Datafiles
===========================
File Size(MB) Tablespace           RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1    480      SYSTEM               ***     +DATA/rac/datafile/system.262.686853771
2    275      UNDOTBS1             ***     +DATA/rac/datafile/undotbs1.263.686853781
3    400      SYSAUX               ***     +DATA/rac/datafile/sysaux.264.686853783
4    200      UNDOTBS2             ***     +DATA/rac/datafile/undotbs2.266.686853789
5    5        USERS                ***     +DATA/rac/datafile/users.267.686853793

List of Temporary Files
=======================
File Size(MB) Tablespace           Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1    28       TEMP                 32767       +DATA/rac/tempfile/temp.265.686853785

更新控制文件中redo log的位置
alter database  rename file '+DATA/rac/onlinelog/group_1.258.686853767' to '/opt/oradata/ORCL/group1_1.log';
alter database  rename file '+DATA/rac/onlinelog/group_1.259.686853767' to '/opt/oradata/ORCL/group1_2.log';
alter database  rename file '+DATA/rac/onlinelog/group_2.260.686853769' to '/opt/oradata/ORCL/group2_1.log';
alter database  rename file '+DATA/rac/onlinelog/group_2.261.686853769' to '/opt/oradata/ORCL/group2_2.log';
alter database  rename file '+DATA/rac/onlinelog/group_3.268.686855633' to '/opt/oradata/ORCL/group3_1.log';
alter database  rename file '+DATA/rac/onlinelog/group_3.269.686855635' to '/opt/oradata/ORCL/group3_2.log';
alter database  rename file '+DATA/rac/onlinelog/group_4.270.686855637' to '/opt/oradata/ORCL/group4_1.log';
alter database  rename file '+DATA/rac/onlinelog/group_4.271.686855639' to '/opt/oradata/ORCL/group4_2.log';

更新控制文件中temp file的位置
alter database rename file '+DATA/rac/tempfile/temp.265.686853785' to '/opt/oradata/ORCL/temp1.dbf';

更新控制文件中数据文件的位置(使用set newname)
run {
allocate channel d1 type disk;
set  newname for datafile 1 to '/opt/oradata/ORCL/system.dbf';
set newname for datafile 2 to '/opt/oradata/ORCL/undotbs1.dbf';
set newname for datafile 3 to '/opt/oradata/ORCL/sysaux.dbf';
set newname for datafile 4 to '/opt/oradata/ORCL/undotbs2.dbf';
set newname for datafile 5 to '/opt/oradata/ORCL/users1.dbf';
restore database;
switch datafile all;
release channel d1;
}
recover database;
alter database open resetlogs;

备注:
清楚thread为2的logfile
SQL> select group#,status,thread# from v$log;  

    GROUP# STATUS              THREAD#
---------- ---------------- ----------
         3 CURRENT                   2
         4 INACTIVE                  2
         5 ACTIVE                    1
         6 CURRENT                   1
         7 INACTIVE                  1
SQL>alter database  disable thread 2;
SQL> alter database drop logfile group 4;
Database altered.
SQL> alter database drop logfile group 3;
alter database drop logfile group 3
*
ERROR at line 1:
ORA-00350: log 3 of instance RAC2 (thread 2) needs to be archived
ORA-00312: online log 3 thread 2: '/opt/oradata/ORCL/group3_1.log'

alter database clear unarchived logfile group 3;
SQL>  alter database drop logfile group 3;
Database altered.

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

上一篇: www.juliandyke.com
请登录后发表评论 登录
全部评论

注册时间:2009-04-12

  • 博文量
    139
  • 访问量
    171801