48 ­­DBaaS REST APIs and EM CLI Verbs Based Use Cases

This chapter describes the procedure for different DBaaS use cases supported in this release.

It contains the following sections:

48.1 Getting Started with DBaaS With REST APIs and EM CLI Verbs

The following figure provides an overview of the different flavors of Enterprise Manager DBaaS.

Figure 48-1 DBaaS Use Cases


DBaaS use cases

This table lists the DBaaS use cases that are supported in this release and lists the different methods (EMCLI, and REST API) that can be used to run these use cases.

Table 48-1 DBaaS Use Cases

Service Type Service Offering See

New

Creating databases using a database template.

Creating Databases Using Database Template With REST APIs and EM CLI Verbs

New

Schema:

  • Creating an empty schema

  • Creating a schema based on profile

Creating Empty Schemas and Schemas Based on Profile With REST APIs and EM CLI Verbs

New

Pluggable Database:

  • Creating an empty pluggable database

  • Creating a pluggable database based on profile

Creating Empty PDBs and PDBs Based on Profile With REST APIs and EM CLI Verbs

Migrating or transferring data from one database to another.

Migrating/Transferring Data from One Database to Another

Snap Clone

  • Software Solution:

    • Sun ZFS

    • Clone DB

  • Hardware Solution:

    • ZFS file system

    • NetApp

    • EMC

Creating Databases Using Snap Clone With REST APIs and EM CLI Verbs

Clone

Full Clone:

  • Cloning databases using RMAN backup

  • Cloning databases using RMAN duplicate

Creating Full Database Clones Using RMAN With REST APIs and EM CLI Verbs

New DBaaS setup

Multi-Datacenter DBaaS setup

Multi-Datacenter DBaaS Setup

48.2 Creating Databases Using Database Template With REST APIs and EM CLI Verbs

The DBCA template supports both structure plus data and structure only types. This database provisioning profile is created from the production or source database registered with Enterprise Manager. It supports both structure plus data and structure only types. This option is recommended if the database size being created is less than 50 GB.

The table below shows the list of tasks that are involved in creating a database using the database template based profile.

You can create single instance and cluster databases using database template based profiles.

Note:

In the table below, wherever REST APIs are not available for any steps EM CLI verbs are provided, and vice-versa.

Table 48-2 Creating Databases Using Database Template with REST APIs and EM CLI Verbs

Step Task REST APIs EM CLI Verbs

1

Follow the steps in the Getting Started section to enable DBaaS.

See Getting Started

See Getting Started

2

Create resource providers.

  • Create one or more PaaS Infrastructure Zones.

  • Create one or more database pools.

See:

See:

6

Create a DBCA template based database provisioning profile.

See Creating Provisioning Profiles using EM CLI

See Creating Provisioning Profiles using EM CLI

4

Create the request settings.

See Creating Database Request Settings

See Database Request Settings EM CLI Verbs

5

Define quotas for each self service user.

See Creating DBaaS Quota for a Role

See Database Quota EM CLI Verbs

7

Create a service template based on the profile you have created.

See Service Templates and Service Template REST API Examples

See Service Template EM CLI Verbs

8

Configure the Chargeback Service.

See Performing UI Equivalent Chargeback Operations

See Performing UI Equivalent Chargeback Operations

9

While deploying a database, select the service template (associated with the database template based profile) you have created.

See Creating a Database Instance

See Creating a Database Instance

48.2.1 Creating Standby Databases With REST APIs and EM CLI Verbs

A data guard configuration consists of one primary database and one or more standby databases. The databases in a Data Guard configuration are connected by Oracle Net and may be dispersed geographically. There are no restrictions on where the databases are located, provided they can communicate with each other.

Oracle Data Guard ensures high availability, data protection, and disaster recovery for enterprise data. It provides a comprehensive set of services that create, maintain, manage, and monitor one or more standby databases to enable production Oracle databases to survive disasters and data corruptions. Oracle Data Guard maintains these standby databases as copies of the production database. If the production database becomes unavailable due to a planned or an unplanned outage, the Oracle Data Guard can switch any standby database to the production role, minimizing the downtime associated with the outage.

The production database, also referred to as the primary database can be either a single-instance Oracle database or an Oracle Real Application Clusters (RAC) database. A standby database is a transaction-wise consistent copy of the primary database. Using a backup copy of the primary database, you can create one or more standby databases and incorporate them in a Data Guard configuration. Using Enterprise Manager Database as a Service, users with the EM_SSA_ADMINISTRATOR role can setup the DBaaS Cloud with single instance of RAC standby databases.

Note:

In the table below, wherever REST APIs are not available for any steps EM CLI verbs are provided, and vice-versa.

Table 48-3 Creating Standby Databases with REST APIs and EM CLI Verbs

Step Task REST APIs EM CLI Verbs

1

Follow the steps in the Getting Started section to enable DBaaS.

See Getting Started

See Getting Started

2

Set up one or more PaaS Infrastructure Zones.

See Creating a PaaS Zone

See PaaS Zone EM CLI Verbs

3

Define a database pool for provisioning standby databases.

See Creating a Database Pool

See Software Pool EM CLI Verbs

4

Configure the request settings.

See Creating Database Request Settings

See Database Request Settings EM CLI Verbs

5

Define quotas for each self service user.

See Creating DBaaS Quota for a Role

See Database Quota EM CLI Verbs

6

Create either of the following types of profiles:

  • DBCA template based database provisioning profile.

  • RMAN Backup based database provisioning profile.

See Creating Provisioning Profiles using EM CLI

See Creating Provisioning Profiles using EM CLI

7

Create a service template based on the profile you have created.

See Service Templates and Service Template REST API Examples

See Service Template EM CLI Verbs

8

Configure the Chargeback Service.

See Performing UI Equivalent Chargeback Operations

See Performing UI Equivalent Chargeback Operations

9

While deploying a database, select the service template (associated with the DBCA template based profile) you have created. Additionally, you can also specify the standby database information while requesting the database.

See Creating a Database Instance

See Creating a Database Instance

48.3 Creating Empty Schemas and Schemas Based on Profile With REST APIs and EM CLI Verbs

The data content of a database provisioning profile is compiled from an export dump. You can choose to export Schema objects (structure only) or the Schema with data (structure and data).

The table below shows the list of tasks that are involved in creating an empty schema or a schema based on profile.

Note:

In the table below, wherever REST APIs are not available for any steps EM CLI verbs are provided, and vice-versa.

Table 48-4 Creating Schemas with REST APIs and EM CLI Verbs

Step Task REST APIs EM CLI Verbs

1

Follow the steps in the Getting Started section to enable DBaaS.

See Getting Started

See Getting Started

2

Set up one or more PaaS Infrastructure Zones.

See Creating a PaaS Zone

See PaaS Zone EM CLI Verbs

3

Define a database pool for schema as a service.

See Creating a Schema Pool

See Software Pool EM CLI Verbs

4

Configure the request settings.

See Creating Database Request Settings

See Database Request Settings EM CLI Verbs

5

Define quotas for each self service user.

See Creating DBaaS Quota for a Role

See Database Quota EM CLI Verbs

6

Create a database provisioning profile. This step is optional and is required if you are importing schemas from a profile.

See Creating Provisioning Profiles using EM CLI

See Creating Provisioning Profiles using EM CLI

7

Create a service template based on:

  • User Defined Schema: In this case, the service template is created with an empty schema.

  • Schema from a Profile: In this case, you can import schemas from a database provisioning profile. You can select this option for applications with data such as eBusiness applications.

See Creating a Service Template for a Schema

See Service Template EM CLI Verbs

8

Configure the Chargeback Service.

See Performing UI Equivalent Chargeback Operations

See Performing UI Equivalent Chargeback Operations

9

Create the schema based on the service template.

See Creating a Schema Service

See Creating a Schema Service

48.4 Creating Empty PDBs and PDBs Based on Profile With REST APIs and EM CLI Verbs

An Oracle Database can contain a portable collection of schemas, schema objects, and non-schema objects, that appear to an Oracle Net client as a separate database. This self-contained collection is called a pluggable database (PDB). A multi-tenant container database (CDB) is a database that includes one or more PDBs. Oracle Database 12c Release 1 (12.1) and later versions allow you to create many PDBs within a single CDB.

Note:

In the table below, wherever REST APIs are not available for any steps EM CLI verbs are provided, and vice-versa.

Table 48-5 Creating Pluggable Databases with REST APIs and EM CLI Verbs

Step Task REST APIs EM CLI Verbs

1

Follow the steps in the Getting Started section to enable DBaaS.

See Getting Started

See Getting Started

2

Set up one or more PaaS Infrastructure Zones.

See Creating a PaaS Zone

See PaaS Zone EM CLI Verbs

3

Create a database pool for PDB as a service.

See Creating a Pluggable Database Pool

See Software Pool EM CLI Verbs

4

Configure the request settings.

See Creating Database Request Settings

See Database Request Settings EM CLI Verbs

5

Define quotas for each self service user.

See Creating DBaaS Quota for a Role

See Database Quota EM CLI Verbs

6

Create a database provisioning profile. This step is optional and is not required if you are creating an empty pluggable database.

See Creating Provisioning Profiles using EM CLI

See Creating Provisioning Profiles using EM CLI

7

Create a service template. A service template can contain:

  • Empty Pluggable Database: In this case, the service template is created with an empty schema.

  • Pluggable Database from a Profile: In this case, you can import schemas from a database provisioning profile. You can select this option for applications with data such as eBusiness applications.

See Creating a Service Template for a Pluggable Database

See Service Template EM CLI Verbs

8

Configure the Chargeback Service.

See Performing UI Equivalent Chargeback Operations

See Performing UI Equivalent Chargeback Operations

9

While deploying a database, select the service template that you have created.

See Creating a Pluggable Database

See Creating a Pluggable Database

48.5 Migrating/Transferring Data from One Database to Another

To migrate data from one database to another using EM CLI verbs, follow the steps below:

  1. Enter the EM CLI verb emcli describe_dbprofile_input -data_mode=EXPORT. The output provides all profile creation input variables.

    Note:

    Export is supported only for database whereas import is supported for both database and PDBs. This indicates that the source should always be a database and the destination can be either a database or a PDB.

  2. Use the input variables to create a properties file with values for all the variables.
  3. Export data from the source database by creating a database profile. To do so, enter the verb emcli create_dbprofile - input_file=data:<properties file name along with path>.

    Note:

    Use the properties file created in the previous step for this verb.

    For the verb details see Creating Provisioning Profiles using EM CLI.

  4. Enter the verb to transfer data: emcli data_transfer -input_file=data:/u01/files/data_trans.props.

    For the verb and properties file details see Transferring Data Between Databases.

  5. Enter the verb to import data in to the destination database: emcli dbimport -input_file=data:/u01/files/dbimport.props.

    For the verb and properties file details see Importing Data from Export Dumps to a Database.

48.6 Creating Databases Using Snap Clone With REST APIs and EM CLI Verbs

Snap Clone is a Self-Service-Application (SSA) way of creating fast and space-saver clones of huge databases. Clones of the production database are often required for test and development purposes, and it is difficult and time consuming to create these clones, especially if the databases are huge.

Enterprise Manager offers Snap Clone as a way to address this issue, so that thin clones can be created from production databases by using the copy on write technology available in some storage systems. This means that these clones take up little space initially (about 2 GB of writable space required for a thin clone of a multi-terabyte database), and will grow as inserts, updates and deletes are performed. Enterprise Manager offers two solutions with snap clone:

  • Hardware Solution: Vendor specific hardware solution which supports NetApps, Oracle Sun ZFS storage appliance, EMC VMAX, and VNX.

  • Software Solution: Storage agnostic software solution that supports all NAS and SAN storage devices. This is supported through use of the ZFS file system, and the CloneDB feature.

The main features of snap clone are:

  • Self Service Driven Approach: Empowers the self service user to clone databases as required on an ad-hoc basis.

  • Rapid Cloning: Databases can be cloned in minutes and not in days or weeks.

  • Space Efficient: This features allows users to significantly reduce the storage footprint.

This section contains the following sub-sections:

48.6.1 Creating a Snap Clone Using a Profile With REST APIs and EM CLI Verbs

This table below lists the steps involved in creating a snap clone using a snapshot or an RMAN Image profile.

Note:

In the table below, wherever REST APIs are not available for any steps EM CLI verbs are provided, and vice-versa.

Table 48-6 Creating a Snap Clone Database Using a Profile with REST APIs and EM CLI Verbs

Step Task REST APIs EM CLI Verbs

1

Follow the steps in the Getting Started section to enable Snap Clone.

See Getting Started

See Getting Started

2

Register storage servers.

  • NetApp and Sun ZFS Storage Server

  • Solaris File System (ZFS)

  • EMC Storage Server

3

Set up one or more PaaS Infrastructure Zones.

See Creating a PaaS Zone

See PaaS Zone EM CLI Verbs

4

Create a database pool.

See Creating a Database Pool

See Software Pool EM CLI Verbs

5

Configure the request settings.

See Creating Database Request Settings

See Database Request Settings EM CLI Verbs

6

Define quotas for each self service user.

See Creating DBaaS Quota for a Role

See Database Quota EM CLI Verbs

7

Set up the Test Master Database and enable snap clone.

See Enabling the Test Master for Snap Clone

See Enabling the Test Master for Snap Clone

8

Depending on the snap clone solution you are using, do either of the following:

  • Hardware Solution: Create a snap clone based profile.

  • Software Solution: Create an RMAN Image profile.

Create a database provisioning profile using a snap clone.

9

Create a service template based on the profile you have created.

10

Configure the Chargeback Service. (this step is optional)

See Performing UI Equivalent Chargeback Operations

See Performing UI Equivalent Chargeback Operations

11

While deploying a database, select the service template you have created.

See Creating a Database Instance

See Creating a Database Instance

48.6.2 Creating a Snap Clone Using Live Database With REST APIs and EM CLI Verbs

This table below lists the steps involved in creating a snap clone using a live standby database.

Note:

In the table below, wherever REST APIs are not available for any steps EM CLI verbs are provided, and vice-versa.

Table 48-7 Creating Snap Clone Using Live Database With REST APIs and EM CLI Verbs

Step Task REST APIs EM CLI Verbs

1

Follow the steps in the Getting Started section to enable Snap Clone.

See Getting Started.

See Getting Started.

2

Register storage servers.

  • NetApp and Sun ZFS Storage Server

  • Solaris File System (ZFS)

  • EMC Storage Server

See:

See:

3

Set up one or more PaaS Infrastructure Zones.

See Creating a PaaS Zone

See PaaS Zone EM CLI Verbs

4

Create a database pool.

See Creating a Database Pool

See Software Pool EM CLI Verbs

5

Configure the request settings.

See Creating Database Request Settings

See Database Request Settings EM CLI Verbs

6

Define quotas for each self service user.

See Creating DBaaS Quota for a Role

See Database Quota EM CLI Verbs

7

Set up the Test Master Database using a live standby database.

See Using a Physical Standby Database as a Test Master

See Using a Physical Standby Database as a Test Master

9

Create a service template.

See Service Templates and Service Template REST API Examples

See Service Template EM CLI Verbs

10

Configure the Chargeback Service. (this step is optional)

See Performing UI Equivalent Chargeback Operations

See Performing UI Equivalent Chargeback Operations

11

While deploying a database, select the service template you have created.

See Creating a Database Instance

See Creating a Database Instance

48.6.3 Continuous Sync

A continuous sync setup has a production database and a Test master database which is on a filer (NAS storage). The Test master is an RMAN image backup of the data files and is scheduled to run a backup of the production database at regular intervals. Thereby the Test master database gets continuous/live data from the production database.

To set up a continuous sync database setup, follow the steps below:

Table 48-8 Creating a Continuous Sync Setup Using EM CLI Verbs

Step Task EM CLI Verb

1

Add an existing standby database.Currently, this task can be accomplished only via the UI screen.

Not available

2

Create a new Test master from a standby database.

Creating a Database Profile Using EM CLI Verbs

3

Create a clone.

Creating a Database Clone Using EM CLI Verbs

4

Promote the clone as the Test master.

Currently, this task can be accomplished only via the UI screen.

Not available

48.7 Creating Full Database Clones Using RMAN With REST APIs and EM CLI Verbs

There are two ways of cloning full databases using RMAN. They are:

48.7.1 Creating a Full Database Clone Using RMAN Backup

Database backups created by RMAN (Recovery Manager) are stored as image copies or backup sets. You can create profiles using these backups and use these profiles to create full database clones.

Note:

In the table below, wherever REST APIs are not available for any steps EM CLI verbs are provided, and vice-versa.

Table 48-9 Cloning Databases Using RMAN Backup Profile with REST APIs and EM CLI Verbs

Step Task REST APIs EM CLI Verbs

1

Follow the steps in the Getting Started section to enable DBaaS.

See Getting Started

See Getting Started

2

Set up one or more PaaS Infrastructure Zones.

See Creating a PaaS Zone

See PaaS Zone EM CLI Verbs

3

Create a database pool.

See Creating a Database Pool

See Software Pool EM CLI Verbs

4

Configure the request settings.

See Creating Database Request Settings

See Database Request Settings EM CLI Verbs

5

Define quotas for each self service user.

See Creating DBaaS Quota for a Role

See Database Quota EM CLI Verbs

6

Create one of the following database provisioning profiles:

  • RMAN Backup

  • Existing RMAN Backup

See Creating Provisioning Profiles using EM CLI

See Creating Provisioning Profiles using EM CLI

7

Set up the Test Master database.

See Enabling the Test Master for Snap Clone

See Enabling the Test Master for Snap Clone

8

Create a service template based on the profile you have created.

See Service Templates and Service Template REST API Examples

See Service Template EM CLI Verbs

9

Configure the Chargeback Service.

See Performing UI Equivalent Chargeback Operations

See Performing UI Equivalent Chargeback Operations

10

While deploying a database, select the service template you have created.

See Creating a Database Instance

See Creating a Database Instance

48.7.2 Creating a Full Database Clone Using RMAN Duplication (Live Cloning)

Database backups created by RMAN (Recovery Manager) are stored as image copies or backup sets. You can create profiles using these backups and use these profiles to create full database clones.

Note:

In the table below, wherever REST APIs are not available for any steps EM CLI verbs are provided, and vice-versa.

Table 48-10 Creating a Full Database Clone Using RMAN Backup WIth REST APIs and EM CLI Verbs

Step Task REST APIs EM CLI Verbs

1

Follow the steps in the Getting Started section to enable DBaaS.

See Getting Started

See Getting Started

2

Set up one or more PaaS Infrastructure Zones.

See Creating a PaaS Zone

See PaaS Zone EM CLI Verbs

3

Create a database pool.

See Creating a Database Pool

See Software Pool EM CLI Verbs

4

Create the test master by using a live standby database.

See Using a Physical Standby Database as a Test Master

See Using a Physical Standby Database as a Test Master

5

Configure the request settings.

See Creating Database Request Settings

See Database Request Settings EM CLI Verbs

6

Define quotas for each self service user.

See Creating DBaaS Quota for a Role

See Database Quota EM CLI Verbs

7

Create a service template based on the test master.

See Service Templates and Service Template REST API Examples

See Service Template EM CLI Verbs

8

Configure the Chargeback Service.

See Performing UI Equivalent Chargeback Operations

See Performing UI Equivalent Chargeback Operations

9

While deploying a database, select the service template you have created.

See Creating a Database Instance

See Creating a Database Instance

48.7.3 Discrete Sync

A discrete sync setup has a production database which is not available for direct cloning operations and thereby with no standby database. The administrator schedules periodic backups on the production database and uses the backups to create the Test master database.

To set up a discrete sync database setup, follow the steps below:

Table 48-11 Creating a Discrete Sync Setup Using EM CLI Verbs

Step Task EM CLI Verb

1

Create a Test master database.

Creating a Database Clone Using EM CLI Verbs

2

Create a full backup.

Creating a Database Profile Using EM CLI Verbs

3

Create a thin backup.

Creating a Database Profile Using EM CLI Verbs

4

Create a clone.

Creating a Database Clone Using EM CLI Verbs

5

Refresh Test master or clones.

Refreshing a Database Using EM CLI Verbs

48.8 Configuring Custom Database Placement Option Using REST APIs

This section describes the custom database placement feature using REST APIs. See the following sections for further details:

48.8.1 Custom Database Placement Option for Databases Using REST APIs

With the custom database placement option, an SSA user has the option of choosing the host on which the database instance is created. This option has to be enabled in the service template by the SSA Administrator while creating the service template. The SELECT_ORACLE_HOME_OPTION parameter in the JSON body of the service template defines if the SSA User has the option to select the host while requesting for a database instance. If SELECT_ORACLE_HOME_OPTION is set with the value "SELECT_ORACLE_HOME_FROM_REQUEST" the SSA User has the option to choose the database host while requesting the database. If the parameter is not defined, or if the value for the parameter is not set, or if the value is set to "SELECT_ORACLE_HOME_AT_RUNTIME", then the SSA User will not have the option of choosing the database host and the database instance will be created on the host selected by the placement algorithm during the execution of the request.

After the option is set in the service template, the SSA User can perform a GET operation on the service template URI to view the available hosts. The "hosts_for_placement" parameter (in the case of a SI database), and "clusters_for_placement" and "hostsInCluster" parameters (in case of a RAC database) provide the details of the available hosts to the SSA User. The SSA User is then required to define the host name for placing the database in the "database_host_name" parameter in the POST operation for requesting a database instance.

The "database_host_name" parameter is a mandatory parameter if the custom placement option is set in the service template. Note that multiple values for database_host_name request parameter can be provided as comma separated values. For a RAC database request, the number of hosts specified in this parameter should match with the number of nodes configured in the service template, and all of the hosts provided should belong to the same cluster and should be present in the selected zone.

48.8.2 Custom Database Placement Option for Pluggable Databases Using REST APIs

With the custom database placement option, an SSA user has the option of choosing the Container Database (CDB) on which the Pluggable Database (PDB) instance is created. This option has to be enabled in the service template by the SSA Administrator while creating the service template.

The SELECT_TARGET_OPTION parameter in the JSON body of the PDB service template defines if the SSA User has the option to select the host while requesting for a database instance. If SELECT_ORACLE_HOME_OPTION is set with the value "SELECT_TARGET_FROM_REQUEST" the SSA User has the option to choose the CDB while requesting the database. If the parameter is not defined, or if the value for the parameter is not set, or if the value is set to "SELECT_TARGET_AT_RUNTIME", then the SSA User will not have the option of choosing the CDB and the PDB instance will be created on the CDB selected by the placement algorithm during the execution of the request.

After the option is set in the PDB service template, the SSA User can perform a GET operation on the service template URI to view the available CDBs. The "target_nodes_for_placement" parameter provides the details of the available CDBs to the SSA User. The SSA User is then required to define the CDB target name for placing the PDB in the "target_name" parameter in the POST operation for requesting a PDB instance.

The "target_name" parameter is a mandatory parameter if the custom placement option is set in the service template. The CDB target name specified in this parameter should be present in the selected zone.

48.9 Service Catalog of Database as a Service

Service catalog is a collection of pre-approved database configurations available to selected consumers for on demand, self service provisioning. It enforces consistency and automation, and helps reduce the database management overhead.

Service catalog offers:

  • Self-service provisioning which provides IT agility

  • Enterprise-wide service catalog which provides standardization and compliance

  • Database cloning using snap clone which saves time and storage space

  • Metering, chargeback and quota which ensures service governance

  • Performance and lifecycle management which guarantees service levels

  • Patching, upgrading and configuration automation which lowers operational costs

For more information on service catalog watch the video at - https://apex.oracle.com/pls/apex/f?p=44785:24:0::::P24_CONTENT_ID,P24_PREV_PAGE:9590,1.

The following section explains the REST APIs required for setting up a sample multi-datacenter DBaaS.

48.9.1 Multi-Datacenter DBaaS Setup

Multi-datacenter DBaaS setup is the best possible structure of DBaaS configuration in an enterprise with multiple data centers where all aspects related to data safety, recovery and backup are considered at the highest levels.

Figure 48-2 Multi-Datacenter DBaaS Setup


Multi-datacenter DBaaS setup

Multi-datacenter DBaaS setup requires creating a Primary RAC software pool and two Standby software pools. Of the two standby software pools, the near disaster recovery (DR) pool is a RAC software pool and the other, which is the far DR is a single instance software pool. After the software pools are created, the service template is created to establish the relation between the software pools. This setup is offered as a Multi-datacenter DBaaS setup to the SSA user.

The topics covered under this section are:

48.9.1.1 Administrator Steps for Creating the Multi-Datacenter DBaaS Setup

This section explains the steps to setup the Multi-datacenter DBaaS using REST APIs. For the EM CLI verb equivalent of the REST APIs run the emcli invoke_ws command for each of the REST APIs in the steps below. For details on emcli invoke_ws command, refer to EM CLI Verbs for Database as a Service Administrator.

Follow the steps below to setup the Multi-datacenter DBaaS:

  1. Create a PaaS zone for the data center with the single instance software pool (Far DR).

    To create a PaaS zone, issue the REST API request given below.

    Table 48-12 Request Configuration to Create a PaaS Zone

    Feature Description

    URI

    https://<OMS_HOST>:<OMS_CONSOLE_PORT>/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/paaszones/

    Request headers

    Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

    Content-Type: application/json

    Body

    {
        "name":"DATACENTER_2",
        "description":"This is a TestZone",
        "credential":"NCAIME",
        "memberType":"host",
        "members":[
            "www.example.com"
        ],
        "constraint":[
            {
                "name":"MAX_CPU_UTILIZATION",
                "value":"85"
            },
            {
                "name":"MAX_MEMORY_ALLOCATION",
                "value":"95"
            }
        ],
        "roles":[
            "SSACOREROLE1",
            "SSACOREROLE2"
        ],
        
    }
    

    Request method

    POST

  2. Create a standby single instance software pool in DATACENTER_2.

    To create a standby single instance software pool, issue the REST API request given below.

    Table 48-13 Configuration to Create a Standby Single Instance Software Pool

    Feature Description

    URI

    https://<OMS_HOST>:<OMS_CONSOLE_PORT>/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/softwarepools

    Request headers

    Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

    Content-Type: application/json

    Body

    { 
            "name": "DB_POOL2", 
            "poolTargetType": "oracle_cloud_zone",
            "description": "Database Pool of Oracle Homes",
            "paasZone": "DATACENTER_2",
            "members": ["OraDb11g_home1_2_example.com"],
            "serviceFamily":"DBAAS",
            "serviceType":"DBAAS",
            "constraints": {"items": [{"name": "MAX_INSTANCES", "value": "10"}]},
            "filters": 
                {"items": [
                                            {"name": "CONFIGURATION","value": "oracle_database"},
                                            {"name": "VERSION","value": "11.2.0.4.0"},
                                            {"name": "PLATFORM","value": "226"}
                                      ]
                    } ,
            "properties": 
                    {"items": [
                            {"name": "host_credential_guid", "value": "FF7A82CE961672E6E0437850B10ABF4E"}           
                                      ]
                    }
    }
    

    Request method

    POST

  3. Create a PaaS zone for the data center with the primary database and the standby RAC database (Near DR).

    To create a PaaS zone, issue the REST API request given below.

    Table 48-14 Request Configuration to Create a PaaS Zone

    Feature Description

    URI

    https://<OMS_HOST>:<OMS_CONSOLE_PORT>/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/paaszones/

    Request headers

    Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

    Content-Type: application/json

    Body

    {
        "name":"DATACENTER_1",
        "description":"This is a TestZone",
        "credential":"NCAIME",
        "memberType":"host",
        "members":[
            "www.example.com"
        ],
        "constraint":[
            {
                "name":"MAX_CPU_UTILIZATION",
                "value":"85"
            },
            {
                "name":"MAX_MEMORY_ALLOCATION",
                "value":"95"
            }
        ],
        "roles":[
            "SSACOREROLE1",
            "SSACOREROLE2"
        ],
        
    }
    

    Request method

    POST

  4. Create a standby RAC software pool in DATACENTER_1.

    To create a standby RAC software pool, issue the REST API request shown below.

    Table 48-15 Configuration to Create a Standby RAC Software Pool

    Feature Description

    URI

    https://<OMS_HOST>:<OMS_CONSOLE_PORT>/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/s

    oftwarepools

    Request headers

    Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

    Content-Type: application/json

    Body

    { 
            "name": "DB_POOL3", 
            "poolTargetType": "oracle_cloud_zone",
            "description": "Database Pool of Oracle Homes",
            "paasZone": "DATACENTER_1",
            "members": ["OraDb11g_home2_11_www.example.com","OraDb11g_home2_11_www.example.com"],
            "serviceFamily":"DBAAS",
            "serviceType":"DBAAS",
            "constraints": {"items": [{"name": "MAX_INSTANCES", "value": "10"}]},
            "filters": 
               {"items": [
                                            {"name": "CONFIGURATION","value": "rac_database"},
                                            {"name": "VERSION","value": "11.2.0.4.0"},
                                            {"name": "PLATFORM","value": "226"}
                                     ]
               } ,
            "properties": 
                    {"items": [
                            {"name": "host_credential_guid", "value": "FF7A82CE961672E6E0437850B10ABF4E"}           
                                      ]
                    }
    }
    

    Request method

    POST

  5. Create a primary RAC software pool in DATACENTER_1.

    To create a primary RAC software pool, issue the REST API request shown below.

    Table 48-16 Configuration to Create a Primary RAC Software Pool

    Feature Description

    URI

    https://<OMS_HOST>:<OMS_CONSOLE_PORT>/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/softwarepools

    Request headers

    Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

    Content-Type: application/json

    Body

    { 
            "name": "DB_POOL1", 
            "poolTargetType": "oracle_cloud_zone",
            "description": "Database Pool of Oracle Homes",
            "paasZone": "DATACENTER_1",
            "members": ["OraDb11g_home1_2_www.example.com","OraDb11g_home1_2_www.example.com"],
            "serviceFamily":"DBAAS",
            "serviceType":"DBAAS",
            "constraints": {"items": [{"name": "MAX_INSTANCES", "value": "10"}]},
            "filters": 
               {"items": [
                                            {"name": "CONFIGURATION","value": "rac_database"},
                                            {"name": "VERSION","value": "11.2.0.4.0"},
                                            {"name": "PLATFORM","value": "226"}
                                     ]
               } ,
            "properties": 
                    {"items": [
                            {"name": "host_credential_guid", "value": "FF7A82CE961672E6E0437850B10ABF4E"},
                            {"name": "standby_pools", "value": "DB_POOL2|DB_POOL3"}
                                      ]
                    }
    }       
    

    Request method

    POST

  6. Create DBaaS Request Settings for a user role.

    To create DBaaS request settings, issue the REST API request shown below.

    Table 48-17 Configuration to Create DBaaS Request Settings

    Feature Description

    URI

    https://<OMS_HOST>:<OMS_CONSOLE_PORT>/em/cloud/dbaas/requestsetttings

    Request headers

    Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

    Content-Type: application/json

    Accept: application/oracle.com.cloud.common.DbaasRequestSettings+json

    Body

    {
            "future_reservation_length" : "2 Months", 
            "maximum_archive_duration" : "10 Weeks",
            "default_retirement_period" : "No Reservation"
            }
    

    Request method

    POST

  7. Create Quota for a user role.

    To create quota, issue the REST API request shown below.

    Table 48-18 Configuration to Create a Quota

    Feature Description

    URI

    https://<OMS_HOST>:<OMS_CONSOLE_PORT>/em/cloud/dbaas/quota

    Request headers

    Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

    Content-Type: application/json

    Accept: application/oracle.com.cloud.common.DbaasRequestSettings+json

    Body

    {
            "role_name" : "DBAAS_ROLE",       
            "databases" : "10",
            "schema_services" : "21",
            "pluggable_databases" : "22",
            "storage" : "99",
            "memory" : "99"
            }
    

    Request method

    POST

  8. Create a Profile to capture the source database information for provisioning. Refer to EM CLI Verbs for Database as a Service Administrator.
  9. Create a database service template.

    To create a database service template, issue the REST API request shown below.

    Table 48-19 Configuration to Create a Database Service Template

    Feature Description

    URI

    https://<OMS_HOST>:<OMS_CONSOLE_PORT>/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/servicetemplates

    Request headers

    Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

    Content-Type: application/json

    Body

    {
            "name":"TestDbTemplate1",
            "serviceType":"DB",
            "serviceFamily":"DBAAS",
            "description":"This is a test database standby service template 1",
            "poolIds":[ "00829096124B0CC3E0537850B10A9E88" ],
            "serviceExecutableMeta":{
                    "type":"CDP",
                    "configurations":[
                     { "name":"PROFILE_COMPONENT_URN", "value":"oracle:defaultService:em:provisioning:1:cmp:COMP_Component:SUB_DbProfile:0008FDF6A8BD706BE0537850B10A5E7A:0.1" },
                     { "name":"DATABASE_TYPE","value":"rac_database" },
                     { "name":"COMMON_DB_SYSTEM_PASSWORD", "value":"welcome" },
                     { "name":"COMMON_DB_DBSNMP_PASSWORD", "value":"welcome" },
                     { "name":"COMMON_DB_SYS_PASSWORD","value":"welcome" },
                     { "name":"DB_ADMIN_PASSWORD_SAME", "value":"true" },
                     { "name":"INSTANCE_COUNT","value":"2" },
                     { "name":"SID_OPTION", "value":"ssauser        "},
                     { "name":"COMMON_DB_SID","value":"mydb1" },
                     { "name":"COMMON_DOMAIN_NAME",  "value":"www.example.com" },
                     { "name":"LISTENER_PORT", "value":"1521"},
                     { "name":"STAGE_LOCATION", "value":"/scratch" },
                     { "name":"REF_ZONE", "value":"DATACENTER_1" },
                     { "name":"REF_POOL",   "value":"DB_POOL1" },
                     { "name":"REF_HOST", "value":"www.example.com" },
                     { "name":"REF_TGT","value":"www.example.com" },
                     { "name":"DBCA_TEMPLATE:DB_STORAGE_TYPE",  "value":"ASM" },
                     { "name":"DBCA_TEMPLATE:DATA_FILE_LOCATION","value":"DATA" },
                     { "name":"DBCA_TEMPLATE:REC_STORAGE_TYPE_SAME_AS_DB_FILES", "value":"Y" },
                     { "name":"DBCA_TEMPLATE:ARCHIVE_LOG_MODE", "value":"Y" },
                     { "name":"DBCA_TEMPLATE:FLASH_RECOVERY_AREA_SIZE", "value":"5000" },
                     { "name":"DBCA_TEMPLATE:RECOVERY_FILE_LOCATION","value":"RECO" },
                     { "name":"DBCA_TEMPLATE:REDO_FILE_LOCATION", "value":"RECO"  },
                     {
                            "name":"INIT_PARAMS",
                            "subconfigurations":[
                               { "name":"INIT_PARAMS:1", "value":"sga_target=1073741824" },
                               { "name":"INIT_PARAMS:2", "value":"pga_aggregate_target=1073741824"  }
                            ]
                     },
                    { "name":"STANDBY_REQUIRED","value":"true" },
                    { "name":"STANDBY_REQUIRED_LOCK","value":"false" },
                    { "name":"STANDBY_WORK_DIR","value":"/tmp" },
                    { "name":"PRIMARY_PROTECTION_MODE","value":"MAXIMIZE AVAILABILITY" },
                    { "name":"DBAAS_SSA_STANDBY_CUSTOM_PRE_SCRIPTS_URN","value":"" },
                    { "name":"DBAAS_SSA_STANDBY_CUSTOM_POST_SCRIPTS_URN","value":"" },
                    { "name":"STANDBY_DB_DETAILS","value":"","values":[
                    "pool=DB_POOL3;databaseSIDPrefix=;databaseType=rac_database;standbyConfigName=Near DR;redoMode=SYNC;realtimeQuery=true;databaseRACInstanceCount=2;databaseDelay=30;databaseUniqueName=;standbyStorageType=FS;standbyStorageLocation=;standbyFRAType=FS;standbyFRALocation=;standbyFRASize=;standbyLsnrPort=;domainName=us.example.com",
                    "pool=DB_POOL2;databaseSIDPrefix=;databaseType=oracle_database;standbyConfigName=Far DR;redoMode=ASYNC;realtimeQuery=false;databaseRACInstanceCount=2;databaseDelay=60;databaseUniqueName=;standbyStorageType=FS;standbyStorageLocation=;standbyFRAType=FS;standbyFRALocation=;standbyFRASize=;standbyLsnrPort=;domainName=us.example.com"]}
             
              ]               
    }
    }
    

    Request method

    POST

The platinum DBaaS setup is ready to be administered.

48.9.1.2 SSA User REST API Request for Using the Multi-Datacenter DBaaS Setup

To request a multi-datacenter DBaaS setup with a near DR and a far DR, issue the REST API request shown below.

Table 48-20 Configuration to Create a Database with Two Standby Databases

Feature Description

URI

https://<OMS_HOST>:<OMS_CONSOLE_PORT>/em/cloud/dbaas/zone/82CF1C28FA20A183C99D13

8FF8065F19

Request headers

Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

Content-Type: application/oracle.com.cloud.common.DbPlatformInstance+json

Accept: application/oracle.com.cloud.common.DbPlatformInstance+json

Body

{
       "based_on": "/em/cloud/dbaas/dbplatformtemplate/CC3BBB665A6BC6FFE040F00AEF252456",
       "name": "Platinum1",
       "description": "Create Database with 1 Standby RAC database & 1 Standby SI database",
       "start_date": "2014-08-13T14:20:00ZAsia/Calcutta",
       "end_date": "2014-08-13T17:20:00ZAsia/Calcutta",
       "params":
       { 
         "username": "Master Account username for the DB",
         "password": "Master Account Password for the  DB",
         "database_sid" : "platinum1" ,
         "service_name" : "Name of the additional service to be created",
                        "standbydbs":
                                [
                                        {
                                                "standbydb_name":"Near DR",
                                                "standbydb_sid":"NR1"
                                        },
                                        {
                                                "standbydb_name":"Far DR",
                                                "standbydb_sid":"FR1"
                                        }                                       
                                ]
       }
  }  

Request method

POST