Skip to main content
Skip table of contents

CLI cookbook: provisioning a virtual PDB to a new virtual CDB

This topic describes how to provision a virtual pluggable database (vPDB) to a virtual container database (vCDB) using the command-line interface.

This process applies to Oracle container databases (CDBs) and the pluggable databases (PDBs) found within them that have been linked to Delphix as dSources. As container databases can only be found in Oracle 12.1.0.1 releases and above of Oracle, this topic is relevant to only these releases.

Prerequisites

The provisioning of virtual PDBs in Delphix is dependent on the following entities being in place prior to attempting the creation of this type of Delphix dataset.

  • A source container database must be linked to the engine.

  • The source container database must have pluggable databases within it linked as dSources to Delphix.

  • A destination host with an Oracle home of the same release as the source database must be available and already discovered as an Environment in Delphix.

In the example CLI provision detailed below the following databases are in place:

  • The source container database is called "CDOMLOSR1TB"

  • The pluggable database found in "CDOMLOSR1TB" that has been linked as a dSource is called "CDOMLOSR1TBPDB1"

  • The destination virtual container database will be called "cdbvirt"

  • Within the Delphix Engine CLI the name of the repository (target Oracle home) on the target system is '/u01/app/oracle/product/12.2.0.1/dbhome_1'

  • The destination virtual pluggable database will be called "PDBS3" and run from virtual container database "cdbvirt"

  • Delphix creates a temporary container database on the target host which will be used to establish the virtualized copy of the dSource PDB "pdborcl". This temporary CDB will be created and running during the provisioning process, it will be destroyed at the end of the provision of the virtual PDB.

Procedure

  1. Log into the Delphix command-line interface using the admin user or a user with admin privileges.

    CODE
    $ ssh admin@YOUR_ENGINE
  2. Move to the database provisioning command line object.

    CODE
    delphix> database provision
  3. Give the dataset a name.

    CODE
    delphix database provision *> set container.name=PDBS3
  4. Place the new dataset in a Group that appears in the Delphix GUI, in this case, the Targets group.

    CODE
    delphix database provision *> set container.group=Targets
  5. Set the type of provision to perform, for Oracle virtual database (VDB) - VDB/vPDBs, the type will be OracleVirtualPdbSource.

    CODE
    delphix database provision *> set source.type=OracleVirtualPdbSource
  6. Set the destination mount point which Delphix NFS mounts are to be linked to under the virtual PDB. This folder must exist at a file system level on the target host. Do not use single quotes around the mount path.

    CODE
    delphix database provision *> set source.mountBase="/mnt/provision"
  7. Name the vPDB. This is what it will appear as in the destination container database.

    CODE
    delphix database provision *> set sourceConfig.databaseName=PDBS3
  8. Supply the dSource PDBs details. In this example, the provision will use the latest point in time available to the dSource PDB as the point in time from which to provision the vPDB. Setting a different timeflowPointParameters.type would allow you to use points in time other than the latest snapshot or latest point in time if this is what you desire. Using other types is not covered in this example

    CODE
    delphix database provision *> set timeflowPointParameters.container=CDOMLOSR1TBPDB1
  9. Give the virtual CDB a name:

    CODE
    delphix database provision *> set virtualCdb.container.name=cdbvirt
  10. Place the virtual CDB in a Group that appears in the Delphix GUI, in this case, the target group.

    CODE
    delphix database provision *> set virtualCdb.container.group=Targets
  11. If automatically restarting the vPDB and vCDB is not required after a reboot of the target host, set this to option to false.

    CODE
    delphix database provision *> set virtualCdb.source.
    allowAutoVDBRestartOnHostReboot=false
  12. Set the destination mount point which Delphix NFS mounts are to be linked to under the virtual CDB. This folder must exist at a file system level on the target host. Do not use single quotes around the mount path.

    CODE
    delphix database provision *> set virtualCdb.source.mountBase="/mnt/provision"
  13. Set the vCDB configuration type to one of OracleRACConfig or OracleSIConfig. RAC configurations are not covered in this article:

    CODE
    delphix database provision *> set virtualCdb.sourceConfig.type=OracleSIConfig
  14. Set the database name for the virtual CDB:

    CODE
    delphix database provision *> set virtualCdb.sourceConfig.databaseName=cdbvirt
  15. Set the target system environment user that while be used to run the virtual CDB:

    CODE
    delphix database provision *> set virtualCdb.sourceConfig.environmentUser=oracle
  16. Set the instance name and number for the virtual CDB

    CODE
    delphix database provision *> set virtualCdb.sourceConfig.instance.instanceName=cdbvirt
    delphix database provision *> set virtualCdb.sourceConfig.instance.instanceNumber=1
  17. Set the repository (Oracle home) on the target system that will be used to run the virtual CDB. In this example the Oracle home is /u01/app/oracle/product/12.2.0.1/dbhome_1:

    CODE
    delphix database provision *> set virtualCdb.sourceConfig.repository='/u01/app/oracle/product/12.2.0.1/dbhome_1'
  18. Set the database unique name for the virtual CDB:

    CODE
    delphix database provision *> set virtualCdb.sourceConfig.uniqueName=cdbvirt
  19. Set the following two parameters to true or false, depending on whether the vCDB and vPDB should be restarted automatically following a target host reboot:

    CODE
    delphix database provision *> set source.allowAutoVDBRestartOnHostReboot=true
    delphix database provision *> set virtualCdb.source.
    allowAutoVDBRestartOnHostReboot=true
  20. Check that all the settings you require are in place using the "ls" command

    CODE
    delphix database provision *> ls
    Properties
        type: OracleMultitenantProvisionParameters
        container:
            type: OracleDatabaseContainer
            name: PDBS3 (*)
            description: (unset)
            diagnoseNoLoggingFaults: true
            group: Untitled (*)
            performanceMode: DISABLED
            preProvisioningEnabled: false
            sourcingPolicy: (unset)
        credential: (unset)
        masked: (unset)
        maskingJob: (unset)
        source:
            type: OracleVirtualPdbSource
            name: (unset)
            allowAutoVDBRestartOnHostReboot: true (*)
            config: (unset)
            customEnvVars: (unset)
            fileMappingRules: (unset)
            logCollectionEnabled: false
            mountBase: /mnt/provision (*)
            operations: (unset)
        sourceConfig:
            type: OraclePDBConfig
            cdbConfig: (unset)
            databaseName: cdbvirt (*)
            environmentUser: (unset)
            linkingEnabled: true
            nonSysCredentials: (unset)
            nonSysUser: (unset)
            repository: (unset)
            services: (unset)
        timeflowPointParameters:
            type: TimeflowPointSemantic
            container: CDOMLOSR1TBPDB1 (*)
            location: LATEST_POINT
        username: (unset)
        virtualCdb:
            type: OracleVirtualCdbProvisionParameters (*)
            container:
                type: OracleDatabaseContainer (*)
                name: cdbvirt (*)
                description: (unset)
                diagnoseNoLoggingFaults: true (*)
                group: Untitled (*)
                performanceMode: DISABLED (*)
                preProvisioningEnabled: false (*)
                sourcingPolicy: (unset)
            source:
                type: OracleVirtualCdbSource (*)
                name: (unset)
                allowAutoVDBRestartOnHostReboot: true (*)
                config: (unset)
                configParams: (unset)
                configTemplate: vcdb (*)
                logCollectionEnabled: false (*)
                mountBase: /mnt/provision (*)
            sourceConfig:
                type: OracleSIConfig (*)
                databaseName: cdbvirt (*)
                environmentUser: (unset)
                instance:
                    type: OracleInstance (*)
                    instanceName: cdbvirt (*)
                    instanceNumber: 1 (*)
                linkingEnabled: true (*)
                nonSysCredentials: (unset)
                nonSysUser: (unset)
                repository: '/u01/app/oracle/product/12.2.0.1/dbhome_1' (*)
                services: (unset)
                tdeKeystorePassword: (unset)
                uniqueName: cdbvirt (*)
    
    Operations
    defaults
  21. Initiate the provision by committing the operation in the CLI.

    CODE
    delphix database provision *> commit
        PDBS3
        Dispatched job JOB-24
        DB_PROVISION job started for "Targets/PDBS3".
        Starting provision of the virtual database "PDBS3".
        Preparing multitenant container database "cdbvirt".
        Creating new TimeFlow.
        Generating recovery scripts.
        Exporting storage.
        Mounting filesystems to recover pluggable database on instance "1".
        Mounting read-only archive log filesystem for the virtual database instance "1".
        Backing up Oracle spfile.
        Mounting virtual database instance.
        Disabling flashback on Oracle database.
        Renaming Oracle datafiles.
        Mounting virtual database instance.
        Recovering Oracle pluggable database.
        Creating control file.
        Creating Oracle online logs.
        Processing startup init file.
        Configuring initialization and server parameter files.
        Mounting virtual database instance.
        Performing Oracle resetlogs.
        Creating tempfiles.
        Renaming readonly datafiles.
        Finalizing Oracle pluggable database.
        Registering listeners.
        Unmounting read-only archive log filesystem for the virtual database instance "1".
        Unmounting filesystems after recovering pluggable database on instance "1".
        Plugging in Oracle pluggable database.
        Opening Oracle pluggable database.
        Setting OMF destination for Oracle pluggable database.
        Creating tempfiles.
        Online readonly tablespaces.
        Enabling Oracle instances.
        Checking Oracle pluggable database plugin violations.
        DB_PROVISION job for "Targets/PDBS3" completed successfully.
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.