Creating and Managing Exadata Databases Manually

Exadata Cloud Service instances include these command line tools for performing various tasks to manage individual databases:

  • dbaasapi - For adding and removing databases from the Exadata Cloud Service instance. See Using dbaasapi.
  • dbaascli - For a variety of life-cycle and administration operations such as:

    • Starting and stopping a database
    • Starting and stopping the Oracle Net listener
    • Viewing information about Oracle Homes
    • Moving a database to another Oracle Home
    • Deleting an unused Oracle Home
    • Performing database configuration changes
    • Managing Oracle Database software images
    • Managing pluggable databases (PDBs)
    • Performing database recovery
    • Rotating the master encryption key

    For details about how to use this CLI, see The dbaascli Utility.

Using dbaasapi

You can use the dbaasapi command line utility to create and delete databases on an Exadata DB system. The utility operates like a REST API. It reads a JSON request body and produces 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.

To learn how to add or remove Exadata databases by using the Oracle Cloud Infrastructure Console or API instead, see Creating and Managing Exadata Databases.

Note

  • You must update the cloud-specific tooling on all the compute nodes in your Exadata Cloud Service instance before performing the following procedures. For more information, see Updating an Exadata Cloud Service Instance.
  • Only one dbaasapi operation can execute at a given time. We recommend that you check the status of an operation to ensure it completed before you run another operation.
  • Databases that you create by using dbaasapi are visible in the Console and through the API and CLI only if you create the database across all nodes in the cluster. However, it can take up to 5 hours before you see them.

Prerequisites

If you plan to create a database and store its backups in the Oracle Cloud Infrastructure Object Storage, refer to the prerequisites in Managing Exadata Database Backups, and ensure that the system meets the networking requirements for backing up to Object Storage. Review Create Database Parameters and gather the information you'll need to supply in the input file you create for the dbaasapi operation.

Creating a Database

The following procedure creates directory called dbinput, a sample input file called myinput.json, and a sample output file called createdb.out.

  1. SSH to a compute node in the Exadata DB system.

    ssh -i <private_key_path> opc@<node_ip_address>
  2. Log in as opc and then sudo to the root user.

    
    login as: opc
    			
    [opc@dbsys ~]$ sudo su - 
    
  3. Make a directory for the input file and change to the directory.

    [root@dbsys ~]# mkdir –p /home/oracle/dbinput
    # cd /home/oracle/dbinput
  4. Create the input file in the directory. The following sample file will create a database configured to store backups in an existing bucket in Object Storage. For parameter descriptions, see Create Database Parameters.

    
    {
      "object": "db",
      "action": "start",
      "operation": "createdb",
      "params": {
        "nodelist":              "",
        "dbname":                "exadb",
        "edition":               "EE_EP",
        "version":               "12.1.0.2",
        "ohome_name":            "oradbhome1",
        "adminPassword":         "<password>",
        "sid":                   "exadb",
        "pdbName":               "PDB1",
        "charset":               "AL32UTF8",
        "ncharset":              "AL16UTF16",
        "backupDestination":     "OSS",
        "cloudStorageContainer": "https://swiftobjectstorage.<region_name>.oraclecloud.com/v1/mycompany/DBBackups", 
        "cloudStorageUser":      "<name@example.com>",
        "cloudStoragePwd":       "<auth_token>"
      },
      "outputfile": "/home/oracle/createdb.out",
      "FLAGS": ""
    }
  5. Run the utility and specify the input file.

    
    [root@dbsys ~]# /var/opt/oracle/dbaasapi/dbaasapi -i myinput.json
    
  6. Check the output file and note the ID.

    [root@dbsys ~]# cat /home/oracle/createdb.out
    {
       "msg" : "",
       "object" : "db",
       "status" : "Starting",
       "errmsg" : "",
       "outputfile" : "/home/oracle/createdb.out",
       "action" : "start",
       "id" : "170",
       "operation" : "createdb",
       "logfile" : "/var/opt/oracle/log/gsa1/dbaasapi/db/createdb/1.log"
    } 
  7. Create a JSON file to check the database creation status. Note the action of "status". Replace the ID and the dbname with the values from the previous steps.

    
    {
      "object": "db",
      "action": "status",
      "operation": "createdb",
      "id": 170,
      "params": {
        "dbname": "exadb"
      },
      "outputfile": "/home/oracle/createdb.out",
      "FLAGS": ""
    }  
  8. Run the utility with the status file as input and then check the utility output.

    Rerun the status action regularly until the response indicates that the operation succeeded or failed.

    
    [root@dbsys ~]# /var/opt/oracle/dbaasapi/dbaasapi -i db_status.json
      
    [root@dbsys ~]# cat /home/oracle/createdb.out
     
    {
       "msg" : "Sync sqlnet file...[done]\\n##Done executing tde\\nWARN: Could not register elogger_parameters: elogger.pm::_init: /var/opt/oracle/dbaas_acfs/events does not exist\\n##Invoking assistant bkup\\nUsing cmd : /var/opt/oracle/ocde/assistants/bkup/bkup -out /var/opt/oracle/ocde/res/bkup.out -sid=\"exadb1\" -reco_grp=\"RECOC1\" -hostname=\"ed1db01.data.customer1.oraclevcn.com\" -oracle_home=\"/u02/app/oracle/product/12.1.0/dbhome_5\" -dbname=\"exadb\" -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=\"12102\" -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\\nWARN: Could not register elogger_parameters: elogger.pm::_init: /var/opt/oracle/dbaas_acfs/events does not existRemoved all entries from creg file : /var/opt/oracle/creg/exadb.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/createdb_exadb.out",
       "action" : "start",
       "id" : "170",
       "operation" : "createdb",
       "logfile" : "/var/opt/oracle/log/exadb/dbaasapi/db/createdb/170.log"
    }

Create Database Parameters

Use the following parameters to create a database.

Parameter Description
object The value "db".
action The value "start".
operation The value "createdb".
nodelist

The value "" (an empty string). The database will be created across all nodes in the cluster.

Note

If you specify only a subset of nodes, then the database you create will not be visible in the Oracle Cloud Infrastructure interfaces (Console, API, and CLI).
dbname The database name, in quotes.
edition The value "EE_EP". (Only Enterprise Edition - Extreme Performance is supported .)
version The database version as 18.0.0.0, 12.2.0.1, 12.1.0.2, or 11.2.0.4, in quotes.
ohome_name The name of the Oracle Database Home to use for the new database, in quotes.
adminPassword The administrator (SYS and SYSTEM) password to use for the new database, in quotes. The password must be nine to thirty characters and contain at least two uppercase, two lowercase, two numeric, and two special characters. The special characters must be _, #, or -.
sid The SID of the database, in quotes.
pdbName The name of the pluggable database, in quotes.
charset

The database character set, in quotes. For allowed values, see Allowed Create Database Charset Values

ncharset The database national character set. The value AL16UTF16 or UTF8, in quotes.
backupDestination

The database backup destination, in quotes. You can configure the following backup destinations.

NONE No backup destination is configured.

DISK Configure database backups to the local disk Fast Recovery Area.

OSS Configure database backups to an existing bucket in the Oracle Cloud Infrastructure Object Storage service. You must specify all the cloudStorage parameters.

BOTH Configure database backups to both local disk and an existing bucket in Object Storage. You must specify all the cloudStorage parameters.

For example:

"backupDestination":"BOTH"

cloudStorageContainer=<swift_url>

Required if you specify a backup destination of OSS or BOTH. The Object Storage URL, your Oracle Cloud Infrastructure tenant, and an existing bucket in the object store to use as the backup destination, in the following format:

https://swiftobjectstorage.<region_name>.oraclecloud.com/v1/<tenant>/<bucket>

See Regions and Availability Domains to look up the region name string.

For example:

"cloudStorageContainer":"https://swiftobjectstorage.<region_name>.oraclecloud.com/v1/<company_name>/DBBackups"

cloudStorageUser=<user_name>

Required if you specify a backup destination of OSS or BOTH. The user name for the Oracle Cloud Infrastructure user account, for example:

"cloudStorageUser":"name@company.com"

This is the user name you use to sign in to the Console. The user name must be a member of the Administrators group, as described in Prerequisites.

cloudStoragePwd=<auth_token>

Required if you specify a backup destination of OSS or BOTH. The auth token generated by using the Console or IAM API, in quotes, for example:

"cloudStoragePwd":"<auth_token>"

For more information, see Managing User Credentials.

This is not the password for the Oracle Cloud Infrastructure user.

outputfile The absolute path for the output of the request, for example, "outputfile":"/home/oracle/createdb.out".
FLAGS The value "" (an empty string).
Allowed Create Database Charset Values

AL32UTF8, AR8ADOS710, AR8ADOS720, AR8APTEC715, AR8ARABICMACS, AR8ASMO8X, AR8ISO8859P6, AR8MSWIN1256, AR8MUSSAD768, AR8NAFITHA711, AR8NAFITHA721, AR8SAKHR706, AR8SAKHR707, AZ8ISO8859P9E, BG8MSWIN, BG8PC437S, BLT8CP921, BLT8ISO8859P13, BLT8MSWIN1257, BLT8PC775, BN8BSCII, CDN8PC863, CEL8ISO8859P14, CL8ISO8859P5, CL8ISOIR111, CL8KOI8R, CL8KOI8U, CL8MACCYRILLICS, CL8MSWIN1251, EE8ISO8859P2, EE8MACCES, EE8MACCROATIANS, EE8MSWIN1250, EE8PC852, EL8DEC, EL8ISO8859P7, EL8MACGREEKS, EL8MSWIN1253, EL8PC437S, EL8PC851, EL8PC869, ET8MSWIN923, HU8ABMOD, HU8CWI2, IN8ISCII, IS8PC861, IW8ISO8859P8, IW8MACHEBREWS, IW8MSWIN1255, IW8PC1507, JA16EUC, JA16EUCTILDE, JA16SJIS, JA16SJISTILDE, JA16VMS, KO16KSCCS, KO16MSWIN949, LA8ISO6937, LA8PASSPORT, LT8MSWIN921, LT8PC772, LT8PC774, LV8PC1117, LV8PC8LR, LV8RST104090, N8PC865, NE8ISO8859P10, NEE8ISO8859P4, RU8BESTA, RU8PC855, RU8PC866, SE8ISO8859P3, TH8MACTHAIS, TH8TISASCII, TR8DEC, TR8MACTURKISHS, TR8MSWIN1254, TR8PC857, US7ASCII, US8PC437, UTF8, VN8MSWIN1258, VN8VN3, WE8DEC, WE8DG, WE8ISO8859P15, WE8ISO8859P9, WE8MACROMAN8S, WE8MSWIN1252, WE8NCR4970, WE8NEXTSTEP, WE8PC850, WE8PC858, WE8PC860, WE8ROMAN8, ZHS16CGB231280, ZHS16GBK, ZHT16BIG5, ZHT16CCDC, ZHT16DBT, ZHT16HKSCS, ZHT16MSWIN950, ZHT32EUC, ZHT32SOPS, ZHT32TRIS

Deleting a Database

We recommend that you create a final backup before you delete any production (non-test) database. See Managing Exadata Database Backups by Using bkup_api to learn how to back up an Exadata database.

  1. SSH to a compute node (virtual machine) in the Exadata cloud VM cluster or DB system.

    ssh -i <private_key_path> opc@<node_ip_address>
  2. Log in as opc and then sudo to the root user.

    
    login as: opc
    			
    [opc@dbsys ~]$ sudo su - 
    
  3. Make a directory for the input file and change to the directory.

    [root@dbsys ~]# mkdir –p /home/oracle/dbinput
    
    
    # cd /home/oracle/dbinput
  4. Create the input file in the directory and specify the database name to delete and an output file. For more information, see Delete Database Parameters.

    
    {
      "object":  "db",
      "action":  "start",
      "operation": "deletedb",
      "params": {
        "dbname": "exadb"
      },
       "outputfile":   "/home/oracle/delete_exadb.out",
       "FLAGS": ""
    }
  5. Run the utility and specify the input file.

    
    [root@dbsys ~]# /var/opt/oracle/dbaasapi/dbaasapi -i myinput.json
    
  6. Check the output file and note the ID.

    
    [root@ed1db01 ~]# cat /home/oracle/delete_exadb.out
     
    {
       "msg" : "",
       "object" : "db",
       "status" : "Starting",
       "errmsg" : "",
       "outputfile" : "/home/oracle/deletedb.out",
       "action" : "start",
       "id" : "17",
       "operation" : "deletedb",
       "logfile" : "/var/opt/oracle/log/exadb/dbaasapi/db/deletedb/17.log"
    }
  7. Create a JSON file to check the database deletion status. Note the action of "status" in the sample file below. Replace the ID and the dbname with the values from the previous steps.

    
    {
      "object": "db",
      "action": "status",
      "operation": "deletedb",
      "id": 17,
      "params": {
        "dbname": "exadb"
      },
      "outputfile": "/home/oracle/deletedb.out",
      "FLAGS": ""
    }  
  8. Run the utility with the status file as input and then check the utility output.

    Rerun the status action regularly until the response indicates that the operation succeeded.

    
    [root@dbsys ~]#  /var/opt/oracle/dbaasapi/dbaasapi -i db_status.json
    
    [root@dbsys ~]# cat /home/oracle/deletedb.out
     
    {
       "msg" : "Using cmd : su - root -c \"/var/opt/oracle/ocde/assistants/dg/dgcc -dbname exadb -action delete\" \\n\\n##Done executing dg\\nWARN: Could not register elogger_parameters: elogger.pm::_init: /var/opt/oracle/dbaas_acfs/events does not exist\\n##Invoking assistant bkup\\nUsing cmd : /var/opt/oracle/ocde/assistants/bkup/bkup -out /var/opt/oracle/ocde/res/bkup.out -bkup_oss_url=\"bkup_oss_url\" -bkup_daily_time=\"0:13\" -bkup_oss_user=\"bkup_oss_user\" -dbname=\"exadb\" -dbtype=\"exarac\" -exabm=\"yes\" -firstrun=\"no\" -action=\"delete\" -bkup_cfg_files=\"no\" -bkup_oss=\"no\" -bkup_disk=\"no\" -action=delete \\n\\n##Done executing bkup\\nWARN: Could not register elogger_parameters: elogger.pm::_init: /var/opt/oracle/dbaas_acfs/events does not exist\\n##Invoking assistant dbda\\nUsing cmd : /var/opt/oracle/ocde/assistants/dbda/dbda -out /var/opt/oracle/ocde/res/dbda.out -em=\"no\" -pga_target=\"2000\" -dbtype=\"exarac\" -sga_target=\"2800\" -action=\"delete\" -build=\"no\" -nid=\"no\" -dbname=\"exadb\" -action=delete \\n",
       "object" : "db",
       "status" : "InProgress",
       "errmsg" : "",
       "outputfile" : "/home/oracle/deletedb.out",
       "action" : "start",
       "id" : "17",
       "operation" : "deletedb",
       "logfile" : "/var/opt/oracle/log/exadb/dbaasapi/db/deletedb/17.log"
    }

Delete Database Parameters

Use the following parameters to delete a database.

Parameter Description
object The value "db".
action The value "start".
operation The value "deletedb".
dbname The database name, in quotes.
outputfile The absolute path for the output of the request, for example, "/home/oracle/deletedb.out".
FLAGS The value "" (an empty string).