RAC下新增控制檔案
一、檢視控制檔案和spfile檔案位置
[root@node1 ~]# su - oracle
[oracle@node1 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on 星期三 8月 16 09:58:38 2017
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
SQL> show parameter spf
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
spfile string +DATADG/prod/spfileprod.ora
SQL> show parameter contr
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
control_file_record_keep_time integer 7
control_files string +DATADG/prod/controlfile/curre
nt.260.947712913
control_management_pack_access string DIAGNOSTIC+TUNING
二、關閉兩個節點
[oracle@node2 /]srvctl stop database -d PROD
[oracle@node1 /]srvctl stop database -d PROD
三、在其中一節點利用RMAN複製控制檔案
[oracle@node1 ~]$ rman target /
Recovery Manager: Release 11.2.0.4.0 - Production on 星期三 8月 16 10:01:45 2017
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database (not started)
RMAN> startup nomount;
Oracle instance started
Total System Global Area 1252663296 bytes
Fixed Size 2252824 bytes
Variable Size 922750952 bytes
Database Buffers 318767104 bytes
Redo Buffers 8892416 bytes
RMAN> restore controlfile to '+DATADG' from '+DATADG/PROD/CONTROLFILE/Current.260.947712913';
Starting restore at 16-8月 -17
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=15 instance=PROD1 device type=DISK
channel ORA_DISK_1: copied control file copy
Finished restore at 16-8月 -17
RMAN> exit
Recovery Manager complete.
四、確定新複製的控制檔名
[grid@node2 ~]$ asmcmd
ASMCMD> cd DATADG
ASMCMD> ls
PROD/
ASMCMD> cd PROD
ASMCMD> ls
CONTROLFILE/
DATAFILE/
ONLINELOG/
PARAMETERFILE/
TEMPFILE/
spfileprod.ora
ASMCMD> cd CONTROLFILE
ASMCMD> ls
Current.260.947712913
current.272.952164187
五、修改spfile檔案
SQL> create pfile='/u01/0816.ora' from spfile='+DATADG/prod/spfileprod.ora';
File created.
[oracle@node1 u01]$ vi 0816.ora
*.control_files='+DATADG/prod/controlfile/current.260.947712913'
*.control_files='+DATADG/prod/controlfile/current.272.952164187'
SQL> create spfile='+DATADG/prod/spfileprod.ora' from pfile='/u01/0816.ora';
File created.
六、修改完成,檢視
[oracle@node1 ~]$ srvctl start database -d PROD
[oracle@node1 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on 星期三 8月 16 10:09:39 2017
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
SQL> show parameter contr
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
control_file_record_keep_time integer 7
control_files string +DATADG/prod/controlfile/curre
nt.260.947712913, +DATADG/prod
/controlfile/current.272.95216
4187
control_management_pack_access string DIAGNOSTIC+TUNING
SQL> show parameter spfile
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
spfile string +DATADG/prod/spfileprod.ora
注意:複製控制檔案之前要關閉資料庫,否則會出現控制檔案版本不一致的報錯
還有另外一種方式,在關庫情況下直接在ASM裡面複製,但是控制檔名字不能和ASM命名機制相同,
ASMCMD> cp current.272.952164187 current.272.952164188
copying +DATADG/PROD/CONTROLFILE/current.272.952164187 -> +DATADG/PROD/CONTROLFILE/current.272.952164188
ASMCMD-8016: copy source '+DATADG/PROD/CONTROLFILE/current.272.952164187' and target '+DATADG/PROD/CONTROLFILE/current.272.952164188' failed
ORA-15056: additional error message
ORA-15046: ASM file name '+DATADG/PROD/CONTROLFILE/current.272.952164188' is not in single-file creation form
ORA-06512: at "SYS.X$DBMS_DISKGROUP", line 415
ORA-06512: at line 3 (DBD ERROR: OCIStmtExecute)
ASMCMD> cp current.272.952164187 current.272.95216418744444
copying +DATADG/PROD/CONTROLFILE/current.272.952164187 -> +DATADG/PROD/CONTROLFILE/current.272.95216418744444
然後再修改spfile檔案即可。建議使用第一種方法
[root@node1 ~]# su - oracle
[oracle@node1 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on 星期三 8月 16 09:58:38 2017
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
SQL> show parameter spf
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
spfile string +DATADG/prod/spfileprod.ora
SQL> show parameter contr
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
control_file_record_keep_time integer 7
control_files string +DATADG/prod/controlfile/curre
nt.260.947712913
control_management_pack_access string DIAGNOSTIC+TUNING
二、關閉兩個節點
[oracle@node2 /]srvctl stop database -d PROD
[oracle@node1 /]srvctl stop database -d PROD
三、在其中一節點利用RMAN複製控制檔案
[oracle@node1 ~]$ rman target /
Recovery Manager: Release 11.2.0.4.0 - Production on 星期三 8月 16 10:01:45 2017
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database (not started)
RMAN> startup nomount;
Oracle instance started
Total System Global Area 1252663296 bytes
Fixed Size 2252824 bytes
Variable Size 922750952 bytes
Database Buffers 318767104 bytes
Redo Buffers 8892416 bytes
RMAN> restore controlfile to '+DATADG' from '+DATADG/PROD/CONTROLFILE/Current.260.947712913';
Starting restore at 16-8月 -17
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=15 instance=PROD1 device type=DISK
channel ORA_DISK_1: copied control file copy
Finished restore at 16-8月 -17
RMAN> exit
Recovery Manager complete.
四、確定新複製的控制檔名
[grid@node2 ~]$ asmcmd
ASMCMD> cd DATADG
ASMCMD> ls
PROD/
ASMCMD> cd PROD
ASMCMD> ls
CONTROLFILE/
DATAFILE/
ONLINELOG/
PARAMETERFILE/
TEMPFILE/
spfileprod.ora
ASMCMD> cd CONTROLFILE
ASMCMD> ls
Current.260.947712913
current.272.952164187
五、修改spfile檔案
SQL> create pfile='/u01/0816.ora' from spfile='+DATADG/prod/spfileprod.ora';
File created.
[oracle@node1 u01]$ vi 0816.ora
*.control_files='+DATADG/prod/controlfile/current.260.947712913'
*.control_files='+DATADG/prod/controlfile/current.272.952164187'
SQL> create spfile='+DATADG/prod/spfileprod.ora' from pfile='/u01/0816.ora';
File created.
六、修改完成,檢視
[oracle@node1 ~]$ srvctl start database -d PROD
[oracle@node1 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on 星期三 8月 16 10:09:39 2017
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
SQL> show parameter contr
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
control_file_record_keep_time integer 7
control_files string +DATADG/prod/controlfile/curre
nt.260.947712913, +DATADG/prod
/controlfile/current.272.95216
4187
control_management_pack_access string DIAGNOSTIC+TUNING
SQL> show parameter spfile
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
spfile string +DATADG/prod/spfileprod.ora
注意:複製控制檔案之前要關閉資料庫,否則會出現控制檔案版本不一致的報錯
還有另外一種方式,在關庫情況下直接在ASM裡面複製,但是控制檔名字不能和ASM命名機制相同,
ASMCMD> cp current.272.952164187 current.272.952164188
copying +DATADG/PROD/CONTROLFILE/current.272.952164187 -> +DATADG/PROD/CONTROLFILE/current.272.952164188
ASMCMD-8016: copy source '+DATADG/PROD/CONTROLFILE/current.272.952164187' and target '+DATADG/PROD/CONTROLFILE/current.272.952164188' failed
ORA-15056: additional error message
ORA-15046: ASM file name '+DATADG/PROD/CONTROLFILE/current.272.952164188' is not in single-file creation form
ORA-06512: at "SYS.X$DBMS_DISKGROUP", line 415
ORA-06512: at line 3 (DBD ERROR: OCIStmtExecute)
ASMCMD> cp current.272.952164187 current.272.95216418744444
copying +DATADG/PROD/CONTROLFILE/current.272.952164187 -> +DATADG/PROD/CONTROLFILE/current.272.95216418744444
然後再修改spfile檔案即可。建議使用第一種方法
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29618264/viewspace-2143615/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- ORACLE 新增控制檔案Oracle
- 如何重建RAC的控制檔案
- RAC環境重建控制檔案
- 【RAC】Oracle 10g RAC 重建控制檔案Oracle 10g
- 【rac】實驗二:增加控制檔案
- 如何建立RAC叢集控制檔案
- oracle 11g 新增控制檔案Oracle
- 為資料庫新增控制檔案資料庫
- oracle之 RAC 11G ASM下控制檔案多路複用OracleASM
- 清空檔案下的SVN控制檔案
- 為rac資料庫增加控制檔案資料庫
- RAC環境中的快照控制檔案
- 叢集資料庫新增控制檔案資料庫
- 新增控制檔案成員形成多路徑
- Oracle單例項+ASM新增控制檔案Oracle單例ASM
- rac 環境新增資料檔案誤新增到檔案系統,正確解決方法
- ASM下遷移控制檔案ASM
- 【控制檔案】映象控制檔案
- RAC控制檔案恢復(三種不同情況)
- 檔案和目錄的訪問控制(2)新增訪問控制
- oracle 11g rac 新增重做日誌檔案Oracle
- Oracle資料庫新增和移動控制檔案Oracle資料庫
- 【備份恢復】利用 備份控制檔案到指定目錄下的控制檔案 恢復控制檔案
- RAC環境下單例項啟動Oracle資料庫重建控制檔案案例單例Oracle資料庫
- 開啟 控制檔案自動備份下,引數檔案、控制檔案全部丟失恢復
- ORACLE 資料庫 ASM磁碟組上新增控制檔案Oracle資料庫ASM
- RAC 11G ASM下修改spfile檔案ASM
- 【RAC】Oracle RAC叢集環境下日誌檔案結構Oracle
- asm下的控制檔案的複製ASM
- 控制檔案損壞重建實驗(下)
- 控制檔案
- Oracle 控制檔案Oracle
- 重建控制檔案
- 控制檔案概述
- 重建控制檔案--
- 映象控制檔案
- 在RAC 12c下GoldenGate故障一則(共享檔案系統檔案鎖)Go
- Linux下誤刪資料檔案從檔案控制程式碼恢復資料檔案Linux