12c RAC 添加删除ora.dbanme.db资源

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了12c RAC 添加删除ora.dbanme.db资源相关的知识,希望对你有一定的参考价值。

一、说明
我们在安装数据库集群的时候,最后有一步是使用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资源的主要内容,如果未能解决你的问题,请参考以下文章

Oracle RACLinux系统Oracle12c RAC安装配置详细记录过程V2.0(图文并茂)

vmware安装oracle 12c rac内存一般设多大

Oracle 12C Rac到Rac搭建ADG

12c rac to rac dg 遇到关于权限报错

12c ADG无法删除备库归档RMAN-08137

oracle12c rac搭建时主机名无效问题的解决