In this Document
Applies to:Oracle Server - Enterprise Edition - Version: 9.2.0.1 to 11.2.0.2 - Release: 9.2 to 11.2 SymptomsThis article will help in the situation where capture process gets stuck on waiting for some of the archive log which is either missing or are deleted. ChangesCauseArchive logs might get deleted by the RMAN job or less value for the retention policy. SolutionStreams works on the concept of redo data mining. The redo logs can be archived in the form. of archive logs. Streams capture process mine these archives and replicate all the underlying actions/operations.
Check the capture process status:
SQL> SELECT CAPTURE_NAME, STATE FROM V$STREAMS_CAPTURE; Capture_Name State ------------------- ------- STREAMS_CAPTURE WAITING FOR REDO: LAST SCN MINED 10404900045757 Note.471713.1 “Different States of Capture & Apply Process.”
A) When MISSING archivelogs CAN be restored. i) Get all the archive logs required for the capture process to get restarted :
Refer :
Note.290143.1 "Minimum Achived Log Necessary to Restart 10g and 11g Streams Capture Process". Or simply query : SQL> SELECT THREAD#, NAME, SEQUENCE# FROM V$ARCHIVED_LOG WHERE 10404900045757 BETWEEN FIRST_CHANGE# AND NEXT_CHANGE#; Note.735976.1 "All Replication Configuration Views For Streams, AQ, CDC and Advanced Replication"
Example:
RMAN> run { set archivelog destination to ‘/tmp’; restore archivelog from logseq=60 until logseq=70; }
SQL> ALTER DATABASE REGISTER LOGICAL LOGFILE
'Full Path & File_name' FOR ''; Example : --------- ALTER DATABASE REGISTER LOGICAL LOGFILE '/oracle/logs_from_dbs1/1_10_456789.dbf' FOR 'strms_capture';
In some cases the following Bugs may be applicable:
Bug 5278539 Bug 5602452 Both are fixed in 10.2.0.4 and above. B) When MISSING archivelogs CANNOT be restored.
NOTE: There is no way that the capture process can skip these missing archive logs and jump to the next available archive log. Streams gets stuck when the archve logs are not available.
exec DBMS_CAPTURE_ADM.STOP_CAPTURE('');
exec DBMS_APPLY_ADM.STOP_APPLY(''); exec DBMS_CAPTURE_ADM.DROP_CAPTURE('') exec DBMS_APPLY_ADM.DROP_APPLY(''); iii). Manually re-sync both the databases by using exp/imp utility or TTS or RMAN.
Refer:
Note.550955.1 "Instantiating Objects in a 10g Streams Using Original Export/Import and Data Pump Export/Import - Example" Note.551106.1 "Instantiating Objects in Streams Using Transportable Tablespace or RMAN" iv). Create the capture and apply process. v). Perform. instantiation.
On the Source DB
============ begin DBMS_CAPTURE_ADM.PREPARE_SCHEMA_INSTANTIATION(''); end; / set serveroutput on DECLARE iscn NUMBER; BEGIN iscn := DBMS_FLASHBACK.GET_SYSTEM_CHANGE_NUMBER(); DBMS_OUTPUT.PUT_LINE ('Instantiation SCN is: ' || iscn); END; / On the Target DB =========== BEGIN DBMS_APPLY_ADM.SET_SCHEMA_INSTANTIATION_SCN( source_schema_name => '', source_database_name => '', recursive => TRUE, instantiation_scn => &iscn); <== iscn from the Source DB. END; / Note.429543.1 "Purpose of Instantiation in Streams Environment"
exec DBMS_CAPTURE_ADM.START_CAPTURE('');
exec DBMS_APPLY_ADM.START_APPLY('');
Refer
Note.729860.1 "Troubleshooting Queries in Streams"
ReferencesNOTE:273674.1 - Streams Configuration Report and Health Check Script |
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/611609/viewspace-712771/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/611609/viewspace-712771/