This topic describes how to provision a virtual database (VDB) from a DB2 dSource.
You will need to have linked a dSource from a staging instance, as described in Linking a Db2 dSource, or have created a VDB from which you want to provision another VDB
You should have set up the Db2 target environment with necessary requirements as described in Requirements for Db2 Hosts and Databases
Make sure you have the required Instance Owner permissions on the target instance and environment as described in Managing Db2 Users and Instance Owners
The method for Database Permissions for Provisioned Db2 VDBs is decided before the provisioning
[Optional] Once you have restored the databases into your target environment, If the version of IBM® Db2® in your source environment is at a different fix pack level than the version of Db2 in your target environment, then you need to update the 11.1 version databases with
db2updv111command and 11.5 databases with
db2updv115command utility. Run the below command as a Pre-snapshot hook:CODE
db2updv111 -d <DBNAME> -a db2updv115 -d <DBNAME> -a
The optional pre-requisite is applicable only when the target environment is using a different Db2 fix pack level than the source. If your source environment is using version 11.1.x and your target is using version 11.5.x, you can neglect the above-mentioned point.
Consider the following scenarios for the optional prerequisite mentioned above:
if your source environment uses Db2 version 11.5.5 and your target environment uses Db2 11.5.8 or a later fix pack, you need to update the databases in the target environment.
If your databases were created or upgraded to Db2 Version 11.1 GA and you applied Db2 Version 11.1 Fix Pack 1 or later, then running the above command will automatically apply all updates required from Version 11.1 GA up to and including the fix pack level that you are installing.
To know how to update databases, see db2updv115 - Update database to Version 11.5 mod pack command
Certain database or instance operations are restricted while an online fix pack update is in progress.
See db2updv111 - Update database to Version 11.1 fix pack command, which mentions it is mandatory to run db2updv111 on database if one is coming from higher version of fix pack to Lower OR vice versa.
For more information, you can also refer: Update the databases for a Db2 11.1.x fix pack
You can take a new snapshot of the dSource by clicking the Camera icon on the dSource card. Once the snapshot is complete you can provision a new VDB from it.
Please note while creating a VDB on an instance By default, DB2 Plugin will not allow provisioning a VDB on an instance which contains a database that has an identical name to the source database.
When we are provisioning a VDB from a VDB then source VDB will be treated as the source database.
When we are provisioning a VDB from a dSource then a staging database will be treated as the source database.
If the user wants to provision a VDB on an instance which contains a source database, then the user needs to follow the below steps :
Check if any config file with name db2_plugin.conf at location <Toolkit directory>/Delphix_COMMON/plugin/<Identifier>/. If it does not exist, then the user should create a file with name db2_plugin.conf at location <Toolkit directory>/Delphix_COMMON/plugin/<Identifier>/. The instance user must have read permission to this file. Once the file is created, user should proceed to step 2. If the file already exists at this location with the required permission, the user should directly proceed to step 2.
Add the below line in this config file.
Then create/Refresh the VDB again.
Login to the Delphix Management application.
Select a dSource.
Select a snapshot from which you want to provision.
Click Provision VDB icon to open Provision VDB wizard.
Select a target environment from the left pane.
Select an Installation to use from the dropdown list of available DB2 instances on that environment.
Set the Environment User to be the Instance Owner. Note: The picking of instance owner is only possible if you have multiple environment users set on that host.
Provide VDB Name as database name as parameter.
Optionally, provide the VDB Mount Base for the VDB.
Optionally, set the database configuration parameters for the VDB.
Select a Target Group for the VDB. Click the green Plus icon to add a new group, if necessary.
Select a Snapshot Policy for the VDB.
Specify any desired hook operations.
Review the Provisioning Configuration and Data Management information.
Click Submit. When provisioning starts, you can review the progress of the job in the Databases panel, or in the Job History panel of the Dashboard. When provisioning is complete, the VDB will be included in the group you designated and listed in the Databases panel. If you select the VDB in the Databases panel and click the Open icon, you can view its card, which contains information about the database and its Data Management settings. Once the VDB provisioning has successfully completed, if the source and target instance ids are not the same, you may want to grant secadm and dbadm on the database to the target instance id. Refer to Database Permissions for Provisioned Db2 VDBs for more information.