Skip to main content
Skip table of contents

Customizing VDB file mappings

This topic describes how to customize file path mappings when provisioning a virtual database (VDB).

In the VDB provisioning process, it may be necessary to create mappings between files and directories that exist on the source, and files or file directories that exist on the target. An example of this is creating a copy in the target environment of a wallet file for an encrypted database that exists in the source environment.

During VDB provisioning, the archive, datafile, external, script and temp directories are mounted from the Delphix Engine to the <Mount Base>/<Database Unique Name>.

You can specify the Mount Base and the Database Unique Name on the Provision VDB card at provision time. But the archive, datafile, external, script and temp mount points are fixed.

  • The default Mount Base is set to /mnt/provision

  • The default Database Unique Name starts with a capital V and includes the dSource name

CODE
Mount Base: /mnt/provision
Database Unique Name: Vdbhcp3_35F
Mounts: /mnt/provision/Vdbhcp3_35F/archive
/mnt/provision/Vdbhcp3_35F/datafile
/mnt/provision/Vdbhcp3_35F/external
/mnt/provision/Vdbhcp3_35F/script
/mnt/provision/Vdbhcp3_35F/temp

File Mappings affect everything that follows the mount point directories above. For datafiles, the datafile location from the dSource is used. You can determine the directory structure by querying the Source database:

CODE
SQL> select name from v$datafile;
NAME
--------------------------------------------------------------------------------
/datafile/dbdhcp3/oradata/dbdhcp3/system01.dbf
/datafile/dbdhcp3/oradata/dbdhcp3/sysaux01.dbf
/datafile/dbdhcp3/oradata/dbdhcp3/undotbs01.dbf
/datafile/dbdhcp3/oradata/dbdhcp3/users01.dbf
/u03/app/ora11202/product/11.2.0/dbhome_1/dbs/dbv_R2V4.dbf

Users have control over the datafiles that were returned by the select name from v$datafile and also the controlfile location.

Archive log files go directly into /mnt/provision/Vdbhcp3_35F/archive Tempfiles go directly into /mnt/provision/Vdbhcp3_35F/temp

By default VDB File Mapping would append the above directory structure to the /mnt/provision/Vdbhcp3_35F/datafile directory:

CODE
/mnt/provision/Vdbhcp3_35F/datafile/datafile/dbdhcp3/oradata/dbdhcp3/system01.dbf
/mnt/provision/Vdbhcp3_35F/datafile/datafile/dbdhcp3/oradata/dbdhcp3/sysaux01.dbf
/mnt/provision/Vdbhcp3_35F/datafile/datafile/dbdhcp3/oradata/dbdhcp3/undotbs01.dbf
/mnt/provision/Vdbhcp3_35F/datafile/datafile/dbdhcp3/oradata/dbdhcp3/users01.dbf
/mnt/provision/Vdbhcp3_35F/datafile/u03/app/ora11202/product/11.2.0/dbhome_1/dbs/dbv_R2V4.dbf

Pattern matching example

You can use pattern matching rules to create full path names for data files and control files.

Pattern matching rules have the form source-regex-expression-KEY : target-replacement-VALUE. You can use multiple rules, which are applied successively. Multiple rules with the same source key are allowed.

File mapping options

Example 1

For this example, the ultimate goal is to create a VDB that has the following datafile File Mappings:

CODE
/u03/devvdb3/datafile/sys/system01.dbf
/u03/devvdb3/datafile/sys/sysaux01.dbf
/u03/devvdb3/datafile/ctrl/control01.ctl
/u03/devvdb3/datafile/undo/undotbs01.dbf
/u03/devvdb3/datafile/data/users01.dbf
/u03/devvdb3/datafile/data/dbv_R2V4.dbf

You can change the default behavior in a few different ways.

  1. Modify the Mount Base.

  2. Modify the Database Unique Name.

  3. Modify the Mount Base and the Database Unique Name.

  4. Modify the name of the individual subdirectories within the Mount Base/Database Unique Name/datafile directory.

Numbers 1-3 can be changed by simply modifying the Mount Base and/or Database Unique Name values when provisioning a VDB:

The datafile locations can be changed in the Advanced tab of the Provision VDB wizard and scroll down to File Mapping:

When you are changing File Mapping, remember that you only need to refer to the part of the path after /Mount Base/Unique Database Name/datafile.

Start by changing all the datafile locations from /u03/devvdb3/datafile/datafile/dbdhcp3/oradata/dbdhcp3

to

/u03/devvdb3/datafile/data by selecting the + sign and setting File Mapping Source File Match and the Replacement and then select Validate to see result.

The result will show the new directory structure for all the datafiles and control file relative to the " /Mount Base/Unique Database Name/datafile" directory, but will only show the directories after the datafile directory.

CODE
Source File Match                   Replacement         Result
/datafile/dbdhcp3/oradata/dbdhcp3   /data              /data/users.dbf

Selecting Validate will show the result of the above mapping, for all the datafiles.

The File Mappings build upon one another, so the first mapping moves almost all the datafiles and the controlfile to /u03//devvdb3/datafile/data.

/u03/app/ora11202/product/11.2.0/dbhome_1/dbs/dbv_R2V4.dbf was not remapped, as it did not contain the directory structure defined in in Source File Match (/datafile/dbdhcp3/oradata/dbdhcp3)

If you wanted the remaining datafiles and controlfile to remain in /data, it would only require the two File Mappings.

The remaining datafiles and controlfile can be relocated by adding to the mapping (select "+" between each Source File Match/Replacement pair).

BASH
Source File Match                                            Replacement             Result
/u03/app/ora11202/product/11.2.0/dbhome_1/dbs/dbv_R2V4.dbf   /data/dbv_R2V4.dbf     /data/dbv_R2V4.dbf

/datafile/dbdhcp3/oradata/dbdhcp3/system01.dbf               /sys/system01.dbf      /sys/system01.dbf

/datafile/dbdhcp3/oradata/dbdhcp3/sysaux01.dbf               /sys/sysaux01.dbf      /sys/sysaux01.dbf

/datafile/dbdhcp3/oradata/dbdhcp3/undotbs01.dbf              /undo/undotbs01.dbf    /undo/undotbs01.dbf

/datafile/dbdhcp3/oradata/dbdhcp3/control01.ctl              /ctrl/control01.ctl    /ctrl/control01.ctl

Select Validate between each new entry in order to verify that datafiles are being mapped as expected.

Once all the files are located the way you want them, select Next to continue the provision process.

The Summary page will show the modifications to Mount Base and Unique Database Name and will show that Customized File Mapping was defined.

After provisioning completes, you can login to the Target server and verify that the datafiles were mapped correctly:

CODE
SQL> select name from v$datafile;
NAME
------------------------------------------------------------------------------
--
/u03/devvdb3/datafile/sys/system01.dbf
/u03/devvdb3/datafile/sys/sysaux01.dbf
/u03/devvdb3/datafile/undo/undotbs01.dbf
/u03/devvdb3/datafile/data/users01.dbf
/u03/devvdb3/datafile/data/dbv_R2V4.dbf

Example 2

In this example, several rules are applied to the source file path /app/oracle/oradata/system01.dbf.

  1. Applying the rule ora:foo results in: /app/foocle/foodata/system01.dbf

  2. Applying the rule foo:bar results in: /app/barcle/bardata/system01.dbf

  3. Applying the rule ora:no results in an error, because ora is no longer found in the pathname.

  4. Applying the rule bar:oranew results in: /app/oranewcle/oranewdata/system01.dbf

  5. Applying the rule ora:yes results in /app/yesnewcle/yesnewdata/system01.dbf

During the pattern matching process, two errors can be generated.

  1. No match for specified mapping rules This is the result when no rules match a source file

  2. Invalid regex pattern specified for path mapping This is the result of an invalid regex rule mapping

This topic on the java.regex.util class, hosted on docs.oracle.com, shows the regular expression syntax and constructs recognized by the Delphix Engine pattern-matching operations.

Applying VDB file mappings during the provisioning process

  1. In the Target Configuration tab of the Provision VDB wizard, click Advanced.

  2. Select Configure File Mapping.

  3. Click Next.

  4. Click the Plus icon to add a mapping rule.

  5. Enter the mapping rule.

  6. Click Validate to see the results of applying the rule. If not matches are found, you will see an error message.

  7. Click Next to continue with the provisioning process.

JavaScript errors detected

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

If this problem persists, please contact our support.