Using dbaascli to Manage Oracle CDB and PDB's with Exadata Cloud at Customer (ExaC@C)

 

Using dbaacli with ExaC@C

There are several ways to manage databases and pluggable databases with Oracle Exadata Cloud at Customer.   The OCI GUI is a graphical way to handle many basic functions such as building a DB, adding automatic backups, creating a data guard standby DB, and databases databases.   There are API’s, rest API’s,  and SDK’s which run in the OCI tenancy and manage the DB and PDB’s.  

dbaascli is a tool which runs locally on the Exadata VM which can be used to manage DB’s and PDB’s.  dbaacli interacts with a db sync process which will then update OCI much of the DB management activities.   For example – build a DB with dbaascli, and it will show up in OCI GUI.

It is possible to manage your DB’s and PDB’s without cloud tooling, but if that is done, then the OCI layer will not know about these activities.   For example, if you were to restore a DB from a backup onto the ExaC@C virtual cluster or use Enterprise Manager to create a DG standby or backup, it would not be recognized by the OCI layer.

This blog will highlight how to use dbaascli to do many DB and PDB maintenance activities.

dbaascli

dbaascli is run from the command line in the virtual machine.   In these examples, the client used ssh to log into the virtual machine guest operating system as the opc user.  The ssh key pair have been uploaded to the virtual cluster.   The key pair for opc could also be given to the client and supplied in the command line for the ssh command.  Once logged into the virtual machine, sudo to the root user in order to run dbaascli.   Since dbaascli jobs may touch ASM, OS, and DB’s it needs to be run as root for many of the tasks.

ssh opc@hostname.domain
sudu su –

The logs for dbaascli commands can be found in /var/opt/oracle/log/dbname

dbaascli database commands

Below is a list of the dbaascli database commands.

 Creating DB with dbaascli

A database can be created with dbaascli.   This can be a container DB or non-container DB.  You can specify some basic parameters such as FRA size, SGA Size and DB Unique Name.  

You can specify a list of nodes for the RAC database.   If you do not specify nodes, then instances will be created for all nodes in the cluster.   If you specify a subset of node names, then a limited RAC database will be created on just those nodes.   This database will NOT register with the cloud tooling – a RAC DB must be created with all nodes in the cluster to be registered with the cloud.  If a subset of nodes is specified, you can choose to either keep that node number as the instance number, or have RAC sequentially assign the instance.

Multiple create DB jobs can be executed with dbaascli at the same time.   Jobs will queue up and run serially while a DB is in the actual create steps.   Once the DB is created, there is more that happens with the cloud tooling to register it with the cloud and setup with all of the Exadata best practices.   Another job will start building the DB while the first job finishes these steps.   So, some of the job steps to finish entire job can run concurrently.

The sys and TDE passwords will need to be provided.  dbaascli will prompt for these passwords

Below is a list of all of the create database options.

 Here is an example of running a dbaascli job to create a database.



 Check create dbaascli job status – in progress:

dbaascli creates jobs for operations.  You can use dbaascli job getStatus the evaluate.

 

 Check create dbaascli job status – Success:

Here are several examples to build a database:

RAC – Container DB

dbaascli database create --dbName jodbx --oracleHome /u02/app/oracle/product/19.0.0.0/dbhome_6 --oracleHomeName OraHome102 --dbSID jodbx --waitForCompletion false --pdbName jopdb1

RAC – Non-Container DB

dbaascli database create --dbName jonocdb --oracleHome /u02/app/oracle/product/19.0.0.0/dbhome_6 --oracleHomeName OraHome102 --dbSID jonocdb --waitForCompletion false --createAsCDB false

RAC – Subset RAC DB

dbaascli database create --dbName jo2N --oracleHome /u02/app/oracle/product/19.0.0.0/dbhome_6 --oracleHomeName OraHome102 --dbSID jo2N --waitForCompletion false --nodeList ecc3c2n1,ecc3c2n3 --honorNodeNumberForInstance false

 

Delete DB:

Here is a database delete job.   It will delete the DB and datafiles and unregister it from the cloud tooling.

 


Following are several examples of dbaascli commands for managing a database.

DB Status:

 

DB List output:

dbaascli database list

  Starting and Stopping a DB

Stopping the Database - default is shutdown immediate of all instances

Srvctl shows that the DB and all instances have stopped

Start the database back up.

 


Now DB is running on all nodes.


 
Modify init.ora parameter for DB

 


PDB’s

Although planed, PDB’s currently can not be managed by the OCI Cloud GUI.   dbaascli is the preferred mechanism to manage PDB’s within the ExaC@C environment.   PDB’s managed manually or with EM will eventually be outside cloud registration.

Below are commands for dbaascli pdb

 


PDB Details

 


Create a new PDB

 


Closing and Opening PDB’s

Close the PDB


 

   Open the PDB

 

 

 

Cloning PDB’s

Creating a Local Clone – clone within a Container – specifying the source PDB but not the target name  --dbname jodbsg2 --pdbname soe3

without specifying the target clone name it will be generated as dbname_sourcepdbname

 



 

 Creating a Local Clone – clone within a Container – specifying the source and target PDB’s

Additionally specifying the degree of parallelism form file cloning portion of job

 

 


 PDB Remote Clone

Before:

Source Container DB

 

Target Container DB

 

PDB Remote Clone Job
 
pdb remoteclone --sourceDBConnectString //scan-name:1521/servicename --pdbname sourcepdb --targetpdbname newpdb 

 



Source Container DB

Target Container DB - Before and After remote clone

  
 

 

PDB Clone Details

 

PDB Delete

 

Get PDB Connect String


 

Comments

  1. Any way to create a non RAC database or if not, any downside to only using a single node instance if RAC not needed (e.g. for a sandbox) ?

    ReplyDelete
  2. if you use the --nodelist option and only specify one node it will only create on node you use. you want to try and keep your virtual clusters balanced for billing reasons - you have to scale up/down the entire virtual cluster - so if you have one node that's very busy and you need more OCPU's - you have to scale up all nodes to accommodate this need. So - just try and keep your virtual clusters CPU load balanced

    ReplyDelete
  3. What version of dbaascli are you using I dont see a create option.

    DBAAS CLI version 19.1.1.1.0
    DBAAS>database
    Executing command database
    Valid Subcommands:
    bounce
    stop
    move
    status
    configureinstance
    healthcheck
    convert_to_pdb
    changepassword
    verify_wallet
    upgrade
    update
    list
    start

    ReplyDelete

Post a Comment

Popular posts from this blog

Getting email Notifications in ExaCC for Operational Activities