Oracle and SQL Server implement table data synchronization

Source: Internet
Author: User

Synchronizing some tables in SQLServer2005 to the Oracle database, data synchronization between different database types can be achieved using linked servers and SQLAgent.

Instance:
SQLServer2008 There is a table employ_epl that needs to be synchronized to an EHR system (ORACLE11G), the synchronization steps for implementing the database are as follows:

1. Establish the corresponding EMPLOY_EPL table in Oracle, which fields need to be synchronized we will build those fields into the Oracle table.
Note: Oracle data types are not the same as SQL Server data types and need to be converted

--to view data type correspondence between SQL Server and other database systems
--SQL to Oracle type correspondence
SELECT* fromMsdb.dbo.MSdatatype_mappings

--detailed indication of the type correspondence of each database system
SELECT* fromMsdb.dbo.sysdatatypemappings


2. Establish a linked server
Join the Oracle system as a linked server to SQL Servers.
Http://www.cnblogs.com/Snowfun/p/5284357.html


3. Using SQL statements to write SQL Server data to Oracle

DELETE fromTestoracle. SCOTT. Employ_epl
Insert intoTestoracle. SCOTT. Employ_epl
Select* fromEmploy_epl

--See if the data is already available in the Oracle database.
Select* fromTestoracle. SCOTT. Employ_epl

4. Set up SQLAgent, and synchronize the above synchronous SQL statements as execution statements every day.

Oracle and SQL Server implement table data synchronization

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.