Oracle Streams for Customized Replication

Oracle uses a variety of technologies to keep multiple copies of databases available for business needs. Some of these technologies include Oracle Data Guard, Oracle Streams, Real Application Clusters, and use of third-party vendor products like GoldenGate. While Oracle Data Guard is useful in many common replication scenarios, we may need to implement a bit more flexible solution for a host of other applications.

Oracle Streams helps us to design information-sharing solutions with multi-master replication between data sources, fine-grained replication, many-sources-to-one centralized source replication, message queuing, and so on. When we deploy Streams, we convert the information to units or messages and share these messages within the stream. This stream will propagate information from one database to another or within the same database. Streams can also propagate from or to a single data source and multiple databases, and even to non-Oracle databases. Streams can also enable bi-directional replication between databases to keep two databases in synchronization, with each of them getting updates from different sources.

The common stages in an Oracle Streams configuration are capture, propagate (staging), and apply (consumption).  The database administrator can control which messages get into a Stream, how it propagates, and how it terminates at the destination.  We can fine-tune the Streams to capture user messages, data definition language changes (changes to database objects), and data manipulation language changes (insert/update/delete operations) at the database level.  There are two forms of data capture–implicit and explicit. For implicit data capture, the database server captures DML and DDL events at the source database, while for explicit capture, applications generate capturing events.  On capturing the data, the changes are formatted as a logical change record (LCR) and placed in the staging area. The staging area is a holding area to store and manage these captured events. Oracle uses subscriber applications to review the contents of the staging area and decide if the data should be applied to the destination (subscriber) database or not.  If the message is needed, it will be propagated to the other staging area at the subscriber location. These are consumed by the apply engine at the other subscriber database. Oracle streams can be controlled from the command line prompt or by the Streams tool in the Oracle Enterprise Manager Console.

Oracle Streams offers various benefits over other forms of data replication and data protection. Streams lets the database administrator to plan for database upgrades, migrations, and patches with very little downtime. It also works across database environments in heterogeneous platforms. We can have different database character sets across the databases as well as controlled information sharing among various databases on multiple platforms. Oracle Data Guard is built over the feature of Streams to create and maintain logical standby database.