Oracle Cloud Infrastructure Documentation

Managing Exadata Databases Manually

Exadata DB systems include these command line tools for performing various tasks to manage individual databases:

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

    • Starting and stoping a database
    • Starting and stoping 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 Managing Exadata Databases.

Note

  • Databases that you create by using dbaasapi do not appear in your Exadata DB system's list of databases that you see in the Console.
  • You must update the cloud-specific tooling on all the compute nodes in your Exadata DB system before performing the following procedures. For more information, see Updating an Exadata DB System.
  • Only one dbaasapi operation can execute at a given time. Oracle recommends that you check the status of an operation to ensure it completed before you run another operation.

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 the Create Database Parameters and gather the information you'll need to supply in the input file you create for the dbaasapi operation.

Warning

Oracle recommends that you avoid specifying parameter values that include confidential information when you use the dbaasapi commands.

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",
        "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.
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.
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.

Allowed 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).

Deleting a Database

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

  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 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).