Splitting and Merging of a Destination - Oracle 11g

As with any kind of day-to-day operational support, rare but unfortunate situations will arise where the target server or database incurs an outage. In a hub-and-spoke configuration,if a destination in a Streams replication environment becomesunavailable,it can cause file system issues or possible performance degradations on the source system.

Splitting a Stream

For such situations, DBAs can split (temporarily offline) the unavailable destination from a Stream configuration using the DBMS_STREAMS_ADM. SPLIT_STREAMSprocedure.The split_streams procedure creates cloned capture queue and processes on the source.In addition,a propagation is created with a disabled status. The split_streams procedure has these parameters:

PROCEDURE split_streams (
propagation_name IN VARCHAR2,
cloned_propagation_name IN VARCHAR2 DEFAULT NULL,
cloned_queue_name IN VARCHAR2 DEFAULT NULL,
cloned_capture_name IN VARCHAR2 DEFAULT NULL,
perform_actions IN BOOLEAN DEFAULT TRUE,
script_name IN VARCHAR2 DEFAULT NULL,
script_directory_object IN VARCHAR2 DEFAULT NULL,
auto_merge_threshold IN NUMBER DEFAULT NULL,
schedule_name IN OUT VARCHAR2,
merge_job_name IN OUT VARCHAR2);

The AUTO_MERGE_THRESHOLD is by default set to NULL or 0,which means the split stream is not automatically merged back with the original stream. If the result of CAPTURE_MESSAGE_CREATE_TIME in the V$STREAMS_CAPTURE view is within seconds of the AUTO_MERGE_THRESHOLD of the split_streams procedure with the original capture process,the two streams are automatically merged.

Merging the Streams

Once the issue on the target is resolved, you can merge the split stream back with the original stream using the merge_streams procedure in the same package:

PROCEDURE merge_streams (
cloned_propagation_name IN VARCHAR2,
propagation_name IN VARCHAR2 DEFAULT NULL,
queue_name IN VARCHAR2 DEFAULT NULL,
perform_actions IN BOOLEAN DEFAULT TRUE,
script_name IN VARCHAR2 DEFAULT NULL,
script_directory_object IN VARCHAR2 DEFAULT NULL);

As mentioned, this merge can be automated by setting the auto_merge_threshold parameter of the split_streams procedure to a nonzero value.

Once a fault is detected at a target destination, you can query theV$BUFFERED_QUEUES view to identify how many messages are in a buffered queue and how many of these messages have spilled to disk.

Merge Streams Job

You can use the merge_streams_job procedure when you need to determine whether the original capture and cloned capture processes are in the range of the specified merge threshold.If the threshold is within the range, then the merge_streams procedure is executed to merge the two streams.

PROCEDURE merge_streams_job (
capture_name IN VARCHAR2,
cloned_capture_name IN VARCHAR2,
merge_threshold IN NUMBER,
schedule_name IN VARCHAR2 DEFAULT NULL,
merge_job_name IN VARCHAR2 DEFAULT NULL);

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Oracle 11g Topics