Topic
  • 5 replies
  • Latest Post - ‏2013-02-07T15:28:21Z by Rphilo
AbhilashJoseph
AbhilashJoseph
36 Posts

Pinned topic Table Capture Point for mirroring

‏2013-02-06T03:21:03Z | idr-cdc
Hi
When we use capture point for mirroring what SCN is captured .In other words from what SCN point will the mirroring start for the particular table, is it the current SCN in when the command is run or is it the SCN of the subscription?
 
We have a condition where we cannot refresh from source tables(interface agreement) and can only read logs but I want to be mirroring from an SCN point (timestamp) which can be set by using setbookmark command.However I do not see any commands to capture bookmark to start mirroring from an SCN point 
 I read from documentation that mirroring will only start from capture point and all entries from where scrapper started to capture point will be ignored (refer below).
Source is Oracle 10g and Target is Oracle 10g 
 
 "Table capture point: This bookmark is the commit point in the database from
which operations for the table that has its capture point marked are
processed. All changes that are committed after the marked point are
replicated. The table capture point is set when you run the mark table
capture point routine for a table in a subscription. When the subscription is
restarted after marking the table capture point, it resumes from its
(subscription) bookmark position. However, changes to tables that have their
table capture point marked are ignored until the log scraper advances and
reaches the capture point. Each table can have its own table capture point;
they do not have to correspond."
 
 
Updated on 2016-08-14T15:40:27Z at 2016-08-14T15:40:27Z by Ken Motilall
  • Rphilo
    Rphilo
    565 Posts

    Re: Table Capture Point for mirroring

    ‏2013-02-07T06:03:03Z  
     Abhilash
     
    The -a flag for dmsetbookmark command explicitly overrides mark table capture point, so if you do mark capture point at 200, then do dmsetbookmark at 100, CDC will start scraping the log at 100 and will start capturing transactions at 200.
     
    Regards
     
    Robert
  • AbhilashJoseph
    AbhilashJoseph
    36 Posts

    Re: Table Capture Point for mirroring

    ‏2013-02-07T07:01:39Z  
    • Rphilo
    • ‏2013-02-07T06:03:03Z
     Abhilash
     
    The -a flag for dmsetbookmark command explicitly overrides mark table capture point, so if you do mark capture point at 200, then do dmsetbookmark at 100, CDC will start scraping the log at 100 and will start capturing transactions at 200.
     
    Regards
     
    Robert
     Hi robert
    my doubt is exactly about how do I specify table capture point.
    i can't see an option to force capture point to an SCN all I can do is right click and set capture point 
     
     
    Updated on 2013-02-07T07:01:39Z at 2013-02-07T07:01:39Z by AbhilashJoseph
  • Rphilo
    Rphilo
    565 Posts

    Re: Table Capture Point for mirroring

    ‏2013-02-07T07:11:32Z  
     Hi robert
    my doubt is exactly about how do I specify table capture point.
    i can't see an option to force capture point to an SCN all I can do is right click and set capture point 
     
     
     HI Abhilash
     
    You would use mark capture point and dmsetbookmark -a together in your case..
     
    Thanks
     
    Robert
  • AbhilashJoseph
    AbhilashJoseph
    36 Posts

    Re: Table Capture Point for mirroring

    ‏2013-02-07T08:31:05Z  
    • Rphilo
    • ‏2013-02-07T07:11:32Z
     HI Abhilash
     
    You would use mark capture point and dmsetbookmark -a together in your case..
     
    Thanks
     
    Robert
     Hi Robert 
     
    Sorry I am lost again . How can i force capture point to be SCN of 200 for a table in the above example? . I am clear about setting bookmark at subcription level to 100 by dmsetbookmark
     
    Regards
    Abhilash  
  • Rphilo
    Rphilo
    565 Posts

    Re: Table Capture Point for mirroring

    ‏2013-02-07T15:28:21Z  
     Hi Robert 
     
    Sorry I am lost again . How can i force capture point to be SCN of 200 for a table in the above example? . I am clear about setting bookmark at subcription level to 100 by dmsetbookmark
     
    Regards
    Abhilash  
     Abhilash
     
    Sorry reading my first reply, this is confusing,
     
    If you have the subscription bookmark set to SCN 100 (either because that is where replication ended and hence is the value in TS_BOKMARK on the target database CDC schema, or because you have explicitly done dmsetbookmark), the log-reading processes will start at SCN. If you have performed mark table capture point at the time that the SCN is 200, the the log-reading processes will ignore any transactions it finds for the tables where the mark has been done until SCN 200 is reached, at which point transactions will be replicated as normal.
     
    If you need to perform the mark table capture point AND you want all transactions from the subscription bookmark to be processed (i..e between SCNs 100 and 199 in the example) then you will need to execute the dmsetbookmark with the -a flag.
     
    You are correct in saying that there is no way to tell CDC to ignore transactions before an explicit SCN, only by performing the mark at the correct time. However if you perform the mark table capture point and then set the bookmark with the -a flag you will then get replication for all tables to start at the desired SCN.
     
    If you are using Oracle as the source you can use the -l flag (lower case ell) to specify a position in SCN instead of the -b flag commonly used to specify a bookmark in hex format derived from the target. With the -l flag you have to specify the SCN in a specific manner which reflects how the CDC bookmarks store various apply points, with internal positions to provide more granularity than provided by a simple SCN. This format is "SCN;SCN.0.0.0.0.0;SCN.0.0.0.0.0.0" as in the following script:
     
    #  Set journal position for $1 subscription to $2 position

    # echo script heading
    echo "--Set journal position": $1

    #Check 2 parameters passed
    if [ -z $1 ]
    then
    echo ">>>Please specify the subscription to process"
    echo ">>>Usage: setjrnpos subscription new_journal_position"
    exit 1
    fi

    if [ -z $2 ]
    then
    echo ">>>Please specify the subscription and new journal position"
    echo ">>>Usage: $0 subscription new_journal_position"
    exit 1
    fi

    # Convert lower case to upper case

    CDC_PIPE=`echo $1 | tr '[:lower:]' '[:upper:]'`

    # Put bookmark is correct format

    NEWAPPPOS=`echo """$2;$2.0.0.0.0.0;$2.0.0.0.0.0.0"""`

    echo "--Actual position :" $NEWAPPPOS

    # Perform  dmsetbookmark

    cd $CDCHOME

    cd bin

    ./dmsetbookmark -I CDCINST -s $CDC_PIPE -l $NEWAPPPOS
     
     note first flag is minus capital eye, last flag is minus small ell
     
    Regards
     
    Robert