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 database unique name of the Oracle database you want to link to.
The database username/password with sufficient privileges as described in the Delphix User Guide.
The host environment user with sufficient privileges as described in the Delphix User Guide.
Procedure
Execute the
database link
command.CODEdelphix> database linkdelphix database link>
The default
linkData.type
in theLinkParameters
is set toASELinkData
, but you can confirm that by getting the input type. SetlinkData.type
toOracleLinkFromExternal
for Oracle database.CODEdelphix database link *> get linkData.type ASELinkDatadelphix database link *> set linkData.type=OracleLinkFromExternaldelphix database link *> get linkData.type OracleLinkFromExternal (*)delphix database link *> lsProperties type: LinkParameters name: (required) description: (unset) group: (required) linkData: type: OracleLinkFromExternal (*) backupLevelEnabled: (unset) bandwidthLimit: (unset) checkLogical: (unset) compressedLinkingEnabled: (unset) config: (required) dbCredentials: type: PasswordCredential password: (required) dbUser: (required) diagnoseNoLoggingFaults: (unset) encryptedLinkingEnabled: (unset) environmentUser: (required) externalFilePath: (unset) filesPerSet: (unset) linkNow: (unset) nonSysCredentials: (unset) nonSysUser: (unset) numberOfConnections: (unset) operations: (unset) preProvisioningEnabled: (unset) rmanChannels: (unset) sourcingPolicy: (unset) syncParameters: type: OracleSyncFromExternalParameters doNotResume: (unset) doubleSync: (unset) forceFullBackup: (unset) skipSpaceCheck: (unset)Operationsdefaults
Set the name for the dSource and the group in which you want to create it.
CODEdelphix database link *> set name=example1delphix database link *> set group=""
Set the source configuration. For Oracle databases, these are identified by the database unique name. If you are unsure of the set of available databases, you can list available source configurations.
CODEdelphix database link *> /sourceconfig listNAME REPOSITORY LINKINGENABLEDexample1 '/opt/ora/dexample1' trueexample2 '/opt/ora/dexample1' truedelphix database link *> set linkData.config=example1
Set the privileged database username/password.
The password can be set like other properties, or the value can be omitted so that it can be manually inputted without exposing the password.
delphix database link *> set linkData.dbUser=delphixdelphix database link *> set linkData.dbCredentials.passwordEnter dbCredentials.password: ********
Set 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 listNAME oracledelphix database link *> set linkData.environmentUser=oracle
Adjust any other properties you may want, such as RMAN tunables, description, and whether to link now. The full set of options is described in the API documentation for the
OracleLinkFromExternal
type. If you set thelinkNow
property, 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=true
Commit the result.
CODEdelphix database link *> commit `ORACLE_DB_CONTAINER-1 Dispatched job JOB-8 DB_LINK job started for "/example1". Obtaining information from source database "/example1". Creating new TimeFlow for dSource "/example1". The dSource "example1" was successfully linked from source database "/example1". DB_LINK job for "/example1" completed successfully.delphix>