How to add Oracle linked server to SQL Server database (Windows system)

1. Adding components to access Oracle

1.1 Download Oracle’s component Oracle Provider for OLE DB

Official download address: https://www.oracle.com/technetwork/topics/dotnet/downloads/odacdeploy-4242173.html
Insert image description here

1.2 Register the component

1.2.1 Decompression location of downloaded compressed package

  For example, I put it directly in the root directory of drive D
Insert image description here

1.2.2 Then run Cmd as an administrator. You must run it as an administrator here, otherwise an error will be reported.

Open the terminal as an administrator and run the following command:

cd D:\test\ODAC-21.10-Xcopy-64-bit  
.\install.bat oledb d:\test\oracle odac  

Insert image description here

2. Configure environment variables

In the system environment variables, add "C:\test\oracle;C:\test\oracle\bin;" to the front of Path.
Insert image description here

3. Restart the SQL Server instance. If you do not restart, an error will be reported when testing the link.

Insert image description here

4. Set OraOLEDB.Oracle access interface properties

Right-click the access interface → General → check "Run in process"
Insert image description here

5. Start creating a new linked server

Right-click "Linked Server" → select "New Linked Server" → You can choose the name of the linked server for identification and subsequent calls → The data source is the IP + port/database name of the target database → Log in with your account and password on the "Security" option page

5.1 General

Insert image description here

5.2 Password

Insert image description here

5.3 Testing

Insert image description here

Guess you like

Origin blog.csdn.net/slb190623/article/details/132069124