Skip to content

dx_ctl_env

Marcin Przepiorowski edited this page Aug 18, 2022 · 10 revisions

SYNOPSIS

dx_ctl_env [ -engine|d <delphix identifier> | -all ] [ -configfile file ]
           [ -name env_name | -reference reference ]
           -action <enable|disable|refresh|adduser|addrepo|adddatabase|addlistener
                  |deleteuser|deleterepo|deletedatabase|deletelistener|updatehost|settdepassword>
           [-dbname dbname]
           [-instancename instancename]
           [-uniquename db_unique_name]
           [-jdbc jdbc_connection_string]
           [-listenername listenername]
           [-endpoint ip:port]
           [-username name]
           [-authtype password|systemkey]
           [-password password]
           [-repotype oracle|vfiles|db2|postgresql|plugin]
           [-repopath ORACLE_HOME]
           [-plugin_params JSON_parameters]
           [-tdecdbpassword password]
           [-host name/ip of existing host to update]
           [-newhost new name/ip of the host]
           [-help|? ]
           [-debug ]

DESCRIPTION

Control environments

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

Actions

  • -action <enable|disable|refresh|adduser|addrepo|adddatabase|addlistener|deleteuser|deleterepo|deletedatabase|deletelistener|updatehost|settdepassword> Run an action specified for environments selected by filter or all environments deployed on Delphix Engine

Filters

  • -name Environment Name

OPTIONS

  • -dbname dbname Name of database to add (use with adddatabase)
  • -instancename instancename Name of database instance to add (use with adddatabase)
  • -uniquename db_unique_name Unique name of database to add (use with adddatabase)
  • -jdbc IP:PORT:SID | IP:PORT/SERVICE JDBC connection string (use with adddatabase)
  • -listenername listenername Listener name (use with addlistener)
  • -endpoint ip:port Listener endpoint (use with addlistener)
  • -username username Username to add (use with adduser)
  • -authtype password|systemkey Authentication type for user (use with adduser)
  • -password password Password for user (use with adduser)
  • -repotype oracle|vfiles|db2|postgresql|plugin Repository type. The following types oracle and vfiles can be used to add repository manually.
  • -repopath ORACLE_HOME Repository name (Oracle Home, plugin name, vfiles directory)
  • -bits 32|64 Oracle Home binary bit version (32/64)
  • -ohversion x.x.x.x Oracle Home version ex. 11.2.0.4 or 12.1.0.2
  • -oraclebase path Oracle Base path
  • -host hostname/IP Host name or IP from an environment to be updated. Not required if environment name is specified
  • -newhost hostname/IP New Host name or IP of host being updated
  • -plugin_params JSON_parameters New Host name or IP of host being updated
  • -tdecdbpassword password TDE CDB password
  • -help Print this screen
  • -debug Turn on debugging

EXAMPLES

Disabling environmanet

dx_ctl_env -d Landshark -name LINUXTARGET -action disable Disabling environment LINUXTARGET
Disabling environment LINUXTARGET

Enabling environment

dx_ctl_env -d Landshark -name LINUXTARGET -action enable
Enabling environment LINUXTARGET
Starting job JOB-234 for environment LINUXTARGET.
0 - 100
Job JOB-234 finised with state: COMPLETED

Refreshing environment

dx_ctl_env -d Landshark -name LINUXTARGET -action refresh
Refreshing environment LINUXTARGET
Starting job JOB-7544 for environment LINUXTARGET.
0 - 40 - 100
Job JOB-7544 finished with state: COMPLETED

Adding an Oracle Home not discovered automatically

dx_ctl_env -d Landshark51 -name LINUXTARGET -action addrepo -repotype oracle -repopath /u01/app/oracle/121_64 -bits 64 -ohversion 12.1.0.2 -oraclebase /u01/app/oracle
Adding repository /u01/app/oracle/121_64 to environment LINUXTARGET
Repository /u01/app/oracle/121_64 created

Deleteing an Oracle Home

dx_ctl_env -d Landshark51 -name LINUXTARGET -action deleterepo  -repopath /u01/app/oracle/121_64
Deleting repository /u01/app/oracle/121_64 from environment LINUXTARGET
Repository /u01/app/oracle/121_64 deleted

Adding an additional user to environment

dx_ctl_env -d Landshark51 -name LINUXTARGET -action adduser -username www-data -authtype password -password delphix
Adding user to environment LINUXTARGET
User www-data created

Deleting an additional user from environment

dx_ctl_env -d Landshark51 -name LINUXTARGET -action deleteuser -username www-data
Deleting user from environment LINUXTARGET
User www-data deleted

Adding an additional listener called ADDLIS

dx_ctl_env -d Landshark51 -name LINUXTARGET -action addlistener -listenername ADDLIS -endpoint 127.0.0.1:1522
Adding listener to environment LINUXTARGET
Listener ADDLIS created

Deleting an additional listener called ADDLIS

dx_ctl_env -d Landshark51 -name LINUXTARGET -action deletelistener -listenername ADDLIS
Adding listener to environment LINUXTARGET
Listener ADDLIS deleted

Adding an Oracle database rmantest into environment

dx_ctl_env -d Landshark51 -name LINUXTARGET -action adddatabase -dbname rmantest -instancename rmantest -uniquename rmantest -jdbc 172.16.111.222:1521:rmantest -repopath "/u01/app/oracle/12.1.0.2/rachome1"
Adding database rmantest into /u01/app/oracle/12.1.0.2/rachome1 on environment LINUXTARGET
Database rmantest added into /u01/app/oracle/12.1.0.2/rachome1

Deleting an Oracle database rmantest from environment

dx_ctl_env -d Landshark51 -name LINUXTARGET -action deletedatabase -dbname rmantest -repopath "/u01/app/oracle/12.1.0.2/rachome1"
Deleting database rmantest from /u01/app/oracle/12.1.0.2/rachome1 on environment LINUXTARGET
Database rmantest deleted from /u01/app/oracle/12.1.0.2/rachome1

Adding a vfiles into environment

dx_ctl_env -d Landshark51 -name LINUXSOURCE -action adddatabase -dbname swingbench -repotype vfiles -vfilepath "/home/delphix/swingbench"
Adding vfiles /home/delphix/swingbench as swingbench into environment LINUXSOURCE
vFiles source /home/delphix/swingbench added into environment LINUXSOURCE

Delete a vfiles from environment

dx_ctl_env -d Landshark51 -name LINUXSOURCE -action deletedatabase -dbname swingbench -repotype vfiles
Deleting vfiles swingbench from environment LINUXSOURCE
Database swingbench deleted from Unstructured Files

Chaging an IP of the environment

dx_ctl_env -d 53 -name linuxsource -newhost 172.16.200.130 -action updatehost
Checking environment for host update linuxsource Starting job JOB-2850 for environment linuxsource.
0 - 30 - 40 - 80 - 100
Job JOB-2850 finished with state: COMPLETED

Chaging an IP of particular host

dx_ctl_env -d 53 -host 172.16.200.130 -newhost 172.16.180.129 -action updatehost
Checking environment for host update racattack121 Host with IP 172.16.200.130 not found
Checking environment for host update racattack Host with IP 172.16.200.130 not found
Checking environment for host update oracle18tgt Host with IP 172.16.200.130 not found
Checking environment for host update oracle18 Host with IP 172.16.200.130 not found
Checking environment for host update linuxsource Starting job JOB-2852 for environment linuxsource.
0 - 30 - 40 - 80 - 100
Job JOB-2852 finished with state: COMPLETED
Checking environment for host update linuxtarget Host with IP 172.16.200.130 not found

Adding the Postgresql database posttest into environment

dx_ctl_env -d 53 -name linuxsource -action adddatabase -dbname posttest -repotype postgresql -repopath "Postgres vFiles (9.6)"
Adding database posttest into Postgres vFiles (9.6) on environment linuxsource
Postgresql posttest added into environment linuxsource

Adding the MySQL database using EDSI plugin

dx_ctl_env -d 53 -action adddatabase -repotype plugin -repopath "/usr/sbin (MySQL Community Server (GPL)) 5.6.29" \
                 -dbname testmysql -name linuxtarget \
                 -plugin_params  '{ "dbName": "testmysql", "baseDir":"/usr/sbin" }'
Adding database testmysql into /usr/sbin (MySQL Community Server (GPL)) 5.6.29 on environment linuxtarget
Plugin database testmysql added into environment linuxtarget

Setting TDE password for CDB

dx_ctl_env -d dxtest -action settdepassword -dbname CDOMLOTG2E25 -tdecdbpassword delphix -name marcinoratgt.dlpxdc.co
Setting TDE password for CDB CDOMLOTG2E25
Waiting for all actions to complete. Parent action is ACTION-470
Action completed with success

Delphix

Clone this wiki locally