Skip to content

dx_get_dbhooks

Marcin Przepiorowski edited this page Apr 4, 2018 · 2 revisions

SYNOPSIS

dx_get_dbhooks    [ -engine|d <delphix identifier> | -all ] [ -configfile file ]
                  [ -hookname hook_name ] 
                  [ -dbname dbname | -group group | -host host | -type type ]
                  [ -outdir dir]
                  [ -save ]
                  [ -exportDBHooks ]
                  [ -format csv|json ]  
                  [ -help|? ] 
                  [ -debug ] 

DESCRIPTION

List or export operation templates from engine. If no operation template name is specified all templates will be processed.

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

Filters

  • -hookname Hook name
  • -group Group Name
  • -dbname Database Name
  • -host Host Name
  • -type Type (dsource|vdb)

OPTIONS

  • -exportDBHooks
    Export database (specified by database filters) hooks in Delphix Engine JSON format into a outdir directory This file(s) can by used by dx_provision_vdb or dx_ctl_dbhooks script
  • -save Save a hook(s) as file(s) into a directory structure started by -outdir Output structure is defined as follow: OUTDIR/DBNAME/HOOKTYPE/hookname
  • -outdir
    Location of exported operation templates files
  • -format
    Display output in csv or json format If not specified pretty formatting is used.
  • -help
    Print this screen
  • -debug Turn on debugging

EXAMPLES

Display all hooks from datasets on Delphix Engine

dx_get_dbhooks -d Landshark51

dbname               hook type            name                 type            command
-------------------- -------------------- -------------------- --------------- ----------------------------------------------------------------------------------------------------
autofs               preRollback          savestate            BASH            cp /home/save /tmp
autotest             postRefresh          changepassword       BASH            sqlplus / as sysdba <<EOF<cr>alter user app identified by app;<cr>EOF

Save hooks into file under outdir folder

dx_get_dbhooks.pl -d Landshark51 -save -outdir /tmp
Saving hook to file /tmp/autofs/preRollback/savestate
Saving hook to file /tmp/autotest/postRefresh/changepassword

Export hooks using Delphix Engine JSON format for other dxtoolkit scripts

dx_get_dbhooks.pl -d Landshark51 -exportDBHooks -outdir /tmp -dbname autotest
Exporting database autotest hooks into  /tmp/autotest.dbhooks

Delphix

Clone this wiki locally