如何重建RAC的控制文件

如何重建RAC的控制文件,第1张

在下面的一些情况下,可能需要重建控制文件

o 所有控制文件都已损坏或丢失

o 没有针对控制文件的备份或者备份已损坏

o 或者在一些情况下,Oracle Support建议这么做

下面是针对RAC环境下重建控制文件的具体过程, 包括两个例子。一个是以noresetlogs模式来重建控制文件,一个是以resetlogs模式来重建控制文件。如果redo logs都存在而且没有被损坏,那么可以采用noresetlogs。 使用resetlogs会将所有redo log清空而且重置log sequence为1.

在RAC上重建控制文件与单实例有一些小区别: 在重建控制文件前必须设置cluster_database=false,而且只启动一个实例来执行 *** 作,否则会报错

ORA-01503: CREATE CONTROLFILE failed

ORA-12720: operation requires database is in EXCLUSIVE mode

重建完控制文件后,需要再将cluster_database设为true.

TESTCASE1

---------------------------

用noresetlog模式重建控制文件

过程:

1.首先生成 重建 控制文件的脚本:

SQL>alter database backup controlfile to trace

Database altered.

2. 所生成的控制文件的脚本会在udump下:

SQL>show parameter user_dump_dest

NAME TYPEVALUE

------------------------------------ ----------- ------------------------------

user_dump_dest string /u01/app/oracle/diag/rdbms/racdb/RACDB1/trace

数据库的Alert log中也会详细输出这个文件的路径和名字:

alter database backup controlfile to trace

Backup controlfile written to trace file /u01/app/oracle/diag/rdbms/racdb/RACDB1/trace/RACDB1_ora_10076.trc

3. 停止所有数据库实例:

[oracle@rac1 trace]$ srvctl stop database -d RACDB

4. 用noresetlog重建控制文件:

[oracle@rac1 trace]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Tue Jan 8 11:23:44 2013

Copyright (c) 1982, 2011, Oracle. All rights reserved.

Connected to an idle instance.

SQL>startup nomount<==启动一个实例

ORACLE instance started.

Total System Global Area 739065856 bytes

Fixed Size 2232032 bytes

Variable Size 549454112 bytes

Database Buffers 184549376 bytes

Redo Buffers2830336 bytes

SQL>CREATE CONTROLFILE REUSE DATABASE "RACDB" NORESETLOGS ARCHIVELOG

2 MAXLOGFILES 192

3 MAXLOGMEMBERS 3

4 MAXDATAFILES 1024

5 MAXINSTANCES 32

6 MAXLOGHISTORY 292

7 LOGFILE

8GROUP 1 (

9 '+DATA/racdb/onlinelog/group_1.261.783272805',

10 '+RECO/racdb/onlinelog/group_1.257.783272807'

11) SIZE 50M BLOCKSIZE 512,

12GROUP 2 (

13 '+DATA/racdb/onlinelog/group_2.262.783272807',

14 '+RECO/racdb/onlinelog/group_2.258.783272809'

15) SIZE 50M BLOCKSIZE 512,

16GROUP 3 (

17 '+DATA/racdb/onlinelog/group_3.269.804115405',

18 '+RECO/racdb/onlinelog/group_3.261.804115405'

19) SIZE 50M BLOCKSIZE 512,

20GROUP 4 (

21 '+DATA/racdb/onlinelog/group_4.270.804115405',

22 '+RECO/racdb/onlinelog/group_4.263.804115407'

23) SIZE 50M BLOCKSIZE 512

24 -- STANDBY LOGFILE

25 DATAFILE

26'+DATA/racdb/datafile/system.256.783272707',

27'+DATA/racdb/datafile/sysaux.257.783272707',

28'+DATA/racdb/datafile/undotbs1.258.783272707',

29'+DATA/racdb/datafile/users.259.783272707',

30'+DATA/racdb/datafile/example.264.783272831',

31'+DATA/racdb/datafile/undotbs2.265.783273081'

32 CHARACTER SET AL32UTF8

33

CREATE CONTROLFILE REUSE DATABASE "RACDB" NORESETLOGS ARCHIVELOG

*

ERROR at line 1:

ORA-01503: CREATE CONTROLFILE failed

ORA-12720: operation requires database is in EXCLUSIVE mode <============由于没有设置cluster_database=false,所以报错

需要将设置cluster_database=false:

SQL>alter system set cluster_database=false scope=spfile

System altered.

SQL>shutdown immediate

ORA-01507: database not mounted

ORACLE instance shut down.

SQL>startup nomount

ORACLE instance started.

Total System Global Area 739065856 bytes

Fixed Size 2232032 bytes

Variable Size 549454112 bytes

Database Buffers 184549376 bytes

Redo Buffers2830336 bytes

SQL>CREATE CONTROLFILE REUSE DATABASE "RACDB" NORESETLOGS ARCHIVELOG

2 MAXLOGFILES 192

3 MAXLOGMEMBERS 3

4 MAXDATAFILES 1024

5 MAXINSTANCES 32

6 MAXLOGHISTORY 292

7 LOGFILE

8GROUP 1 (

9 '+DATA/racdb/onlinelog/group_1.261.783272805',

10 '+RECO/racdb/onlinelog/group_1.257.783272807'

11) SIZE 50M BLOCKSIZE 512,

12GROUP 2 (

13 '+DATA/racdb/onlinelog/group_2.262.783272807',

14 '+RECO/racdb/onlinelog/group_2.258.783272809'

15) SIZE 50M BLOCKSIZE 512,

16GROUP 3 (

17 '+DATA/racdb/onlinelog/group_3.269.804115405',

18 '+RECO/racdb/onlinelog/group_3.261.804115405'

19) SIZE 50M BLOCKSIZE 512,

20GROUP 4 (

21 '+DATA/racdb/onlinelog/group_4.270.804115405',

22 '+RECO/racdb/onlinelog/group_4.263.804115407'

23) SIZE 50M BLOCKSIZE 512

24 -- STANDBY LOGFILE

25 DATAFILE

26'+DATA/racdb/datafile/system.256.783272707',

27'+DATA/racdb/datafile/sysaux.257.783272707',

28'+DATA/racdb/datafile/undotbs1.258.783272707',

29'+DATA/racdb/datafile/users.259.783272707',

30'+DATA/racdb/datafile/example.264.783272831',

31'+DATA/racdb/datafile/undotbs2.265.783273081'

32 CHARACTER SET AL32UTF8

33

补充:估计你掉电导致CONTROL彼此不一致了

给你找了篇ITPUB的文章,跟你情况差不多

http://www.itpub.net/thread-211513-1-1.html

如果还是搞不起来可以跟我交谈,白天我在线

9i似乎不能支持INTERNAL用户了。。

下面的方法都不行的话你就系统命令手动杀进程把。。杯具

sqlplus 下用SYS可以启动吗,一般掉电之后启动它会自己实例恢复的,再把信息贴全点

补充:

把库版本贴出来

1.重开个SQLPLUS用SHUTDOWN ABORT试试

2.上述不行的话CMD下用svrmgrl(具体命令跟平台和版本有关) 然后connect internal再关试试

3.再不行的话手动KILL掉ORACLE进程。。再开启进程测试,还错误的话查日志


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/sjk/6765607.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-03-28
下一篇 2023-03-28

发表评论

登录后才能评论

评论列表(0条)

保存