Friday, June 5, 2015


Convert Oracle RAC Cluster to RAC One 


During one of the recent deployments, we came across the scenario, where we have to convert out two node RAC cluster to One Node RAC One node.
We tried to find proper MOS note but could not find any, though there are plenty of notes to convert the otherwise i.e. from RAC One to RAC.

So I thought it will be good to put up a note with all the detailed information. 

NodeA -

SYS@racon1 SQL> sho parameter service

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
service_names                        string      racon


$ srvctl config database -d racon
Database unique name: racon
Database name: racon
Oracle home: /ora01/app/oracle/product/11.2.0.4/db_1
Oracle user: oracle
Spfile: +DATA1/racon/spfileracon.ora
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: racon
Database instances: racon1,racon2
Disk Groups: DATA1,ARCH1,REDO1,REDO2
Mount point paths:
Services:
Type: RAC
Database is administrator managed

$ crsctl stat res  | grep ora.racon.db
NAME=ora.racon.db
< NodeA : racon1 : oracle : /users/oracle >
$ crsctl stat res ora.racon.db -p
NAME=ora.racon.db
TYPE=ora.database.type
ACL=owner:oracle:rwx,pgrp:oinstall:r--,other::r--,group:dba:r-x,group:oinstall:r-x,user:grid:r-x
ACTION_FAILURE_TEMPLATE=
ACTION_SCRIPT=
ACTIVE_PLACEMENT=1
AGENT_FILENAME=%CRS_HOME%/bin/oraagent%CRS_EXE_SUFFIX%
AUTO_START=restore
CARDINALITY=2
.................
.................
GEN_START_OPTIONS@SERVERNAME(NodeA)=open
GEN_START_OPTIONS@SERVERNAME(NodeB)=open
GEN_USR_ORA_INST_NAME=
GEN_USR_ORA_INST_NAME@SERVERNAME(NodeA)=racon1
GEN_USR_ORA_INST_NAME@SERVERNAME(NodeB)=racon2
HOSTING_MEMBERS=
INSTANCE_FAILOVER=0
LOAD=1
LOGGING_LEVEL=1
MANAGEMENT_POLICY=AUTOMATIC
NLS_LANG=
NOT_RESTARTING_TEMPLATE=
OFFLINE_CHECK_INTERVAL=0
ONLINE_RELOCATION_TIMEOUT=0
ORACLE_HOME=/ora01/app/oracle/product/11.2.0.4/db_1
ORACLE_HOME_OLD=
PLACEMENT=restricted
PROFILE_CHANGE_TEMPLATE=
RESTART_ATTEMPTS=2
ROLE=PRIMARY
SCRIPT_TIMEOUT=60
SERVER_POOLS=ora.racon
SPFILE=+DATA1/racon/spfileracon.ora
START_DEPENDENCIES=hard(ora.DATA1.dg,ora.ARCH1.dg,ora.REDO1.dg,ora.REDO2.dg) weak(type:ora.listener.type,global:type:ora.scan_listener.type,uniform:ora.ons,global:ora.gns) pullup(ora.DATA1.dg,ora.ARCH1.dg,ora.REDO1.dg,ora.REDO2.dg)
START_TIMEOUT=600
STATE_CHANGE_TEMPLATE=
STOP_DEPENDENCIES=hard(intermediate:ora.asm,shutdown:ora.DATA1.dg,shutdown:ora.ARCH1.dg,shutdown:ora.REDO1.dg,shutdown:ora.REDO2.dg)
STOP_TIMEOUT=600
TYPE_VERSION=3.2
UPTIME_THRESHOLD=1h
USR_ORA_DB_NAME=racon
USR_ORA_DOMAIN=
USR_ORA_INST_NAME=
USR_ORA_INST_NAME@SERVERNAME(NodeA)=racon1
USR_ORA_INST_NAME@SERVERNAME(NodeB)=racon2
USR_ORA_OPEN_MODE=open
USR_ORA_OPI=false
USR_ORA_STOP_MODE=immediate
VERSION=11.2.0.4.0

SYS@racon1 SQL> sho parameter listener

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
listener_networks                    string
local_listener                       string       (ADDRESS=(PROTOCOL=TCP)(HOST=
                                                 10.18.nn.nn)(PORT=1521))
remote_listener                      string      xxxx.com:1521


$ srvctl status database -d racon
Instance racon1 is running on node NodeA
Instance racon2 is running on node NodeB

-- Prior to converting an Oracle RAC database to an Oracle RAC One Node database, you must first ensure that the Oracle RAC database has only one instance.

$srvctl stop instance  -d racon -i  racon2

< NodeA : racon1 : oracle : /users/oracle >
$ srvctl stop instance  -d racon -i  racon2

< NodeA : racon1 : oracle : /users/oracle >
$ srvctl status database -d racon
Instance racon1 is running on node NodeA
Instance racon2 is not running on node NodeB


$ srvctl convert database -d racon  -c RACONENODE -i racon1 -w 30
PRCD-1214 : Administrator-managed RAC database racon has more than one instance

$ srvctl remove instance -d racon -i racon2
Remove instance from the database racon? (y/[n]) y


$ crsctl stat res ora.racon.db -p
NAME=ora.racon.db
TYPE=ora.database.type
ACL=owner:oracle:rwx,pgrp:oinstall:r--,other::r--,group:dba:r-x,group:oinstall:r-x,user:grid:r-x
ACTION_FAILURE_TEMPLATE=
ACTION_SCRIPT=
ACTIVE_PLACEMENT=1
AGENT_FILENAME=%CRS_HOME%/bin/oraagent%CRS_EXE_SUFFIX%
AUTO_START=restore
CARDINALITY=1
CHECK_INTERVAL=1
CHECK_TIMEOUT=30
CLUSTER_DATABASE=true
DATABASE_TYPE=RAC
DB_UNIQUE_NAME=racon
DEFAULT_TEMPLATE=PROPERTY(RESOURCE_CLASS=database) PROPERTY(DB_UNIQUE_NAME= CONCAT(PARSE(%NAME%, ., 2), %USR_ORA_DOMAIN%, .)) ELEMENT(INSTANCE_NAME= %GEN_USR_ORA_INST_NAME%) ELEMENT(DATABASE_TYPE= %DATABASE_TYPE%)
DEGREE=1
DESCRIPTION=Oracle Database resource
ENABLED=1
FAILOVER_DELAY=0
FAILURE_INTERVAL=60
FAILURE_THRESHOLD=1
GEN_AUDIT_FILE_DEST=/ora47/adump/racon
GEN_START_OPTIONS=
GEN_START_OPTIONS@SERVERNAME(NodeA)=open
GEN_START_OPTIONS@SERVERNAME(NodeB)=open
GEN_USR_ORA_INST_NAME=
GEN_USR_ORA_INST_NAME@SERVERNAME(NodeA)=racon1


$ srvctl convert database -d racon  -c RACONENODE -i racon1 -w 30
PRCD-1242 : Unable to convert RAC database racon to RAC One Node database because the database had no service added

$ srvctl add  service -d racon -s racon -r racon1
PRCD-1210 : The service name racon cannot be same as the database default service name racon

$ srvctl add  service -d racon -s racon_svc -r racon1

$ srvctl config service -d racon -s racon_svc
Service name: racon_svc
Service is enabled
Server pool: racon_racon_svc
Cardinality: 1
Disconnect: false
Service role: PRIMARY
Management policy: AUTOMATIC
DTP transaction: false
AQ HA notifications: false
Failover type: NONE
Failover method: NONE
TAF failover retries: 0
TAF failover delay: 0
Connection Load Balancing Goal: LONG
Runtime Load Balancing Goal: NONE
TAF policy specification: NONE
Edition:
Preferred instances: racon1
Available instances:

 < NodeA : racon1 : oracle : /users/oracle >
$ srvctl convert database -d racon  -c RACONENODE -i racon1 -w 30

$ srvctl config database -d racon
Database unique name: racon
Database name: racon
Oracle home: /ora01/app/oracle/product/11.2.0.4/db_1
Oracle user: oracle
Spfile: +DATA1/racon/spfileracon.ora
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: racon
Database instances:
Disk Groups: DATA1,ARCH1,REDO1,REDO2
Mount point paths:
Services: racon_svc
Type: RACOneNode
Online relocation timeout: 30
Instance name prefix: racon1
Candidate servers: NodeA
Database is administrator managed


$ srvctl relocate database -d racon -n NodeB
< NodeA : racon1 : oracle : /users/oracle >
$ srvctl status database -d racon
Instance racon1_2 is running on node NodeB
Online relocation: INACTIVE

$ srvctl relocate database -d racon -n NodeA
< NodeA : racon1 : oracle : /users/oracle >
$ srvctl status database -d racon
Instance racon1_1 is running on node NodeA
Online relocation: INACTIVE

So as you can see the conversion completed successfully and so is the relocation.. 
Hope that helps...

No comments:

Post a Comment