Oracle Streams Foundation: Communication process

Source: Internet
Author: User
Tags message queue requires advantage

This section mainly describes the workflow of communication, as well as some related features (processing logic), the content is equally boring, but think twice about the value of reading. In the entire streams replication environment, the propagation process is responsible for copying the source-side modification queues to the target database.

1. LCR Segmentation

Streams passes messages through a queue segment. Queues of type Anydata can be used to segment almost all types of messages, and this type of queue is defined as: Anadata queue. Note that only one type of message can be stored in a queue, and streams always use the Anydata queue by default.

Two message types in Streams can be encapsulated as anadata objects placed in Anadata QUEUE:LCR and user-enqueued messages. LCR described the capture before, here is not mentioned. user-enqueued messages is actually similar to LCR, except that the message is not Oracle automatic capture and generation, but rather a message generated by the user based on some of Oracle's rules (Oracle is known to streams replicate across database types). It is rooted in the support of user-enqueued Messages).

A segmented LCR is stored in the staging area. In streams, the staging area is the Anydata queue located in the SGA to store Rowlcrs/ddl Lcrs and other types of messages.

Staged Lcrs can be replicated to the far end by the propagation process, and can also be applied directly to the application process/messaging client or user process (some special staged LCR can even be propagated and applied at the same time). The application process applies the message implicitly out of the team, but the message client or user name process needs to be explicitly out of the team. If you configure propagation or forwarding, it will still be stored in the queue even if the message is applied.

2, LCR Transmission

In the streams replication environment, the propagation process replicates Lcrs to the target-side queue (destination queue) from the source-side queue (the sources queue).

In fact, the process of communication is very flexible, such as the above figure in the process can be one-to-many or more pairs of one or more pairs. For Lcrs that are already propagated or applied, if you expect to continue propagating them to other queues, you can even keep them in the source-side queue.

In the propagation phase, you can create/modify/delete a propagation, or you can define rule to control which messages are propagated. The owner of the message queue is the person who propagated the message 3, Anydata queue and team

Streams supports two kinds of message queue, the capture process automatically captures messages and user-enqueued Messages, and different types of messages are joined in different ways:

A>. The capture process will capture messages automatically on the team.

B>. User queue types are packaged by the user, and user messages may be Lcrs or other types. Messages packaged by the user are called user-enqueued message.

There are also two ways to get a message out of the team:

A>. The Apply process automatically moves messages out of the team (either capturing messages or user-enqueued Messages). If the message contains a lcr,apply process, it can be applied directly, or the user-specified procedure application can be invoked, and if LCR is not included, the apply process needs to invoke the user-specified procedure called message handler. In addition, the message out of the team was streams provided by the DBMS_APPLY_ADM. Set_enqueue_destination process team, but also user-enqueued Messages.

B>. The user applies an explicit team. Because the user's application may not be using the streams message client, the capture process is unable to process the queued message, and the message from the capture process team is still to be operated by the apply process.

Supplemental Knowledge: Messaging client (messaging Clients)

The user or application invokes the message client to the team user-enqueued Messages.

4, message dissemination

A, queue to queue propagation

A propagation can be based on queues to queues, or queues to database chains. The propagation of queues to queues has its own propagation job to propagate, because each propagation job has its own propagation schedule that can be managed separately, even if multiple queues to queues and propagate processes use the same database chain, you can enable/ Disable/set propagation scheduling of arbitrary queue propagation.

Tips:

To use queues to propagate from queues, the compatible parameter values in each database of the replication environment cannot be lower than the 10.2.0.1

B, message propagation between queues

In a Streams environment, message propagation between two queues can be configured, and two queues can be in different databases, Streams to propagate messages through the job. Propagation always takes place between two queues, and of course a queue can be propagated multiple times simultaneously (that is, to multiple destination queues), and a queue can receive messages from multiple different queues. However, there can be only one propagation between the specified source and destination queues, and a single queue can be either a target queue for a propagation or a source queue. One propagation can replicate all messages in the source queue to the destination queue (that is, the previous queue to the queue), or you can copy a partial message, which can be controlled by setting the rule. Note that the settings of the tag in the replication environment configuration should be avoided to produce cyclic modifications.

C. Dissemination of rules

The message being propagated or discarded is based on our definition in rule. The defined rule can also be placed in a positive ruleset (positive rule set), or in a negative ruleset (negative rules set).

For example, a message that conforms to the rule of a definition, and which is in a positive set of rules, the propagation process copies the message. If the rule is in the negative ruleset, the propagate process automatically discards the modification. Note that if a rule exists at the same time in both a positive and a negative set of rules, the Strema takes precedence over the negative rule set.

D, ensure that messages are sent

E, send binary files

Because the bfile type is supported, streams can also propagate binary files. This is probably the case, placing the bfile Type column into the load message payload, and then copying the message to the remote queue. A heavy load message with bfile data before the message is propagated is also transmitted. Note that information such as the directory object and file name of the bfile is maintained, so you need to ensure that the target-side directory objects actually point to the validity (the directory that you are actually pointing to can be different from the source side).

F, directed network

Defining the Network (directed Networks) is interesting, as the official definition means that the message propagates across one or more transit servers (intermediate Databases) before reaching the target database.

See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/database/Oracle/

The advantage of using a directed network is that when there is no physical connection between the source database and the target database, with the help of the relay server, the message is first propagated to the relay server and then processed by the relay server (or not processed) and sent to the target server, while in disguise, the security of the source database is improved and the burden of the source databases is reduced. Of course, if the relay server down, the entire streams environment will also stop.

Two nouns: queue forwarding and application forwarding

What is queued forwarding (queue forwarding)

Indicates that the message is forwarded immediately after it is received, and the message owner is still the source database.

What is application forwarding (apply forwarding)

Indicates that a message receives a staging server and is first applied by the apply process, then captured by the capture process, and then continues to propagate. The message is changed by the owner, and the message queue can be said to have no relation to the source database, and the relay server becomes the new queue source server.

The difference between queue forwarding and application forwarding:

For queue forwarding, the message jumps over the staging server but does not change (by default) application forwarding is more complex, because the message has been applied and recaptured, so there may be a lot of conversion, such as the modification of its forwarding path or filtering some of the modification operations, etc. are possible.

For queue forwarding, the target database must have more than one apply process to handle messages from different source databases separately. Application forwarding requires fewer applications, and the number of source databases must be reduced for the target database.

For queue forwarding, the staging server must be independent. There is no limit to the application forwarding, you can even understand that the relay server is the source server.

Advantages of Queue forwarding:

Performance has an advantage, so the capture is done only once, and the same propagation may be faster, and the process of application and recapture must be less.

Easier to get the initial source of a message

Because the trust relationship between messages is not strong, the application of parallelism can be higher.

If the staging server is down, you can reconfigure capture, propagation, and application by capturing the side start SCN. Application forwarding requires more work because once the forwarding server is down, the equivalent of the source database is gone, and it is possible to reset the capture process.

Advantages of applying Forwarding:

For Multi-Source replication environment, application forwarding may be more conducive to streams replication environment, most of the operation can be placed on a transit server, the source and target side as long as the capture and apply can be.

For large streams replication environments, application forwarding is easier to manage and monitor, and there is at least one apply process in the staging server for the source database, which is equivalent to capturing and applying one-on-one.

Author: 51cto Blog Oracle Little Bastard

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.