一、說(shuō)明
我們?cè)诎惭b數(shù)據(jù)庫(kù)集群的時(shí)候,最后有一步是使用DBCA建庫(kù),建庫(kù)的過(guò)程中到底在集群資源中做了什么呢?實(shí)際上添加了一個(gè)ora.dbname.db這個(gè)集群資源。
刪除數(shù)據(jù)庫(kù)的方法
1、使用DBCA進(jìn)行刪除,這個(gè)大家都會(huì)
2、手動(dòng)刪庫(kù),先刪除集群資源ora.dbanme.db,然后到ASM中刪除相關(guān)數(shù)據(jù)即可。
創(chuàng)新互聯(lián)建站專(zhuān)注于企業(yè)網(wǎng)絡(luò)營(yíng)銷(xiāo)推廣、網(wǎng)站重做改版、湘鄉(xiāng)網(wǎng)站定制設(shè)計(jì)、自適應(yīng)品牌網(wǎng)站建設(shè)、H5高端網(wǎng)站建設(shè)、成都做商城網(wǎng)站、集團(tuán)公司官網(wǎng)建設(shè)、外貿(mào)營(yíng)銷(xiāo)網(wǎng)站建設(shè)、高端網(wǎng)站制作、響應(yīng)式網(wǎng)頁(yè)設(shè)計(jì)等建站業(yè)務(wù),價(jià)格優(yōu)惠性?xún)r(jià)比高,為湘鄉(xiāng)等各大城市提供網(wǎng)站開(kāi)發(fā)制作服務(wù)。
二、操作步驟
1、查看數(shù)據(jù)庫(kù)配置
$srvctl config database -d orcl
Database unique name: orcl
Database name: orcl
Oracle home: /u01/app/oracle/product/12.1.0/dbhome_1
Oracle user: oracle
Spfile: +DATADG/ORCL/PARAMETERFILE/spfile.268.954540133
Password file: +DATADG/ORCL/PASSWORD/pwdorcl.256.954539259
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools:
Disk Groups: DATADG
Mount point paths:
Services:
Type: RAC
Start concurrency:
Stop concurrency:
OSDBA group: dba
OSOPER group: oper
Database instances: orcl1,orcl2
Configured nodes: rac01,rac02
Database is administrator managed
$
2、刪除資源
--grid用戶執(zhí)行
srvctl stop database -d orcl
--oracle 用戶執(zhí)行
$srvctl remove instance -d orcl -i orcl1
Remove instance from the database orcl? (y/[n]) y
$srvctl remove instance -d orcl -i orcl2
Remove instance from the database orcl? (y/[n]) y
$srvctl config database -d orcl
Database unique name: orcl
Database name: orcl
Oracle home: /u01/app/oracle/product/12.1.0/dbhome_1
Oracle user: oracle
Spfile: +DATADG/ORCL/PARAMETERFILE/spfile.268.954540133
Password file: +DATADG/ORCL/PASSWORD/pwdorcl.256.954539259
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools:
Disk Groups: DATADG
Mount point paths:
Services:
Type: RAC
Start concurrency:
Stop concurrency:
OSDBA group: dba
OSOPER group: oper
Database instances:
Configured nodes:
Database is administrator managed
$
$srvctl remove database -d orcl
Remove the database orcl? (y/[n]) y
3、再添加資源
--oracle 用戶
srvctl add database -d orcl -o $ORACLE_HOME
srvctl add instance -d orcl -n rac01 -i orcl1
srvctl add instance -d orcl -n rac02 -i orcl2
$srvctl add database -d orcl -o $ORACLE_HOME
$srvctl config database -d orcl
Database unique name: orcl
Database name:
Oracle home: /u01/app/oracle/product/12.1.0/dbhome_1
Oracle user: oracle
Spfile:
Password file:
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools:
Disk Groups:
Mount point paths:
Services:
Type: RAC
Start concurrency:
Stop concurrency:
OSDBA group: dba
OSOPER group: oper
Database instances:
Configured nodes:
Database is administrator managed
$srvctl add instance -d orcl -n rac01 -i orcl1
$srvctl add instance -d orcl -n rac02 -i orcl2
$
$srvctl config database -d orcl
Database unique name: orcl
Database name:
Oracle home: /u01/app/oracle/product/12.1.0/dbhome_1
Oracle user: oracle
Spfile:
Password file:
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools:
Disk Groups:
Mount point paths:
Services:
Type: RAC
Start concurrency:
Stop concurrency:
OSDBA group: dba
OSOPER group: oper
Database instances: orcl1,orcl2
Configured nodes: rac01,rac02
Database is administrator managed
$
srvctl modify database -db orcl -spfile '+DATADG/ORCL/PARAMETERFILE/spfile.268.954540133' -pwfile '+DATADG/ORCL/PASSWORD/pwdorcl.256.954539259'
$srvctl modify database -db orcl -spfile '+DATADG/ORCL/PARAMETERFILE/spfile.268.954540133' -pwfile '+DATADG/ORCL/PASSWORD/pwdorcl.256.954539259'
$srvctl start database -d orcl
$