Load Ingest Data
Results 1 to 8 of 8
Like Tree2Likes
  • 2 Post By stevenguyen

Thread: Replicate Command Line - Starting and Stopping Tasks

  1. #1
    stevenguyen is offline Senior Member
    Join Date
    May 2014
    Posts
    297
    Rep Power
    6

    Replicate Command Line - Starting and Stopping Tasks




    The repctl is from the ~\Attunity\replicate\bin directory (run as Administrator)


    repctl connect; stoptask task_name; disconnect

    repctl connect; gettaskstatus task_name; disconnect

    You can start the task multiple ways:

    Paramaters:
    1 = Start Full Load only
    2 = Start Change Capture only
    3 = Start Both

    Flags Values:
    0 = Resume
    1 = Fresh Start (like starting as of now)

    repctl connect; execute task_name 3 Flags=0; disconnect

    Note: The execute command may take up to several minutes to complete.

    Remotly:
    repctl connect ip=192.168.165.11 port=3552 ; stoptask task; disconnect

    NOTE: To run this on Linux you may need to add a back slash in front of the semi-colon:
    repctl connect\; gettaskstatus task_name\; disconnect

    Note: When running a full load only task you may want to have the batch file wait until the load completes:
    Repctl execute task=<task_name> 1 flags=1

    Alternate (non-default) data directories must be provided using -d <path>
    Alternatively in windows use: set AREP_DATA=<path>

    Note : If using Linux shell you have to escape the semicolons with backslashes.

    e.g.

     ./repctl connect\; gettaskstatus task_name\; disconnect


    Further note on usage - be certain to have blank space following the semi-colon command delimiter.
    zeebytes and DanBarry like this.

  2. #2
    Hein is offline Senior Member
    Join Date
    Dec 2007
    Location
    Nashua, NH - USA.
    Posts
    152
    Rep Power
    12
    Thank you Steve. Good info. Couple of remarks...

    - For Powershell one needs to use a backtick as escape for the semicolon: `;

    - The disconnect is just a waste of typing imho. At best it will distort the command status to become the status or the disconnect instead of the status of the last real command. loose - loose ?

    - Remote Connect is easier said than done, notably for Replicate V5
    ---- Need to change the service in RegEdit to allow for connections from anywhere (*) instead of localhost only! (stop/start)
    ---- Neeed to pick the right repctl matching the server version
    ---- The set serverpasswd need to be run? and be in-sync witoter processes.


    Execute should not table too long, unless you do NOT connect, in which case it happens 'in line'/

  3. #3
    elena is offline Junior Member
    Join Date
    May 2015
    Posts
    18
    Rep Power
    0

    just to confirm:

    to restart a stopped task that was performing change data capture (after a full load), it should be:
    repctl connect; execute task name 3 Flags=0; disconnect

    the Flags value is the one i'm questioning. what is the difference between the Resume and Fresh Start?

    the example above uses Flags=0, which is a resume, but the paramater is for both a full load and a change capture only..

    sorry for the confusion!

    thanks!

  4. #4
    stevenguyen is offline Senior Member
    Join Date
    May 2014
    Posts
    297
    Rep Power
    6
    Quote Originally Posted by elena View Post
    to restart a stopped task that was performing change data capture (after a full load), it should be:
    repctl connect; execute task name 3 Flags=0; disconnect

    the Flags value is the one i'm questioning. what is the difference between the Resume and Fresh Start?

    the example above uses Flags=0, which is a resume, but the paramater is for both a full load and a change capture only..

    sorry for the confusion!

    thanks!
    With your example command:


    repctl connect; execute task name 3 Flags=0; disconnect


    the 3 , full load and cdc , for job setting


    the flag=0 , would be a resume, not a restart load.

  5. #5
    Hein is offline Senior Member
    Join Date
    Dec 2007
    Location
    Nashua, NH - USA.
    Posts
    152
    Rep Power
    12
    >> difference between the Resume and Fresh Start

    Huge difference.

    Resume picks up the last saved STATE from files like: ...
    data\tasks\<taskname>\StateManager\ars_saved_state _000001.sts
    It then continues reading changes exactly from the point of which it stopped (LSN, SCN, Context,....) and continues to apply any pending changes from the .TSWP files

    Fresh start, starts fresh. It clears out anything left from a prior run, re-reads the table-descriptions performing a 'fake' 0-row full-load in the process.
    Typically fresh starts is used with a cdcposition=timestamp:yyyy-mm-ddThh:mm:ss

    The line "]I: Task 'xxxxx' running" in the first 10 lines of the reptask_xxxxxx.log file reflect the option last used.

    hth,
    Hein





  6. #6
    SriVathsa is offline Junior Member
    Join Date
    Apr 2018
    Posts
    3
    Rep Power
    0
    Is there a list of task Status:
    I've seen STOPPED, STOPPING, RUNNING. Is there a consolidated list of statuses?

    thanks
    sri

  7. #7
    stevenguyen is offline Senior Member
    Join Date
    May 2014
    Posts
    297
    Rep Power
    6
    Quote Originally Posted by SriVathsa View Post
    Is there a list of task Status:
    I've seen STOPPED, STOPPING, RUNNING. Is there a consolidated list of statuses?

    thanks
    sri
    I Have not seen one.

  8. #8
    Hein is offline Senior Member
    Join Date
    Dec 2007
    Location
    Nashua, NH - USA.
    Posts
    152
    Rep Power
    12
    Quote Originally Posted by SriVathsa View Post
    Is there a list of task Status:
    I've seen STOPPED, STOPPING, RUNNING. Is there a consolidated list of statuses?

    thanks
    sri
    Sure. Ask for the command help in REPCTL -

    Code:
    >repctl -d x:\data gettaskstatus ?command gettaskstatus:
        request arguments:
    
    
        task:required string
    
    
        response arguments:
        task_status:required structure {
            name:required string
            state:required enum, valid values:
                    00 - STOPPED
                    01 - STARTING
                    02 - RUNNING
                    03 - PAUSED
                    04 - STOPPING
                    05 - ERROR
                    06 - NOT_EXIST
                    07 - RECOVERY

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •