Skip to main content
Skip table of contents

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:

    CODE
    snapshot 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

  1. Execute the database export command.

    CODE
    delphix> database export
  2. Set the database export parameters type.

    CODE
    delphix database export *> set type=OraclePDBExportParameters
  3. Set the storage strategy:

    1. Exporting to ASM:

      1. Set the storage strategy type to OracleExportASMStorageStrategy.

        CODE
        delphix database export *> set storageStrategy.type=OracleExportASMStorageStrategy
      2. Set the default target data diskgroup in asmLayout.

        CODE
        delphix database export *> set storageStrategy.asmLayout.type=OracleASMLayout
        delphix database export *> set storageStrategy.asmLayout.defaultDataDiskgroup=+DATA

        Note: redoDiskgroup parameter is not required for PDB export.

    2. Exporting to a Physical Filesystem:

      1. Set the storage strategy type to OracleExportFilesystemStorageStrategy.

        CODE
        delphix database export *> set storageStrategy.type=OracleExportFilesystemStorageStrategy
      2. Set the data directory in the filesystemLayout object to the location on the filesystem where all the datafiles should be exported.

        CODE
        delphix 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:

        1. All the properties in the storageStrategy.filesystemLayout object are optional and only dataDirectory is applicable here.

        2. If the datafile location is not specified via dataDirectory property, the default location for the exported datafiles is under db_create_file_dest of the target CDB.

  4. Set the transfer strategy type and base mount point.

    CODE
    delphix database export *> set transferStrategy.type=OracleExportPDBTimeflowPointTransferStrategy
    delphix database export *> set transferStrategy.mountBase=/mnt/provision
  5. 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.

    CODE
    delphix 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
  6. Set the Timeflow point parameters. In the below example, the latest Timeflow point for the pluggable database is being specified for export.

    CODE
    delphix 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.

  1. Optionally set the following parameters:

    1. Number of RMAN channels. Default value for the RMAN channels is 8. 

    2. RMAN file section size. Default value is 0 (i.e. RMAN file section size is not set).

      CODE
      delphix 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.

  1. Check that all the settings you require are in place using the ls command.

CODE
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 *> 
  1. Initiate the export by committing the operation in the CLI.

CODE
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.

JavaScript errors detected

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

If this problem persists, please contact our support.