千家信息网

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

发表于:2025-01-21 作者:千家信息网编辑
千家信息网最后更新 2025年01月21日,一、说明我们在安装数据库集群的时候,最后有一步是使用DBCA建库,建库的过程中到底在集群资源中做了什么呢?实际上添加了一个ora.dbname.db这个集群资源。删除数据库的方法1、使用DBCA进行删
千家信息网最后更新 2025年01月21日12c RAC 添加删除ora.dbanme.db资源

一、说明
我们在安装数据库集群的时候,最后有一步是使用DBCA建库,建库的过程中到底在集群资源中做了什么呢?实际上添加了一个ora.dbname.db这个集群资源。
删除数据库的方法
1、使用DBCA进行删除,这个大家都会
2、手动删库,先删除集群资源ora.dbanme.db,然后到ASM中删除相关数据即可。

二、操作步骤
1、查看数据库配置

$srvctl config database -d orclDatabase unique name: orclDatabase name: orclOracle home: /u01/app/oracle/product/12.1.0/dbhome_1Oracle user: oracleSpfile: +DATADG/ORCL/PARAMETERFILE/spfile.268.954540133Password file: +DATADG/ORCL/PASSWORD/pwdorcl.256.954539259Domain: Start options: openStop options: immediateDatabase role: PRIMARYManagement policy: AUTOMATICServer pools: Disk Groups: DATADGMount point paths: Services: Type: RACStart concurrency: Stop concurrency: OSDBA group: dbaOSOPER group: operDatabase instances: orcl1,orcl2Configured nodes: rac01,rac02Database is administrator managed$

2、删除资源

--grid用户执行srvctl stop database -d orcl--oracle 用户执行$srvctl remove instance -d orcl -i  orcl1Remove instance from the database orcl? (y/[n]) y$srvctl remove instance -d orcl -i  orcl2Remove instance from the database orcl? (y/[n]) y$srvctl config database -d orclDatabase unique name: orclDatabase name: orclOracle home: /u01/app/oracle/product/12.1.0/dbhome_1Oracle user: oracleSpfile: +DATADG/ORCL/PARAMETERFILE/spfile.268.954540133Password file: +DATADG/ORCL/PASSWORD/pwdorcl.256.954539259Domain: Start options: openStop options: immediateDatabase role: PRIMARYManagement policy: AUTOMATICServer pools: Disk Groups: DATADGMount point paths: Services: Type: RACStart concurrency: Stop concurrency: OSDBA group: dbaOSOPER group: operDatabase instances: Configured nodes: Database is administrator managed$$srvctl remove database -d orclRemove the database orcl? (y/[n]) y

3、再添加资源

--oracle 用户 srvctl add database -d orcl -o $ORACLE_HOMEsrvctl add instance -d orcl -n rac01 -i orcl1srvctl add instance -d orcl -n rac02 -i orcl2$srvctl add database -d orcl -o $ORACLE_HOME$srvctl config database -d orclDatabase unique name: orclDatabase name: Oracle home: /u01/app/oracle/product/12.1.0/dbhome_1Oracle user: oracleSpfile: Password file: Domain: Start options: openStop options: immediateDatabase role: PRIMARYManagement policy: AUTOMATICServer pools: Disk Groups: Mount point paths: Services: Type: RACStart concurrency: Stop concurrency: OSDBA group: dbaOSOPER group: operDatabase 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 orclDatabase unique name: orclDatabase name: Oracle home: /u01/app/oracle/product/12.1.0/dbhome_1Oracle user: oracleSpfile: Password file: Domain: Start options: openStop options: immediateDatabase role: PRIMARYManagement policy: AUTOMATICServer pools: Disk Groups: Mount point paths: Services: Type: RACStart concurrency: Stop concurrency: OSDBA group: dbaOSOPER group: operDatabase instances: orcl1,orcl2Configured nodes: rac01,rac02Database 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$
0