Skip to main content
Delphix

Provision an Oracle VDB via the Delphix Command Line Implementing Multiple Configure Clone Hooks (KBA1852)

 

 

Oracle VDB Provisioning using the Delphix CLI

This article details the process and commands required to provision an Oracle VDB via the Delphix Command Line Interface (CLI) and implement multiple hook scripts, in this case via the Configure Clone Hook.

Prerequisites

  • An Oracle dSource.
  • Access to the Delphix Command Line Interface as the Delphix Administrator user or another user capable of provisioning VDB's.
  • In this specific case the version of the Delphix Virtualisation Engine used is 5.2.3.0. (CLI commands can differ across releases).
  • A target host that will be used to run the Oracle VDB that has been provisioned.
  • Bash Shell script hooks that are to perform some function against the VDB to be provisioned or the some other function against the target host.

To perform a Delphix CLI based provision of the Oracle VDB

 

The following process and CLI commands will allow you to perform a provision and set multiple hooks.

  • Set the new containers name and group
Delphix5261 database provision *> set container.name=vdbhook2
Delphix5261 database provision *> set container.group=Targets 
  • Set the new VDB's configuration profile
Delphix5261 database provision *> set sourceConfig.type=OracleSIConfig 
Delphix5261 database provision *> set sourceConfig.databaseName=vdbhook2
Delphix5261 database provision *> set sourceConfig.instance.instanceName=vdbhook2
Delphix5261 database provision *> set sourceConfig.instance.instanceNumber=1
Delphix5261 database provision *> set sourceConfig.repository=OEL7SI2/'/u01/app/oracle/product/12.1.0/dbhome_1'
Delphix5261 database provision *> set sourceConfig.uniqueName=vdbhook2
  • Set where the provision is to be performed from, the dSource and the timeflow details
Delphix5261 database provision *> set timeflowPointParameters.container=oel7si1_db121
Delphix5261 database provision *> set timeflowPointParameters.location=LATEST_SNAPSHOT 
  • Set the VDB source parameters including the hooks
Delphix5261 database provision *> set source.allowAutoVDBRestartOnHostReboot=false 
Delphix5261 database provision *> set source.mountBase=/mnt/provision
Delphix5261 database provision *> set source.operations.type=VirtualSourceOperations
Delphix5261 database provision *> set source.name=vdbhook1
Delphix5261 database provision *> set source.type=OracleVirtualSource
  • Using edit add the individual hooks
Delphix5261 database provision *> edit source.operations.configureClone
Delphix5261 database provision source.operations.configureClone *> add
Delphix5261 database provision source.operations.configureClone 0 *> set type=RunBashOnSourceOperation 
Delphix5261 database provision source.operations.configureClone 0 *> set name=hook1
Delphix5261 database provision source.operations.configureClone 0 *> set command=ls
Delphix5261 database provision source.operations.configureClone 0 *> back
Delphix5261 database provision source.operations.configureClone *> ls
Properties
    0:
        type: RunBashOnSourceOperation (*)
        name: hook1 (*)
        command: ls (*)

Use the "add" command to add an element to this array.

Delphix5261 database provision source.operations.configureClone *> add
Delphix5261 database provision source.operations.configureClone 1 *> set name=hook2
Delphix5261 database provision source.operations.configureClone 1 *> set type=RunBashOnSourceOperation
Delphix5261 database provision source.operations.configureClone 1 *> set command=date
Delphix5261 database provision source.operations.configureClone 1 *> back
Delphix5261 database provision source.operations.configureClone *> ls
Properties
    0:
        type: RunBashOnSourceOperation (*)
        name: hook1 (*)
        command: ls (*)
    1:
        type: RunBashOnSourceOperation (*)
        name: hook2 (*)
        command: date (*)

Use the "add" command to add an element to this array.

Delphix5261 database provision source.operations.configureClone *> add
Delphix5261 database provision source.operations.configureClone 2 *> set name=hook3
Delphix5261 database provision source.operations.configureClone 2 *> set type=RunBashOnSourceOperation
Delphix5261 database provision source.operations.configureClone 2 *> set command=env
Delphix5261 database provision source.operations.configureClone 2 *> back
Delphix5261 database provision source.operations.configureClone *> ls
Properties
    0:
        type: RunBashOnSourceOperation (*)
        name: hook1 (*)
        command: ls (*)
    1:
        type: RunBashOnSourceOperation (*)
        name: hook2 (*)
        command: date (*)
    2:
        type: RunBashOnSourceOperation (*)
        name: hook3 (*)
        command: env (*)
  • Using back move up to the provision settings once more
Delphix5261 database provision source.operations.configureClone *> back
  • Confirm everything is in place for the provision
Delphix5261 database provision *> ls
Properties
    type: OracleProvisionParameters (*)
    container:
        type: OracleDatabaseContainer
        name: vdbhook2 (*)
        description: (unset)
        diagnoseNoLoggingFaults: true
        group: Targets (*)
        performanceMode: DISABLED
        preProvisioningEnabled: false
        sourcingPolicy: (unset)
    credential: (unset)
    masked: (unset)
    maskingJob: (unset)
    newDBID: (unset)
    openResetlogs: (unset)
    physicalStandby: (unset)
    source:
        type: OracleVirtualSource (*)
        name: vdbhook1 (*)
        allowAutoVDBRestartOnHostReboot: false (*)
        archivelogMode: (unset)
        config: (unset)
        configParams: (unset)
        configTemplate: (unset)
        customEnvVars: (unset)
        fileMappingRules: (unset)
        mountBase: /mnt/provision (*)
        nodeListeners: (unset)
        operations:
            type: VirtualSourceOperations (*)
            configureClone:
                0:
                    type: RunBashOnSourceOperation (*)
                    name: hook1 (*)
                    command: ls (*)
                1:
                    type: RunBashOnSourceOperation (*)
                    name: hook2 (*)
                    command: date (*)
                2:
                    type: RunBashOnSourceOperation (*)
                    name: hook3 (*)
                    command: env (*)
            postRefresh: (unset)
            postRollback: (unset)
            postSnapshot: (unset)
            postStart: (unset)
            postStop: (unset)
            preRefresh: (unset)
            preRollback: (unset)
            preSnapshot: (unset)
            preStart: (unset)
            preStop: (unset)
        redoLogGroups: (unset)
        redoLogSizeInMB: (unset)
    sourceConfig:
        type: OracleSIConfig (*)
        databaseName: vdbhook2 (*)
        environmentUser: (unset)
        instance:
            type: OracleInstance (*)
            instanceName: vdbhook2 (*)
            instanceNumber: 1 (*)
        linkingEnabled: true
        nonSysCredentials: (unset)
        nonSysUser: (unset)
        repository: OEL7SI2/'/u01/app/oracle/product/12.1.0/dbhome_1' (*)
        services: (unset)
        uniqueName: vdbhook2 (*)
    timeflowPointParameters:
        type: TimeflowPointSemantic
        container: oel7si1_db121 (*)
        location: LATEST_SNAPSHOT (*)
    username: (unset)

Operations
defaults

  • Using commit kick off the provision process.
Delphix5261 database provision *> commit
    vdbhook2
    Dispatched job JOB-335
    DB_PROVISION job started for "Targets/vdbhook2".
    Starting provision of the virtual database "vdbhook1".
    Creating new TimeFlow.
    Generating recovery scripts.
    Exporting storage.
    Mounting filesystems for the virtual database instance "1".
    Mounting read-only archive log filesystem for the virtual database instance "1".
    Recovering Oracle database.
    Opening the virtual database "vdbhook1".
    Creating control file.
    Recovering Oracle database with created control file.
    Starting incomplete recovery.
    Creating Oracle online logs.
    Processing startup init file.
    Configuring initialization and server parameter files.
    Mounting virtual database instance.
    Opening Oracle database.
    Creating tempfiles.
    Renaming readonly datafiles.
    Enabling Oracle instances.
    Registering listeners.
    Oracle recovery was successful.
    Unmounting read-only archive log filesystem for the virtual database instance "1".
    The virtual database "vdbhook1" was successfully provisioned.
    Running user-specified "Configure Clone" operations.
    DB_PROVISION job for "Targets/vdbhook2" completed successfully.

Related Articles

The following articles may provide more information or related information to this article: