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/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- RAC控制檔案恢復(三種不同情況)
- Oracle RAC引數檔案管理Oracle
- Oracle RAC+ADG新增資料檔案失敗處理(db_create_file_dest)Oracle
- Oracle 控制檔案Oracle
- Oracle RAC修改引數檔案位置Oracle
- Xcode 新增PCH檔案XCode
- Oracle RAC新增節點Oracle
- Oracle RAC NFS掛載檔案系統OracleNFS
- 2.6.4 指定控制檔案
- rac歸檔模式/非歸檔模式下檔案建至本地儲存修復方法-ORA-01157模式
- docker新增檔案重新打包Docker
- SpringBoot 新增本地 jar 檔案Spring BootJAR
- Win10系統下控制皮膚怎麼新增“編輯登錄檔”Win10
- Windows 11.2.0.4 RAC安裝配置以及RAC新增節點Windows
- win10怎麼新增信任檔案 新增Win10信任檔案的方法Win10
- VSCode中新增vue檔案模板VSCodeVue
- IntelliJ IDEA 新增本地xsd檔案IntelliJIdea
- 用檔案新增Swap分割槽
- linux shell 命令下批量新增檔案的字尾 和批量刪除 擁有某字尾的檔案Linux
- JavaWeb之實現檔案上傳與下載控制元件JavaWeb控制元件
- springboot下新增日誌模組和設定日誌檔案輸出Spring Boot
- Win10系統下怎麼給影片新增srt字幕檔案Win10
- 12c複製 RAC ASM中的密碼檔案到檔案系統ASM密碼
- SVN培訓筆記(下拉專案、同步修改、新增檔案、修改檔案、刪除檔案、改名檔案等)筆記
- 控制檔案損壞處理
- ORACLE 控制檔案(Control Files)概述Oracle
- 怎麼在jupyter中新增檔案?
- git add 新增錯檔案 撤銷Git
- 檔案下載
- 檔案操作(下)
- 檔案程式設計、檔案下載程式設計
- SpringMVC檔案上傳下載(單檔案、多檔案)SpringMVC
- ORACLE RAC ASM資料檔案遷移OMF檔案報錯ORA-01276解決OracleASM
- 記一次Oracle RAC for aix 儲存雙控鎖盤導致ASM控制檔案損壞恢復OracleAIASM
- Win10系統下怎麼給視訊新增srt字幕檔案Win10
- 【RMAN】Oracle中如何備份控制檔案?備份控制檔案的方式有哪幾種?Oracle
- rac 新增第二public ip 和 vip
- oracle11g RAC新增節點Oracle
- 【/proc/檔案淺析】另類辦法恢復資料檔案和控制檔案