Create DBLINK in SQL Server and Oracle

Source: Internet
Author: User

From: https://www.cnblogs.com/mengfanrong/p/5086930.html

Dblink
When we want to cross the local database. When you visit data in another database table, you must create a dblink of the remote database in the local database, and access the data in the Remote database table as you would the local database by dblink the local database.




How to create a Dblink
1) SQL Server to SQL Server
Exec sp_droplinkedsrvlogin Pdalink,null--Deleting mappings (mapping to remote logins on the linked server)
Exec sp_dropserver Pdalink--Remove remote server link


EXEC sp_addlinkedserver
@server = ' Pdalink ',--the name of the server being interviewed
@srvproduct = ',--the product name of the OLE DB data source to join as a linked server
@provider = ' SQLOLEDB ',--be interviewed for database category Msdaora SQLOLEDB
@datasrc = ' 192.168.120.114 '--the server being interviewed


EXEC sp_addlinkedsrvlogin
' Pdalink ',--the server alias to be interviewed
' False ',--
NULL, the logon on the local server. The LocalLogin data type is sysname and is set to NULL by default.


' Sa ',--account number
' Sa '--password

SELECT * from Pdalink. [Database].dbo. [table name, view]

SQL08 version number to SQL2000 version number will be encountered when connecting

Unable to run the operation because the OLBDB access interface "SQLNCLI10" of the connection server could not start the distributed transaction

Please take a look at the link to set up

Http://www.cnblogs.com/markhe/archive/2009/04/30/1447223.html
Http://blog.sina.com.cn/s/blog_53c190520100z4yy.html

2) Oracle to Oracle
Drop/* Public */Database link pda_link--delete remote server link


Create/* Public */Database link pda_link--the server alias to be interviewed
Connect to SYSTEM identified by Frontlink
Using ' (DESCRIPTION = (Address_list = (ADDRESS = (PROTOCOL = TCP)
(HOST = 192.168.1.10)--the server being interviewed
(PORT = 1521))) --The port to be interviewed
(Connect_data =
(service_name = SMB)--the database being interviewed
))‘;


SELECT * FROM [table name, view] @PDA_LINK

3) SQL to Oracle please visit http://blog.csdn.net/lygzscnt12/article/details/40074793

Create DBLINK in SQL Server and Oracle

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.