Oracle Streams Syed Muhammad Abid Azam FA-07-MS-0054
Agenda Background Overview of Streams Uses of Streams Architecture of Oracle Streams Heterogeneous Information Sharing Examples Of Streams Configurations
Background One of the challenges of today's distributed business environments is the sharing of information among a multitude of applications and databases. As the number of applications grows, you end up with several databases, which may even be from different vendors. Sharing information in such a complex and disparate environment can be demanding.  Oracle Streams provides a flexible infrastructure that businesses can use to simplify information sharing tasks.
Overview of Streams Oracle Streams  captures database changes at a source database, stages the changes, propagates the changes to one or more destination databases, and then applies the changes at the destination database(s). Using Oracle Streams, enterprise systems can capture, propagate, and apply information as follows:  Within an Oracle database Between two Oracle databases Among multiple Oracle databases Between an Oracle database and a non-Oracle database
Uses of Streams Oracle Streams are used for the following Message Queuing Oracle Streams Advanced Queuing (AQ) enables user applications to enqueue messages into  queue, propagate messages to subscribing queues, notify user applications that messages are ready for consumption, and dequeue messages at the destination.  Data Replication Streams can capture DML and DDL changes made to database objects and replicate those changes to one or more other databases. Data Warehouse Loading Data warehouse loading is a special case of data replication. Some of the most critical tasks in creating and maintaining a data warehouse include refreshing existing data, and adding new data from the operational databases. Streams components can capture changes made to a production system and send those changes to a staging database or directly to a data warehouse or operational data store
Architecture of Oracle Streams The architecture of Oracle Streams is very flexible. It contains three basic elements.     Capture Staging Consumption
Capture Process Changes made to database objects in an Oracle database are logged in the redo log to guarantee recoverability in the event of user error or media failure.  A capture process is an Oracle background process that scans the database redo log to capture DML and DDL changes made to database objects.  A capture process formats these changes into messages called Logical change record (LCR) and enqueues them into a queue Locally:  A local capture process runs at the source database and captures changes from the local source database redo log. Remotely at a downstream database A real-time downstream capture  configuration means that the log writer process (LGWR) at the source database sends redo data from the online redo log to the downstream database. At the downstream database, the redo data is stored in the standby redo log, and the capture process captures changes from the standby redo log. An archived-log downstream capture  configuration means that archived redo log files from the source database are copied to the downstream database, and the capture process captures changes in these archived redo log files.
Message Staging and Propagation Streams uses queues to stage messages for propagation or consumption. Propagations send messages from one queue to another, and these queues can be in the same database or in different databases. The queue from which the messages are propagated is called the source queue, and the queue that receives the messages is called the destination queue. There can be a one-to-many, many-to-one, or many-to-many relationship between source and destination queues. Propagation from a Source Queue to a Destiniaton Queue Explicit Enqueue and Dequeue of Messages in a Single Queue Explicit Enqueue, Propagation, and Dequeue of Message
Overview of the Apply Process An apply process is an Oracle background process that dequeues messages from a queue and either applies each message directly to a database object or passes the message as a parameter to a user-defined procedure called an apply handler. Apply handlers include message handlers, DML handlers, DDL handler, precommit handlers, and error handlers.
Heterogeneous Information Sharing In addition to information sharing between Oracle databases, Streams supports information sharing between Oracle databases and non-Oracle databases. Oracle to Non-Oracle Data Sharing Non-Oracle to Oracle Data Sharing
Oracle to Non-Oracle Data Sharing If an Oracle database is the source and a non-Oracle database is the destination, then the non-Oracle database destination lacks the following Streams mechanisms: A queue to receive messages An apply process to dequeue and apply messages To share DML changes, the Oracle database functions as a proxy and carries out some of the steps that would normally be done at the destination database. That is, the messages intended for the non-Oracle destination database are dequeued in the Oracle database itself, and an apply process at the Oracle database uses Heterogeneous Services to apply the messages to the non-Oracle database across a network connection through a gateway.
Non-Oracle to Oracle Data Sharing To capture and propagate changes from a non-Oracle database to an Oracle database, a custom application is required. It gets the changes made to the non-Oracle database by reading from transaction logs, using triggers, or some other method. The application must assemble and order the transactions and must convert each change into an LCR. Next, the application must enqueue the LCRs into a queue in an Oracle database by using the PL/SQL interface, where they can be processed by an apply process.
Examples Of Streams Configurations Streams Configuration in a Single Database
Streams Configuration Sharing Information Between Databases
Thank you

Oracle Streams

  • 1.
    Oracle Streams SyedMuhammad Abid Azam FA-07-MS-0054
  • 2.
    Agenda Background Overviewof Streams Uses of Streams Architecture of Oracle Streams Heterogeneous Information Sharing Examples Of Streams Configurations
  • 3.
    Background One ofthe challenges of today's distributed business environments is the sharing of information among a multitude of applications and databases. As the number of applications grows, you end up with several databases, which may even be from different vendors. Sharing information in such a complex and disparate environment can be demanding. Oracle Streams provides a flexible infrastructure that businesses can use to simplify information sharing tasks.
  • 4.
    Overview of StreamsOracle Streams captures database changes at a source database, stages the changes, propagates the changes to one or more destination databases, and then applies the changes at the destination database(s). Using Oracle Streams, enterprise systems can capture, propagate, and apply information as follows: Within an Oracle database Between two Oracle databases Among multiple Oracle databases Between an Oracle database and a non-Oracle database
  • 5.
    Uses of StreamsOracle Streams are used for the following Message Queuing Oracle Streams Advanced Queuing (AQ) enables user applications to enqueue messages into queue, propagate messages to subscribing queues, notify user applications that messages are ready for consumption, and dequeue messages at the destination. Data Replication Streams can capture DML and DDL changes made to database objects and replicate those changes to one or more other databases. Data Warehouse Loading Data warehouse loading is a special case of data replication. Some of the most critical tasks in creating and maintaining a data warehouse include refreshing existing data, and adding new data from the operational databases. Streams components can capture changes made to a production system and send those changes to a staging database or directly to a data warehouse or operational data store
  • 6.
    Architecture of OracleStreams The architecture of Oracle Streams is very flexible. It contains three basic elements.   Capture Staging Consumption
  • 7.
    Capture Process Changesmade to database objects in an Oracle database are logged in the redo log to guarantee recoverability in the event of user error or media failure. A capture process is an Oracle background process that scans the database redo log to capture DML and DDL changes made to database objects. A capture process formats these changes into messages called Logical change record (LCR) and enqueues them into a queue Locally: A local capture process runs at the source database and captures changes from the local source database redo log. Remotely at a downstream database A real-time downstream capture configuration means that the log writer process (LGWR) at the source database sends redo data from the online redo log to the downstream database. At the downstream database, the redo data is stored in the standby redo log, and the capture process captures changes from the standby redo log. An archived-log downstream capture configuration means that archived redo log files from the source database are copied to the downstream database, and the capture process captures changes in these archived redo log files.
  • 8.
    Message Staging andPropagation Streams uses queues to stage messages for propagation or consumption. Propagations send messages from one queue to another, and these queues can be in the same database or in different databases. The queue from which the messages are propagated is called the source queue, and the queue that receives the messages is called the destination queue. There can be a one-to-many, many-to-one, or many-to-many relationship between source and destination queues. Propagation from a Source Queue to a Destiniaton Queue Explicit Enqueue and Dequeue of Messages in a Single Queue Explicit Enqueue, Propagation, and Dequeue of Message
  • 9.
    Overview of theApply Process An apply process is an Oracle background process that dequeues messages from a queue and either applies each message directly to a database object or passes the message as a parameter to a user-defined procedure called an apply handler. Apply handlers include message handlers, DML handlers, DDL handler, precommit handlers, and error handlers.
  • 10.
    Heterogeneous Information SharingIn addition to information sharing between Oracle databases, Streams supports information sharing between Oracle databases and non-Oracle databases. Oracle to Non-Oracle Data Sharing Non-Oracle to Oracle Data Sharing
  • 11.
    Oracle to Non-OracleData Sharing If an Oracle database is the source and a non-Oracle database is the destination, then the non-Oracle database destination lacks the following Streams mechanisms: A queue to receive messages An apply process to dequeue and apply messages To share DML changes, the Oracle database functions as a proxy and carries out some of the steps that would normally be done at the destination database. That is, the messages intended for the non-Oracle destination database are dequeued in the Oracle database itself, and an apply process at the Oracle database uses Heterogeneous Services to apply the messages to the non-Oracle database across a network connection through a gateway.
  • 12.
    Non-Oracle to OracleData Sharing To capture and propagate changes from a non-Oracle database to an Oracle database, a custom application is required. It gets the changes made to the non-Oracle database by reading from transaction logs, using triggers, or some other method. The application must assemble and order the transactions and must convert each change into an LCR. Next, the application must enqueue the LCRs into a queue in an Oracle database by using the PL/SQL interface, where they can be processed by an apply process.
  • 13.
    Examples Of StreamsConfigurations Streams Configuration in a Single Database
  • 14.
    Streams Configuration SharingInformation Between Databases
  • 15.