From the Command Line into the to the Oracle Cloud – the ORACLE-DBCS-CLI Utility

The Oracle ORACLE-DBCS-CLI utility is a command-line interface tool to manage the lifecycle of your Database as as Service instances in cloud.oracle.com. You can create and delete instances, verify and apply patches, scale your instances up and down and many more. The advantage is that you can work with configuration files. And I like to work with such files, if I need 10 instances with the same shape, I have only to search and replace the instance name – fire!

The ORACLE-DBCS-CLI utility is available for Unix platforms at the moment. I have installed ORACLE-DBCS-CLI on a Oracle Linux 6.5, JDK version 1.7 or higher is required.

Download and Documents

The software can be downloaded here: http://www.oracle.com/technetwork/database/database-cloud/public/downloads/index.html

The  ORACLE-DBCS-CLI documentation starts here: https://docs.oracle.com/cloud/latest/dbcs_dbaas/CSDBI/GUID-E9F2219D-EBDC-44B3-BE22-BEED6C2BAB74.htm#CSDBI-GUID-E9F2219D-EBDC-44B3-BE22-BEED6C2BAB74

Installation

After download the software has to be extracted on target server. My install directory is /u00/app/oracle/tools/dbcs-cli/ – take care about the release number.

What you get:

The dboplan.dat.tmpl is a template file which contains all required variables for working with cloud.oracle.com. For some actions you only need a subset of them.

Get Domain Information

To gather information about your created instances, you need this four parameters.

sm_url Endpoint URL – Attention: for EMEA it’s https://dbcs.emea.oraclecloud.com/paas/service/dbcs/api/v1.1/instances and not https://dbaas.oraclecloud.com/paas/service/dbcs/api/v1.1/instances as written in the documentation
user_name Your cloud.oracle.com user name
password Your cloud.oracle.com password
identity domain Your identity domain – e.g. trivadis4703

 

For this action, I have created a small configuration file which contains these four lines:

Now I can execute ORACLE-DBCS-CLI with the configuration file, all my instances in the specified domain are listed:

Get Patch Information

For this action you need your cloud SSH key and the host, IP does also work if the host name is not resolved by DNS, /etc/hosts etc.

Creating a new Instance

It is very easy to create a new instance, but here you need the full content from the configuration template. I have created my own template called cloud10.dat to create an instance with shape OC3 and no backup, a new ssh key will be created and uploaded by the ORACLE-DBCS-CLI. I have specified these parameters, all other I let them on default values:

sm_url Endpoint URL – Attention: for EMEA it’s https://dbcs.emea.oraclecloud.com/paas/service/dbcs/api/v1.1/instances and not https://dbaas.oraclecloud.com/paas/service/dbcs/api/v1.1/instances as written in the documentation
user_name Your cloud.oracle.com user name
password Your cloud.oracle.com password
identity domain Your identity domain – e.g. trivadis4703
vm_name Your new instance name – e.g. CLOUD10
vm_shape Your shape – e.g. OC3
db_sid Your SID – e.g. cloud10
db_dbname Your DB name – e.g. cloud10
db_passwd Your SYS password – it have to contain a numer, a # or a _ character
db_bkup_disk Backup = No

 

Executing ORACLE-DBCS-CLI with my Configuration File cloud04.dat

Unfortunately there is no logfile available, but If you have set a wrong shape or a too simple password, you will get an error.

That’s all folks – in cloud.oracle.com you can see now that your instance will be created immediately.

cloud04

My Template cloud04.dat

Summary

The ORACLE-DBCS-CLI Utility is a great tool to manage the lifecycle of your Oracle cloud instances in th CLI. With a small set of templates and configuration files, you are able to manage your cloud instances without any browser.