Skip to content
Home » Oracle » How Srvctl Disable Database

How Srvctl Disable Database

Srvctl Disable Database

The command srvctl disable database means that it detaches the database you specified from the cluster temporarily. Which means, you will no longer manage it in this cluster. In fact, the command does not remove the database, just prevent you from managing it, temporarily.

Please note that, if you just want to stop a RAC database from starting up automatically after system reboots, you may use srvctl modify database to configure the database and you really need not to disable the database.

Let's see how we detach a database.

[oracle@primary01 ~]$ srvctl disable database -d orclcdb
[oracle@primary01 ~]$ srvctl status database -d orclcdb
Instance ORCLCDB1 is running on node primary01
Instance ORCLCDB2 is running on node primary02

As we can see, all instances are still running, it seems that nothing has been changed. To check whether the resource is manageable or not, we can use the following command.

[grid@primary01 ~]$ crsctl status resource ora.orclcdb.db -p -attr ENABLED

ENABLED=0 means no, we can't bring it ONLINE after a server reboot.

Next, let's see what we can do to the running database.

[oracle@primary01 ~]$ srvctl stop database -d orclcdb

As we can see, we can still stop it if it's running. But we are no longer to start it.

[oracle@primary01 ~]$ srvctl start database -d orclcdb
PRCR-1079 : Failed to start resource ora.orclcdb.db
CRS-2501: Resource 'ora.orclcdb.db' is disabled

To revert the process, just simply enable it.

[oracle@primary01 ~]$ srvctl enable database -d orclcdb [grid@primary01 ~]$ crsctl status resource ora.orclcdb.db -p -attr ENABLED

ENABLED=1 means yes, the database resource is available and reattached to the cluster.

In practice, we usually disable a RAC database for maintenance to prevent it from any accidental restarts. There're more scenarios that use srvctl disable database can be found by following the link.

Leave a Reply

Your email address will not be published. Required fields are marked *