Delphix Toolkits (dxToolkit and dxmToolkit)

 View Only
  • 1.  Restricting results

    Posted 01-23-2024 06:48:00 AM
    Edited by Manish K 01-23-2024 07:06:07 AM

    Hi - Need your help to have some understanding on this.

    • Is there any way to restrict the results of dx_get_db_env, there are plently of informations which are not needed , i just need a few columns.
    • Is there any way to have another filter, like to have vdbs which are not runing when I used dx_get_db_env 

               



    ------------------------------
    Manish K
    Delphix Community Members
    ------------------------------



  • 2.  RE: Restricting results
    Best Answer

    Posted 01-23-2024 11:03:00 AM

    Hello,

    There are a lot of built in filters. If you run with the "-help" parameter it gives you a listing along with examples:

      Filters:
        Filter databases using one of the following filters


        -group Group Name
        -name Database Name
        -host Host Name
        -type Type (dsource|vdb)
        -envname Environment name
        -dsource dsourcename Dsource name
        -instancename instname Instance name (Oracle)
        -rdbms oracle|sybase|db2|mssql|vFiles Filter by RDBMS type - this filter
        is implemented only in dx_get_db_env
        -reponame repository_name Filter using repository_name ( Oracle Home, MS
        SQL instance, etc)


       Instance option:
        Specify a instance number (only with combination with host)


        -instance inst_no Instance number

    For other things such as VDB status, you may have to use grep to filter for/out the things you want. For example, if I want to skip all of the RUNNING datasets, I do it like this:

    ./dx_get_db_env -engine neal1800 | grep -v RUNNING

    Appliance            Hostname             Database                       Group           Type     SourceDB                       Parent snapshot                     Used [GB]  Status     Enabled    Unique Name                    Parent time                         VDB creation time                   VDB refresh time                    
    -------------------- -------------------- ------------------------------ --------------- -------- ------------------------------ ----------------------------------- ---------- ---------- ---------- ------------------------------ ----------------------------------- ----------------------------------- ----------------------------------- 
    neal1800             NA                   McLaren                        MSSQL           detached                                N/A                                       0.14 NA         N/A        N/A                            N/A                                 2024-01-08 09:53:54                 N/A                                 
    neal1800             10-43-36-232.qa-ad.d VMcLaren                       MSSQL           VDB      McLaren                        2023-12-19 10:10:05 CST                   0.00 UNKNOWN    enabled    N/A                            2023-12-19 10:10:05 CST             2024-01-08 09:59:49                 2024-01-08 10:21:28       

    I don't see a way of suppressing columns from the command line.

    You could dump the output to a CSV or JSON file and do some post processing.

    You can always file feature requests for new filters or column suppression here:

    • https://github.com/delphix/dxtoolkit/issues

    Thanks,

    Neal



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