溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

Oracle 11g rac 安裝后在asm上增加control file文件副本

發(fā)布時(shí)間:2020-08-11 19:03:48 來(lái)源:ITPUB博客 閱讀:174 作者:edge_dba 欄目:關(guān)系型數(shù)據(jù)庫(kù)
Oracle 11g rac在建庫(kù)的時(shí)候使用了ASM存儲(chǔ),然而rac在建庫(kù)時(shí)默認(rèn)只在asm上面創(chuàng)建了一個(gè)控制文件,如果想多加幾個(gè)控制文件,
就需要通過(guò)手工來(lái)添加了,很多人可能會(huì)忽略這個(gè)細(xì)節(jié),但是我們還是希望多建幾個(gè)control file來(lái)增加數(shù)據(jù)庫(kù)的穩(wěn)定性。
下面是具體步驟:


1、在操作前要保留一份控制文件和參數(shù)文件,以備搞不成恢復(fù)用。
注:只在一個(gè)數(shù)據(jù)庫(kù)實(shí)例上進(jìn)行修改。


SQL> create pfile='/home/oracle/pfile0531.ora' from spfile;
File created.
SQL> alter database backup controlfile to '/home/oracle/cntrl_20180531.ctl';
Database altered.


SQL> col name for a50
SQL> select * from gv$controlfile;
   INST_ID STATUS  NAME                                               IS_ BLOCK_SIZE FILE_SIZE_BLKS
---------- ------- -------------------------------------------------- --- ---------- --------------
         2         +DATA/crmdb/controlfile/current.282.873504505    NO       16384           1152
         1         +DATA/crmdb/controlfile/current.282.873504505    NO       16384           1152


2、修改spfile中的控制文件參數(shù)
SQL> alter system set control_files='+DATA/crmdb/controlfile/current.256.977420629','+DATA','+DATA' scope=spfile sid='*';
System altered.


3、關(guān)閉數(shù)據(jù)庫(kù)實(shí)例
crmdb1:/home/oracle@db> srvctl stop database -d crmdb
 
4、創(chuàng)建control file 副本
crmdb1:/home/oracle@db>  rman target/
Recovery Manager: Release 11.2.0.4.0 - Production on 星期五 2月 6 15:50:12 2015
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   68412682240 bytes
Fixed Size                     2263488 bytes
Variable Size              31675385408 bytes
Database Buffers           36507222016 bytes
Redo Buffers                 227811328 bytes


RMAN> restore controlfile from '+DATA/crmdb/controlfile/current.256.977420629';
Starting restore at 06-2月 -15
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=4086 instance=crmdb device type=DISK
channel ORA_DISK_1: copied control file copy
output file name=+DATA/crmdb/controlfile/current.256.870194351
output file name=+DATA/crmdb/controlfile/current.426.870969063
output file name=+DATA/crmdb/controlfile/current.427.870969063
Finished restore at 06-2月 -15


RMAN> sql ' alter database mount';
sql statement:  alter database mount
released channel: ORA_DISK_1
RMAN> sql ' alter database open';
sql statement:  alter database open


5、登錄數(shù)據(jù)庫(kù)驗(yàn)證
SQL> select name from gv$controlfile;


NAME
--------------------------------------------------------------------------------
+DATA/crmdb/controlfile/current.256.977420629
+DATA/crmdb/controlfile/current.276.977568423
+DATA/crmdb/controlfile/current.277.977568423


6、修改spfile中的新添加的控制文件參數(shù)
SQL> alter system set control_files='+DATA/crmdb/controlfile/current.256.977420629','+DATA/crmdb/controlfile/current.276.977568423','+DATA/crmdb/controlfile/current.277.977568423' scope=spfile sid='*';
System altered.
SQL>  shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.


7、打開(kāi)數(shù)據(jù)庫(kù)最終驗(yàn)證
crmdb1:/home/oracle@db> srvctl start database -d crmdb
SQL>  select * from  gv$controlfile;
   INST_ID STATUS  NAME                                               IS_ BLOCK_SIZE FILE_SIZE_BLKS
---------- ------- -------------------------------------------------- --- ---------- --------------
         1         +DATA/crmdb/controlfile/current.256.977420629     NO       16384           1512
         1         +DATA/crmdb/controlfile/current.276.977568423     NO       16384           1512
         1         +DATA/crmdb/controlfile/current.277.977568423     NO       16384           1512
         2         +DATA/crmdb/controlfile/current.256.977420629     NO       16384           1512
         2         +DATA/crmdb/controlfile/current.276.977568423     NO       16384           1512
         2         +DATA/crmdb/controlfile/current.277.977568423     NO       16384           1512
6 rows selected.
向AI問(wèn)一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI