12c在集群操作rac与rac one node互相转换的实验

-- 首先在集群里停掉2号节点的实例
[oracle@host01 app]$ srvctl stop instance -d racdb -i racdb_2


--查看rac的类型,目前显示为(Type: RAC)
[oracle@host01 app]$ srvctl config database -d racdb
Database unique name: racdb
Database name: racdb
Oracle home: /u01/app/oracle/product/12.1.0/db_1
Oracle user: oracle
Spfile: +DATA/RACDB/PARAMETERFILE/spfile.288.960026421
Password file: +DATA/RACDB/PASSWORD/pwdracdb.276.960026013
Domain: 
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: racdbpool
Disk Groups: FRA,DATA
Mount point paths: 
Services: RACDBACN
Type: RAC
Start concurrency: 
Stop concurrency: 
OSDBA group: dba
OSOPER group: oper
Database instances: 
Configured nodes: 
Database is policy managed


-- 转换成rac one node类型
[oracle@host01 app]$ srvctl convert database -d racdb -c RACONENODE


-- 再查看rac的类型,此时显示(Type: RACOneNode)
[oracle@host01 app]$ srvctl config database -d racdb
Database unique name: racdb
Database name: racdb
Oracle home: /u01/app/oracle/product/12.1.0/db_1
Oracle user: oracle
Spfile: +DATA/RACDB/PARAMETERFILE/spfile.288.960026421
Password file: +DATA/RACDB/PASSWORD/pwdracdb.276.960026013
Domain: 
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: racdbpool
Disk Groups: FRA,DATA
Mount point paths: 
Services: RACDBACN
Type: RACOneNode
Online relocation timeout: 30
Instance name prefix: racdb
Candidate servers: 
OSDBA group: dba
OSOPER group: oper
Database instances: 
Database is policy managed


-- 尝试再重新转换回rac类型
[oracle@host01 app]$ srvctl convert database -d racdb -c RAC


-- 查看rac的类型,已经变成rac了,而且在两个节点上的实例也被起来了
[oracle@host01 app]$ srvctl config database -d racdb
Database unique name: racdb
Database name: racdb
Oracle home: /u01/app/oracle/product/12.1.0/db_1
Oracle user: oracle
Spfile: +DATA/RACDB/PARAMETERFILE/spfile.288.960026421
Password file: +DATA/RACDB/PASSWORD/pwdracdb.276.960026013
Domain: 
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: racdbpool
Disk Groups: FRA,DATA
Mount point paths: 
Services: RACDBACN
Type: RAC
Start concurrency: 
Stop concurrency: 
OSDBA group: dba
OSOPER group: oper
Database instances: 
Configured nodes: 
Database is policy managed


-- 再重新转换回rac one node
[oracle@host01 app]$ srvctl convert database -d racdb -c RACONENODE
PRCD-1154 : Failed to convert the configuration of cluster database racdb into its equivalent RAC One Node database configuration because cluster database is running on more than one server [host02, host01]


-- 提示有两个节点在跑,关掉2号节点
[oracle@host01 app]$ srvctl stop instance -d racdb -i racdb_2
PRCD-1315 : failed to stop instances for database racdb
PRCR-1014 : Failed to stop resource ora.racdb.db
PRCR-1065 : Failed to stop resource ora.racdb.db
CRS-2529: Unable to act on 'ora.racdb.db' because that would require stopping or relocating 'ora.racdb.racserv.svc', but the force option was not specified


-- 提示要先关掉racserv这个service才能关闭2号节点实例
[oracle@host01 app]$ srvctl stop service -d RACDB -s racserv


-- 再次关闭实例
[oracle@host01 app]$ srvctl stop instance -d racdb -i racdb_2


-- 转换rac至rac one node
[oracle@host01 app]$ srvctl convert database -d racdb -c RACONENODE


-- 查状态,转换成功
[oracle@host01 app]$ srvctl config database -d racdb
Database unique name: racdb
Database name: racdb
Oracle home: /u01/app/oracle/product/12.1.0/db_1
Oracle user: oracle
Spfile: +DATA/RACDB/PARAMETERFILE/spfile.288.960026421
Password file: +DATA/RACDB/PASSWORD/pwdracdb.276.960026013
Domain: 
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: racdbpool
Disk Groups: FRA,DATA
Mount point paths: 
Services: RACDBACN
Type: RACOneNode
Online relocation timeout: 30
Instance name prefix: racdb
Candidate servers: 
OSDBA group: dba
OSOPER group: oper
Database instances: 
Database is policy managed


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/31457562/viewspace-2147246/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/31457562/viewspace-2147246/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值