Exadata Cloud – Database Deployment

This is Part 3 of the Post Provisioning of Exadata Cloud

Here we will create our first 12.2 database using dbaasapi utility

Once the Exadata tooling has been updated, you can leverage the dbaasapi command to create or delete Exadata Oracle databases.  When creating new databases you should only use the dbaasapi to this purpose.

The dbaasapi utility, which is a REST API, reads a JSON request body and generates a JSON response body in an output file.

The utility is located in the /var/opt/oracle/dbaasapi/ directory on the compute nodes and must be run as the root user.

[root@ashdbm01~]# mkdir –p /home/oracle/dbassinput

[root@ashdbm01~] # cd /home/oracle/dbassinput

Create a JSON file for DB creation, using the template

[root@ashdbm01~] # cat /home/oracle/dbassinput/dbaas.json

{ “object”: “db”, “action”: “start”, “operation”: “createdb”, “params”: {

“nodelist”:

“dbname”:

“edition”:

“version”: “adminPassword”:

“sid”:

“pdbName”:

“charset”:

“ncharset”: “backupDestination”: “cloudStorageContainer”:

“”,

“exadb”, “EE_EP”, “12.1.0.2”, “WElcome#123_”, “exadb”, “PDB1”, “AL32UTF8”, “AL16UTF16”, “OSS”,

“https://swiftobjectstorage.<region>.oraclecloud.com/v1/mycompany/DBBackups”, “cloudStorageUser”: “jsmith@mycompany.com”,

“cloudStoragePwd”: “XXXXXXXXXXXX”

},

“outputfile”: “/home/oracle/createdb.out”,

“FLAGS”: “”

}

The following example illustrates the usage of dbaasapi to build a 12.2 database.

Dbaasapi uses the json format file as input for db creation.

[root@phxdbm-o3eja1 oracle]# cat $HOME/createdb_start.json

{

  “object”: “db”,

  “action”: “start”,

  “operation”: “createdb”,

  “params”: {

    “dbname”:                “yoda”,

    “edition”:               “EE_EP”,

    “version”:               “12.2.0.1”,

    “adminPassword”:         “”,

    “pdbName”:               “jedi1”,

    “backupDestination”:     “NONE”,

    “cloudStorageContainer”: “<bkup_oss_url>”,

    “cloudStorageUser”:      “<bkup_oss_user>”,

    “cloudStoragePwd”:       “<bkup_oss_passwd>”,

    “charset”:               “AL32UTF8”,

    “ncharset”:              “AL16UTF16”,

    “nodelist”:              “”

  },

  “outputfile”: “/home/oracle/created_yoda.out”,

  “FLAGS”: “”

}

[root@phxdbm-o3eja1 oracle]#  /var/opt/oracle/dbaaspi/dbaasapi -I cretedb_yoda

Once invoked, you can use the status.json file to check the progress

[root@phxdbm-o3eja1 oracle]# /var/opt/oracle/dbaasapi/dbaasapi -I status_createdb_yoda.json

[root@phxdbm-o3eja1 oracle]# cat createdb.out

{

“msg” : “Sync sqlnet file…[done]\\n

#Invoking assistant bkup\\nUsing cmd : /var/opt/oracle/ocde/assistants/bkup/bkup -out /var/opt/oracle/ocde/res/bkup.out -sid=\”yoda1\” -reco_grp=\”RECOC1\” -hostname=\”phxdbm-o3eja1.client.phxexadata.oraclevcn.com\” -oracle_home=\”/u02/app/oracle/product/12.2.0/dbhome_3\” -dbname=\”yoda\” -dbtype=\”exarac\” -exabm=\”yes\” -edition=\”enterprise\” -bkup_cfg_files=\”no\” -acfs_vol_dir=\”/var/opt/oracle/dbaas_acfs\” -bkup_oss_url=\”<bkup_oss_url>\” -bkup_oss_user=\”<bkup_oss_user>\” -version=\”12201\” -archlog=\”yes\” -oracle_base=\”/u02/app/oracle\” -firstrun=\”no\” -action=\”config\” -bkup_oss=\”no\” -bkup_disk=\”no\” -data_grp=\”DATAC1\” -action=config \\n\\n#

#Done executing bkup\\

Removed all entries from creg file : /var/opt/oracle/creg/yoda.ini matching passwd or decrypt_key\\n\\n#### Completed OCDE

Successfully ####\\nWARN: Could not register elogger_parameters: elogger.pm::_init: /var/opt/oracle/dbaas_acfs/events does not exist”,

   “object” : “db”,

   “status” : “Success”,

   “errmsg” : “”,

   “outputfile” : “/home/oracle/created_yoda.out”,

   “action” : “start”,

   “id” : “4”,

   “operation” : “createdb”,

   “logfile” : “/var/opt/oracle/log/yoda/dbaasapi/db/createdb/4.log”

}

Backups

When the dbaasapi utility is used to create a database, it automatically enables automated RMAN backups.  These scheduled backups which are processed via crontab.  The following lists the crontab entries for backups.

[root@ network-scripts]# cat /etc/crontab

SHELL=/bin/bash

PATH=/sbin:/bin:/usr/sbin:/usr/bin

MAILTO=root

HOME=/

# For details see man 4 crontabs

# Example of job definition:

# .—————- minute (0 – 59)

# |  .————- hour (0 – 23)

# |  |  .———- day of month (1 – 31)

# |  |  |  .——- month (1 – 12) OR jan,feb,mar,apr …

# |  |  |  |  .—- day of week (0 – 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat

# |  |  |  |  |

# *  *  *  *  * user-name command to be executed

0,30 * * * * root /var/opt/oracle/bkup_api/bkup_api bkup_archlogs –dbname=OCITEST

0,30 * * * * root /var/opt/oracle/bkup_api/bkup_api bkup_archlogs –dbname=yoda