21 Creating Snap Clones for Pluggable Databases

This chapter provides the following different solutions of creating a test master pluggable database and snapshot clones of pluggable databases. It contains the following sections:

21.1 Creating Test Master Pluggable Databases

This section provides the different solutions of creating a test master pluggable database using the Pluggable Database Cloning wizard. It contains the following subsections:

Note:

To create a test master pluggable database using EM CLI, see Section 47.15, "Creating a Test Master Pluggable Database."

21.1.1 Creating a Test Master Pluggable Database

If you have the 12.1.0.8 Enterprise Manager for Oracle Database plug-in deployed in your system, you can create a test master PDB from a source PDB, using the new Clone PDB Wizard.

To create a test master PDB from a source PDB, follow these steps:

  1. From the Targets menu, select Databases.

  2. For View, select Search List. From the View menu, select Expand All.

  3. Look for the source CDB (the CDB that the source PDB is a part of) in the list, then click the name of the PDB from which you want to create a test master PDB.

  4. From the Oracle Database menu, select Cloning, then select Create Test Master.

    Alternatively, in Step 3, you can right click the name of the PDB from which you want to create a test master PDB, select Oracle Database, select Cloning, then select Create Test Master.

  5. On the Create Test Master Pluggable Database: Source and Destination page, do the following:

    • Specify the SYSDBA credentials for the source CDB. You can choose to use the preferred credentials, use a saved set of named credentials, or specify a new set of credentials.

    • In the Pluggable Database Definition section, specify a name, and a display name for the test master PDB. Enterprise Manager uses the display name to identify the test master PDB target.

    • In the PDB Administrator Credentials section, specify the credentials of the admin user account that you want to use to administer the test master PDB.

    • In the Container Database section, specify the destination CDB (the CDB that the test master PDB must be a part of).

    • In the Credentials section, specify the SYSDBA credentials for the destination CDB, and the host credentials for the destination CDB. Also, if the destination CDB is using Automatic Storage Management (ASM) to manage disk storage, you must specify the ASM credentials.

      Click Next.

      Create Test Master Pluggable Database: Source and Destination page
  6. On the Create Test Master Pluggable Database: Configuration page, do the following:

    In the Database Files Location section, specify the storage location where the datafiles of the test master PDB must be stored. If the destination CDB is using ASM to manage disk storage, specify the disk group where the datafiles of the test master PDB must be stored.

    To ensure that only the source PDB data model definition is cloned (and the source PDB data is not cloned), select Exclude User Data.

    In the PDB Administrator Credentials section, specify the credentials of the admin user account that you want to use to administer the test master PDB.

    In the Advanced Configuration section, specify the storage limits for the maximum size of the test master PDB, and the maximum size of a shared tablespace within the test master PDB. By default, no limits are placed on the values for these attributes. In the Miscellaneous section, select the logging option that you want to use for the tablespaces created within the test master PDB.

    Note that if the destination CDB is part of an Exadata machine, the Access Controls and Permissions section is displayed in place of the Advanced Configuration section. In this case, you must specify the owner and the group that must be granted read only permissions on the datafiles.

    Click Next.

    Create Test Master PDB: Config page
  7. On the Create Test Master Pluggable Database: Post Processing page, in the Data Masking section, specify the data masking definition that you want to apply after creating the test master PDB. Data masking masks sensitive data in a database.

    For information on how to create a data masking definition, see Oracle Data Masking and Subsetting Guide. Note that you can apply a data masking definition only if you have the Subset-Masking license pack.

    In the Custom Scripts section, for Pre Script and Post Script, specify the Oracle Software Library components that contain the scripts that you want to run before, and after creating the test master PDB respectively. Also, for SQL Script, specify the SQL scripts that you want to run after creating the test master PDB. For Run As User, select the user account that you want to use to run the SQL scripts.

    Click Next. Test Master PDB Post Processing page

  8. Specify an instance name for the deployment procedure. Also, specify the point in time when you want the deployment procedure to begin.

    In the Notification section, select the deployment procedure states for which you want to receive e-mail notifications. For example, if you select Scheduled and Succeeded for Status for Notification, you will receive e-mail notifications when the deployment procedure is scheduled, and when it succeeds.

    Click Next.

    Create Test Master PDB: Schedule page
  9. Review all the details you provided. If you want to edit certain details, click Back to navigate to the required page.

    Click Clone to submit the deployment procedure to create a test master PDB from the source PDB.

    Surrounding text describes pdf_test_master_review.gif.

21.1.2 Creating an Exadata Test Master Pluggable Database

If you have the 12.1.0.8 Enterprise Manager for Oracle Database plug-in deployed in your system, you can create a test master PDB from a source PDB, using the new Clone PDB Wizard.

To create a test master PDB from a source PDB, follow these steps:

  1. From the Targets menu, select Databases.

  2. For View, select Search List. From the View menu, select Expand All.

  3. Look for the source CDB (the CDB that the source PDB is a part of) in the list, then click the name of the PDB from which you want to create a test master PDB.

  4. From the Oracle Database menu, select Cloning, then select Create Test Master.

    Alternatively, in Step 3, you can right click the name of the PDB from which you want to create a test master PDB, select Oracle Database, select Cloning, then select Create Test Master.

  5. On the Create Test Master Pluggable Database: Source and Destination page, do the following:

    • Specify the SYSDBA credentials for the source CDB. You can choose to use the preferred credentials, use a saved set of named credentials, or specify a new set of credentials.

    • In the Pluggable Database Definition section, specify a name, and a display name for the test master PDB. Enterprise Manager uses the display name to identify the test master PDB target.

    • In the PDB Administrator Credentials section, specify the credentials of the admin user account that you want to use to administer the test master PDB.

    • In the Container Database section, specify the destination CDB (the CDB that the test master PDB must be a part of).

    • In the Credentials section, specify the SYSDBA credentials for the destination CDB, and the host credentials for the destination CDB. Also, if the destination CDB is using Automatic Storage Management (ASM) to manage disk storage, you must specify the ASM credentials.

      Click Next.

      Create Test Master Pluggable Database: Source and Destination page
  6. On the Create Test Master Pluggable Database: Configuration page, do the following:

    In the Database Files Location section, specify the disk group where the data files of the test master PDB will be created.

    To ensure that only the source PDB data model definition is cloned (and the source PDB data is not cloned), select Exclude User Data.

    In the Access Controls and Permissions section, specify the owner and the group that must be granted read-only permissions on the data files.

    Click Next.

    PDB Exadata test master configuration page
  7. On the Create Test Master Pluggable Database: Post Processing page, in the Data Masking section, specify the data masking definition that you want to apply after creating the test master PDB. Data masking masks sensitive data in a database.

    For information on how to create a data masking definition, see Oracle Data Masking and Subsetting Guide. Note that you can apply a data masking definition only if you have the Subset-Masking license pack.

    In the Custom Scripts section, for Pre Script and Post Script, specify the Oracle Software Library components that contain the scripts that you want to run before, and after creating the test master PDB respectively. Also, for SQL Script, specify the SQL scripts that you want to run after creating the test master PDB. For Run As User, select the user account that you want to use to run the SQL scripts.

    Click Next. Test Master PDB Post Processing page

  8. Specify an instance name for the deployment procedure. Also, specify the point in time when you want the deployment procedure to begin.

    In the Notification section, select the deployment procedure states for which you want to receive e-mail notifications. For example, if you select Scheduled and Succeeded for Status for Notification, you will receive e-mail notifications when the deployment procedure is scheduled, and when it succeeds.

    Click Next.

    Create Test Master PDB: Schedule page
  9. Review all the details you provided. If you want to edit certain details, click Back to navigate to the required page.

    Click Clone to submit the deployment procedure to create a test master PDB from the source PDB.

    PDB exadata test master review page

21.1.3 Creating an ACFS Test Master Pluggable Database

If you have the 12.1.0.8 Enterprise Manager for Oracle Database plug-in deployed in your system, you can create a test master PDB from a source PDB, using the new Clone PDB Wizard.

To create a test master PDB from a source PDB, follow these steps:

  1. From the Targets menu, select Databases.

  2. For View, select Search List. From the View menu, select Expand All.

  3. Look for the source CDB (the CDB that the source PDB is a part of) in the list, then click the name of the PDB from which you want to create a test master PDB.

  4. From the Oracle Database menu, select Cloning, then select Create Test Master.

    Alternatively, in Step 3, you can right click the name of the PDB from which you want to create a test master PDB, select Oracle Database, select Cloning, then select Create Test Master.

  5. On the Create Test Master Pluggable Database: Source and Destination page, do the following:

    • Specify the SYSDBA credentials for the source CDB. You can choose to use the preferred credentials, use a saved set of named credentials, or specify a new set of credentials.

    • In the Pluggable Database Definition section, specify a name, and a display name for the test master PDB. Enterprise Manager uses the display name to identify the test master PDB target.

    • In the PDB Administrator Credentials section, specify the credentials of the admin user account that you want to use to administer the test master PDB.

    • In the Container Database section, specify the destination CDB (the CDB that the test master PDB must be a part of).

    • In the Credentials section, specify the SYSDBA credentials for the destination CDB, and the host credentials for the destination CDB. Also, if the destination CDB is using Automatic Storage Management (ASM) to manage disk storage, you must specify the ASM credentials.

      Click Next.

      Create Test Master Pluggable Database: Source and Destination page
  6. On the Create Test Master Pluggable Database: Configuration page, in the Database Files Location section, specify the ACFS mount point storage location where the data files of the test master PDB will be created.

    To ensure that only the source PDB data model definition is cloned (and the source PDB data is not cloned), select Exclude User Data.

    Click Next.

    Test master pdb acfs config page
  7. On the Create Test Master Pluggable Database: Post Processing page, in the Data Masking section, specify the data masking definition that you want to apply after creating the test master PDB. Data masking masks sensitive data in a database.

    For information on how to create a data masking definition, see Oracle Data Masking and Subsetting Guide. Note that you can apply a data masking definition only if you have the Subset-Masking license pack.

    In the Custom Scripts section, for Pre Script and Post Script, specify the Oracle Software Library components that contain the scripts that you want to run before, and after creating the test master PDB respectively. Also, for SQL Script, specify the SQL scripts that you want to run after creating the test master PDB. For Run As User, select the user account that you want to use to run the SQL scripts.

    Click Next. Test Master PDB Post Processing page

  8. Specify an instance name for the deployment procedure. Also, specify the point in time when you want the deployment procedure to begin.

    In the Notification section, select the deployment procedure states for which you want to receive e-mail notifications. For example, if you select Scheduled and Succeeded for Status for Notification, you will receive e-mail notifications when the deployment procedure is scheduled, and when it succeeds.

    Click Next.

    Create Test Master PDB: Schedule page
  9. Review all the details you provided. If you want to edit certain details, click Back to navigate to the required page.

    Click Clone to submit the deployment procedure to create a test master PDB from the source PDB.

    PDB acfs test master review page

21.2 Creating Snapshot Clones of Test Master Pluggable Databases

This section provides the different solutions of creating snapshot clones of test master pluggable databases using the Pluggable Database Cloning wizard. It contains the following subsections:

Note:

To create a snapshot clone of a pluggable database using EM CLI, see Section 47.14.2, "Pluggable Database Snapshot Clone Types."

21.2.1 Creating a Snapshot Clone of an Exadata Test Master PDB

Important:

You can create snapshot clones of only those test master PDBs that are of version 12.1.0.2.0 or higher.

If you have the 12.1.0.8 Enterprise Manager for Oracle Database plug-in deployed in your system, you can create a snapshot clone of a test master PDB using the new Clone PDB Wizard.

To create a snapshot clone of an exadata test master PDB, follow these steps:

  1. From the Targets menu, select Databases.

  2. For View, select Search List. From the View menu, select Expand All.

  3. Look for the source CDB (the CDB that the source test master PDB is a part of) in the list, then click the name of the test master PDB that you want to clone.

  4. From the Oracle Database menu, select Cloning, then select Create Snapshot Clone.

    Alternatively, in Step 3, you can right click the name of the test master PDB that you want to clone, select Oracle Database, select Cloning, then select Create Snapshot Clone.

  5. On the Source and Destination: Create Snapshot Clone Pluggable Database, do the following:

    • Specify the SYSDBA credentials for the source CDB. You can choose to use the preferred credentials, use a saved set of named credentials, or specify a new set of credentials.

    • In the Credentials section, specify the SYSDBA credentials of the CDB.

    • In the Pluggable Database Definition section, specify the name of the PDB, and a display name of the PDB snapshot clone. Enterprise Manager uses the display name to identify the PDB snapshot clone target.

    • In the PDB Administrator Credentials section, specify the credentials of the Admin user account that you want to use to administer the PDB snapshot clone.

      To clone the test master PDB to a CDB different from the source CDB, select Clone the Pluggable Database into a different Container Database, then specify the destination CDB.

    • In the Credentials section, specify the CDB host credentials. Also, specify the ASM credentials of the ASM that will be used to manage disk storage.

      PDB exadata snapshot clone source page
  6. If you do not need to specify anymore details, click Clone. This submits the deployment procedure to clone a PDB to a CDB that is deployed in a public cloud setup.

    To specify other configuration details, mask data, as well as schedule the cloning process, click Advanced.

    Follow the rest of the steps, if you have selected the Advanced option. The option to Clone is available on each page.

  7. On the Create Snapshot Clone Pluggable Database: Source and Destination page, verify the details specified, and then click Next.

    PDB exadata snapshot clone source and destination page
  8. On the Create Snapshot Clone Pluggable Database: Configuration page, do the following:

    • In the Database Files Location section, specify the name of the Sparse disk group where the data files of the PDB snapshot clone will be created.

    • In the Advanced Configuration section, specify the storage limits for the maximum size of the PDB snapshot clone, and the maximum size of a shared tablespace within the PDB snapshot clone. By default, no limits are placed on the values for these attributes.

    • In the Miscellaneous section, select the default logging option for the tablespaces created within the PDB snapshot clone.

    • Click Next.

      PDB exadata snapshot clone config page
  9. On the Create Snapshot Clone Pluggable Database: Post Processing section, in the Data Masking section, specify the data masking definition that you want to apply after cloning the PDB. Data masking masks sensitive data in a database.

    For information on how to create a data masking definition, see Oracle Data Masking and Subsetting Guide. Note that you can apply a data masking definition only if you have the Subset-Masking license pack.

    In the Custom Scripts section, for Pre Script and Post Script, specify the Oracle Software Library components that contain the scripts that you want to run before cloning, and after cloning the PDB respectively. Also, for SQL Script, specify the SQL scripts that you want to run after cloning the PDB. For Run As User, select the user account that you want to use to run the SQL scripts.

    Click Next.

    PDB exadata snapshot clone post processing page
  10. On the Create Snapshot Clone Pluggable Database: Schedule page, specify an instance name for the cloning deployment procedure. Also, specify the point in time when you want the cloning procedure to begin.

    In the Notification section, select the deployment procedure states for which you want to receive e-mail notifications. For example, if you select Scheduled and Succeeded for Status for Notification, you will receive e-mail notifications when the cloning deployment procedure is scheduled, and when it succeeds.

    Click Next.

    PDB exadata snapshot clone schedule page
  11. On the Create Snapshot Clone Pluggable Database: Review page, review all the details you provided. If you want to edit certain details, click Back to navigate to the required page.

    Click Clone to submit the deployment procedure to create a snapshot clone of the exadata test master PDB.

    PDB exadata snapshot clone review page

21.2.2 Creating a Snapshot Clone of an ACFS Test Master PDB

Important:

You can create snapshot clones of only those test master PDBs that are of version 12.1.0.2.0 or higher.

If you have the 12.1.0.8 Enterprise Manager for Oracle Database plug-in deployed in your system, you can create a snapshot clone of a test master PDB using the new Clone PDB Wizard.

To create a snapshot clone of an exadata test master PDB, follow these steps:

  1. From the Targets menu, select Databases.

  2. For View, select Search List. From the View menu, select Expand All.

  3. Look for the source CDB (the CDB that the source test master PDB is a part of) in the list, then click the name of the test master PDB that you want to clone.

  4. From the Oracle Database menu, select Cloning, then select Create Snapshot Clone.

    Alternatively, in Step 3, you can right click the name of the test master PDB that you want to clone, select Oracle Database, select Cloning, then select Create Snapshot Clone.

  5. On the Source and Destination: Create Snapshot Clone Pluggable Database, do the following:

    • Specify the SYSDBA credentials for the source CDB. You can choose to use the preferred credentials, use a saved set of named credentials, or specify a new set of credentials.

    • In the Credentials section, specify the SYSDBA credentials of the CDB.

    • In the Pluggable Database Definition section, specify the name of the PDB, and a display name of the PDB snapshot clone. Enterprise Manager uses the display name to identify the PDB snapshot clone target.

    • In the PDB Administrator Credentials section, specify the credentials of the Admin user account that you want to use to administer the PDB snapshot clone.

      To clone the test master PDB to a CDB different from the source CDB, select Clone the Pluggable Database into a different Container Database, then specify the destination CDB.

    • In the Credentials section, specify the CDB host credentials. Also, specify the ASM credentials of the ASM that will be used to manage disk storage.

      PDB exadata snapshot clone source page
  6. If you do not need to specify anymore details, click Clone. This submits the deployment procedure to clone a PDB to a CDB that is deployed in a public cloud setup.

    To specify other configuration details, mask data, as well as schedule the cloning process, click Advanced.

    Follow the rest of the steps, if you have selected the Advanced option. The option to Clone is available on each page.

  7. On the Create Snapshot Clone Pluggable Database: Source and Destination page, verify the details specified, and then click Next.

    PDB exadata snapshot clone source and destination page
  8. On the Create Snapshot Clone Pluggable Database: Configuration page, do the following:

    • In the Database Files Location section, specify the name of the Sparse disk group where the data files of the PDB snapshot clone will be created.

    • In the Advanced Configuration section, specify the storage limits for the maximum size of the PDB snapshot clone, and the maximum size of a shared tablespace within the PDB snapshot clone. By default, no limits are placed on the values for these attributes.

    • In the Miscellaneous section, select the default logging option for the tablespaces created within the PDB snapshot clone.

    • Click Next.

      PDB ACFS snapshot clone config page
  9. On the Create Snapshot Clone Pluggable Database: Post Processing section, in the Data Masking section, specify the data masking definition that you want to apply after cloning the PDB. Data masking masks sensitive data in a database.

    For information on how to create a data masking definition, see Oracle Data Masking and Subsetting Guide. Note that you can apply a data masking definition only if you have the Subset-Masking license pack.

    In the Custom Scripts section, for Pre Script and Post Script, specify the Oracle Software Library components that contain the scripts that you want to run before cloning, and after cloning the PDB respectively. Also, for SQL Script, specify the SQL scripts that you want to run after cloning the PDB. For Run As User, select the user account that you want to use to run the SQL scripts.

    Click Next.

    PDB exadata snapshot clone post processing page
  10. On the Create Snapshot Clone Pluggable Database: Schedule page, specify an instance name for the cloning deployment procedure. Also, specify the point in time when you want the cloning procedure to begin.

    In the Notification section, select the deployment procedure states for which you want to receive e-mail notifications. For example, if you select Scheduled and Succeeded for Status for Notification, you will receive e-mail notifications when the cloning deployment procedure is scheduled, and when it succeeds.

    Click Next.

    PDB exadata snapshot clone schedule page
  11. On the Create Snapshot Clone Pluggable Database: Review page, review all the details you provided. If you want to edit certain details, click Back to navigate to the required page.

    Click Clone to submit the deployment procedure to create a snapshot clone of the exadata test master PDB.

    PDB ACFS snapshot clone review page

21.3 Enabling a Test Master Pluggable Database

To convert a pluggable database into a test master, follow these steps:

  1. Right click on the pluggable database target name that you want to enable as a test master, select Oracle Database, select Cloning, and then select Enable as a Test Master.

  2. On the Enable as a Test Master page, in the Credentials section, specify the credentials for the container database of the pluggable database, and the credentials of the Oracle Home.

  3. In the Source section, specify or search for the parent database from which the database has been created. This provides better lineage tracking.

  4. In the Data Masking section, you can choose to desensitize the data by applying masking templates or by running additional scripts of your choice.

  5. In the Custom Scripts section, you can select the Software Library components which contain post cloning scripts. The clone database can also be customized by executing the post cloning SQL script.

  6. Click Submit.

    Enabling a test master PDB

21.4 Disabling a Test Master Pluggable Database

Disabling a test master pluggable database, resets the data files to read-write mode and restarts the pluggable database in open mode. You can make further changes to the database and then enable it as a test master again.

To disable a test master pluggable database, follow these steps:

  1. Right click on the test master pluggable database, select Oracle Database, select Cloning, and then select Disable as a Test Master.

  2. On the Disable Test Master page, specify the credentials of the container database of the test master pluggable database. Also, specify the credentials of the Oracle Home.

  3. Click Submit.

    Disabling a test master pdb page