標籤:
1.使用sqlplus串連到已經mount或open的rac資料庫
sql> alter database backup controlfile to trace noresetlogs;
2.找出對應的trace檔案
3.編寫指令碼control.sql
startup nomountcreate controlfile reuse database "orcl" noresetlogs noarchivelogmaxlogfiles 192maxlogmembers 3maxdatafiles 1024maxinstances 32maxloghistory 292logfilegroup 1 ‘/ocfs01/rac/redo01.log‘ size 50m,group 2 ‘/ocfs01/rac/redo02.log‘ size 50m,group 3 ‘/ocfs01/rac/redo03.log‘ size 50m,group 4 ‘/ocfs01/rac/redo04.log‘ size 50m-- standby logfiledatafile‘/ocfs01/rac/system01.dbf‘,‘/ocfs01/rac/undotbs01.dbf‘,‘/ocfs01/rac/sysaux01.dbf‘,‘/ocfs01/rac/undotbs02.dbf‘,‘/ocfs01/rac/users01.dbf‘character set we8iso8859p1recover databasealter database open;alter tablespace temp add tempfile ‘/ocfs01/rac/temp01.dbf‘size 167772160 reuse autoextend off;recover databasealter database open;alter tablespace temp add tempfile ‘/ocfs01/rac/temp01.dbf‘size 524288000 reuse autoextend on next 655360 maxsize 32767m;-- the next step is optional if gv$thread does not show all the threads:-- alter database enable public thread 2;-- repeat for other threads if applicable
4.關閉資料庫所有執行個體
$ srvctl stop database -d orcl -o immediate
5.備份當前的控制檔案
6.確保執行個體設定都是針對thread 1
instance = 1thread = 1
7.將參數檔案中的cluster_database設定為false
如果是使用spfile:
sql> startup nomountsql> alter system set cluster_database=false scope=spfile;sql> shutdown
8.運行指令碼建立新的控制檔案
sqlplus / as sysdbaSQL> @control.sql
9.將參數cluster_database設定為true
sql> alter system set cluster_database=true scope=spfile;
10.關閉資料庫
sql> shutdown immediate
11.啟動所有執行個體
$ srvctl start database -d orcl$ srvctl status database -d orcl
12.備份資料庫
oracle rac重建控制檔案