ExaCC: Single instance databases

When a new database is deployed on ExaCC, all nodes of the VM cluster are considered. But sometimes a multi-instance database is not required, for example for DEV or non-business critical databases. In this blog post, I will demonstrate how to handle this requirement with dbaascli.

Prerequisites

Instance State

If the instance you want to remove is already stopped, you have to start it. Otherwise, dbaascli will fail with the following exception.

[FATAL] [DBAAS-70107] An instance of database 'MYCDB_h3r_fra' was not found in node 'exaccnode2'.

To fix this, start the instance on the affected node.

$> srvctl start instance -db MYCDB_h3r_fra -node MYCDB2

Open Mode

The database on the VM cluster node where dbaascli is executed has to be in the OPEN or OPEN READ ONLY (for Data Guard) state. Otherwise, dbaascli fails with the following error.

[DBAAS-70111] The database is not running on node 'exaccnode1'.

CAUTION: If you don’t have an Active Data Guard license, ensure that only the CDB is opened read-only while Redo Apply is active. As an alternative stop Redo Apply before opening the database.

Database Services

An instance cannot be removed, when it is a preferred instance for a database service.

[FATAL] [DBAAS-70127] The instance in node 'exaccnode2' is a preferred instance for service 'MYCDB_PDB.paas.oracle.com'.

To check and change the service configuration, use srvctl.

$> srvctl config service -db MYCDB_h3r_fra -service MYCDB_PDB1.paas.oracle.com
Service name: MYCDB_PDB1.paas.oracle.com
Server pool:
Cardinality: 2
Service role: PRIMARY
Management policy: AUTOMATIC
DTP transaction: false
AQ HA notifications: false
Global: false
Commit Outcome: false
Failover type:
Failover method:
Failover retries:
Failover delay:
Failover restore: NONE
Connection Load Balancing Goal: LONG
Runtime Load Balancing Goal: NONE
TAF policy specification: NONE
Edition:
Pluggable database name: PDB1
Hub service:
Maximum lag time: ANY
SQL Translation Profile:
Retention: 86400 seconds
Replay Initiation Time: 300 seconds
Drain timeout:
Stop option:
Session State Consistency: DYNAMIC
GSM Flags: 0
Service is enabled
Preferred instances: MYCDB1,MYCDB2
Available instances:
CSS critical: no
Service uses Java: false

$> srvctl modify service -db MYCDB_h3r_fra -service MYCDB_PDB1.paas.oracle.com -modifyconfig -preferred MYCDB1

Remove Instances

To remove an instance, run the following command as the root user.

$> dbaascli database deleteInstance --dbname MYCDB --node exaccnode2
DBAAS CLI version 22.2.1.1.0
Executing command database deleteInstance --node exaccnode2
Job id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Loading PILOT...
Session ID of the current execution is: 23
Log file location: /var/opt/oracle/log/MYCDB/database/deleteInstance/pilot_2022-08-09_01-39-00-PM
-----------------
Running Plugin_initialization job
Completed Plugin_initialization job
-----------------
Running Validate_input job
Completed Validate_input job
-----------------
Running Delete_db_instance job
Completed Delete_db_instance job
-----------------
Running Reload_db_details job
Completed Reload_db_details job
-----------------
Running Remove_backup_jobs job
Completed Remove_backup_jobs job
-----------------
Running Update_cloud_metadata job
Completed Update_cloud_metadata job
-----------------
Running Generate_dbsystem_details job
Completed Generate_dbsystem_details job
dbaascli execution completed

Add Instances

For the case, that an additional instance is required, run the following command as the root user.

$> dbaascli database configureInstance --dbname MYCDB --node exaccnode2
DBAAS CLI version 22.2.1.1.0
Executing command database configureInstance --node exaccnode2
Job id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Loading PILOT...
Session ID of the current execution is: 40
Log file location: /var/opt/oracle/log/MYCDB/database/configureInstance/pilot_2022-08-02_10-14-56-AM
-----------------
Running Plugin_initialization job
Completed Plugin_initialization job
-----------------
Running Validate_input job
Completed Validate_input job
-----------------
Running Configure_hsm_on_node job
Skipping. Job is detected as not applicable.
-----------------
Running Configure_instance job
Completed Configure_instance job
-----------------
Running Reload_db_details job
Completed Reload_db_details job
-----------------
Running Validate_instance job
Completed Validate_instance job
-----------------
Running Update_cluster_interconnect job
Completed Update_cluster_interconnect job
-----------------
Running Restart_instance job
Completed Restart_instance job
-----------------
Running Add_services_to_node job
Completed Add_services_to_node job
-----------------
Running Update_cloud_metadata job
Completed Update_cloud_metadata job
-----------------
Running Generate_dbsystem_details job
Completed Generate_dbsystem_details job
dbaascli execution completed

Patching

Since version 21.2.1.x.x of the dbaascli, patching of a single instance database is possible, but a dbaascli move database will fail when the default options are used.

[WARNING] [DBAAS-70231] Database '[MYCDB]' is running only on one node.
   CAUSE: It has been detected that database is configured on multiple nodes. However database instance is running only on one node. Stopping instance on this node would cause the downtime.
[WARNING] [DBAAS-70173] Some of the pluggable databases have just one instance up which would lead to a PDB downtime.
   CAUSE: Following databases have pdbs with just one instance up '{MYCDB=[PDB1]}'.
   ACTION: Make sure there are atleast two instances of all pluggable databases up.

To continue with the patching, parameter –continueWithDbDowntime is mandatory.

$> dbaascli database move \
        --dbname MYCDB \
        --oracleHome /u02/app/oracle/product/19.0.0.0/dbhome_4 \
        --continueWithDbDowntime

Data Guard

Single instance databases are fully supported by the OCI CLI. No special parameters are required to successfully switch a primary to its standby.

References

Leave a Reply

Your email address will not be published.