Oracle® Database XStream Guide 11g Release 2 (11.2) Part Number E15874-01 |
|
|
View PDF |
With XStream, an Oracle Streams apply process can function as an outbound server or an inbound server. Therefore, you can troubleshoot outbound servers and inbound servers in the same way that you troubleshoot apply processes. In addition, an XStream Out environment includes capture processes and queues, and might include other Oracle Streams components, such as propagations, rules, and rule-based transformations. To troubleshoot these components, see the troubleshooting documentation in Oracle Streams Concepts and Administration.
The following topics describe troubleshooting problems that are related specifically to XStream:
Is an OCI Client Application Unable to Attach to the Outbound Server?
Are Changes Failing to Reach the Client Application in XStream Out?
Are LCRs Streaming from an Outbound Server Missing Extra Attributes?
See Also:
If a client application cannot attach to an outbound server using the Oracle Call Interface (OCI) OCIXStreamOutAttach()
function, then the following conditions might be causing the problem:
The client application is not connected to the outbound server's database as the outbound server's connect user. The client application must connect to the database as the connect user before attaching to the outbound server.
The client application is not passing a service handle to the outbound server. Ensure that the client application is passing a service handle using the OCISvcCtx
and not OCIServer
.
In an XStream Out configuration, if database changes that should be captured and streamed to the client application are not reaching the client application, then the capture process might have fallen behind, or there might be problems with rules or rule-based transformations.
To determine the time when the capture process last created a logical change record (LCR) and the time when the capture process last enqueued an LCR, run the following query:
COLUMN CAPTURE_NAME HEADING 'Capture|Name' FORMAT A15 COLUMN CREATE_MESSAGE HEADING 'Last LCR|Create Time' COLUMN ENQUEUE_MESSAGE HEADING 'Last|Enqueue Time' SELECT CAPTURE_NAME, TO_CHAR(CAPTURE_MESSAGE_CREATE_TIME, 'HH24:MI:SS MM/DD/YY') CREATE_MESSAGE, TO_CHAR(ENQUEUE_MESSAGE_CREATE_TIME, 'HH24:MI:SS MM/DD/YY') ENQUEUE_MESSAGE FROM V$STREAMS_CAPTURE;
If the times returned are before the time when the database changes were made, then the capture process must catch up and capture the changes. Normally, the capture process will catch up on its own without the need for intervention.
Rules determine which logical change records (LCRs) are captured by a capture process, sent from a source queue to a destination queue by a propagation, and sent to a client application by an outbound server. If the rules are not configured properly, then the client application might not receive the LCRs it should receive. The client application might also receive LCRs that it should not receive.
Rule-based transformations modify the contents of LCRs. Therefore, if the expected change data is not reaching the client application, it might be because a rule-based transformation modified the data or deleted the data. For example, a DELETE_COLUMN
declarative rule-based transformation removes a column from an LCR.
Check the rules and rule-based transformations that are configured for each component in the stream from the capture process to the client application, and correct any problems.
If the capture process has not fallen behind, and there are no problems with rules or rule-based transformations, then LCRs might be blocked in the stream for some other reason. For example, a propagation or outbound server might be disabled, a database link might be broken, or there might be another problem.
You can track an LCR through a stream using one of the following methods:
Setting the message_tracking_frequency
capture process parameter to 1
or another relatively low value
Running the SET_MESSAGE_TRACKING
procedure in the DBMS_STREAMS_ADM
package
After using one of these methods, use the V$STREAMS_MESSAGE_TRACKING
view to monitor the progress of LCRs through a stream. By tracking an LCR through the stream, you can determine where the LCR is blocked.
See Also:
Oracle Streams Replication Administrator's Guide for more information about tracking LCRs through a stream
Oracle Database PL/SQL Packages and Types Reference for information about the message_tracking_frequency
capture process parameter
Logical change records (LCRs) can contain the following extra attributes related to database changes:
row_id
serial#
session#
thread#
tx_name
username
By default, a capture process does not capture these extra attributes. If you want extra attributes to be included in LCRs streamed from an outbound server to a client application, but the LCRs do not contain values for extra attributes, then make sure the capture process that captures changes for the outbound server is configured to capture values for the extra attributes.
To configure a capture process to capture one or more of these extra attributes, use the INCLUDE_EXTRA_ATTRIBUTE
procedure in the DBMS_CAPTURE_ADM
package.
If the client application is unresponsive, then the Streams pool size might be too small. Run the following query at the database that contains the outbound server or inbound server:
SELECT STATE FROM V$PROPAGATION_RECEIVER;
If the state is WAITING
FOR
MEMORY
, then consider increasing the Streams pool size.
You can also run the following query:
SELECT TOTAL_MEMORY_ALLOCATED/CURRENT_SIZE FROM V$STREAMS_POOL_STATISTICS;
If the value returned is 0.90 or greater, then consider increasing the Streams pool size.
For an outbound server that receives changes from a capture process that is running on the same database, you can also run the following query:
SELECT STATE FROM V$STREAMS_CAPTURE;
If the state is WAITING
FOR
BUFFER
QUEUE
TO
SHRINK
, then increase the Streams pool size.
You can increase the Streams pool size by modifying the STREAMS_POOL_SIZE
initialization parameter, or by modifying other initialization parameters related to memory.
Otherwise, if there is enough memory in the Streams pool, then check your client application for programming errors.
If an XStream In configuration cannot identify an inbound server, then the following error is returned:
ORA-26840: STREAMS unable to identify an apply for the source database "%s"
This error indicates that there are multiple subscribers to the queue used by the inbound server. Subscribers can include inbound servers, outbound servers, apply processes, and propagations.
To determine whether there are multiple subscribers to the inbound server's queue, run the following query on the inbound server's database:
SELECT APPLY_NAME SUBSCRIBER, QUEUE_NAME FROM DBA_APPLY UNION SELECT PROPAGATION_NAME, SOURCE_QUEUE_NAME FROM DBA_PROPAGATION ORDER BY QUEUE_NAME;
You can add a WHERE
clause to the query to limit the output to the inbound server's queue.
If the query returns more than one subscriber to the inbound server's queue, then reconfigure the subscribers so that the inbound server is the only subscriber.
See Also:
Chapter 3, "Configuring XStream"