{"id":9,"date":"2013-11-13T08:59:00","date_gmt":"2013-11-13T08:59:00","guid":{"rendered":"http:\/\/anjo.pt\/wp\/keyword-oracle\/2013\/11\/13\/goldengate-scn-translation\/"},"modified":"2015-11-17T20:27:23","modified_gmt":"2015-11-17T19:27:23","slug":"goldengate-scn-translation","status":"publish","type":"post","link":"https:\/\/anjo.pt\/keyword-oracle\/2013\/11\/13\/goldengate-scn-translation\/","title":{"rendered":"GoldenGate &#8211; SCN translation"},"content":{"rendered":"<p>On GoldenGate when you do &#8220;SEND &lt;extract&gt; status&#8221; you get a SCN field which does not correspond to the database SCN:<br \/>\n<span style=\"font-family: Courier New, Courier, monospace;\">GGSCI&gt; send e_test status<br \/>Sending STATUS request to EXTRACT E_TEST &#8230;<br \/>EXTRACT E_TEST (PID 9372244)<br \/>Current status: Recovery complete: Processing data<br \/>Current read position:<br \/>Redo thread #: 1<br \/>Sequence #: 198315<br \/>RBA: 335376<br \/>Timestamp: 2013-11-11 16:11:57.000000<br \/><b style=\"background-color: orange;\">SCN: 78.924145222<\/b><br \/>Current write position:<br \/>Sequence #: 1548<br \/>RBA: 401683<br \/>Timestamp: 2013-11-11 16:12:31.811533<br \/>Extract Trail: \/acfs\/goldengate\/dirdat\/test\/tt<\/span><\/p>\n<div>\n<span style=\"font-family: Courier New, Courier, monospace;\"><br \/><\/span><\/div>\n<p><span style=\"font-family: Courier New, Courier, monospace;\">SQL&gt; select current_scn from v$database;<br \/>CURRENT_SCN<br \/>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>335931612762<\/span><\/p>\n<div>\n<span style=\"font-family: Courier New, Courier, monospace;\"><br \/><\/span><\/div>\n<p>To translate that SCN into the database SCN there is the calculation to make:<\/p>\n<div>\n<span style=\"font-family: Courier New, Courier, monospace;\"><br \/><\/span><\/div>\n<p><span style=\"font-family: Courier New, Courier, monospace;\">78 * (2^32) + 924145222 = 335931594310<\/span>or with a hexadecimal translation:<br \/>\n<span style=\"font-family: Courier New, Courier, monospace;\">78 to hexa &nbsp; &nbsp; &nbsp; &nbsp;==&gt; 4E<br \/>924145222 to hexa ==&gt; 37155646<\/span><\/p>\n<div>\nConcatenate both and then<br \/>\n<span style=\"font-family: 'Courier New', Courier, monospace;\">4E37155646 to decimal ==&gt; 335931594310<\/span><\/div>\n<div>\n<span style=\"font-family: 'Courier New', Courier, monospace;\"><br \/><\/span><\/div>\n<p>Well, with the most recent versions of GoldenGate you can simply to &#8220;INFO &lt;extract&gt;&#8221; and you get the database SCN between parentheses.<\/p>\n<div>\n<\/div>\n<div>\n<div>\n<span style=\"font-family: Courier New, Courier, monospace;\">GGSCI&gt; info e_test<\/span><\/div>\n<div>\n<span style=\"font-family: Courier New, Courier, monospace;\">EXTRACT &nbsp;E_TEST &nbsp;Last Started 2013-11-13 08:08 &nbsp; Status RUNNING<\/span><\/div>\n<div>\n<span style=\"font-family: Courier New, Courier, monospace;\">Checkpoint Lag &nbsp; &nbsp; &nbsp; 00:00:00 (updated 00:00:04 ago)<\/span><\/div>\n<div>\n<span style=\"font-family: Courier New, Courier, monospace;\">Log Read Checkpoint &nbsp;Oracle Redo Logs<\/span><\/div>\n<div>\n<span style=\"font-family: Courier New, Courier, monospace;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 2013-11-13 09:57:40 &nbsp;Seqno 200447, RBA 16256592<\/span><\/div>\n<div>\n<span style=\"font-family: Courier New, Courier, monospace;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"background-color: orange;\">SCN 78.1163096680 (336170545768)<\/span><\/span><\/div>\n<\/div>\n<div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>On GoldenGate when you do &#8220;SEND &lt;extract&gt; status&#8221; you get a SCN field which does not correspond to the database SCN: GGSCI&gt; send e_test statusSending STATUS request to EXTRACT E_TEST &#8230;EXTRACT E_TEST (PID 9372244)Current status: Recovery complete: Processing dataCurrent read position:Redo thread #: 1Sequence #: 198315RBA: 335376Timestamp: 2013-11-11 16:11:57.000000SCN: 78.924145222Current write position:Sequence #: 1548RBA: 401683Timestamp: [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,6],"tags":[],"class_list":{"0":"post-9","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-goldengate","7":"category-oracle","8":"czr-hentry"},"_links":{"self":[{"href":"https:\/\/anjo.pt\/keyword-oracle\/wp-json\/wp\/v2\/posts\/9","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/anjo.pt\/keyword-oracle\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/anjo.pt\/keyword-oracle\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/anjo.pt\/keyword-oracle\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/anjo.pt\/keyword-oracle\/wp-json\/wp\/v2\/comments?post=9"}],"version-history":[{"count":1,"href":"https:\/\/anjo.pt\/keyword-oracle\/wp-json\/wp\/v2\/posts\/9\/revisions"}],"predecessor-version":[{"id":158,"href":"https:\/\/anjo.pt\/keyword-oracle\/wp-json\/wp\/v2\/posts\/9\/revisions\/158"}],"wp:attachment":[{"href":"https:\/\/anjo.pt\/keyword-oracle\/wp-json\/wp\/v2\/media?parent=9"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/anjo.pt\/keyword-oracle\/wp-json\/wp\/v2\/categories?post=9"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/anjo.pt\/keyword-oracle\/wp-json\/wp\/v2\/tags?post=9"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}