CLI cookbook: linking to a single instance Oracle database
This topic describes how to link to a single instance Oracle database using the Delphix Engine command-line interface.
Prerequisites
You will need the following information:
The name of the dSource you want to create.
The group in which you want to create the dSource.
The host environment user with sufficient privileges as described in the Delphix User Guide.
The database unique name of the Oracle database you want to link to.
Procedure
Execute the
database linkcommand.CODEdelphix> database link delphix database link *>The default
linkData.typein theLinkParametersis set toASELinkData, but you can confirm that by getting the input type. SetlinkData.typetoOracleLinkFromExternalfor Oracle database.CODEdelphix database link *> get linkData.type ASELinkData delphix database link *> set linkData.type=OracleLinkFromExternal delphix database link *> get linkData.type OracleLinkFromExternal (*) delphix database link *> ls Properties type: LinkParameters name: (required) description: (unset) group: (required) linkData: type: OracleLinkFromExternal (*) diagnoseNoLoggingFaults: (unset) environmentUser: (required) externalFilePath: (unset) linkNow: (unset) nonSysCredentials: (unset) nonSysUser: (unset) operations: (unset) oracleFallbackCredentials: (unset) oracleFallbackUser: (unset) preProvisioningEnabled: (unset) sourcingPolicy: (unset) syncParameters: type: OracleSyncFromExternalParameters doNotResume: (unset) doubleSync: (unset) filesForFullBackup: (unset) forceFullBackup: (unset) skipSpaceCheck: (unset) syncStrategy: (required) Operations defaultsSet the name for the dSource and the group in which you want to create it.
CODEdelphix database link *> set name=example1 delphix database link *> set group="<Group Name>"Adjust any other properties you may want, such as description, and whether to link now. The full set of options is described in the API documentation for the
OracleLinkFromExternaltype. If you set thelinkNowproperty, then this operation will wait for the sync to complete, otherwise, you can perform the initial link by running the sync command at a later pointCODEdelphix database link *> set linkData.linkNow=trueSet the privileged environment user.
This user must be from the same environment as the associated source config set in step 4. You can list the set of available users through the environment user list command.
delphix database link *> /environment/user list
NAME
oracle
delphix database link *> set linkData.environmentUser=oracle
Set the
linkData.syncStrategy.type
delphix database link *> set linkData.syncStrategy.type=OracleSourceBasedSyncStrategy
Set the source configuration.
For Oracle databases, the source configurations are identified by the database unique name. If you are unsure of the set of available databases, you can list available source configurations.
delphix database link *> /sourceconfig list
NAME REPOSITORY LINKINGENABLED
example1 '/opt/ora/dexample1' true
example2 '/opt/ora/dexample1' true
delphix database link *> set linkData.syncStrategy.config=example1
Adjust any other properties of
linkData.syncStrategyyou may want, such as RMAN tunables.Check that all the settings you require are in place using the "ls" command.
CODEdelphix database link *> ls Properties type: LinkParameters name: example1 (*) description: (unset) group: <Group Name> (*) linkData: type: OracleLinkFromExternal (*) diagnoseNoLoggingFaults: (unset) environmentUser: oracle (*) externalFilePath: (unset) linkNow: true (*) nonSysCredentials: (unset) nonSysUser: (unset) operations: (unset) oracleFallbackCredentials: (unset) oracleFallbackUser: (unset) preProvisioningEnabled: (unset) sourcingPolicy: (unset) syncParameters: type: OracleSyncFromExternalParameters doNotResume: (unset) doubleSync: (unset) filesForFullBackup: (unset) forceFullBackup: (unset) skipSpaceCheck: (unset) syncStrategy: type: OracleSourceBasedSyncStrategy (*) backupLevelEnabled: (unset) bandwidthLimit: 0 (*) checkLogical: false (*) compressedLinkingEnabled: true (*) config: example1 (*) encryptedLinkingEnabled: false (*) filesPerSet: 5 (*) numberOfConnections: 1 (*) rmanChannels: 2 (*) Operations defaultsCommit the result.
CODEdelphix database link *> commit `ORACLE_DB_CONTAINER-29 Dispatched job JOB-263 DB_LINK job started for "<Group Name>/example1". Obtaining information from source database "<Group Name>/example1". Creating new TimeFlow for dSource "<Group Name>/example1". The dSource "example1" was successfully linked from source database "<Group Name>/example1". DB_LINK job for "<Group Name>/example1" completed successfully.