19 Provisioning Pluggable Databases

This chapter describes the process involved in provisioning pluggable databases. It contains the following sections:

19.1 Getting Started

An Oracle Database can contain a portable collection of schemas, schema objects, and nonschema 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.

Table 19-1 Provisioning Pluggable Databases

Step Task Role

1

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

See Getting Started

2

Create one or more resource providers.

See Creating Resource Providers

4

Configure the request settings.

See Configuring Request Settings

5

Define quotas for each self service user.

See Defining Quotas

6

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

See Creating a Database Provisioning Profile Using Export Schema Objects

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 PDB Based on Profile

8

Configure the Chargeback Service.

See Configuring Chargeback

9

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

See Requesting a Pluggable Database

19.2 Creating Resource Providers

You must create one or more resource providers which include:

19.2.1 Creating a Database Pool for PDB as a Service

A Pluggable Database (PDB) is portable set of schemas, schema objects, and related structures that appears logically to an application as a separate database. This self-contained collection is called a pluggable database (PDB). Every PDB is owned by a SYS user.

A container is a collection of schemas, objects, and related structures in a container database (CDB) that appears logically to an application as a separate database. A container database (CDB) is an Oracle database that includes zero, one, or many user-created PDBs.

A database pool for PDB as a Service must contain a set of container databases. The container databases must meet the following guidelines:

  • All CDBs in a database pool must be of the same version and platform.

  • All CDBs in a database pool must either be single instance databases or RAC databases. Mix and match of database types is not supported.

To create a database pool for PDB as a service, follow these steps:

  1. Log into Enterprise Manager as a user with the EM_SSA_ADMINISTRATOR role.
  2. From the Enterprise menu, select Cloud, then select Cloud Home. From the Oracle Cloud menu, select Setup, then select Getting Started. Click the Setup link next to the Database service family, select Pluggable Database from the drop down link, click on the Pluggable Database Pool link and then click Create.

    Figure 19-1 Create Database Pool: Setup Page (PDB)


    Create Database Pool: Setup Page (PDB)
  3. Enter a name and description for the database pool.
  4. In the Credentials region, specify the credentials that will be used for performing database operations. Specify the following credentials:
    • Host: Required for performing remote host operations.

    • Grid Infrastructure: Required to register a database service with grid infrastructure credentials.

    • Database: Required for creating the pluggable database.

    • Container Database Wallet Password: If the PDB is to be encrypted, you must specify the password required to open the wallet from the keystore.

  5. Specify the following details:
    • PaaS Infrastructure Zone: Select a PaaS Infrastructure Zone in which the container databases are present. The PDBs will be created on the databases selected for the pool. For details on creating container databases, see Provision a Container Database for PDB as a Service.

    • Target Type: Specify the configuration of the target database on which the PDB is being deployed. This can be Single Instance or Cluster Database (RAC).

    • Platform and Version: Specify the platform and version of the database being deployed.

  6. Click Add and select one or more container databases to be added to the pool. All databases you select must be present in the same PaaS Infrastructure Zone.

    Note:

    You can search for database groups that meet your requirements by specifying a search string in the Groups field.

  7. Click Next. The Create New Pool: Policies page appears.

    Figure 19-2 Create Database Pool: Policies (PDB)


    Create Database Pool: Policies (PDB)

    Specify the placement policy constraints to set maximum ceilings for resource utilization on each database. Placement policy constraints for each database can be defined by services or workloads as follows:

    • Pluggable Database: Select the Pluggable Database checkbox and specify the Maximum Number of Pluggable Databases that can be created inside each CDB.

    • Workloads Associated with Service Requests: The amount of resources (such as CPU and memory) to manage the workload can be specified here. Specify the workload that is to be enforced for the pluggable database.

      • Maximum CPU Allocation: Specify the maximum CPU that can be allocated to each database.

      • Maximum Memory Allocation: Specify the maximum memory that can be allocated for each database.

      For example: If a container database is caged to 2 CPUs with SGA of 4GB, and you specify the Maximum CPU Allocation and Maximum Memory Allocation as 80%:

      • the maximum CPU limit for each pluggable database is 1.6

      • the maximum S­­GA / memory limit for each pluggable database is 3.2

  8. If you have chosen to set the placement constraints by Workloads Associated with Service Requests, you can choose to enable the resource manager by selecting the Enable Resource Manager for CPU check box. You can use the resource manager to manage the CPU resource and create Consumer Groups. A Consumer Group is used to ensure that the service gets the requested CPU cycles on a fully loaded system.
  9. Click Submit to create a database pool for PDB as a service. The newly created database pool will appear in the Database Cloud Self Service Portal Setup: Database Pools page.

19.2.2 Creating an Oracle Cloud Database Pool for PDB as a Service

Enterprise Manager Cloud Control provides a single pane of glass for monitoring and managing on-premise as well as Oracle Cloud deployments, all from the same management cloud. By leveraging Enterprise Manager’s hybrid cloud management capabilities, database pools for PDBaaS can be created as a set of container databases on Oracle Cloud. This provides Enterprise Manager self service users with the capability to provision PDBs on Oracle Cloud. Once the Oracle Cloud container database target has been discovered by deploying an Enterprise Manager Agent for hybrid cloud (See Enabling Hybrid Cloud Management in the Enterprise Manager Administrator’s Guide), a database pool consisting of a set of container databases can be created on Oracle Cloud by following instructions listed in Creating a Database Pool for PDB as a Service.

19.3 Creating a Database Provisioning Profile Using Export Schema Objects

To create a database provisioning profile, follow these steps:

  1. You can access the Database Provisioning page using either of the following ways:
    • From the Enterprise menu, select Cloud, and then select Cloud Home. On the Cloud home page, click Oracle Cloud, select Setup, and then select Data Sources. On the Database: Data Sources page, in the Data Profiles tab, click Create.

    • From the Enterprise menu, select Provisioning and Patching, and then select Database Provisioning. On the Database Provisioning page, in the Profiles section, click Create.

    • From the database target home page, click Oracle Database, select Provisioning, and then select Create Provisioning Profile.

  2. On the Reference Target page, click the search icon to select a target.
  3. In the Search and Select:Targets display box, select the database you want to create a profile for, and then, click Select.
  4. On the Reference Target page, select the following:
    • Data Content

    • Structure and Data to include physical and structural files from the database or Structure Only to include only the structural files in the template.

    • Export Schema Objects


    Reference Target page for Export Schema Objects
  5. In the Credentials section, select the database. In the Credentials column, you can select Named Credentials and then select a credential name from the Credential Name column (or) select Preferred Credentials. Click Next.
  6. On the Content Options page, do the following:
    • Select the schema you want to include in the profile by clicking on a schema in the Available Schema list and moving it to the Selected Schema list.

      Note:

      When one or more schemas are selected, the database checks if the dependent schemas are also selected for export. If the dependent schemas are not exported, you will receive a warning. You can choose to go ahead with the selected schemas, or to include the schemas which were not initially selected.

      The same warning is also displayed when you select a profile that does not have the dependent schemas exported.


      Content Options page

      Note:

      The Available Schemas section displays only the user created schemas that has data content in it. All the empty schemas are filtered out by default.

      Note:

      System schemas such as SYS, SYSTEM, and DBSNMP will not be exported.

      The user schemas which do not have their own tablespace are not shown in left side of the shuttle.

    • In the Degree of Parallelism section, enter the number of threads required to perform the export operation.

      Note:

      Increasing the number of threads helps reduce the time required to create the profile at the cost of using system resources.

    • In the Directory Locations section, click on Add. In the Select Directory window, select a directory object listed to perform the export operation, and then click Select.

      Note:

      The number of export threads determines the number of parallel export processes that will run in parallel during export.

      Hence, the dump file names should contain %U, to ensure the file names are auto generated with the running count to facilitate parallel operation along with the maximum size for the dump file. For example, 5GB. This means that the file rotation will start after 5GB limit is reached.

      Note:

      Ensure that the directory location is accessible. The directory object that you select must refer to a location that is accessible across all the nodes. You can also create a directory object on ASM. However, it is not supported on ASM.

      In the Log subsection, click on the search icon. In the Select Directory window, select the directory object you require to perform the export operation, and then click Select.

      In the Log subsection, enter the file name, and then click on Next.

      Note:

      You can make use of degree of parallelism with dump file names. The default value of dump files contain %U which creates a running count when degree of parallelism is greater than 1.

      Also, this enables you to add multiple dump directories to distribute the storage if required.

  7. On the Create Database Provisioning Profile: Page, in the Profile Information section, do the following:
    • Specify or select a profile location in the software library where the database profile will be created.

    • Specify a unique profile name.

      For example:
      Export Schema Objects Provisioning Profile for HR database
      
    • Add a description for the profile.

    • Verify the profile version and the vendor.

    • Add any additional notes such as host name, database, data content, data content mode, and the like.


      Profile information
  8. In the Schedule section, you can choose to start the profile creation immediately, or you can schedule it for a later time. You can also choose to repeat the creation of the provisioning profile, and set a repeat time.
  9. Specify or select a working directory. Click Next.
  10. On the Review page, ensure that the selections you have made in the previous pages are correctly displayed and click Submit. Otherwise, click Back repeatedly till you reach the page where you want to make changes. Click Cancel to abort the provisioning profile creation.

    Once you have submitted the provisioning profile creation job, manually refresh the page if View Data has been set to Real Time: Manual Refresh. Else, set View Data to reload after a specific period of time, and then select an execution step from the Procedure Steps tree on the left pane to view the details.

    To view the submitted jobs, select the Procedure Activity link in the Data Profiles tab.

19.4 Configuring Request Settings

You can configure the request settings by specifying when a request can be made, its duration, and so on. See Configuring Request Settings

19.5 Defining Quotas

After configuring the request settings, you must define quotas for each self service user. See Setting Up Quotas

19.6 Creating a Service Template for PDB Based on Profile

One or more pluggable databases can be created based on the service template definition. To create a service template for PDB as a service, follow these steps:

  1. Log into Enterprise Manager as a user with the EM_SSA_ADMINISTRATOR role.
  2. From the Enterprise menu, select Cloud, then select Cloud Home. The Cloud Home page appears. From the Oracle Cloud menu, select Setup, then select Getting Started.
  3. Click the Setup link next to the Databases option in the left panel. Select Pluggable Database from the drop down menu.
  4. Click the Service Templates link. The Service Templates page appears. Click Create. The Create Service Template: General page appears.

    Figure 19-3 Create Service Template: General (PDB)


    Create Service Template: General (PDB)
  5. Enter a name and description for the service template. The description must be unique and provide information on the type of service template being created.
  6. In the Pluggable Database region, select the Create Pluggable Databases from Profile option and select a database provisioning profile that is to be used to create the pluggable database. Click the Search icon next to the Profile field and select an export schema objects profile from the list. If a profile does not exist, you must create one. See Creating a Database Provisioning Profile Using Export Schema Objects for details.
    • Note:

      You can also create a PDB from an uplugged PDB. To do so, follow these steps:

      • Unplug the PDB from the container database and specify the location in the Software Library which the PDB template (contains data files and the metadata XML file) is to be stored.

      • In the Service Template Creation wizard, specify the PDB template location in the Shared Location field. The PDB is created with the specified data files.

  7. In the Pools and Zones region, click Add to select a PaaS Infrastructure Zone into which the pluggable database instance is to be provisioned. Click Assign Pool to add a Database Pool (for Pluggable Databases) for the zone.

    Note:

    A database pool (for PDBs) must be present in the PaaS Infrastructure Zone that you select here.

  8. After the database pool has been assigned, the container database into which the pluggable database is to be added is displayed in the Reference Container Database field. All the validations for the service template will be performed against this database.
  9. If you have selected Create Pluggable Databases from Profile in the Pluggable Database region, in the Shared Location field, specify the Path or the shared location on all hosts in which the schema dumps are present. The Dump File Location must be accessible by all the databases.
  10. In the Placement region, the pluggable database can be provisioned on the container database using one of the following options:
    • Selected by placement algorithm: If this option is selected, the container database will be selected based on the placement algorithm.

    • Selected by user during request: If this option is selected, while requesting a new PDB, the self service user can select the container database on which the PDB is to be provisioned.

  11. In the Identification region, in the Pluggable Database Prefix Name field, specify the prefix that is to be used to generate a unique Pluggable Database name at the time of database creation. The prefix helps to identify the PDBs that are created using this service template.
  12. Click Next. The Create New Service Template: Configurations page appears.

    Figure 19-4 Create Service Template: Configurations (PDB)


    Create Service Template: Configurations (PDB)

    Specify the following details:

    • Workload Size: Workload represents the total CPU, memory, number of sessions, and storage requirements for each service. You can define workload sizes such as small, medium, and large. The workload sizes defined here will be the default workload sizes available to the users with the EM_SSA_USER role.

      Click Create and in the Create Workload window, enter the name, CPU, Memory, and Storage limit for each service.

    • Pluggable Database Administrator Privileges: You can assign privileges to the Pluggable Database Administrator by:

      • From Existing Database Roles: If you select this option, click Add Roles to add one or more existing roles from which the privileges will be assigned to the Pluggable Database Administrator.

      • Creating a new Database Role: If you select this option, you must specify the Role Name, Description, and the Privileges such as CREATE_SESSION, ALTER_SESSION, CREATE ANY OPERATOR, CREATE ANY PROCEDURE and so on that will be assigned to the administrator.

    • Pluggable Database Storage: The maximum size of the PDB storage can either be Unlimited or Specified by the workload size selected at request time.

    • Tablespace: The tablespaces in the profile are displayed. You can edit the value of the Initial Size of the tablespace.

      Note:

      You can create encrypted tablespaces by specifying a Tablespace Data Encryption (TDE) key. This encrypts and decrypts the data in the tablespace. If you are using a profile with encrypted tablespaces, you will be prompted for the wallet password here.

  13. Click Next. The Create Service Template: Initialization Parameters page appears. In this page, you can configure the values of various initialization parameters that affect the operation of the database instance. Select the parameter and click the Set icon to modify the value of the parameter.
  14. Click Next. The Create Service Template: Customization page appears. Specify the custom scripts that need to be executed before and after the database is created. See Pre and Post Request Creation / Deletion Scripts for details.
  15. In the Target Properties region, you can specify global target properties such as Location, Department, Line of Business, and so on. You can do the following:
    • Mark a property as mandatory by selecting the Required check box. If a property is marked as mandatory, the self service user must specify a value for this property while requesting a database.

    • Lock a property. When a property is locked, the self service user cannot modify the value of this property while requesting a database.

  16. Click Next. The Create Service Template: Roles page appears. Click Add to select the EM_SSA_USER roles to which this service template will be available. All users belonging to the selected role can use this service template.
  17. Click Next. The Create Service Template: Review page appears where you can review the details entered so far.
  18. Click Submit. The newly created service template will appear in the Database Cloud Self Service Portal Setup: Service Templates page. You can click on the Service Template Name link to view additional details.

19.7 Creating a Service Template for an Empty PDB

One or more pluggable databases can be created based on the service template definition. To create a service template for PDB as a service, follow these steps:

  1. Log into Enterprise Manager as a user with the EM_SSA_ADMINISTRATOR role.
  2. From the Enterprise menu, select Cloud, then select Cloud Home. The Cloud Home page appears. From the Oracle Cloud menu, select Setup, then select Getting Started.
  3. Click the Setup link next to the Databases option in the left panel. Select Pluggable Database from the drop down menu.
  4. Click the Service Templates link. The Service Templates page appears. Click Create. The Create Service Template: General page appears.

    Figure 19-5 Create Service Template: General (Empty)


    Create Service Template: General (Empty)
  5. Enter a name and description for the service template. The description must be unique and provide information on the type of service template being created.
  6. In the Pluggable Databases region, select the Create Empty Pluggable Database option to create an empty PDB that can be configured by the user.
  7. In the Pools and Zones region, click Add to select a PaaS Infrastructure Zone into which the pluggable database instance is to be provisioned. Click Assign Pool to add a Database Pool (for Pluggable Databases) for the zone.

    Note:

    A database pool (for PDBs) must be present in the PaaS Infrastructure Zone that you select here.

  8. After the database pool has been assigned, the container database into which the pluggable database is to be added is displayed in the Reference Container Database field. All the validations for the service template will be performed against this database.
  9. In the Placement region, the pluggable database can be provisioned on the container database using one of the following options:
    • Selected by placement algorithm

    • Selected by user during request

  10. In the Identification region, in the Pluggable Database Prefix Name field, specify the prefix that is to be used to generate a unique Pluggable Database name at the time of database creation. The prefix helps to identify the PDBs that are created using this service template.
  11. Click Next. The Create New Service Template: Configurations page appears.

    Figure 19-6 Create Service Template: Configurations (PDB)


    Create Service Template: Configurations (PDB)

    Specify the following details:

    • Workload Size: Workload represents the total CPU, memory, number of sessions, and storage requirements for each service. You can define workload sizes such as small, medium, and large. The workload sizes defined here will be the default workload sizes available to the users with the EM_SSA_USER role.

      Click Create and in the Create Workload window, enter the name, CPU, Memory, and Storage limit for each service.

    • Pluggable Database Administrator Privileges: You can assign privileges to the Pluggable Database Administrator by:

      • From Existing Database Roles: If you select this option, click Add Roles to add one or more existing roles from which the privileges will be assigned to the Pluggable Database Administrator.

      • Creating a new Database Role: If you select this option, you must specify the Role Name, Description, and the Privileges such as CREATE_SESSION, ALTER_SESSION, CREATE ANY OPERATOR, CREATE ANY PROCEDURE and so on that will be assigned to the administrator.

    • Pluggable Database Storage: The maximum size of the PDB storage can either be Unlimited or Specified by the workload size selected at request time.

    • Tablespace: Specify the number of tablespaces that should be present in the new empty PDB.

  12. Click Next. The Create Service Template: Initialization Parameters page appears. In this page, you can configure the values of various initialization parameters that affect the operation of the database instance. Select the parameter and click the Set icon to modify the value of the parameter.
  13. Click Next. The Create Service Template: Customization page appears. Specify the custom scripts that need to be executed before and after the database is created. See Pre and Post Request Creation / Deletion Scripts for details.
  14. In the Target Properties region, you can specify global target properties such as Location, Department, Line of Business, and so on. You can do the following:
    • Mark a property as mandatory by selecting the Required check box. If a property is marked as mandatory, the self service user must specify a value for this property while requesting a database.

    • Lock a property. When a property is locked, the self service user cannot modify the value of this property while requesting a database.

  15. Click Next. The Create Service Template: Roles page appears. Click Add to select the EM_SSA_USER roles to which this service template will be available. All users belonging to the selected role can use this service template.
  16. Click Next. The Create Service Template: Review page appears where you can review the details entered so far.
  17. Click Submit. The newly created service template will appear in the Database Cloud Self Service Portal Setup: Service Templates page. You can click on the Service Template Name link to view additional details.

19.8 Configuring Chargeback

Optionally, you can configure the chargeback service. See Chargeback Administration.

19.9 Requesting a Pluggable Database

The self service user can now select the service template and create a pluggable database. See Requesting a Pluggable Database