Delphix Toolkits (dxToolkit and dxmToolkit)

 View Only
  • 1.  dx_ctl_dbhooks creates hook with entire content of given HookScript instead of creating hook with script path

    Posted 04-27-2020 05:34:00 AM
    When I create a hook using dx_ctl_dbhooks toolkit, it creates a hook in the VDB with the content of the script which I passed as hook.
    e.g.:
    dx_ctl_dbhooks -d de1 -action set -hookname confighook1 -hooktype configureClone -dbname msktest1 -hook /home/delphix/delphix_oratab.sh

    When I check configure clone hook in the Engine, the entire script content appears in the hook. I believe the hook should be created only with the exact path of the script (as "/home.delphix/delphix_oratab.sh") which needs to be executed as hook (script might have some runtime user arguments), and not the entire content of the script.

    Please check if this can be corrected to fix this behavior. 

    Thanks,
    Sushil

    ------------------------------
    Sushil Krishn
    Oracle DBA
    Unisys
    ------------------------------


  • 2.  RE: dx_ctl_dbhooks creates hook with entire content of given HookScript instead of creating hook with script path
    Best Answer

    Posted 04-27-2020 08:31:00 AM
    Hi,

    File /home/delphix/delphix_oratab.sh on machine with Dxtoolkit installed should contain a requested hook body.
    If you want to call script "/path/foo.sh" using Dephix Hook you need to do the following:

    1. Create a file 

    /tmp/myhook.txt with body:
    /path/foo.sh

    2. run Dxtoolkit command
    dx_ctl_dbhooks -d de1 -action set -hookname confighook1 -hooktype configureClone -dbname msktest1 -hook /tmp/myhook.txt

    and body of /tmp/myhook.txt will be uploaded as hook body.

    regards,
    Marcin



    ------------------------------
    Marcin Przepiorowski
    Technical Principal
    Delphix
    ------------------------------



  • 3.  RE: dx_ctl_dbhooks creates hook with entire content of given HookScript instead of creating hook with script path

    Posted 04-28-2020 03:02:00 AM
    Hi Marcin,

    The suggested workaround is helpful upto some extent. But, I am looking forward if this behavior is going to be fixed because we have several custom scripts with runtime user variable/arguments to be passed which are dynamically generated. These scripts need to be triggered as hooks. 
    It will be more meaningful to only consider the passed command/script details in hook instead of converting to script body.

    Please check and suggest.

    Thanks,
    Sushil

    ------------------------------
    Sushil Krishn
    Oracle DBA
    Unisys
    ------------------------------



  • 4.  RE: dx_ctl_dbhooks creates hook with entire content of given HookScript instead of creating hook with script path

    Posted 04-28-2020 03:18:00 AM
    Hello,

    This is not a workaround but this is how this script has been design.
    Passing hooks body directly from command line it's very tricky and it will requires a lot of escape characters so parsing shell will skip 
    special characters needed in the scripts.

    You can still generate automatically a text file with hook body and use it as input of dx_ctl_dbhook

    regards,
    Marcin

    ------------------------------
    Marcin Przepiorowski
    Technical Principal
    Delphix
    ------------------------------



  • 5.  RE: dx_ctl_dbhooks creates hook with entire content of given HookScript instead of creating hook with script path

    Posted 05-04-2020 08:53:00 AM
    Thanks Marcin, 
    If its designed in such way, I think what you suggested as alternate should be helpful to achieve what I am looking for. 

    Regards,
    Sushil

    ------------------------------
    Sushil Krishn
    Oracle DBA
    Unisys
    ------------------------------