APIPythonOpen-Source Solutions

  • 1.  Find specific timeflow from a few days ago

    Posted 06-06-2016 08:59:00 AM
    Hi

    We have the following issue
    Our SQL dSource is backed up every 2 mins.  There is a restriction in the GUI to only show the last 1500 snapshots.
    This means that we cannot see any snapshots from last friday.
    Our support team need a delphix VDB refreshed from a certain timepoint 2016-06-03T13:29:59.000Z

    If I use the CLI to view timeflow

    timeflow "DBName" timeflowRanges

    I get a massive list and cannot scroll up enough to view all...

    So I try and refresh manually using the CLI and guess the timeflow (we have logsync on)

    > database> select <VDB name>
    > refresh
    > set timeflowPointParameters.type= TimeflowPointTimestamp
    > set timeflowPointParameters.location=2016-06-03T13:29:59:000Z

    but the CLI keeps saying the timeflow does not exist

    Also tried
    set timeflowPointParameters.timeflow=2016-06-03T13:29:59:000Z

    instead of location.

    Is there anyway to restrict the timeflowranges that come back in the first query to only look at a certain daterange?

    Is there a better way to refresh a DB to a particular point in time without knowing this information?

    Thanks in advance


  • 2.  RE: Find specific timeflow from a few days ago

    Posted 06-06-2016 09:16:00 AM
    ok, I've found the location ID via the API 

      "firstChangePoint":{      "type":"MSSqlTimeflowPoint",
          "location":"1074858000084573400001",
          "timestamp":"2016-06-03T12:28:01.000Z",
          "timeflow":"MSSQL_TIMEFLOW-1"
       },
       "latestChangePoint":{
          "type":"MSSqlTimeflowPoint",
          "location":"1074858000087359000001",
          "timestamp":"2016-06-03T12:30:01.000Z",
          "timeflow":"MSSQL_TIMEFLOW-1"
       },

    but not sure how to get to a specific time within that 

    I tried

    > database> select <VDB name>
    > refresh
    > set timeflowPointParameters.type=TimeflowPointTimestamp
    > set timeflowPointParameters.location=2016-06-03T12:29:59.000Z
    > set timeflowPointParameters.timeflow=MSSQL_TIMEFLOW-1
    > commit

    (I noticed that BST took affect, so needed to go back an hour)

    If I do this, I get
    No such property 'location'



  • 3.  RE: Find specific timeflow from a few days ago
    Best Answer

    Posted 06-06-2016 09:18:00 AM
    Hi Mark,

    You'll need to get a correct timeflow specified for a timestamp refresh.

    Easiest is to list the available timeflows for the database with:

    /timeflow list database=<VDB Name>

    probably only one or maybe two, then use that as the "timeflow" parameter in the TimeflowPointTimestamp args.

    Thanks,

    Scott.


  • 4.  RE: Find specific timeflow from a few days ago

    Posted 06-06-2016 09:22:00 AM
    ah think I've done it now


    > database> select <VDB name>
    > refresh
    > set timeflowPointParameters.type=TimeflowPointTimestamp
    > set timeflowPointParameters.timetamp=2016-06-03T12:29:59.000Z
    > set timeflowPointParameters.timeflow=MSSQL_TIMEFLOW-1
    > commit

    Had to use timestamp instead of location

    thanks



  • 5.  RE: Find specific timeflow from a few days ago

    Posted 06-06-2016 09:23:00 AM
    Hi Mark, 

    Regarding your last update, if you wish to specify location, you need to change the type from TimeflowPointTimestamp to TimeflowPointLocation.

    For reference, the types are:

    TimeflowPointBookmark, TimeflowPointBookmarkTag, TimeflowPointLocation, TimeflowPointSemantic, TimeflowPointSnapshot, TimeflowPointTimestamp

    Thanks,


    Scott.



  • 6.  RE: Find specific timeflow from a few days ago

    Posted 06-06-2016 09:38:00 AM
    Mark,
    1) TimeflowPointTimestamp doesn't use location, it has two attributes: timeflow and timestamp.

    LandsharkEngine database 'Employee DB - Dev' refresh *> set timeflowPointParameters.type=TimeflowPointTimestamp 

    LandsharkEngine database 'Employee DB - Dev' refresh *> ls

    Properties

        type: OracleRefreshParameters

        credential: (unset)

        timeflowPointParameters:

            type: TimeflowPointTimestamp (*)

            timeflow: default (*)

            timestamp: (required)

        username: (unset)

    2) If you want to revert to a snapshot, you probably want this:

    LandsharkEngine database 'Employee DB - Dev' refresh *> set timeflowPointParameters.type=TimeflowPointSnapshot 

    LandsharkEngine database 'Employee DB - Dev' refresh *> ls

    Properties

        type: OracleRefreshParameters

        credential: (unset)

        timeflowPointParameters:

            type: TimeflowPointSnapshot (*)

            snapshot: (required)

        username: (unset)

    3) Then you can easily use Tab Complete to help:

    LandsharkEngine database 'Employee DB - Dev' refresh *> set timeflowPointParameters.snapshot='@2016-06-04T<press tab>

    '@2016-06-04T12:01:05.165Z'  '@2016-06-04T12:02:58.312Z'

    '@2016-06-04T12:23:10.219Z'  '@2016-06-04T12:41:54.327Z'

    '@2016-06-04T12:46:08.660Z'  '@2016-06-04T13:00:04.411Z'

    '@2016-06-04T20:04:39.519Z' 


    4) If python is an option for you, I think my dx_provision_vdb.py script would be helpful here. You can put in as much of the date as you know, and it will return a possible matches, then you can keep refining until you get the one you want. Here is a link to my blog page that talks about how to set it up, etc.

    http://www.therealcloudsurgeon.com/2016/04/getting-started-with-delphix-python.html


  • 7.  RE: Find specific timeflow from a few days ago

    Posted 06-06-2016 09:49:00 AM
    Ahhh, See you gents already have it sorted. Nevermind!