Data Replication 2
Results 1 to 1 of 1

Thread: How to reload individual table(s) for a full-load-only tasks using Perl or PowerShell

  1. #1
    Hein is offline Senior Member
    Join Date
    Dec 2007
    Location
    Nashua, NH - USA.
    Posts
    163
    Rep Power
    12

    How to reload individual table(s) for a full-load-only tasks using Perl or PowerShell

    Sometimes it is desirable to reload an individual table, but not all tables.

    For a RUNNING CDC tasks, that is enabled for APPLY or STORE changes, one can use the MONITOR - FULL-LOAD page,
    select the COMPLETED (or ALL) view, select (highlight) the desired table(s) and select the [RELOAD] option.

    A Full-Load-Only tasks stops running once the full load is completed and a resume will immediately stop when all tables are loaded.
    Thus the operator is not given a chance to select a table for reload.

    The solution is to manipulate the Replicate Internal table status SQLite database to clear the status for the table(s) to be reloaded.
    This is currently NOT a supported operation as such.
    Attunity reserves the right to change the table name, column name and status interpretation.
    But what's the worst that could happen ?! :-)

    The database needed it stored in the TASK_TABLES.SQLITE file in the TASK directory.
    For example: 'C:\Program Files\Attunity\Replicate\data\tasks\my-task\task_tables.sqlite'

    The status is the column 'table_status' in the 'tables_status' where the 'name' column matched the table name.

    One way to clear this column is simply using the SQLITEBROWSER

    Or one can use the SQLITE Powershell module
    Code:
    Import-Module sqlite
    $TaskName = 'my-task'
    $TableName = 'my-table'
    $drive = new-psdrive -name my_task -psp SQLite -root "Data Source=$DataDirectory\tasks\$TaskName\task_tables.sqlite"
    set-item my_task:\tables_status -filter "name='$TableName'" -value @{ table_status = 0 }
    Once the status is cleared, just RESUME the full-load-only task with the GUI or using REPCTL EXECUTE
    Presto!

    Attached a PERL script using the DBI module to change the status column, as well as a POWERSHELL script

    Enjoy,
    Hein.
    Attached Files Attached Files

Tags for this Thread

Posting Permissions

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