Skip to content

dx_ctl_dsource

Marcin Przepiorowski edited this page Jul 3, 2024 · 14 revisions

SYNOPSIS

dx_ctl_dsource [ -engine|d <delphix identifier> | -all ] [ -configfile file ]
               -action create, attach, detach
               -type dsourcetype
               -sourcename name
               -dsourcename dsourcename
               -group groupname
               -sourceinst source_instance
               -sourceenv source_environment
               -dbuser username
               -password password
               -source_os_user osusername
               [-creategroup]
               [-logsync yes/no ]
               [-logsyncmode redo|arch]
               [-stageinst staging_inst ]
               [-stageenv staging_env ]
               [-stage_os_user staging_osuser ]
               [-backup_dir backup_dir ]
               [-dumppwd password ]
               [-mountbase mountpoint ]
               [-validatedsync mode ]
               [-delphixmanaged yes/no ]
               [-dbusertype database|environment|domain]
               [-cdbcont container -cdbuser user -cdbpass password]
               [-commserver Commvault servername]
               [-commsourceclient Commvault client name]
               [-commstagingclient Commvault staging name]
               [-exclude path]
               [-hooks path_to_hooks]
               [-presync [hookname,]template|filename[,OS_shell] ]
               [-postsync [hookname,]template|filename[,OS_shell] ]
               [-stagingpush]
               [-oracledbtype nonmt|cdb|pdb]
               [-customparameters (param_name=value)|(#param_name)]
               [-ingestiontype single|initalized|externalbackup ] 
               [-sourcehostname hostname ] 
               [-sourceport xxx]
               [-singledbname dbname]
               [-stagingport xxx ]
               [-dumpdir directory]
               [-restorejobs x]
               [-dumpjobs x]
               [-backup_dir_log directory]
               [-keepinsync yes|no]
               [-debug ]
               [-version ]
               [-help|? ]

DESCRIPTION

Create or attache dSource to a Delphix Engine

ARGUMENTS

Delphix Engine selection - if not specified a default host(s) from dxtools.conf will be used.

  • -engine|d Specify Delphix Engine name from dxtools.conf file
  • -all Display databases on all Delphix appliance
  • -configfile file Location of the configuration file. A config file search order is as follow:
  • configfile parameter
  • DXTOOLKIT_CONF variable
  • dxtools.conf from dxtoolkit location

dSource arguments

  • -type Type (oracle|sybase|mssql|db2|vfiles)

  • -action Action - create, attach, detach, update

    Update action can change a backup path and validated sync mode for MS SQL and Sybase dsources

  • -group Source Group Name

  • -sourcename Database Name

  • -dsourcename dSource name

  • -sourceinst source_instance Source database instance / home

  • -sourceenv source_environment Source database environment name

  • -dbuser username Database user

  • -password password Database password

  • -source_os_user osusername Source database os user

  • -stageinst staging_inst Staging database instance

  • -stageenv staging_env Staging database environment

  • -stage_os_user staging_osuser Staging database os user

  • -backup_dir backup_dir Backup location. From Delphix 5.2.3 multiple backup locations with comma separation can be specified for MS SQL dSource.

  • -logsync yes/no Enable or no LogSync for dSource. Default LogSync is disabled.

  • -logsyncmode redo|arch LogSync mode for Oracle only - allowed values redo to use redo/archivlog logsync or arch for Archive log only

  • -dumppwd password Password for backup used to create dsource

  • -mountbase mountpoint For Sybase only - mount point for staging server

  • -validatedsync mode Set validated sync mode for MS SQL and Sybase

    Allowed values for MS SQL: TRANSACTION_LOG, FULL, FULL_OR_DIFFERENTIAL, NONE

    Allowed values for Sybase: DISABLED, ENABLED

  • -delphixmanaged yes/no Use Delphix Manage backup mode for MS SQL

  • -cdbcont container Oracle only - CDB container for a PDB dSource

  • -cdbuser user Oracle only - CDB user for a PDB dSource

  • -cdbpass password Oracle only - CDB password for a PDB dSource

  • -creategroup Create a Delphix group if it doesn't exist

  • -dbusertype database|environment|domain Specify a database user type for MS SQL. Default value is database.

  • -commserver Commvault servername Commvault server name

  • -commsourceclient Commvault client name Commvault client name

  • -commstagingclient Commvault staging name Commvault staging name

  • -stagingpush Create dsource using staging push technology ( current support MS SQL )

  • -oracledbtype nonmt|cdb|pdb Oracle staging push database type:

      - nonmt - for Oracle non multitenant
      - cdb - for Oracle Container ( required before PDB )
      - pdb - for Oracle Pluggable database
    
  • -hadr hadrPrimarySVC:XXX,hadrPrimaryHostname:hostname,hadrStandbySVC:YYY Add DB2 dSource with HADR support Parameter hadrTargetList is optional.

    ex. hadrPrimarySVC:50001,hadrPrimaryHostname:marcindb2src.dcenter,hadrStandbySVC:50011,hadrTargetList:marcindb2src.dcenter:50001

  • -exclude path Exclude path for vFiles dSources

  • -hooks path_to_hooks Import hooks exported using dx_get_hooks

  • -customparameters (param_name=value)|(#param_name) Provide a custom parameter for Postgresql. For more then one parameter, use -customparameters multiple times. To comment an existing variable inside Postgresql VDB, put a # sign before a parameter.

  • **-ingestiontype single|initalized|externalbackup ** Postgresql dSource ingestion type

  • -sourcehostname hostname Postgresql dSource source host

  • -sourceport xxx Postgresql dSource source port

  • -singledbname dbname Postgresql dSource single database name

  • -stagingport xxx Postgresql dSource staging port

  • -dumpdir directory Postgresql dSource single database dump directory

  • -restorejobs x Postgresql dSource single database number of restore jobs

  • -dumpjobs x Postgresql dSource single database number of dump joba

  • -backup_dir_log Location of WAL logs for external Postgresql ingestion

  • -keepinsync yes|no- Keep a dSource in sync using Postgresql replication. If value set to yes, replication parameters are mandatory

Hooks

Hook definition.

File name is a path to a file with a hook body on machine with dxtoolkit.

Template name is an operational template name

Allowed combinations:

- hookname,template_name,OS_shell

- hookname,filename,OS_shell

- hookname,template_name

- hookname,filename

- template_name

- filename

OS sheel allowed: - BASH - to force bash - SHELL - to use default OS user shell - PS - to force PowerShell 2 - PSD - to use default PowerShell

  • -presync [hookname,]template|filename[,OS_shell] PreSync hook
  • -postsync [hookname,]template|filename[,OS_shell] PostSync hook

OPTIONS

  • -help Print this screen
  • -debug Turn on debugging

EXAMPLES

Create a Sybase dSource from database called pub3 running on instance LINUXSOURCE discovered in environment LINUXSOURCE, staging environment is on LINUXTARGET environment with instance named LINUXTARGET

dx_ctl_dsource -d Landshark5 -type sybase -sourcename pubs3 -sourceinst LINUXSOURCE -sourceenv LINUXSOURCE \
               -source_os_user delphix -dbuser sa -password delphixdb -group Sources -dsourcename "Sybase dsource" \
               -stage_os_user delphix -stageinst LINUXTARGET -stageenv LINUXTARGET -backup_dir "/u02/sybase_back"
               -action create -dumppwd xxxxxx
Waiting for all actions to complete. Parent action is ACTION-2995
Action completed with success.

Create an Oracle dSource from database unique name TESTU running from Oracle Home "/u01/app/oracle/product/11.2.0/dbhome_1" discovered in environment LINUXSOURCE

dx_ctl_dsource -d Landshark5 -type oracle -sourcename TESTU -sourceinst /u01/app/oracle/product/11.2.0/dbhome_1 \
               -sourceenv LINUXSOURCE -source_os_user delphix -dbuser delphixdb -password delphixdb -group Sources \
               -dsourcename "ORACLE dsource" -action create
Waiting for all actions to complete. Parent action is ACTION-3011
Action completed with success.

Create an MSSQL dSource from database unique name AdventureWorksLT2008R2 running on MSSQLSERVER instance discovered in environment WINDOWSSOURCE, staging environment is on WINDOWSTARGET environment with instance named MSSQLSERVER

dx_ctl_dsource -d Landshark5 -type mssql -sourcename AdventureWorksLT2008R2 -sourceinst MSSQLSERVER \
               -sourceenv WINDOWSSOURCE -source_os_user "DELPHIX\delphix_admin" -dbuser aw -password delphixdb \
               -group Sources -dsourcename AdventureWorksLT2008R2 -stage_os_user "DELPHIX\delphix_admin"
               -stageinst MSSQLSERVER - stageenv WINDOWSTARGET -backup_dir "\\\\172.16.180.133\\backups" -action create
Waiting for all actions to complete. Parent action is ACTION-3050
Action completed with success.

Detach dsource

dx_ctl_dsource -d Landshark5 -action detach -dsourcename "Sybase dsource"
Waiting for all actions to complete. Parent action is ACTION-3050
Action completed with success.

Attach Sybase dsource

dx_ctl_dsource -d Landshark5 -action attach -type sybase -sourcename pubs3 -sourceinst LINUXSOURCE -sourceenv LINUXSOURCE \
               -source_os_user delphix -dbuser sa -password delphixdb -group Sources -dsourcename "Sybase dsource" \
               -stage_os_user delphix -stageinst LINUXTARGET -stageenv LINUXTARGET -backup_dir "/u02/sybase_back"
Waiting for all actions to complete. Parent action is ACTION-12699
Action completed with success

Attach Oracle dsource

dx_ctl_dsource -d Landshark5 -action attach -type oracle -sourcename TESTU -sourceinst /u01/app/oracle/product/11.2.0/dbhome_1 \
                             -sourceenv LINUXSOURCE -source_os_user delphix -dbuser delphixdb -password delphixdb \
                             -group Sources -dsourcename "Oracle dsource"
Waiting for all actions to complete. Parent action is ACTION-12691
Action completed with success

Attach Oracle PDB dsource

dx_ctl_dsource -d Landshark5 -action attach -type oracle -sourcename PDB1 -source_os_user delphix  \
                             -group Sources -dsourcename "PDB1" -cdbcont CDOML_A
Waiting for all actions to complete. Parent action is ACTION-1023
Action completed with success

Adding an Oracle PDB dSource

dx_ctl_dsource -d Landshark5 -action create -sourcename PDB1 -type oracle -sourceinst /u01/app/oracle/12.2.0.1/db1 \
                             -sourceenv LINUXSOURCE -source_os_user oracle -dbuser delphixdb -password delphixdb -group Sources \
                             -dsourcename PDB1 -cdbcont test122 -cdbuser c##delphixdb -cdbpass delphixdb
Setting credential for CDB test122 sucessful.
Waiting for all actions to complete. Parent action is ACTION-13947
Action completed with success

Adding a DB2 dSource without HADR dx_ctl_dsource -d 531 -stage_os_user auto1052 -stageenv marcindb2tgt -stageinst "auto1052 - 10.5.0.5 - db2aese" -action create -type db2 \ -sourcename R74D105D -dsourcename dsourceR74D105D -group Untitled -backup_dir "/db2backup" Waiting for all actions to complete. Parent action is ACTION-1870 Action completed with success

Adding a DB2 dSource with HADR

dx_ctl_dsource -d 531 -stage_os_user auto1052 -stageenv marcindb2tgt -stageinst "auto1052 - 10.5.0.5 - db2aese" -action create -type db2 \
                      -sourcename R74D105E  -dsourcename R74D105E -group Untitled -backup_dir "/db2backup" \
                      -hadr "hadrPrimarySVC:50001,hadrPrimaryHostname:marcindb2src.dcenter,hadrStandbySVC:50011,hadrTargetList:marcindb2src.dcenter:50001"
Waiting for all actions to complete. Parent action is ACTION-1879
Action completed with success

Adding a vFiles dSource

dx_ctl_dsource -d test -action create -group "Untitled" -creategroup -dsourcename "vtest"  -type vFiles -sourcename "vtest" -sourceinst "Unstructured Files" \
               -sourceenv "marcintgt" -source_os_user "delphix" -exclude "dir1/dir2" -exclude "dir3"
Waiting for all actions to complete. Parent action is ACTION-2919
Action completed with success

Adding a Posgresql dSource using Delphix initialized backup

dx_ctl_dsource -d dxtest -action create -group "Untitled" -creategroup -dsourcename "postdsource"  -type postgresql -sourcename "postdsource" -stageinst "Postgres vFiles (15.2)" \
               -stageenv "POSTSTG" -stage_os_user "postgres" -mountbase "/mnt/provision/postdsource" -password xxxxxxxxx -stagingport 5433 -ingestiontype initiated \
               -dbuser "delphix" -sourcehostname "sourceserver" -sourceport 5432 -customparameters "deadlock_timeout=123s"
Waiting for all actions to complete. Parent action is ACTION-734
Action completed with success

Adding a Posgresql dSource using single database ingestion

dx_ctl_dsource -d dxtest -action create -group "Untitled" -creategroup -dsourcename "postdsource" -type postgresql -sourcename "postdsource_cluster" -stageinst "Postgres vFiles (15.2)" \ -stageenv "POSTSTG" -mountbase "/mnt/provision/pioro" -dbuser "postgres" -password xxxxxxxxx -stagingport 5433 -sourcehostname "sourceserver" \ -ingestiontype single -sourceport 5432 -singledbname "singleDB" -dumpdir "/home/postgres" -restorejobs 2 -dumpjobs 2

Adding a Postgresql dSource using external backup

dx_ctl_dsource -d dxtest -action create -group "Untitled" -creategroup -dsourcename "extbac" -type postgresql -sourcename "extbac" -stageinst "Postgres vFiles (15.2)" \
               -stageenv "POSTSTG"  -mountbase "/mnt/provision/extbac" -stagingport 5434 -ingestiontype externalbackup \
               -backup_dir "/home/postgres/backup" -backup_dir_log "/home/postgres/backup" -keepinsync no

Updating a backup path and validated sync mode for Sybase

dx_ctl_dsource -d Landshark5 -action update -validatedsync ENABLED -backup_dir "/u02/sybase_back" -dsourcename pubs3
Waiting for all actions to complete. Parent action is ACTION-20194
Action completed with success

Updating a backup path and validated sync mode for MS SQL

 dx_ctl_dsource -d Landshark5 -action update -validatedsync FULL -backup_dir "\\\\172.16.180.10\\loc1,\\\\172.16.180.10\\loc2" -dsourcename AdventureWorks2012
 Waiting for all actions to complete. Parent action is ACTION-20190
 Action completed with success

Update a staging server and instance for Sybase or MS SQL

dx_ctl_dsource -d Landshark5 -action update -dsourcename pubs3 -backup_dir /u02/sybase_backup -stageinst LINUXTARGET -stageenv linuxtarget
Waiting for all actions to complete. Parent action is ACTION-8576
Action completed with success
Waiting for all actions to complete. Parent action is ACTION-8577
Action completed with success

Update a staging server and instance for Sybase or MS SQL based on group

dx_ctl_dsource -d Landshark5 -action update -group SybaseSource -backup_dir /u02/sybase_backup -stageinst LINUXTARGET -stageenv linuxtarget
Waiting for all actions to complete. Parent action is ACTION-8593
Action completed with success
Waiting for all actions to complete. Parent action is ACTION-8594
Action completed with success

Delphix

Clone this wiki locally