Delphix Toolkits (dxToolkit and dxmToolkit)

 View Only
  • 1.  Dxtoolkit wildcard for -name for db refresh

    Posted 03-09-2023 08:31:00 AM

    Hello,

    I'm trying to create a script that will refresh all VDBs with a similar name using a wildcard. I was hoping the below would work:

    dx_refresh_db -d DXFANP01 -name purstg3_% -timestamp LATEST_SNAPSHOT

    or

    dx_refresh_db -d DXFANP01 -name purstg3_* -timestamp LATEST_SNAPSHOT

    ...where the VDBs are named like: purstg3_facets and purstg3_stgdata . But, the '%' and '*' are not working as expected. Any ideas?



    ------------------------------
    Chris Patton
    Database Adminstrator, Sr
    CalOptima
    ------------------------------


  • 2.  RE: Dxtoolkit wildcard for -name for db refresh

    Posted 03-13-2023 05:09:00 PM

    Hi Chris,

    I quickly searched the dxtoolkit documentation but could not find where it said it supported wildcards. I might have missed it though.

    In practice, what I have seen customers do is run the commands in steps:

    1. Run one command, dump the results to a file (format with with grep/awk/etc).
    2. Run the second command and read the results from the file.
    3. Remove the temporary file.

    You could do this in a single line of code. In this example, I just refresh VDBs with starting with YY:

     % ./dx_get_db_env --engine neal6017 --type vdb | grep YY | awk '{print $3}' | while read -r line ; do 
    ./dx_refresh_db --engine neal6017 -name $line
    done
    Starting job JOB-1251 for database YYA. 0 - 32 - 39 - 100
    Job JOB-1251 finished with state: COMPLETED
    Starting job JOB-1253 for database YYY. 0 - 32 - 39 - 100
    Job JOB-1253 finished with state: COMPLETED
    Starting job JOB-1255 for database YYZ. 0 - 36 - 39 - 100
    Job JOB-1255 finished with state: COMPLETED 

    I hope this helps.

    Thanks,

    Neal



    ------------------------------
    Neal Stack
    Senior Principal Technical Support Engineer
    Delphix
    ------------------------------



  • 3.  RE: Dxtoolkit wildcard for -name for db refresh
    Best Answer

    Posted 03-13-2023 05:43:00 PM

    Hello,

    One of the developers of dxtoolkit confirmed that it doesn't support wildcards. You can always add a new feature request ( https://github.com/delphix/dxtoolkit/issues ).

    Another option to refresh multiple VDBs is to comma separate them like this:

    % ./dx_refresh_db --engine neal6017 -name YYA,YYY,VbigdbDW0
    Starting job JOB-1274 for database VbigdbDW0. 0 - 25 - 39 - 100
    Job JOB-1274 finished with state: COMPLETED
    Starting job JOB-1276 for database YYA. 0 - 25 - 39 - 100
    Job JOB-1276 finished with state: COMPLETED Starting job
    JOB-1278 for database YYY. 0 - 25 - 39 - 100
    Job JOB-1278 finished with state: COMPLETED



    ------------------------------
    Neal Stack
    Senior Principal Technical Support Engineer
    Delphix
    ------------------------------