Oracle RAC重建控制文件

系统环境:
操作系统: AIX5.3

Cluster:  Oracle 10gR2 CRS
Oracle:  Oracle 10gR2

在RAC环境下重建控制文件和在单实例上类似,只是有些步骤需要注意:
[oracle@aix211 ~]$cat mkln.sh 
ln -s /dev/rsystem          /u01/app/oracle/oradata/prod/system01.dbf
ln -s /dev/rsysaux          /u01/app/oracle/oradata/prod/sysaux01.dbf
ln -s /dev/rusers            /u01/app/oracle/oradata/prod/users01.dbf
ln -s /dev/rundotbs1        /u01/app/oracle/oradata/prod/undotbs01.dbf 
ln -s /dev/rundotbs2        /u01/app/oracle/oradata/prod/undotbs02.dbf
ln -s /dev/rtemp            /u01/app/oracle/oradata/prod/temp01.dbf
ln -s /dev/rcontrol1_1        /u01/app/oracle/oradata/prod/control01.ctl
ln -s /dev/rcontrol2_2        /u01/app/oracle/oradata/prod/control02.ctl
ln -s /dev/rcontrol3_3        /u01/app/oracle/oradata/prod/control03.ctl
ln -s /dev/rredo1_1          /u01/app/oracle/oradata/prod/log11.log
ln -s /dev/rredo1_2          /u01/app/oracle/oradata/prod/log12.log
ln -s /dev/rredo2_1          /u01/app/oracle/oradata/prod/log21.log
ln -s /dev/rredo2_2          /u01/app/oracle/oradata/prod/log22.log
ln -s /dev/rindex            /u01/app/oracle/oradata/prod/index01.dbf
ln -s /dev/rspfile          /u01/app/oracle/oradata/prod/spfile01
ln -s /dev/rexample          /u01/app/oracle/oradata/prod/example01.dbf

Database存储在在RAW上。

1、首先在一个节点备份controlfile

[oracle@aix201 ~]$sqlplus '/as sysdba'
SQL*Plus: Release 10.2.0.1.0 - Production on Mon Mar 23 16:16:07 2015
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
 
SQL> select status from v$instance;
STATUS
------------
OPEN
SQL> alter database backup controlfile to trace;
Database altered.

2、查看控制文件的trace备份(udump)
CREATE CONTROLFILE REUSE DATABASE "PROD" NORESETLOGS  NOARCHIVELOG
    MAXLOGFILES 192
    MAXLOGMEMBERS 3
    MAXDATAFILES 1024
    MAXINSTANCES 32
    MAXLOGHISTORY 292
LOGFILE
  GROUP 1 '/u01/app/oracle/oradata/prod/log11.log'  SIZE 50M,
  GROUP 2 '/u01/app/oracle/oradata/prod/log12.log'  SIZE 50M,
  GROUP 3 '/u01/app/oracle/oradata/prod/log21.log'  SIZE 50M,
  GROUP 4 '/u01/app/oracle/oradata/prod/log22.log'  SIZE 50M
-- STANDBY LOGFILE
DATAFILE
  '/u01/app/oracle/oradata/prod/system01.dbf',
  '/u01/app/oracle/oradata/prod/undotbs01.dbf',
  '/u01/app/oracle/oradata/prod/sysaux01.dbf',
  '/u01/app/oracle/oradata/prod/users01.dbf',
  '/u01/app/oracle/oradata/prod/example01.dbf',
  '/u01/app/oracle/oradata/prod/undotbs02.dbf'
CHARACTER SET ZHS16GBK
;

3、关闭database,启动其中一个instance到弄mount
SQL> startup nomount;
ORACLE instance started.
Total System Global Area  612368384 bytes
Fixed Size                  2022832 bytes
Variable Size            184549968 bytes
Database Buffers          423624704 bytes
Redo Buffers                2170880 bytes
 
SQL> @/home/oracle/cr_ctr.sql
CREATE CONTROLFILE REUSE DATABASE "PROD" NORESETLOGS  NOARCHIVELOG
*
ERROR at line 1:
ORA-01503: CREATE CONTROLFILE failed
ORA-12720: operation requires database is in EXCLUSIVE mode
SQL> show parameter cluster
NAME                                TYPE        VALUE
------------------------------------ ----------- ------------------------------
cluster_database                    boolean    TRUE
cluster_database_instances          integer    2
cluster_interconnects                string
 
---创建失败,原因是在RAC下控制文件时处于共享(share)模式,需启动到独立(exclusive)模式,才能重建;修改cluster_database 为false,然后重建

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/1b5c613903266bbdf8ebedc995febdd8.html