叢集資料庫新增控制檔案
以下是簡要介紹給叢集資料庫新增控制檔案的過程。
----新增控制檔案:
---檢視當前的控制檔案:
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/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- MySQL8.0.18資料庫新增資料檔案MySql資料庫
- GBase XDM(單機/分片叢集)資料庫 新增記錄資料庫
- 【資料庫】Redis叢集篇資料庫Redis
- DG備庫手動管理 新增資料檔案
- Moebius資料庫多活叢集資料庫
- Oracle DG備庫手動管理新增資料檔案Oracle
- Kubernetes 部署 Nebula 圖資料庫叢集資料庫
- [專業術語]資料庫叢集資料庫
- 時序資料庫的叢集方案?資料庫
- spark叢集的配置檔案Spark
- 透過修改控制檔案scn推進資料庫scn資料庫
- 如何恢復在全備後新增了資料檔案的資料庫資料庫
- 資料庫代理服務和叢集管理資料庫
- 快速建立POLARDB for PostgreSQL資料庫叢集教程SQL資料庫
- 通過memberlist庫實現gossip管理叢集以及叢集資料互動Go
- 趣說GBase 8a資料庫叢集(一)資料庫
- UAVStack之檔案資料歸集
- 織夢資料庫配置檔案-DedeCMS織夢資料庫檔案在哪裡資料庫
- 淺談高效能資料庫叢集——分庫分表資料庫
- sql server2016叢集資料庫解除安裝SQLServer資料庫
- 基於Docker搭建Percona XtraDB Cluster資料庫叢集Docker資料庫
- 崖山資料庫的共享叢集機制初探資料庫
- GBase XDM(單機/分片叢集)資料 庫查詢
- Sqlserver資料庫使用 .bak 檔案還原資料庫SQLServer資料庫
- 用kubeadm建立高可用kubernetes叢集后,如何重新新增控制平面
- 使用Artifactory叢集作為檔案共享中心
- IndexedDB 資料庫新增資料Index資料庫
- HAC叢集新增新節點
- 分散式文件儲存資料庫之MongoDB分片叢集分散式資料庫MongoDB
- 效能優化資料庫篇-從單機到叢集優化資料庫
- GBase XDM(單機/分片叢集)資料庫修改記錄資料庫
- oracle資料庫的配置檔案Oracle資料庫
- 織夢資料庫配置檔案修改資料庫配置方法資料庫
- 織夢CMS(dedecms)的資料庫連線檔案_織夢連線資料庫檔案資料庫
- 【/proc/檔案淺析】另類辦法恢復資料檔案和控制檔案
- Oracle叢集軟體管理-新增和刪除叢集節點Oracle
- 替換OCR和表決磁碟後,重啟叢集,資料庫資源的叢集狀態為OFFLINE資料庫
- 網站檔案修改資料庫,安全高效地修改網站資料庫中的檔案資訊網站資料庫
- 大資料專案實踐(一)——之HDFS叢集配置大資料