Testing 12c Cluster : What-If Command Evaluation with serverpool
The What-if command (eval, predict) is the 12c clusterware new features. This feature is used to determine the impact of cluster operations without actually executing these commands.Administrators can use these commands to analyze and determine the impact of a certain operation before actually executing the operation and minimizes the potential risk.
Check what will happen if we delete server, rac2
--------------------------------------------------
[oracle@rac1 bin]$ ./crsctl eval delete server rac2
Stage Group 1:
--------------------------------------------------------------------------------
Stage Number Required Action
--------------------------------------------------------------------------------
1 Y Resource 'ora.ASMNET1LSNR_ASM.lsnr' (rac2) will
be in state [OFFLINE]
Y Resource 'ora.DATA.dg' (rac2) will be in state
[OFFLINE]
Y Resource 'ora.FRA.dg' (rac2) will be in state
[OFFLINE]
Y Resource 'ora.LISTENER.lsnr' (rac2) will be in
state [OFFLINE]
Y Resource 'ora.LISTENER_SCAN1.lsnr' (1/1) will be
in state [OFFLINE]
Y Resource 'ora.asm' (2/1) will be in state
[OFFLINE]
Y Resource 'ora.net1.network' (rac2) will be in
state [OFFLINE]
Y Resource 'ora.ons' (rac2) will be in state
[OFFLINE]
Y Resource 'ora.orcl.db' (1/1) will be in state
[OFFLINE]
Y Resource 'ora.proxy_advm' (rac2) will be in
state [OFFLINE]
Y Resource 'ora.rac2.vip' (1/1) will be in state
[OFFLINE]
Y Resource 'ora.scan1.vip' (1/1) will be in state
[OFFLINE]
Y Server 'rac2' will be removed from pools
[ora.MONOTST]
2 Y Resource 'ora.rac2.vip' (1/1) will be in state
[ONLINE|INTERMEDIATE] on server [rac1]
Y Resource 'ora.scan1.vip' (1/1) will be in state
[ONLINE] on server [rac1]
3 Y Resource 'ora.LISTENER_SCAN1.lsnr' (1/1) will be
in state [ONLINE|INTERMEDIATE] on server [rac1]
--------------------------------------------------------------------------------
NOTE:
The SRVCTL predict command evaluates the consequences of resource failure.Administrators must use the SRVCTL command with eval option for resources with the .ora prefix.
Check for ASM diskgroup and database
-------------------------------------
[oracle@rac2 bin]$ srvctl predict diskgroup -diskgroup FRA -verbose
Resource ora.FRA.dg will be started on nodes rac1,rac2
[oracle@rac2 bin]$ srvctl predict diskgroup -diskgroup DATA -verbose
Resource ora.DATA.dg will be started on nodes rac1,rac2
[oracle@rac2 bin]$ ./srvctl stop database -db orcl -eval
Database orcl will be stopped on node rac2
[oracle@rac2 bin]$ srvctl predict database -db orcl -verbose
Database orcl will be started on node rac2
Check with Serverpool
------------------------
[oracle@rac2 dbs]$ 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: +FRA/orcl/spfileorcl.ora
Password file: +FRA/orcl/orapworcl
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: MONOTST
Database instances:
Disk Groups: DATA,DATA,FRA
Mount point paths:
Services:
Type: RAC
Start concurrency:
Stop concurrency:
Database is policy managed
[oracle@rac1 bin]$ ./crsctl stat serverpool ora.MONOTST
NAME=ora.MONOTST
ACTIVE_SERVERS=rac2
[oracle@rac2 dbs]$ srvctl remove srvpool -serverpool MONOTST
PRCS-1012 : Failed to remove server pool MONOTST
PRCD-1002 : Database orcl is dependent upon server pool MONOTST
Create a different serverpool, TESTMONO and assign it to orcl database
-----------------------------------------------------------------------
[oracle@rac1 bin]$ srvctl add srvpool -g TESTMONO -l 2 -u 2
[oracle@rac2 bin]$ ./srvctl modify database -d orcl -g TESTMONO -f
[oracle@rac2 bin]$ 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: +FRA/orcl/spfileorcl.ora
Password file: +FRA/orcl/orapworcl
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: TESTMONO
Database instances:
Disk Groups: DATA,DATA
Mount point paths:
Services:
Type: RAC
Start concurrency:
Stop concurrency:
Database is policy managed
[oracle@rac2 bin]$ ./srvctl add srvpool -serverpool MONOTST
Server pool MONOTST already exists
[oracle@rac2 bin]$ ./srvctl add srvpool -serverpool TESTMONO
Server pool TESTMONO already exists
[oracle@rac2 bin]$ ./srvctl remove srvpool -serverpool TESTMONO
PRCS-1012 : Failed to remove server pool TESTMONO
PRCD-1002 : Database orcl is dependent upon server pool TESTMONO
[oracle@rac2 bin]$ ./srvctl remove srvpool -serverpool MONOTST
[oracle@rac2 bin]$ crsctl eval delete serverpool TESTMONO
Stage Group 1:
--------------------------------------------------------------------------------
Stage Number Required Action
--------------------------------------------------------------------------------
1 N Error code [212] for entity [TESTMONO]. Message
is [CRS-2553: Server pool 'TESTMONO' cannot be
unregistered as it does not exist].
--------------------------------------------------------------------------------
Check what will happen if we delete server, rac2
--------------------------------------------------
[oracle@rac1 bin]$ ./crsctl eval delete server rac2
Stage Group 1:
--------------------------------------------------------------------------------
Stage Number Required Action
--------------------------------------------------------------------------------
1 Y Resource 'ora.ASMNET1LSNR_ASM.lsnr' (rac2) will
be in state [OFFLINE]
Y Resource 'ora.DATA.dg' (rac2) will be in state
[OFFLINE]
Y Resource 'ora.FRA.dg' (rac2) will be in state
[OFFLINE]
Y Resource 'ora.LISTENER.lsnr' (rac2) will be in
state [OFFLINE]
Y Resource 'ora.LISTENER_SCAN1.lsnr' (1/1) will be
in state [OFFLINE]
Y Resource 'ora.asm' (2/1) will be in state
[OFFLINE]
Y Resource 'ora.net1.network' (rac2) will be in
state [OFFLINE]
Y Resource 'ora.ons' (rac2) will be in state
[OFFLINE]
Y Resource 'ora.orcl.db' (1/1) will be in state
[OFFLINE]
Y Resource 'ora.proxy_advm' (rac2) will be in
state [OFFLINE]
Y Resource 'ora.rac2.vip' (1/1) will be in state
[OFFLINE]
Y Resource 'ora.scan1.vip' (1/1) will be in state
[OFFLINE]
Y Server 'rac2' will be removed from pools
[ora.MONOTST]
2 Y Resource 'ora.rac2.vip' (1/1) will be in state
[ONLINE|INTERMEDIATE] on server [rac1]
Y Resource 'ora.scan1.vip' (1/1) will be in state
[ONLINE] on server [rac1]
3 Y Resource 'ora.LISTENER_SCAN1.lsnr' (1/1) will be
in state [ONLINE|INTERMEDIATE] on server [rac1]
--------------------------------------------------------------------------------
NOTE:
The SRVCTL predict command evaluates the consequences of resource failure.Administrators must use the SRVCTL command with eval option for resources with the .ora prefix.
Check for ASM diskgroup and database
-------------------------------------
[oracle@rac2 bin]$ srvctl predict diskgroup -diskgroup FRA -verbose
Resource ora.FRA.dg will be started on nodes rac1,rac2
[oracle@rac2 bin]$ srvctl predict diskgroup -diskgroup DATA -verbose
Resource ora.DATA.dg will be started on nodes rac1,rac2
[oracle@rac2 bin]$ ./srvctl stop database -db orcl -eval
Database orcl will be stopped on node rac2
[oracle@rac2 bin]$ srvctl predict database -db orcl -verbose
Database orcl will be started on node rac2
Check with Serverpool
------------------------
[oracle@rac2 dbs]$ 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: +FRA/orcl/spfileorcl.ora
Password file: +FRA/orcl/orapworcl
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: MONOTST
Database instances:
Disk Groups: DATA,DATA,FRA
Mount point paths:
Services:
Type: RAC
Start concurrency:
Stop concurrency:
Database is policy managed
[oracle@rac1 bin]$ ./crsctl stat serverpool ora.MONOTST
NAME=ora.MONOTST
ACTIVE_SERVERS=rac2
[oracle@rac2 dbs]$ srvctl remove srvpool -serverpool MONOTST
PRCS-1012 : Failed to remove server pool MONOTST
PRCD-1002 : Database orcl is dependent upon server pool MONOTST
Create a different serverpool, TESTMONO and assign it to orcl database
-----------------------------------------------------------------------
[oracle@rac1 bin]$ srvctl add srvpool -g TESTMONO -l 2 -u 2
[oracle@rac2 bin]$ ./srvctl modify database -d orcl -g TESTMONO -f
[oracle@rac2 bin]$ 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: +FRA/orcl/spfileorcl.ora
Password file: +FRA/orcl/orapworcl
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: TESTMONO
Database instances:
Disk Groups: DATA,DATA
Mount point paths:
Services:
Type: RAC
Start concurrency:
Stop concurrency:
Database is policy managed
[oracle@rac2 bin]$ ./srvctl add srvpool -serverpool MONOTST
Server pool MONOTST already exists
[oracle@rac2 bin]$ ./srvctl add srvpool -serverpool TESTMONO
Server pool TESTMONO already exists
[oracle@rac2 bin]$ ./srvctl remove srvpool -serverpool TESTMONO
PRCS-1012 : Failed to remove server pool TESTMONO
PRCD-1002 : Database orcl is dependent upon server pool TESTMONO
[oracle@rac2 bin]$ ./srvctl remove srvpool -serverpool MONOTST
[oracle@rac2 bin]$ crsctl eval delete serverpool TESTMONO
Stage Group 1:
--------------------------------------------------------------------------------
Stage Number Required Action
--------------------------------------------------------------------------------
1 N Error code [212] for entity [TESTMONO]. Message
is [CRS-2553: Server pool 'TESTMONO' cannot be
unregistered as it does not exist].
--------------------------------------------------------------------------------
Comments
Post a Comment