Forum Stats

  • 3,770,919 Users
  • 2,253,183 Discussions
  • 7,875,654 Comments

Discussions

goldengate SCN

chandra_1986
chandra_1986 Member Posts: 285 Blue Ribbon
edited Jun 4, 2021 8:08AM in GoldenGate

Hi experts,



We need to write script to send SCN DETAILS AND DB TIMESTAMP when EXTRACT IS ABENDED --- EXTRACT for source DB


Any suggestions.

Answers

  • BluShadow
    BluShadow Member, Moderator Posts: 41,500 Red Diamond

    It's not quite clear what you're asking or what this has got to do with goldengate, but as you've tagged your post with PL/SQL I'm guessing you just want to know how to get the current timestamp and associated SCN?

    SQL> select systimestamp, timestamp_to_scn(systimestamp) from dual;
    
    
    SYSTIMESTAMP                                                                  TIMESTAMP_TO_SCN(SYSTIMESTAMP)
    --------------------------------------------------------------------------- --------------------------------
    03-JUN-21 08.30.19.839000 +01:00                                                               6007505491542
    
    
    

    Is that what you want?

    chandra_1986
  • chandra_1986
    chandra_1986 Member Posts: 285 Blue Ribbon

    Thanks experts,


    We need to first check the info all goldengate process then if extract is abended in source db:


    need to write script to send SCN DETAILS AND DB TIMESTAMP when EXTRACT IS ABENDED --- EXTRACT for source DB

  • BluShadow
    BluShadow Member, Moderator Posts: 41,500 Red Diamond

    @chandra_1986 I've moved your question over to the goldengate forum as I think your requirements are more specific to that than to SQL or PL/SQL itself.

  • user10126973
    user10126973 Member Posts: 126 Red Ribbon

    HI

    when extract abended just check the archive log sequence number from logdump

    with that sequence number check NEXT_CHANGE# from v$archivedlog

    Regards

    DR

  • ORASCN
    ORASCN Member Posts: 1,825 Gold Trophy

    Hi ,

    If this is an Integrated Extract, please check the below views to know the SCN values.

    DBA_CAPTURE

    CDB_CAPTURE


    Regards,

    Veera

  • chandra_1986
    chandra_1986 Member Posts: 285 Blue Ribbon

    Thanks experts,


    how can we automate it in script, any sample code will try to replicate it In prod env.

  • chandra_1986
    chandra_1986 Member Posts: 285 Blue Ribbon

    HI Experts, can you please update how can we acheive this,

  • Gururaj0-Oracle
    Gururaj0-Oracle Member Posts: 78 Employee

    This is how the script logic should be. You must run as a cronjob.

    --> Either poll the heartbeat table to check the Extract status or ggsci STATUS EXTRACT command.

    --> Then ggsci info <extract> detail to get the SCN


    Regards

    Gururaj