XStream provides a flexible infrastructure for sharing information between Oracle data sources and non-Oracle data sources. Therefore, you can use XStream in many different ways to meet the needs of various organizations. This chapter describes the most common use cases for XStream.
This chapter contains these topics:
See Also:
Each XStream use case in this chapter contains three main elements:
A general description of the use case as it applies to both XStream Out and XStream In
A specific scenario for XStream Out
A specific scenario for XStream In
In some cases, a section includes a reference to sample code in the Oracle Database installation that illustrates a scenario.
In each XStream Out use case, the following components and actions send Oracle Database changes to a client application:
Oracle Streams captures data changes made to an Oracle database.
Oracle Streams sends these changes, in the form of logical change records (LCRs), to an outbound server.
The outbound server sends the LCRs to a client application.
How the client application processes the LCRs is different for each use case.
See Also:
"XStream Out"In each XStream In use case, the following components and actions send Oracle Database changes to an inbound server:
A client application gathers data changes from an external data source and sends them to an inbound server in the form of LCRs.
The inbound server receives the LCRs from a client application.
The inbound server can apply the data changes to database objects in an Oracle database. The inbound server can also process the LCRs in a customized way.
How the client application gathers the data changes is different for each use case.
See Also:
"XStream In"You can configure a heterogeneous replication environment with XStream. Replication is generally used to improve availability and to improve performance by spreading the network load over multiple regions and servers. In a heterogeneous replication environment, data is replicated between databases from different vendors. See Oracle Streams Replication Administrator's Guide for common reasons to use replication.
XStream Out can send data changes made to an Oracle database to a non-Oracle database. Specifically, the client application connects to the outbound server and receives changes made to tables within the Oracle database. The client application then applies the data changes in the LCRs to the non-Oracle database. The client application can process the LCRs in any customized way before applying them.
XStream In can receive data changes made to a non-Oracle database. Specifically, the client application gathers the data changes made to the non-Oracle database, formats these changes into LCRs, and sends these LCRs to an inbound server. The inbound server applies the changes in the LCRs to the Oracle database.
Some environments use files to store data changes. Typically, files store data changes for the following reasons:
To process data changes in an environment that has no physical network or a limited physical network. For example, some locations do not have a physical network for security reasons.
To process data changes in an environment that uses disconnected computing. For example, a salesperson might fill orders on a laptop at various locations without a network connection, and then update a primary database over the network once a day.
To process data changes in an environment that uses satellite communications. In this case, a bulk transfer of files is more efficient than incremental changes over the network.
XStream Out can send Oracle Database changes to a file in a file system. Specifically, the client application writes the data changes in LCRs to the file. The client application can process the LCRs in any customized way before writing them to the file, and the file can reside on the computer system running the client application or on a different computer system. Using SQL generation, the client application can also write the SQL statement required to perform the change encapsulated in a row LCR to a file.
XStream In can send data changes from a file to an Oracle database. Specifically, the client application reads the data changes from the file and sends the changes, in the form of LCRs, to an inbound server.
A demo is available that creates sample client applications that perform file-based replication using the XStream APIs. Specifically, at one database, the demo creates an XStream Out configuration that captures database changes and sends the LCRs to an outbound server. A client application attaches to the outbound server and writes the database changes to a file.
At a different database, the demo creates an XStream In client application that attaches to an inbound server, reads the changes in the file, and sends them in the form of LCRs to the inbound server. The inbound server applies the changes to the database objects at the destination database.
This demo is available in the following location:
$ORACLE_HOME/rdbms/demo/xstream/fbr
Some environments cache data in memory to improve performance. Cached data can provide low response times and high throughput for systems that require the best possible performance. XStream can share data changes incrementally with a client side memory cache.
XStream Out can incrementally refresh a client-side memory cache by sending Oracle database changes to a memory cache. Specifically, the client application applies the data changes in the LCRs to the memory cache. The client application can process the LCRs in any customized way before applying them, and the memory cache can reside on the computer system running the client application or on a different computer system.
XStream In can incrementally retrieve data changes from a memory cache. Specifically, the client application retrieves the data changes and sends the changes, in the form of LCRs, to an inbound server. The memory cache can reside on the computer system running the client application or on a different computer system.