Oracle Distributed Data Solutions

Source: Internet
Author: User
Tags manual xml parser

Oracle-related distributed data Solutions
   may be fading in the cloud, SOA architecture, but it is still practical, this article briefly describes the commonly used data synchronization scenarios, because of the use of advanced replication solutions, So the emphasis is on Oracle's advanced Replication
One, common distributed data Solutions
If the database is Oracle, data-dispersed distributed systems, you can often see the distributed solution
Non-real-time, batch-sync
1.ETL tools or their own developed interfaces
  typically corresponds to a data file in a particular format, using the FTP service.
  Data Warehouse or data mart can use ETL tools to do data integration, the general system is its own written interface program implementation. Conventional thinking is the Data import interface table, after cleaning into the formal table
import way very much, if the amount of data can use Sqlloder, if the data is not large, can be imported and cleaned at the same time. In my experience, it's better to put the cleaning logic on the database.
  may also be an XML file obtained via HTTP, which requires you to customize the XML parser and read the CDATA section. Advanced Program Language This aspect of the function is very powerful, simple.
Real-time, small-batch synchronization
1. Third-party-provided
  for critical systems, middleware can be used to ensure data security and stability. For example, Bea's tuxedo is good.
2. Develop yourself
  If all UNIX machines can be programmed with sockets, the data is sent in packets and the stability can be guaranteed. Often in the format of XML, the data file has a strong ability to describe itself.
Both of these schemes can be seen in systems such as telecommunications, and are relatively reliable.
3.oracle provides its own
3.1 real-time table interface
  uses db_link and stored procedures, combined with job, very flexible and powerful.
3.2 Oracle Advanced replication
  If you need to ensure two-way real-time data synchronization, while the replication link is more complex, there are multiple replication nodes, you can use advanced replication of Oracle, last month, Jinan website Construction   did the real estate agency project used this program. Although this option is not appropriate for this project, for historical reasons, we continue this synchronization program for the needs of the first-time system. This article mainly describes the process of advanced replication:

Second, advanced replication basic Concepts
 1. The same data exists in multiple nodes, which is more appropriate to use advanced replication
 2. Oracle can use advance between different versions and different operating systems Replication
 3. Several nouns
  Replication object: Copying objects, including tables, indexes, stored procedures
  replication group: Replication groups, copying the collection of objects, A group contains multiple objects, one object can only belong to one group
  replication site: replication site
 4.multimaster replication: Features: Full table replication, Replication
  Replication
   asynchronous replication can be performed after each transaction: replicated to other Master in deferred time, also known as store and forward data replication
    Synchronous replication: Immediately update to other master, also on real time data replication
   procedual replication: Package generates a wrapper, Data changes are done through stored procedures, and procedure in one master is investigated, Wapper ensures that the procedure of     in other site is also called, reducing Network load when there is large amount of data to operate
  Asynchronous call procedure
   DML operation (or wappers) generated by an internal trigger a delay RPC and put in a deferred transaction queue, 1 site has a deferred transaction queue, 1 queues are shared by multiple group
    Error putting the transaction into the wrong queue, and after the transaction successfully ended, the purge job removes the transaction from the transaction queue in the source site
  Synchronous replication
   DML operation is immediately captured and the transaction executes immediately. Any site error, transaction rollback, lock the local row, use the after row trigger to lock the remote row, all sites submitted    Oracle will unlock, highly dependent on system and network availability
III. advanced replication creation steps:
 A lot of information on the Internet, but also very detailed, which eygle more detailed classics, you can see, I will simply say, and on their own problems to describe the solution
1. Adjust the Oracle environment, establish repadmin users, and assign rights to usage
2. Establish DB _link
3. Create replication objects in a replication group
  can be built using graphical tools or manual scripts, because there are a lot of tables, and the formal deployment is built again, here I use manual scripting
 --Create replication groups:
     Dbms_repcat. Create_master_repgroup (
     gname => ' "* * *",
     qualifier = > ',
     group_comment => ');

--Add the copied object to the replication group:
Dbms_repcat. Create_master_repobject (
Gname => ' "* *",
Type => ' TABLE ',
Oname => ' "TEST",
Sname => ' "Lfgistest",
Copy_rows => False,
Use_existing_object => TRUE);

-Generate replication support for replicated objects:


Dbms_repcat. Generate_replication_support (


sname => ' "Lfgistest",


oname => ' "TEST",


type => ' TABLE ');


    


--Add principal replication node:


Dbms_repcat. Add_master_database (


gname => ' "* * * * *,


Master => ' * * *,


use_existing_objects => TRUE,


copy_rows => false,


propagation_mode => ' asynchronous ');


 


--Initiates replication at the principal definition site:


Dbms_repcat. Resume_master_activity (gname => ' "* * *", true);


's Mistake


1.db_link was created and could not be used and found that the Db_link name was problematic


Solution: If global_names = True;db_link name must be consistent with global_name, after the modification succeeded


2. Add principal replication node times wrong:


ora-23357:the propagator does not exist


Ora-06512:at "SYS. Dbms_repcat_cache ", line 76


Ora-06512:at "SYS. Dbms_repcat_mas ", Line 2105


Ora-06512:at "SYS. Dbms_repcat ", line 146


Ora-06512:at Line 2


Possible reasons:


1.global_name uses Oracle's reserved word, reference: http://oracle-tech.blogspot.com/2008/08/ Ora-23375-when-adding-new-master-site.html


Modify the Extranet (Global_name) to OUT.WWKJ.LZFC2


ALTER DATABASE rename Global_name to out. Wwkj. LZFC2;


2.REPADMIN user rights are not sufficient, check the statement to assign permissions to ensure that permissions are in place


3.db_link must use Repadmin to connect to the End-to-end database, that's why I reported it wrong


4. It is said that the domain of two databases must be the same


5. The user and schema of the two machines should be consistent


solution: Oh, very careless Ah, did not run the script with repadmin


3. When you add a replication object to a replication group, you report 23312 errors and the current site is not masterdef


Oracle Error:ora-23312:not The masterdef according to string


Cause:the group name is null, the group name is misspelled, the invocation or given database isn't not the masterdef, or one The Masters does not believe the invocation database is the masterdef.


Action:if the given group name and Masterdef were both correct, connect to the Masterdef and retry the request, or Relocate the masterdef at the (errant) databases using Relocate_masterdef.

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.