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 server alias to be interviewed
@srvproduct = ' ',--The product name of the OLE DB data source to join as a linked server
@provider = ' SQLOLEDB ',--Be interviewed 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 --Login 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--Remove the 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)--Access to the database
))‘;
SELECT * FROM [table name, view] @PDA_LINK
3) SQL to Oracle please visit http://blog.csdn.net/lygzscnt12/article/details/40074793
Article: http://blog.csdn.net/davidhsing/article/details/6408770
Create DBLINK in SQL Server and Oracle