Monday, November 11, 2024

How to disable/setup autostart parameters for specified instance ?

Q: We have a 4-node RAC. I need to disable autostart of the DB on one node only.
   How to do it and how to see autostart parameters, confirming that specified instance was disabled?
   I didn’t find this in the output of the command: crsctl status res –t.


A:
You're right, crsctl status res –t don't show the instance autostart parameter.
The crsctl also don't show the disabled instance:
 

[root@exa1dbadm01 ~]# crsctl status res ora.orcl.db

NAME=ora.orcl.db
TYPE=ora.database.type
TARGET=ONLINE                  , ONLINE
STATE=ONLINE on exa1dbadm01, ONLINE on exa1dbadm02

[root@exa1dbadm01 ~]# crsctl status res ora.orcl.db -p
NAME=ora.orcl.db
TYPE=ora.database.type
ACL=owner:oracle:rwx,pgrp:oinstall:r--,other::r--,group:dba:r-x,group:racoper:r-x,user:grid:r-x
ACTIONS=relocate_client,group:"dba",group:"racoper",user:"grid",user:"oracle" status_target,group:"dba",group:"racoper",user:"grid",user:"oracle" listJavaServices,group:"dba",group:"racoper",user:"grid",user:"oracle" isPUJSDone,group:"dba",group:"racoper",user:"grid",user:"oracle" unmonitor,user:"grid" serviceDrain,group:"dba",group:"racoper",user:"grid",user:"oracle" monitor,user:"grid" startoption,group:"dba",group:"racoper",user:"grid",user:"oracle"
ACTION_SCRIPT=
ACTION_START_OPTION=
ACTION_TIMEOUT=600
ACTIVE_PLACEMENT=0
AGENT_FILENAME=%CRS_HOME%/bin/oraagent%CRS_EXE_SUFFIX%
ALLOW_RESTART=default
AUTO_START=restore
CARDINALITY=2
CHECK_INTERVAL=900
CHECK_TIMEOUT=30
CLEAN_TIMEOUT=60
CLUSTER_DATABASE=true
CSS_CRITICAL=no
DATABASE_TYPE=RAC
DB_UNIQUE_NAME=orcl
DEFAULT_NETNUM=
DELETE_TIMEOUT=60
DESCRIPTION=Oracle Database resource
DISABLED_REASON=
DRAIN_ID=
DRAIN_TIMEOUT=
ENABLED=1
ENABLED@SERVERNAME(exa1dbadm02)=0
FAILOVER_DELAY=0
FAILURE_INTERVAL=60
FAILURE_THRESHOLD=1
GEN_AUDIT_FILE_DEST=/u01/app/oracle/product/19.0.0.0/dbhome_1/rdbms/audit
GEN_RESTART=
GEN_RESTART@SERVERNAME(exa1dbadm01)=StartCompleted
GEN_RESTART@SERVERNAME(exa1dbadm02)=StartCompleted
GEN_START_OPTIONS=
GEN_USR_ORA_INST_NAME=
GEN_USR_ORA_INST_NAME@SERVERNAME(exa1dbadm01)=orcl1
GEN_USR_ORA_INST_NAME@SERVERNAME(exa1dbadm02)=orcl2
HOSTING_MEMBERS=
IGNORE_TARGET_ON_FAILURE=no
INSTANCE_FAILOVER=0
INTERMEDIATE_TIMEOUT=0
JAVA_SERVICES=
LOAD=1
LOGGING_LEVEL=1
MANAGEMENT_POLICY=AUTOMATIC
MODIFY_TIMEOUT=60
NLS_LANG=
OFFLINE_CHECK_INTERVAL=0
ONLINE_RELOCATION_TIMEOUT=0
ORACLE_HOME=/u01/app/oracle/product/19.0.0.0/dbhome_1
ORACLE_HOME_OLD=
PATCH_IN_PROGRESS=false
PLACEMENT=restricted
PWFILE=+DATAC1/orcl/PASSWORD/pwdorcl.258.1149713235
RANK=0
RELOCATE_ACTION=0
RELOCATE_BY_DEPENDENCY=1
RELOCATE_KIND=offline
RESOURCE_GROUP=
RESTART_ATTEMPTS=2
RESTART_DELAY=0
ROLE=PRIMARY
SCRIPT_TIMEOUT=60
SERVER_CATEGORY=
SERVER_POOLS=ora.orcl
SERVER_POOLS_PQ=
SERVER_POOLS_RF=
SERVICE_NAMES=
SPFILE=+DATAC1/orcl/PARAMETERFILE/spfile.270.1149714021
START_CONCURRENCY=0
START_DEPENDENCIES=hard(global:uniform:ora.DATAC1.dg, global:uniform:ora.RECOC1.dg) pullup(global:ora.DATAC1.dg, global:ora.RECOC1.dg) weak(type:ora.listener.type,global:type:ora.scan_listener.type,uniform:ora.ons,global:ora.gns)
START_DEPENDENCIES_RTE_INTERNAL=<xml><Cond name="ASMClientMode">False</Cond><Cond name="ASMmode">remote</Cond><Arg name="dg" type="ResList">ora.DATAC1.dg,ora.RECOC1.dg</Arg><Arg name="acfs_or_nfs" type="ResList"></Arg><Cond name="OHResExist">False</Cond><Cond name="DATABASE_TYPE">RAC</Cond><Cond name="MANAGEMENT_POLICY">AUTOMATIC</Cond><Arg name="acfs_and_nfs" type="ResList"></Arg></xml>
START_DEPENDENCIES_TEMPLATE=<xml>hard(<If cond="ASMClientMode" op="neq" value="True"><Then><If cond="ASMmode" value="remote"><Then><ResList>uniform:global:{dg}</ResList>,</Then><Else><ResList>{dg}</ResList>,</Else></If></Then></If><ResList>{acfs_or_nfs}</ResList><If cond="OHResExist" value="True"><Then>,<Res>{oraclehome}</Res></Then></If>) weak(<If cond="DATABASE_TYPE" op="eql" value="RAC|RACOneNode"><Then>type:ora.listener.type,global:type:ora.scan_listener.type,uniform:ora.ons,global:ora.gns</Then><Else>type:ora.listener.type,uniform:ora.ons</Else></If>) dispersion(<If cond="DATABASE_TYPE" value="RACOneNode"><Then><If cond="DB_CENTRIC" value="False"><Then>type:ora.database.type</Then></If></Then></If>) pullup(<If cond="ASMClientMode" op="neq" value="True"><Then><If cond="MANAGEMENT_POLICY" op="neql" value="MANUAL|NORESTART"><Then><If cond="ASMmode" value="remote"><Then><ResList>global:{dg}</ResList>,</Then><Else><ResList>{dg}</ResList>,</Else></If></Then></If></Then></If><ResList>{acfs_and_nfs}</ResList><If cond="OHResExist" value="True"><Then>,<Res>{oraclehome}</Res></Then></If>)</xml>
START_TIMEOUT=600
STOP_CONCURRENCY=0
STOP_DEPENDENCIES=hard(global:intermediate:ora.asm,global:shutdown:ora.DATAC1.dg,global:shutdown:ora.RECOC1.dg)
STOP_DEPENDENCIES_RTE_INTERNAL=<xml><Cond name="ASMClientMode">False</Cond><Cond name="DGExist">True</Cond><Cond name="ASMmode">remote</Cond><Arg name="dg" type="ResList">ora.DATAC1.dg,ora.RECOC1.dg</Arg><Arg name="acfs_same_as_oh" type="Res"></Arg><Arg name="acfs" type="ResList"></Arg><Cond name="OHResExist">False</Cond></xml>
STOP_DEPENDENCIES_TEMPLATE=<xml><If cond="ASMClientMode" op="neq" value="True"><Then><If cond="DGExist" value="True"><Then><If cond="ASMmode" value="remote"> <Then>hard(global:intermediate:ora.asm,<ResList>global:shutdown:{dg}</ResList>)</Then> <Else>hard(intermediate:ora.asm,<ResList>shutdown:{dg}</ResList>)</Else> </If></Then> </If>hard(<Res>{acfs_same_as_oh}</Res>,<ResList>intermediate:{acfs}</ResList>)</Then> <Else>hard(intermediate:<Res>{nfs}</Res>)</Else> </If><If cond="OHResExist" value="True"><Then>hard(intermediate: <Res>{oraclehome}</Res>)</Then></If></xml>
STOP_TIMEOUT=600
TARGET_DEFAULT=default
TARGET_NAME=
TARGET_TYPE=
TYPE_VERSION=3.3
UPTIME_THRESHOLD=1h
USER_WORKLOAD=yes
USE_QOS_DATA=no
USE_STICKINESS=0
USR_ORA_DB_NAME=orcl
USR_ORA_DOMAIN=
USR_ORA_ENV=
USR_ORA_FLAGS=
USR_ORA_INST_NAME=
USR_ORA_INST_NAME@SERVERNAME(exa1dbadm01)=orcl1
USR_ORA_INST_NAME@SERVERNAME(exa1dbadm02)=orcl2
USR_ORA_OPEN_MODE=open
USR_ORA_OPI=false
USR_ORA_STOP_MODE=immediate
WORKLOAD_CPU=0
WORKLOAD_CPU_CAP=0
WORKLOAD_MEMORY_MAX=0
WORKLOAD_MEMORY_TARGET=0

[root@exa1dbadm01 ~]# crsctl status res ora.orcl.db -p|grep orcl

NAME=ora.orcl.db
DB_UNIQUE_NAME=orcl
GEN_USR_ORA_INST_NAME@SERVERNAME(exa1dbadm01)=orcl1
GEN_USR_ORA_INST_NAME@SERVERNAME(exa1dbadm02)=orcl2
PWFILE=+DATAC1/orcl/PASSWORD/pwdorcl.258.1149713235
SERVER_POOLS=ora.orcl
USR_ORA_DB_NAME=orcl
USR_ORA_INST_NAME@SERVERNAME(exa1dbadm01)=orcl1
USR_ORA_INST_NAME@SERVERNAME(exa1dbadm02)=orcl2

[root@exa1dbadm01 ~]#



Q: Which command can be used to disable automatic start?

A:

To disable/enable autostart for whole DATABASE (all instances):
srvctl disable database -db $DBNAME
srvctl enable  database -db $DBNAME

Ins a such a way we disable autostart of the database on all nodes. All instances.

But how can we prevent autostart on one node only? Only for one instance ?

To disable/enable autostart for certain instance:
srvctl disable instance -db orcl –i orcl2
srvctl enable  instance -db orcl –i orcl2

Q: How to see autostart property for disabled instance in the cluster settings?
 

A:
 

Let experiment.

1st try as "grid" account.

Choose the appropriate DB.

I like use -v option is srvctl because it bring more information:

[grid@exa1dbadm01 ~]$ srvctl config db -v
orcl  /u01/app/oracle/product/19.0.0.0/dbhome_1       19.0.0.0.0
ok_awr  /u01/app/oracle/product/19.0.0.0/dbhome_1913    19.0.0.0.0



[grid@exa1dbadm01 ~]$ srvctl disable instance -d orcl -i orcl2
PRCR-1012 : Failed to disable resource ora.orcl.db
PRCR-1071 : Failed to register or update resource ora.orcl.db
CRS-0245:  User doesn't have enough privilege to perform the operation

The syntax is right, but "grid" account in OS doesn't have enough privileges. OK.

The rule to use srvctl: USE SRVCTL FROM ORACLE HOME WHERE DB IS STARTED. DON'T USE SRVCTL FROM GRID HOME OR OTHER ORACLE HOME.

[root@exa1dbadm01 ~]# su - oracle

[oracle@exa1dbadm01 ~]$ srvctl config db -v
orcl  /u01/app/oracle/product/19.0.0.0/dbhome_1       19.0.0.0.0
ok_awr  /u01/app/oracle/product/19.0.0.0/dbhome_1913    19.0.0.0.0

[oracle@exa1dbadm01 ~]$ /u01/app/oracle/product/19.0.0.0/dbhome_1/bin/srvctl disable instance -d orcl -i orcl2


Previous command was completed successfully. And silently.
Let obtain the status (with -v, verbose):

[oracle@exa1dbadm01 ~]$ /u01/app/oracle/product/19.0.0.0/dbhome_1/bin/srvctl  status instance -d orcl -i orcl1,orcl2 -v
Instance orcl1 is running on node exa1dbadm01 with online services srvorcl1. Instance status: Open.
Instance orcl2 is running on node exa1dbadm02. Instance status: Open.

The above output don't show the DISABLED.
May be my instance is not disabled? Let me disable it 2nd time:

[oracle@exa1dbadm01 ~]$ /u01/app/oracle/product/19.0.0.0/dbhome_1/bin/srvctl disable instance -d orcl -i orcl2
PRCC-1013 : orcl was already disabled on exa1dbadm02
PRCR-1003 : Resource ora.orcl.db is already disabled

But "srvctl status instance" don't show that instance autostart property is disabled|enabled.

srvctl CONFIG - don't show the DISABLED instance too:

[oracle@exa1dbadm01 ~]$ srvctl config db -d orcl
Database unique name: orcl
Database name: orcl
Oracle home: /u01/app/oracle/product/19.0.0.0/dbhome_1
Oracle user: oracle
Spfile: +DATAC1/orcl/PARAMETERFILE/spfile.270.1149714021
Password file: +DATAC1/orcl/PASSWORD/pwdorcl.258.1149713235
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools:
Disk Groups: DATAC1,RECOC1
Mount point paths:
Services: srvorcl1
Type: RAC
Start concurrency:
Stop concurrency:
OSDBA group: dba
OSOPER group: racoper
Database instances: orcl1,orcl2
Configured nodes: exa1dbadm01,exa1dbadm02
CSS critical: no
CPU count: 0
Memory target: 0
Maximum memory: 0
Default network number for database services:
Database is administrator managed


How to view autostart at instance level?

As you see the "-v" option don't show the DISABLED instance:
[oracle@exa1dbadm01 ~]$ /u01/app/oracle/product/19.0.0.0/dbhome_1/bin/srvctl  status instance -d orcl -i orcl1,orcl2 -v
Instance orcl1 is running on node exa1dbadm01 with online services srvorcl1. Instance status: Open.
Instance orcl2 is running on node exa1dbadm02. Instance status: Open.

The only "-f" option gives the expected output:

[oracle@exa1dbadm01 ~]$ /u01/app/oracle/product/19.0.0.0/dbhome_1/bin/srvctl  status instance -d orcl -i orcl1,orcl2 -f -v
Instance orcl1 is running on node exa1dbadm01 with online services srvorcl1. Instance status: Open.
Instance orcl2 is disabled on node exa1dbadm02
Instance orcl2 is running on node exa1dbadm02. Instance status: Open.


Bingo!

Don't forget to restore the instance autostart:
[oracle@exa1dbadm01 ~]$ /u01/app/oracle/product/19.0.0.0/dbhome_1/bin/srvctl enable instance -d orcl -i orcl2


No comments:

Post a Comment

Note: Only a member of this blog may post a comment.

How to disable/setup autostart parameters for specified instance ?

Q: We have a 4-node RAC. I need to disable autostart of the DB on one node only.    How to do it and how to see autostart parameters, confir...