Scenario Preview:
We have 2 node RAC 12.1.0.2.0 on linux SLES 12 SP5. Now we will scale down 2 node RAC to 1 node RAC, We face some error also so we will discuss them below. We have not removed any error, So if u face similar error u can also validate the same.
- Check the status of 2 node RAC
srv1:~ # crsctl status resource -t
--------------------------------------------------------------------------------
Name Target State Server State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.CRS.dg
ONLINE ONLINE srv1 STABLE
ONLINE ONLINE srv2 STABLE
ora.DATA.dg
ONLINE ONLINE srv1 STABLE
ONLINE ONLINE srv2 STABLE
ora.FRA.dg
ONLINE ONLINE srv1 STABLE
ONLINE ONLINE srv2 STABLE
ora.LISTENER.lsnr
ONLINE ONLINE srv1 STABLE
ONLINE ONLINE srv2 STABLE
ora.asm
ONLINE ONLINE srv1 Started,STABLE
ONLINE ONLINE srv2 Started,STABLE
ora.net1.network
ONLINE ONLINE srv1 STABLE
ONLINE ONLINE srv2 STABLE
ora.ons
ONLINE ONLINE srv1 STABLE
ONLINE ONLINE srv2 STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE srv1 STABLE
ora.LISTENER_SCAN2.lsnr
1 ONLINE ONLINE srv2 STABLE
ora.LISTENER_SCAN3.lsnr
1 ONLINE ONLINE srv2 STABLE
ora.MGMTLSNR
1 ONLINE ONLINE srv1 169.254.52.81 192.16
8.10.1,STABLE
ora.cvu
1 ONLINE ONLINE srv2 STABLE
ora.mgmtdb
1 ONLINE ONLINE srv1 Open,STABLE
ora.oc4j
1 ONLINE ONLINE srv2 STABLE
ora.rac.db
1 ONLINE ONLINE srv1 Open,STABLE
2 ONLINE ONLINE srv2 Open,STABLE
ora.rac.pretaf.svc
1 ONLINE ONLINE srv1 STABLE
ora.rac.pretaf_preconnect.svc
1 ONLINE ONLINE srv2 STABLE
ora.scan1.vip
1 ONLINE ONLINE srv1 STABLE
ora.scan2.vip
1 ONLINE ONLINE srv2 STABLE
ora.scan3.vip
1 ONLINE ONLINE srv2 STABLE
ora.srv1.vip
1 ONLINE ONLINE srv1 STABLE
ora.srv2.vip
1 ONLINE ONLINE srv2 STABLE
--------------------------------------------------------------------------------
- Stop the instance RAC2 on srv2 node ( As we have added TAF policy on grid so it will not able to stop instance so stop pretaf_preconnect service see or relocate it , You can also remove the service |crsctl stop crs to stop all clusterware service on node), Once pretaf_preconnect poilcy is stopped we can stop the instance on node srv2
srv1:~ # srvctl stop instance -i RAC2 -d RAC
- Check the status of instance and service
srv1:~ # crsctl status resource -t
--------------------------------------------------------------------------------
Name Target State Server State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.CRS.dg
ONLINE ONLINE srv1 STABLE
ONLINE ONLINE srv2 STABLE
ora.DATA.dg
ONLINE ONLINE srv1 STABLE
ONLINE ONLINE srv2 STABLE
ora.FRA.dg
ONLINE ONLINE srv1 STABLE
ONLINE ONLINE srv2 STABLE
ora.LISTENER.lsnr
ONLINE ONLINE srv1 STABLE
ONLINE ONLINE srv2 STABLE
ora.asm
ONLINE ONLINE srv1 Started,STABLE
ONLINE ONLINE srv2 Started,STABLE
ora.net1.network
ONLINE ONLINE srv1 STABLE
ONLINE ONLINE srv2 STABLE
ora.ons
ONLINE ONLINE srv1 STABLE
ONLINE ONLINE srv2 STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE srv1 STABLE
ora.LISTENER_SCAN2.lsnr
1 ONLINE ONLINE srv2 STABLE
ora.LISTENER_SCAN3.lsnr
1 ONLINE ONLINE srv2 STABLE
ora.MGMTLSNR
1 ONLINE ONLINE srv1 169.254.52.81 192.16
8.10.1,STABLE
ora.cvu
1 ONLINE ONLINE srv2 STABLE
ora.mgmtdb
1 ONLINE ONLINE srv1 Open,STABLE
ora.oc4j
1 ONLINE ONLINE srv2 STABLE
ora.rac.db
1 ONLINE ONLINE srv1 Open,STABLE
2 OFFLINE OFFLINE Instance Shutdown,ST
ABLE
ora.rac.pretaf.svc
1 ONLINE ONLINE srv1 STABLE
ora.rac.pretaf_preconnect.svc
1 OFFLINE OFFLINE STABLE
ora.scan1.vip
1 ONLINE ONLINE srv1 STABLE
ora.scan2.vip
1 ONLINE ONLINE srv2 STABLE
ora.scan3.vip
1 ONLINE ONLINE srv2 STABLE
ora.srv1.vip
1 ONLINE ONLINE srv1 STABLE
ora.srv2.vip
1 ONLINE ONLINE srv2 STABLE
--------------------------------------------------------------------------------
srv1:~ #
- Remove the instance RAC2
srv1:~ # srvctl remove instance -d RAC -i RAC2
Remove instance from the database RAC? (y/[n]) y
srv1:~ #
- It will throw error so use oracle user not root user
- srv1:~ # srvctl convert database -d RAC -c RACONENODE -i RAC2 -w 5
PRCD-1153 : Failed to convert the configuration of cluster database RAC into its equivalent RAC One Node database configuration
PRKH-1014 : Current user "root" is not the oracle owner user "oracle" of oracle home "/u01/app/oracle/product/12.1.0/db_1"
srv1:~ # su oracle
oracle@srv1:/root> . oraenv
ORACLE_SID = [+ASM1] ?
ORACLE_BASE environment variable is not being set since this
information is not available for the current user ID oracle.
You can set ORACLE_BASE manually if it is required.
Resetting ORACLE_BASE to its previous value or ORACLE_HOME
The Oracle base remains unchanged with value /u01/app/grid
- Now convert the database to RAC ONE NODE , But TAF policy services are already existed, so remove the service
oracle@srv1:/root> srvctl convert database -d RAC -c srv2 -i RAC2 -w 5
PRKO-2003 : Invalid command line option value: srv2
oracle@srv1:/root> srvctl convert database -d RAC -c RACONENODE -i RAC2 -w 5
PRCD-1156 : Failed to convert the configuration of cluster database RAC into its equivalent configuration for RAC One Node database due to its services pretaf having PRECONNECT TAF policy
oracle@srv1:/root>
- Stop and remove the TAF services
oracle@srv1:/root> srvctl stop service -database rac -service pretaf
oracle@srv1:/root> srvctl convert database -d RAC -c RACONENODE -i RAC2 -w 5
PRCD-1156 : Failed to convert the configuration of cluster database RAC into its equivalent configuration for RAC One Node database due to its services pretaf having PRECONNECT TAF policy
oracle@srv1:/root> srvctl remove service -database rac -service pretaf
- Now at least one service should be there on RAC
oracle@srv1:/root> srvctl convert database -d RAC -c RACONENODE -i RAC2 -w 5
PRCD-1242 : Unable to convert RAC database RAC to RAC One Node database because the database had no service added
- Add the service as per requirements
oracle@srv1:/root> srvctl add service -db rac -service staf -preferred RAC1
- Finally Convert database to One Node RAC
oracle@srv1:/root> srvctl convert database -d RAC -c RACONENODE -i RAC2 -w 5
- Check the status ( RAC node is for cold fail over also for low budget setup, We will also do cold failoveron upcoming days)
oracle@srv1:/root> srvctl config database -d RAC
Database unique name: RAC
Database name: RAC
Oracle home: /u01/app/oracle/product/12.1.0/db_1
Oracle user: oracle
Spfile: +DATA/RAC/PARAMETERFILE/spfile.274.1038413121
Password file: +DATA/RAC/PASSWORD/pwdrac.262.1038412435
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools:
Disk Groups: FRA,DATA
Mount point paths:
Services: staf
Type: RACOneNode
Online relocation timeout: 5
Instance name prefix: RAC2
Candidate servers: srv1
OSDBA group: dba
OSOPER group: oper
Database instances:
Database is administrator managed
oracle@srv1:/root>
No comments:
Post a Comment