CLI cookbook: export a snapshot or a Timeflow point of a multitenant pluggable Oracle database to ASM or Physical Filesystem
This topic describes how to perform an export of a snapshot or a Timeflow point belonging to a multitenant pluggable Oracle database to a physical pluggable database stored on an Oracle Automatic Storage Management (ASM) diskgroup or a Physical Filesystem using the Delphix Engine command-line interface. The export procedure provisions a temporary vPDB from the snapshot or Timeflow point as specified in the CLI parameters and then performs an in-place conversion of the temporary vPDB to a physical database. This temporary vPDB is destroyed at the end of the export procedure.
Prerequisites
You must have the following configuration before you start the export:
If exporting to ASM â the target Data diskgroup, or the diskgroup that will contain all the database files, or if exporting to a physical filesystem â the filesystem path where all the datafiles will be exported.
The base mount point on the target server where the temporary vPDB data should be mounted.
Database name for the physical pluggable database.
A linked container database on the target system. This will be where the physical pluggable database will be plugged into, on the target system.
The snapshot or Timeflow point of an Oracle multitenant dSource or a PDB that needs to be exported. This will be referenced as the "container" in the Timeflow point parameters in step 6 below. You can run these commands to get the list of snapshots or Timeflow ranges:
CODEsnapshot list database=dexample timeflow "dexample" timeflowRanges; commit
Optionally, the target ASM disk group for redo log files (if exporting to ASM), number of RMAN channels and the RMAN file section size.
In the example CLI export detailed below, the following configuration parameters are being passed:
The snapshot that is being exported to ASM belongs to PDB "CDOMLOTGAS2FPDB1â.
The database name for the physical pluggable database is "asmpdb".
The container database where the physical pluggable database will be exported into is "CDOMLOTGAS2Fâ.
The target ASM data diskgroup is "+DATA".
The base mount point on the target server is "/mnt/provision".
Procedure
Execute the
database export
command.CODEdelphix> database export
Set the database export parameters type.
CODEdelphix database export *> set type=OraclePDBExportParameters
Set the storage strategy:
Exporting to ASM:
Set the storage strategy type to
OracleExportASMStorageStrategy
.CODEdelphix database export *> set storageStrategy.type=OracleExportASMStorageStrategy
Set the default target data diskgroup in
asmLayout
.CODEdelphix database export *> set storageStrategy.asmLayout.type=OracleASMLayout delphix database export *> set storageStrategy.asmLayout.defaultDataDiskgroup=+DATA
Note:
redoDiskgroup
parameter is not required for PDB export.
Exporting to a Physical Filesystem:
Set the storage strategy type to
OracleExportFilesystemStorageStrategy
.CODEdelphix database export *> set storageStrategy.type=OracleExportFilesystemStorageStrategy
Set the data directory in the
filesystemLayout
object to the location on the filesystem where all the datafiles should be exported.CODEdelphix database export *> edit storageStrategy.filesystemLayout delphix database export storageStrategy.filesystemLayout *> set type=OracleExportTimeflowFilesystemLayout delphix database export storageStrategy.filesystemLayout *> set dataDirectory=/path/to/exported/datafiles delphix database export storageStrategy.filesystemLayout *> back
Note:
All the properties in the
storageStrategy.filesystemLayout
object are optional and onlydataDirectory
is applicable here.If the datafile location is not specified via
dataDirectory
property, the default location for the exported datafiles is underdb_create_file_dest
of the target CDB.
Set the transfer strategy type and base mount point.
CODEdelphix database export *> set transferStrategy.type=OracleExportPDBTimeflowPointTransferStrategy delphix database export *> set transferStrategy.mountBase=/mnt/provision
Set the source config type as PDB config, and set the database name, database unique name and the linked container database where the resulting physical database will be exported into.
CODEdelphix database export *> edit transferStrategy.sourceConfig delphix database export transferStrategy.sourceConfig *> set type=OraclePDBConfig delphix database export transferStrategy.sourceConfig *> set databaseName=asmpdb delphix database export transferStrategy.sourceConfig *> set cdbConfig=CDOMLOTGAS2F delphix database export transferStrategy.sourceConfig *> back
Set the Timeflow point parameters. In the below example, the latest Timeflow point for the pluggable database is being specified for export.
CODEdelphix database export *> edit transferStrategy.timeflowPointParameters delphix database export transferStrategy.timeflowPointParameters *> set type=TimeflowPointSemantic delphix database export transferStrategy.timeflowPointParameters *> set container=CDOMLOTGAS2FPDB1 delphix database export transferStrategy.timeflowPointParameters *> set location=LATEST_POINT delphix database export transferStrategy.timeflowPointParameters *> back
Info: The parameter values in steps 2 to 6 above are just examples. Replace the appropriate parameter values to match your needs.
Optionally set the following parameters:
Number of RMAN channels. Default value for the RMAN channels is 8.
RMAN file section size. Default value is 0 (i.e. RMAN file section size is not set).
CODEdelphix database export *> set transferStrategy.rmanChannels=10 delphix database export *> set transferStrategy.rmanFileSectionSizeInGb=64
Info: The above values are just examples. Replace the redo diskgroup, number of RMAN channels and RMAN file section size to match your needs. For more details on RMAN channels and RMAN file section size, refer to Performance tuning considerations for Oracle databases with bigfile tablespaces page.
Check that all the settings you require are in place using the
ls
command.
delphix database export *> ls
Properties
type: OraclePDBExportParameters (*)
storageStrategy:
type: OracleExportASMStorageStrategy (*)
asmLayout:
type: OracleASMLayout (*)
defaultDataDiskgroup: +DATA (*)
redoDiskgroup: (unset)
transferStrategy:
type: OracleExportPDBTimeflowPointTransferStrategy (*)
configParams: (unset)
mountBase: /mnt/provision (*)
parentTdeKeystorePassword: (unset)
parentTdeKeystorePath: (unset)
rmanChannels: 8 (*)
rmanFileSectionSizeInGb: 0 (*)
sourceConfig:
type: OraclePDBConfig (*)
cdbConfig: CDOMLOTGAS2F (*)
databaseName: asmpdb (*)
environmentUser: (unset)
linkingEnabled: true (*)
nonSysCredentials: (unset)
nonSysUser: (unset)
repository: (unset)
services: (unset)
tdeExportedKeyFileSecret: (unset)
tdeKeyIdentifier: (unset)
timeflowPointParameters:
type: TimeflowPointSemantic (*)
container: CDOMLOTGAS2FPDB1 (*)
location: LATEST_POINT (*)
delphix database export *>
Initiate the export by committing the operation in the CLI.
delphix database export *> commit
Dispatched job JOB-72
DB_EXPORT job started for "CDOMLOTGAS2FPDB1".
Provisioning temporary virtual database "asmpdb" from the chosen snapshot or point-in-time for exporting.
Provisioning of temporary virtual database "asmpdb" completed successfully.
Starting export of database "asmpdb" at "Untitled/CDOMLOTGAS2FPDB1 time: Wed Sep 20 14:00:40 PDT 2023" to location "+DATA" on target environment "ora1914-asm-tgt".
Generating V2P scripts.
Setting up environment map.
Setting up database for V2P.
Performing backup as copy for database V2P.
Performing Switch to copy for database V2P.
Finalizing database V2P.
Disabling virtual database "asmpdb".
Unexporting storage containers.
Virtual database "asmpdb" disabled.
The export job for virtual source 'ORACLE_VIRTUAL_PDB_SOURCE-3' with name 'asmpdb' got COMPLETED. Started cleanup for the same. Monitor job '<JOB-82>' and take suggested action if the cleanup fails.
DB_EXPORT job for "CDOMLOTGAS2FPDB1" completed successfully.