RAC環境重建控制檔案
1、生成重建controlfile的指令碼
SQL> alter database backup controlfile to trace;
Database altered.
2、檢視指令碼位置
SQL> show parameter user_dump_dest
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
user_dump_dest string /u01/app/oracle/diag/rdbms/jzh
/jzh1/trace
3、關閉資料庫
[oracle@jzh1 ~]$ srvctl stop database -d jzh
4、啟動資料庫至nomount狀態(啟動一個例項即可)
[oracle@jzh1 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Wed Jun 17 15:40:07 2015
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup nomount
ORACLE instance started.
Total System Global Area 1436389376 bytes
Fixed Size 2228384 bytes
Variable Size 905973600 bytes
Database Buffers 520093696 bytes
Redo Buffers 8093696 bytes
5、執行前面生成的指令碼
alter database backup controlfile to trace
Backup controlfile written to trace file /u01/app/oracle/diag/rdbms/jzh/jzh1/trace/jzh1_ora_4989.trc
指令碼在上面的trace檔案中
SQL> CREATE CONTROLFILE REUSE DATABASE "JZH" NORESETLOGS ARCHIVELOG
2 MAXLOGFILES 192
3 MAXLOGMEMBERS 3
4 MAXDATAFILES 1024
5 MAXINSTANCES 32
6 MAXLOGHISTORY 292
7 LOGFILE
8 GROUP 1 (
9 '+DATA/jzh/onlinelog/group_1.271.880001913',
10 '+ARCH/jzh/onlinelog/group_1.261.880001915'
11 ) SIZE 50M BLOCKSIZE 512,
12 GROUP 2 (
13 '+DATA/jzh/onlinelog/group_2.268.880001917',
14 '+ARCH/jzh/onlinelog/group_2.271.880001919'
15 ) SIZE 50M BLOCKSIZE 512,
16 GROUP 3 (
17 '+DATA/jzh/onlinelog/group_3.260.880005747',
18 '+ARCH/jzh/onlinelog/group_3.260.880005753'
19 ) SIZE 50M BLOCKSIZE 512,
20 GROUP 4 (
21 '+DATA/jzh/onlinelog/group_4.264.880005761',
22 '+ARCH/jzh/onlinelog/group_4.259.880005763'
23 ) SIZE 50M BLOCKSIZE 512
24 -- STANDBY LOGFILE
25 DATAFILE
26 '+DATA/jzh/datafile/system.261.880001919',
27 '+DATA/jzh/datafile/sysaux.265.880001965',
28 '+DATA/jzh/datafile/undotbs1.272.880001991',
29 '+DATA/jzh/datafile/undotbs2.269.880002027',
30 '+DATA/jzh/datafile/users.262.880002029'
31 CHARACTER SET AL32UTF8;
CREATE CONTROLFILE REUSE DATABASE "JZH" NORESETLOGS ARCHIVELOG
*
ERROR at line 1:
ORA-01503: CREATE CONTROLFILE failed
ORA-12720: operation requires database is in EXCLUSIVE mode---------->該錯誤是由於沒有設定cluster_database=false
SQL> show parameter cluster_database
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
cluster_database boolean TRUE
cluster_database_instances integer 2
SQL> alter system set cluster_database=false scope=spfile;
System altered.
SQL> shu immediate
ORA-01507: database not mounted
ORACLE instance shut down.
SQL> startup nomount
ORACLE instance started.
Total System Global Area 1436389376 bytes
Fixed Size 2228384 bytes
Variable Size 905973600 bytes
Database Buffers 520093696 bytes
Redo Buffers 8093696 bytes
SQL> CREATE CONTROLFILE REUSE DATABASE "JZH" NORESETLOGS ARCHIVELOG
2 MAXLOGFILES 192
3 MAXLOGMEMBERS 3
4 MAXDATAFILES 1024
5 MAXINSTANCES 32
6 MAXLOGHISTORY 292
7 LOGFILE
8 GROUP 1 (
9 '+DATA/jzh/onlinelog/group_1.271.880001913',
10 '+ARCH/jzh/onlinelog/group_1.261.880001915'
11 ) SIZE 50M BLOCKSIZE 512,
12 GROUP 2 (
'+DATA/jzh/onlinelog/group_2.268.880001917',
'+ARCH/jzh/onlinelog/group_2.271.880001919'
) SIZE 50M BLOCKSIZE 512,
GROUP 3 (
'+DATA/jzh/onlinelog/group_3.260.880005747',
13 14 15 16 17 18 '+ARCH/jzh/onlinelog/group_3.260.880005753'
19 ) SIZE 50M BLOCKSIZE 512,
20 GROUP 4 (
21 '+DATA/jzh/onlinelog/group_4.264.880005761',
22 '+ARCH/jzh/onlinelog/group_4.259.880005763'
23 ) SIZE 50M BLOCKSIZE 512
24 -- STANDBY LOGFILE
25 DATAFILE
26 '+DATA/jzh/datafile/system.261.880001919',
27 '+DATA/jzh/datafile/sysaux.265.880001965',
28 '+DATA/jzh/datafile/undotbs1.272.880001991',
29 '+DATA/jzh/datafile/undotbs2.269.880002027',
30 '+DATA/jzh/datafile/users.262.880002029'
31 CHARACTER SET AL32UTF8;
Control file created.
6、確認redo log
SQL> select * from v$log;
GROUP# THREAD# SEQUENCE# BYTES BLOCKSIZE MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIM NEXT_CHANGE# NEXT_TIME
---------- ---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- --------- ------------ ---------
1 1 69 52428800 512 2 NO CURRENT 972789 17-JUN-15 2.8147E+14 17-JUN-15
2 1 68 52428800 512 2 NO INACTIVE 952423 18-MAY-15 952425 18-MAY-15
3 2 3 52428800 512 2 NO INACTIVE 952462 18-MAY-15 972466 17-JUN-15
4 2 4 52428800 512 2 NO INACTIVE 972466 17-JUN-15 981652 17-JUN-15
7、recover database
SQL> recover database;
ORA-00283: recovery session canceled due to errors
ORA-00264: no recovery required
8、開啟資料庫
SQL> alter system archive log all;
System altered.
SQL> alter database open
2 ;
Database altered.
9、新增原tempfile至temp表空間
SQL> select name from v$tempfile;
no rows selected
SQL> select tablespace_name from dba_tablespaces;
TABLESPACE_NAME
------------------------------
SYSTEM
SYSAUX
UNDOTBS1
TEMP
UNDOTBS2
USERS
6 rows selected.
SQL> alter tablespace temp add tempfile '+DATA/jzh/tempfile/TEMP.267.880001997';
Tablespace altered.
SQL> select name from v$tempfile;
NAME
--------------------------------------------------------------------------------
+DATA/jzh/tempfile/temp.267.880001997
10、設定cluster_database為true
SQL> alter system set cluster_database=true scope=spfile;
System altered.
SQL>
SQL> shu immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
11、啟動所有例項
[oracle@jzh1 ~]$ srvctl start database -d jzh
[oracle@jzh1 ~]$ srvctl status database -d jzh
Instance jzh1 is running on node jzh1
Instance jzh2 is running on node jzh2
controlfile 重建完成!
SQL> alter database backup controlfile to trace;
Database altered.
2、檢視指令碼位置
SQL> show parameter user_dump_dest
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
user_dump_dest string /u01/app/oracle/diag/rdbms/jzh
/jzh1/trace
3、關閉資料庫
[oracle@jzh1 ~]$ srvctl stop database -d jzh
4、啟動資料庫至nomount狀態(啟動一個例項即可)
[oracle@jzh1 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Wed Jun 17 15:40:07 2015
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup nomount
ORACLE instance started.
Total System Global Area 1436389376 bytes
Fixed Size 2228384 bytes
Variable Size 905973600 bytes
Database Buffers 520093696 bytes
Redo Buffers 8093696 bytes
5、執行前面生成的指令碼
alter database backup controlfile to trace
Backup controlfile written to trace file /u01/app/oracle/diag/rdbms/jzh/jzh1/trace/jzh1_ora_4989.trc
指令碼在上面的trace檔案中
SQL> CREATE CONTROLFILE REUSE DATABASE "JZH" NORESETLOGS ARCHIVELOG
2 MAXLOGFILES 192
3 MAXLOGMEMBERS 3
4 MAXDATAFILES 1024
5 MAXINSTANCES 32
6 MAXLOGHISTORY 292
7 LOGFILE
8 GROUP 1 (
9 '+DATA/jzh/onlinelog/group_1.271.880001913',
10 '+ARCH/jzh/onlinelog/group_1.261.880001915'
11 ) SIZE 50M BLOCKSIZE 512,
12 GROUP 2 (
13 '+DATA/jzh/onlinelog/group_2.268.880001917',
14 '+ARCH/jzh/onlinelog/group_2.271.880001919'
15 ) SIZE 50M BLOCKSIZE 512,
16 GROUP 3 (
17 '+DATA/jzh/onlinelog/group_3.260.880005747',
18 '+ARCH/jzh/onlinelog/group_3.260.880005753'
19 ) SIZE 50M BLOCKSIZE 512,
20 GROUP 4 (
21 '+DATA/jzh/onlinelog/group_4.264.880005761',
22 '+ARCH/jzh/onlinelog/group_4.259.880005763'
23 ) SIZE 50M BLOCKSIZE 512
24 -- STANDBY LOGFILE
25 DATAFILE
26 '+DATA/jzh/datafile/system.261.880001919',
27 '+DATA/jzh/datafile/sysaux.265.880001965',
28 '+DATA/jzh/datafile/undotbs1.272.880001991',
29 '+DATA/jzh/datafile/undotbs2.269.880002027',
30 '+DATA/jzh/datafile/users.262.880002029'
31 CHARACTER SET AL32UTF8;
CREATE CONTROLFILE REUSE DATABASE "JZH" NORESETLOGS ARCHIVELOG
*
ERROR at line 1:
ORA-01503: CREATE CONTROLFILE failed
ORA-12720: operation requires database is in EXCLUSIVE mode---------->該錯誤是由於沒有設定cluster_database=false
SQL> show parameter cluster_database
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
cluster_database boolean TRUE
cluster_database_instances integer 2
SQL> alter system set cluster_database=false scope=spfile;
System altered.
SQL> shu immediate
ORA-01507: database not mounted
ORACLE instance shut down.
SQL> startup nomount
ORACLE instance started.
Total System Global Area 1436389376 bytes
Fixed Size 2228384 bytes
Variable Size 905973600 bytes
Database Buffers 520093696 bytes
Redo Buffers 8093696 bytes
SQL> CREATE CONTROLFILE REUSE DATABASE "JZH" NORESETLOGS ARCHIVELOG
2 MAXLOGFILES 192
3 MAXLOGMEMBERS 3
4 MAXDATAFILES 1024
5 MAXINSTANCES 32
6 MAXLOGHISTORY 292
7 LOGFILE
8 GROUP 1 (
9 '+DATA/jzh/onlinelog/group_1.271.880001913',
10 '+ARCH/jzh/onlinelog/group_1.261.880001915'
11 ) SIZE 50M BLOCKSIZE 512,
12 GROUP 2 (
'+DATA/jzh/onlinelog/group_2.268.880001917',
'+ARCH/jzh/onlinelog/group_2.271.880001919'
) SIZE 50M BLOCKSIZE 512,
GROUP 3 (
'+DATA/jzh/onlinelog/group_3.260.880005747',
13 14 15 16 17 18 '+ARCH/jzh/onlinelog/group_3.260.880005753'
19 ) SIZE 50M BLOCKSIZE 512,
20 GROUP 4 (
21 '+DATA/jzh/onlinelog/group_4.264.880005761',
22 '+ARCH/jzh/onlinelog/group_4.259.880005763'
23 ) SIZE 50M BLOCKSIZE 512
24 -- STANDBY LOGFILE
25 DATAFILE
26 '+DATA/jzh/datafile/system.261.880001919',
27 '+DATA/jzh/datafile/sysaux.265.880001965',
28 '+DATA/jzh/datafile/undotbs1.272.880001991',
29 '+DATA/jzh/datafile/undotbs2.269.880002027',
30 '+DATA/jzh/datafile/users.262.880002029'
31 CHARACTER SET AL32UTF8;
Control file created.
6、確認redo log
SQL> select * from v$log;
GROUP# THREAD# SEQUENCE# BYTES BLOCKSIZE MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIM NEXT_CHANGE# NEXT_TIME
---------- ---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- --------- ------------ ---------
1 1 69 52428800 512 2 NO CURRENT 972789 17-JUN-15 2.8147E+14 17-JUN-15
2 1 68 52428800 512 2 NO INACTIVE 952423 18-MAY-15 952425 18-MAY-15
3 2 3 52428800 512 2 NO INACTIVE 952462 18-MAY-15 972466 17-JUN-15
4 2 4 52428800 512 2 NO INACTIVE 972466 17-JUN-15 981652 17-JUN-15
7、recover database
SQL> recover database;
ORA-00283: recovery session canceled due to errors
ORA-00264: no recovery required
8、開啟資料庫
SQL> alter system archive log all;
System altered.
SQL> alter database open
2 ;
Database altered.
9、新增原tempfile至temp表空間
SQL> select name from v$tempfile;
no rows selected
SQL> select tablespace_name from dba_tablespaces;
TABLESPACE_NAME
------------------------------
SYSTEM
SYSAUX
UNDOTBS1
TEMP
UNDOTBS2
USERS
6 rows selected.
SQL> alter tablespace temp add tempfile '+DATA/jzh/tempfile/TEMP.267.880001997';
Tablespace altered.
SQL> select name from v$tempfile;
NAME
--------------------------------------------------------------------------------
+DATA/jzh/tempfile/temp.267.880001997
10、設定cluster_database為true
SQL> alter system set cluster_database=true scope=spfile;
System altered.
SQL>
SQL> shu immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
11、啟動所有例項
[oracle@jzh1 ~]$ srvctl start database -d jzh
[oracle@jzh1 ~]$ srvctl status database -d jzh
Instance jzh1 is running on node jzh1
Instance jzh2 is running on node jzh2
controlfile 重建完成!
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/10271187/viewspace-1703392/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Controlfile 重建控制檔案 noresetlogs, resetlogs..
- Oracle RAC 環境 引數檔案的啟動順序Oracle
- oracle快速拿到重建控制檔案語句的方法二Oracle
- RAC控制檔案恢復(三種不同情況)
- 重建共享(db或asm)密碼檔案 in Oracle 19c RAC-20220209ASM密碼Oracle
- RAC環境修改spfile的位置
- KingbaseES RAC部署案例之---SAN環境構建RAC
- Laravel 配置多環境env檔案Laravel
- 手工清理19c RAC環境
- RAC環境下建立物理DATAGUARD(1)
- RAC環境下建立物理DATAGUARD(2)
- RAC和ASM環境下打patchASM
- 如何在rac環境中增加監聽
- Oracle RAC 環境下的連線管理Oracle
- SpringMVC基本環境搭建(配置檔案模板模板)SpringMVC
- 開發環境下PP檔案的建立開發環境
- Oracle RAC環境下ASM磁碟組擴容OracleASM
- 簡單介紹Linux環境變數檔案Linux變數
- PHP本地檔案包含漏洞環境搭建與利用PHP
- NfS網路共享檔案系統環境搭建NFS
- lustre檔案系統環境搭建及測試
- ubuntu系統環境配置檔案的區別Ubuntu
- Oracle RAC引數檔案管理Oracle
- 惡意軟體PE檔案重建指南
- 三,搭建環境:事務控制
- yml檔案中使用profile配置切換多環境
- AspNetCore配置多環境log4net配置檔案NetCore
- unix環境高階程式設計(上)-檔案篇程式設計
- Oracle 控制檔案Oracle
- Oracle RAC修改引數檔案位置Oracle
- Oracle 11.2.0.4 rac for aix acfs異常環境的克隆環境ASM磁碟組掛載緩慢OracleAIASM
- ElasticSearch7.3 學習之生產環境實時重建索引Elasticsearch索引
- 【Linux】python版本控制和環境管理LinuxPython
- oracle 11G RAC的建立(VM虛擬環境)Oracle
- ORACLE 12C RAC 生產環境搭建介紹Oracle
- Oracle RAC一鍵部署001(主機環境校驗)Oracle
- RAC環境下的SEQUENCE對應用的影響
- 如何在伺服器環境中上傳下載檔案伺服器
- vscode 配置c/c++環境,無法生成 *.exe檔案VSCodeC++