Wednesday, March 14, 2012

waiting for dictionary redo first scn

Capture status : Streams Waiting for dictionary first scn


Example :

Capture is waiting on redo log file with SCN 5611274208824
Capture

The First SCN 5611441137818
Start SCN 5611441137818

Applied Scn 5611441373264
Required SCN 5611441137818

You can get the above information from enterprise manager
Maintenance -> Stream -> management -> capture (choose capture name and edit).

Note : 
1-Applied Scn +  Required SCN : you can't change them (read only).






2-Set First SCN + Start SCN same as Required SCN .


 [Document 313279.1] Master Note for Troubleshooting Streams capture 'WAITING For REDO' or INITIALIZING


ACTION Plan #1 :

A) Restore archived redo logs starting with sequence   
B) If you can not restore logs, then capture must be droppend and recreated.
Note 471695.1 - Required Steps to Recreate a Capture Process

You should be running dbms_capture_adm.build on a regular basis to allow you to rebuild capture without having to resync.


ACTION Plan #2 :

look at the output from below sql and ensure that ALL logs (by time) are online and available.



++ Registered Log Files for Capture ++
COLUMN CONSUMER_NAME HEADING 'Capture|Process|Name' FORMAT A15
COLUMN SOURCE_DATABASE HEADING 'Source|Database' FORMAT A10
COLUMN SEQUENCE# HEADING 'Sequence|Number' FORMAT 999999
COLUMN NAME HEADING 'Archived Redo Log|File Name' format a35
column first_scn HEADING 'Archived Log|First SCN'
COLUMN FIRST_TIME HEADING 'Archived Log Begin|Timestamp'
column next_scn HEADING 'Archived Log|Last SCN'
COLUMN NEXT_TIME HEADING 'Archived Log Last|Timestamp'
COLUMN MODIFIED_TIME HEADING 'Archived Log|Registered Time'
COLUMN DICTIONARY_BEGIN HEADING 'Dictionary|Build|Begin' format A6
COLUMN DICTIONARY_END HEADING 'Dictionary|Build|End' format A6
COLUMN PURGEABLE HEADING 'Purgeable|Archive|Log' format a9

SELECT r.CONSUMER_NAME,
r.SOURCE_DATABASE,
r.SEQUENCE#,
r.NAME,
r.first_scn,
r.FIRST_TIME,
r.next_scn,
r.next_time,
r.MODIFIED_TIME,
r.DICTIONARY_BEGIN,
r.DICTIONARY_END,
r.purgeable
FROM DBA_REGISTERED_ARCHIVED_LOG r, DBA_CAPTURE c
WHERE r.CONSUMER_NAME = c.CAPTURE_NAME
AND r.SEQUENCE# > 48056
ORDER BY source_database, consumer_name, r.first_scn;


After verifying that all those logs are available, then for capture , advance first/start snc
login to strmadmin
exec dbms_capture_adm.alter_capture('capture-name',first_scn=>same as the above);
exec dbms_capture_adm.alter_capture('capture-name',start_scn=>same as the above);

Verify
SELECT CAPTURE_NAME, FIRST_SCN, START_SCN, APPLIED_SCN, REQUIRED_CHECKPOINT_SCN FROM ALL_CAPTURE;

Restart capture.



 ##To check if SCN changed :

SELECT SUBSTR(s.PROGRAM,INSTR(S.PROGRAM,'(')+1,4) PROCESS_NAME,
c.CAPTURE_NAME,
C.STARTUP_TIME,
c.SID,
c.SERIAL#,
c.STATE,
c.state_changed_time,
FROM gV$STREAMS_CAPTURE c, gV$SESSION s
WHERE c.SID = s.SID AND
c.SERIAL# = s.SERIAL#;


ACTION PLAN #3 : 

If the Missing Archivelog found on ASM but Capture can't see them you have to do the following :

ALTER DATABASE REGISTER LOGICAL LOGFILE '' FOR ''; 

OR

ALTER DATABASE REGISTER OR REPLACE LOGICAL LOGFILE 'PATH' FOR 'Capture-name';

Then Check By :

select name, sequence# from v$archived_log -- use gv$archived_log in RAC
where between FIRST_CHANGE# and NEXT_CHANGE#
order by name;



Hope this will be Useful for you
Finally Don't forget after you resolve the problem ro run this command once everyday to rebuild capture without having to resync

SQL> exec DBMS_CAPTURE_ADM.BUILD;


Check This Link : Stream Capture


 Thank you
Osama Mustafa
Oracle Database Consultant


 

3 comments:

  1. I am really impressed from this post! The person who created this post is a generous and knows how to keep the readers connected.Thank you. Please keep on posting.

    Sol
    www.gofastek.com

    ReplyDelete
  2. Thanks for the post, just wondering about this line in action plan 2
    AND r.SEQUENCE# > 48056
    what should I be using in my case ?

    ReplyDelete
  3. This is really interesting and knowledgeable. Thanks for sharing. I really appreciate it a lot. Please do more blogs in the future. Thank you and God bless to the blogger!

    www.imarksweb.org

    ReplyDelete