您好,登錄后才能下訂單哦!
一、說明
我們在安裝數據庫集群的時候,最后有一步是使用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>$
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。