How Tags are used in Streams
For example, the following procedure can be
used to set the tag to the hexadecimal value of 2A in the
current session:
BEGIN
DBMS_STREAMS.SET_TAG(tag => HEXTORAW('2A')
);
END;
/
After running this procedure, each redo
entry generated by DML or DDL statements in the current session
will have a tag value of 2A. Running this procedure affects only
the current session.
The tag for all redo entries generated by
the current session can be retrieved by using the get_tag
procedure in the dbms_streams package. For example, to
get the hexadecimal value of the tags generated in the redo
entries for the current session, use the following SQL block:
SET SERVEROUTPUT ON
DECLARE
raw_tag RAW(2000);
BEGIN
raw_tag := DBMS_STREAMS.GET_TAG();
DBMS_OUTPUT.PUT_LINE('Session Tag Value = '
|| RAWTOHEX(raw_tag));
END;
/