1. 程式人生 > >12c RAC 添加刪除ora.dbanme.db資源

12c RAC 添加刪除ora.dbanme.db資源

dom 操作 per sta automatic 1.0 disk 安裝數據庫 執行

一、說明
我們在安裝數據庫集群的時候,最後有一步是使用DBCA建庫,建庫的過程中到底在集群資源中做了什麽呢?實際上添加了一個ora.dbname.db這個集群資源。
刪除數據庫的方法
1、使用DBCA進行刪除,這個大家都會
2、手動刪庫,先刪除集群資源ora.dbanme.db,然後到ASM中刪除相關數據即可。

二、操作步驟
1、查看數據庫配置

<rac01:+ASM1:/home/grid>$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
<rac01:+ASM1:/home/grid>$

2、刪除資源

--grid用戶執行
srvctl stop database -d orcl
--oracle 用戶執行
<rac01:orcl1:/home/oracle>$srvctl remove instance -d orcl -i  orcl1
Remove instance from the database orcl? (y/[n]) y
<rac01:orcl1:/home/oracle>$srvctl remove instance -d orcl -i  orcl2
Remove instance from the database orcl? (y/[n]) y
<rac01:orcl1:/home/oracle>$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
<rac01:orcl1:/home/oracle>$
<rac01:orcl1:/home/oracle>$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

<rac01:orcl1:/home/oracle>$srvctl add database -d orcl -o $ORACLE_HOME
<rac01:orcl1:/home/oracle>$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
<rac01:orcl1:/home/oracle>$srvctl add instance -d orcl -n rac01 -i orcl1
<rac01:orcl1:/home/oracle>$srvctl add instance -d orcl -n rac02 -i orcl2
<rac01:orcl1:/home/oracle>$

<rac01:orcl1:/home/oracle>$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
<rac01:orcl1:/home/oracle>$

srvctl modify database -db orcl  -spfile ‘+DATADG/ORCL/PARAMETERFILE/spfile.268.954540133‘ -pwfile ‘+DATADG/ORCL/PASSWORD/pwdorcl.256.954539259‘

<rac01:orcl1:/home/oracle>$srvctl modify database -db orcl  -spfile ‘+DATADG/ORCL/PARAMETERFILE/spfile.268.954540133‘ -pwfile ‘+DATADG/ORCL/PASSWORD/pwdorcl.256.954539259‘
<rac01:orcl1:/home/oracle>$srvctl start database -d orcl
<rac01:orcl1:/home/oracle>$

12c RAC 添加刪除ora.dbanme.db資源