CLI cookbook: provisioning a virtual PDB in a target CDB
This topic describes how to provision a virtual pluggable database (vPDB) using the command-line interface.
Prerequisites
Provisioning of virtual PDB's 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 container database of the same Oracle release as the source database must exist in the target host. If this container database is a physical database, then it must be linked to Delphix. If it’s a virtual container database, then it must be of Oracle version 12.1.0.2 or later.
In the example CLI provision detailed below the following databases are in place:
-
The source container database is called "cdb12"
-
The destination container database is called "cdbstage"
-
The pluggable database found in "cdb12" that has been linked as a dSource is called "pdborcl"
-
The destination virtual pluggable database will be called "pdbs2" and run from container database "cdbstage"
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
-
Log into the Delphix command-line interface using the admin user or a user with admin privileges.
Copy$ ssh admin@YOUR_ENGINE
-
Set the type of provision to perform, for Oracle virtual database (VDB) - VDB/vPDBs, the type will be OracleVirtualSource.
Copyset source.type=OracleVirtualPdbSource
-
Set the destination target environment/host through setting the sourceConfig environment user to perform the provision. A destination container database must already be running on this target host.
Copydelphix database provision *> set sourceConfig.environmentUser=OEL6SIN1/delphix
-
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.
Copydelphix database provision *> set source.mountBase="/mnt/provision"
-
Set the login details for the provision and Delphix OS user who is to perform the provision.
Copydelphix database provision *> set username=delphix
delphix database provision *> set credential.type=PasswordCredential
delphix database provision *> set credential.password=delphix -
Give the dataset a name.
Copydelphix database provision *> set container.name=PDBS2
-
Place the new dataset in a Group that appears in the Delphix GUI, in this case, the target group.
Copydelphix database provision *> set container.group=Targets
-
If automatically restarting the VDB is not required after a reboot of the VDB target host, set this to option to false. False is possibly a better option given the container database would need to be running prior to any attempt to pull up a vPDB.
Copydelphix database provision *> set source.allowAutoVDBRestartOnHostReboot=false
-
Supply the destination container database name. This will be where the vPDB will ultimately be placed and run from on the target host.
Copydelphix database provision *> set sourceConfig.cdbConfig=cdbstage
-
Name the vPDB. This is what it will appear as in the destination container database.
Copydelphix database provision *> set sourceConfig.databaseName=pdbs2
-
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.
Copydelphix database provision *> set timeflowPointParameters.container=PDBORCL
-
Check that all the settings you require are in place using the "ls" command.
Copydelphix database provision *> ls
Properties
type: OracleProvisionParameters
container:
type: OracleDatabaseContainer
name: PDBS2 (*)
description: (unset)
diagnoseNoLoggingFaults: true
group: Targets (*)
performanceMode: DISABLED
preProvisioningEnabled: false
sourcingPolicy: (unset)
credential:
type: PasswordCredential (*)
password: ******** (*)
maskingJob: (unset)
newDBID: true (*)
openResetlogs: true
physicalStandby: false
source:
type: OracleVirtualSource (*)
name: (unset)
allowAutoVDBRestartOnHostReboot: false (*)
archivelogMode: true
config: (unset)
configParams: (unset)
configTemplate: (unset)
customEnvVars: (unset)
fileMappingRules: (unset)
manualProvisioning: false
mountBase: /mnt/provision (*)
nodeListenerList: (unset)
operations: (unset)
redoLogGroups: 3
redoLogSizeInMB: 0
sourceConfig:
type: OraclePDBConfig
cdbConfig: cdbstage (*)
databaseName: pdbs2 (*)
environmentUser: (unset)
linkingEnabled: true
repository: (unset)
services: (unset)
timeflowPointParameters:
type: TimeflowPointSemantic
container: PDBORCL (*)
location: LATEST_POINT
username: delphix (*)
Operationsdefaults -
Initiate the provision by committing the operation in the CLI.
Copydelphix database provision *> commit
PDBS2
Dispatched job JOB-333
DB_PROVISION job started for "Targets/PDBS2".
Starting provision of the virtual database "pdbs2".
Preparing multitenant container database "cdbstage".
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".
Recovering Oracle pluggable database.
Mounting filesystems for the virtual database instance "1".
Unmounting filesystems after recovering pluggable database on instance "1".
Cleaning up objects created by pluggable database provisioning.
Opening Oracle pluggable database.
DB_PROVISION job for "Targets/PDBS2" completed successfully.