叢集資料庫新增控制檔案
以下是簡要介紹給叢集資料庫新增控制檔案的過程。
----新增控制檔案:
---檢視當前的控制檔案:
SQL> show parameter control_files
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
control_files string +DATA/prod/controlfile/current
.264.927167493, +OCR_VOTE/prod
/controlfile/current.256.92716
7497
#可以看到有兩個日誌檔案:
---關閉資料庫並將一個節點啟動到nomount狀態:
[oracle@node1 ~]$ srvctl stop database -d prod -o immediate
PRCC-1016 : prod was already stopped
[oracle@node1 ~]$ srvctl status database -d prodInstance prod1 is not running on node node1
Instance prod2 is not running on node node2
[oracle@node1 ~]$
#已經關閉資料庫:
--開啟到nomount狀態:
[oracle@node1 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Sun Nov 6 14:35:22 2016
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup nomount;
ORACLE instance started.
Total System Global Area 849530880 bytes
Fixed Size 1339824 bytes
Variable Size 620760656 bytes
Database Buffers 222298112 bytes
Redo Buffers 5132288 bytes
SQL>
---備份引數檔案:
SQL> create pfile='/home/oracle/initprod.ora' from spfile;
File created.
SQL>
---利用RMAN 建立控制檔案:
[oracle@node1 ~]$ rman target /
Recovery Manager: Release 11.2.0.1.0 - Production on Sun Nov 6 14:44:33 2016
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: PROD (not mounted)
RMAN>
RMAN> restore controlfile to '+DATA' from '+DATA/prod/controlfile/Current.264.927167493';
Starting restore at 06-NOV-16
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=33 instance=prod1 device type=DISK
channel ORA_DISK_1: copied control file copy
Finished restore at 06-NOV-16
RMAN> exit
Recovery Manager complete.
[oracle@node1 ~]$
-
---在Grid使用者使用ASM檢視控制檔案:
cd DATA/prod/CONTROLFILE
[grid@node2 ~]$
[grid@node2 ~]$ asmcmd
ASMCMD>
ASMCMD> cd DATA/prod/CONTROLFILE
ASMCMD> pwd
+DATA/prod/CONTROLFILE
ASMCMD> ls
Current.264.927167493
current.269.927211623
ASMCMD>
#已經新增一個。
---修改引數檔案,使其新增控制檔案:
SQL> col HOST_NAME for a20
SQL> select INST_ID,HOST_NAME,STATUS from gv$instance;
INST_ID HOST_NAME STATUS
---------- -------------------- ------------
1 node1 STARTED
SQL>
--修改引數檔案的控制檔案引數:
SQL>
SQL> alter system set control_files=
2 '+DATA/prod/controlfile/Current.264.927167493',
3 '+DATA/RACDB/controlfile/current.269.927211623',
4 '+OCR_VOTE/prod/controlfile/current.256.927167497'
5 scope=spfile;
System altered.
SQL>
--退出:
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
[oracle@node1 ~]$
[oracle@node1 ~]$
---啟動資料庫:
[oracle@node1 ~]$ srvctl start database -d prod
PRCC-1014 : prod was already running
[oracle@node1 ~]$
---檢視新的控制檔案:
--節點1:
SQL> show parameter control_files
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
control_files string +DATA/prod/controlfile/current
.264.927167493, +DATA/racdb/co
ntrolfile/current.269.92721162
3, +OCR_VOTE/prod/controlfile/
current.256.927167497
SQL>
--節點2:
[oracle@node2 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Sun Nov 6 15:10:26 2016
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
SQL>
SQL> show parameter control_files
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
control_files string +DATA/prod/controlfile/current
.264.927167493, +DATA/racdb/co
ntrolfile/current.269.92721162
3, +OCR_VOTE/prod/controlfile/
current.256.927167497
SQL>
#控制檔案新增完成。
----新增控制檔案:
---檢視當前的控制檔案:
SQL> show parameter control_files
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
control_files string +DATA/prod/controlfile/current
.264.927167493, +OCR_VOTE/prod
/controlfile/current.256.92716
7497
#可以看到有兩個日誌檔案:
---關閉資料庫並將一個節點啟動到nomount狀態:
[oracle@node1 ~]$ srvctl stop database -d prod -o immediate
PRCC-1016 : prod was already stopped
[oracle@node1 ~]$ srvctl status database -d prodInstance prod1 is not running on node node1
Instance prod2 is not running on node node2
[oracle@node1 ~]$
#已經關閉資料庫:
--開啟到nomount狀態:
[oracle@node1 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Sun Nov 6 14:35:22 2016
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup nomount;
ORACLE instance started.
Total System Global Area 849530880 bytes
Fixed Size 1339824 bytes
Variable Size 620760656 bytes
Database Buffers 222298112 bytes
Redo Buffers 5132288 bytes
SQL>
---備份引數檔案:
SQL> create pfile='/home/oracle/initprod.ora' from spfile;
File created.
SQL>
---利用RMAN 建立控制檔案:
[oracle@node1 ~]$ rman target /
Recovery Manager: Release 11.2.0.1.0 - Production on Sun Nov 6 14:44:33 2016
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: PROD (not mounted)
RMAN>
RMAN> restore controlfile to '+DATA' from '+DATA/prod/controlfile/Current.264.927167493';
Starting restore at 06-NOV-16
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=33 instance=prod1 device type=DISK
channel ORA_DISK_1: copied control file copy
Finished restore at 06-NOV-16
RMAN> exit
Recovery Manager complete.
[oracle@node1 ~]$
-
---在Grid使用者使用ASM檢視控制檔案:
cd DATA/prod/CONTROLFILE
[grid@node2 ~]$
[grid@node2 ~]$ asmcmd
ASMCMD>
ASMCMD> cd DATA/prod/CONTROLFILE
ASMCMD> pwd
+DATA/prod/CONTROLFILE
ASMCMD> ls
Current.264.927167493
current.269.927211623
ASMCMD>
#已經新增一個。
---修改引數檔案,使其新增控制檔案:
SQL> col HOST_NAME for a20
SQL> select INST_ID,HOST_NAME,STATUS from gv$instance;
INST_ID HOST_NAME STATUS
---------- -------------------- ------------
1 node1 STARTED
SQL>
--修改引數檔案的控制檔案引數:
SQL>
SQL> alter system set control_files=
2 '+DATA/prod/controlfile/Current.264.927167493',
3 '+DATA/RACDB/controlfile/current.269.927211623',
4 '+OCR_VOTE/prod/controlfile/current.256.927167497'
5 scope=spfile;
System altered.
SQL>
--退出:
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
[oracle@node1 ~]$
[oracle@node1 ~]$
---啟動資料庫:
[oracle@node1 ~]$ srvctl start database -d prod
PRCC-1014 : prod was already running
[oracle@node1 ~]$
---檢視新的控制檔案:
--節點1:
SQL> show parameter control_files
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
control_files string +DATA/prod/controlfile/current
.264.927167493, +DATA/racdb/co
ntrolfile/current.269.92721162
3, +OCR_VOTE/prod/controlfile/
current.256.927167497
SQL>
--節點2:
[oracle@node2 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Sun Nov 6 15:10:26 2016
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
SQL>
SQL> show parameter control_files
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
control_files string +DATA/prod/controlfile/current
.264.927167493, +DATA/racdb/co
ntrolfile/current.269.92721162
3, +OCR_VOTE/prod/controlfile/
current.256.927167497
SQL>
#控制檔案新增完成。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31392094/viewspace-2127889/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 為資料庫新增控制檔案資料庫
- 新增叢集資料庫服務service資料庫
- Oracle資料庫新增和移動控制檔案Oracle資料庫
- 叢集資料庫重要檔案的檢視管理資料庫
- oracle ocfs 叢集檔案系統新增資料檔案帶來的問題Oracle
- ORACLE 資料庫 ASM磁碟組上新增控制檔案Oracle資料庫ASM
- 如何建立RAC叢集控制檔案
- 資料庫叢集資料庫
- 修改叢集資料庫的歸檔模式資料庫模式
- oracle資料庫叢集新增表空間操作規範Oracle資料庫
- MySQL資料庫叢集MySql資料庫
- 重建Oracle資料庫控制檔案Oracle資料庫
- GBase XDM(單機/分片叢集)資料庫 新增記錄資料庫
- oracle資料庫移動資料檔案、日誌檔案和控制檔案Oracle資料庫
- 【資料庫】Redis叢集篇資料庫Redis
- RAC叢集資料庫搭建資料庫
- MySQL8.0.18資料庫新增資料檔案MySql資料庫
- 為rac資料庫增加控制檔案資料庫
- Oracle叢集資料庫中恢復歸檔日誌Oracle資料庫
- ORACLE 新增控制檔案Oracle
- Moebius資料庫多活叢集資料庫
- 把資料庫控制檔案備份到跟蹤檔案資料庫
- 4 管理資料庫例項和叢集資料庫資料庫
- DG備庫手動管理 新增資料檔案
- RAC下新增控制檔案
- [專業術語]資料庫叢集資料庫
- 時序資料庫的叢集方案?資料庫
- SequoiaDB資料庫之叢集管理資料庫
- redis資料庫叢集三種模式Redis資料庫模式
- 資料庫叢集技術漫談資料庫
- 資料庫引數檔案控制檔案日誌檔案資料檔案跟蹤檔案等8大檔案的字典資料庫
- 資料庫控制檔案中的SCN詳解資料庫
- Oracle DG備庫手動管理新增資料檔案Oracle
- Redis叢集 - cluster叢集、資料分片Redis
- 建立資料庫檔案-日誌檔案-次要資料庫檔案資料庫
- spark叢集的配置檔案Spark
- 資料庫代理服務和叢集管理資料庫
- 使用備份的控制檔案恢復資料庫資料庫