Configure Oracle transparent gateway to access SQL Server

Source: Internet
Author: User

Test environment:

OS: XP
In ORACLE 10.1
SQLSERVER2000
HOSTNAME: home-30b98e1e20
Both use the default TCP/IP Port

1. Install the transparent gateway Option
Use Oracle Universal Instraller to choose custom installation on the installed ORACLE_HOME, and select Oracle Transparent Gateways for Microsoft SQL Server,
After the installation is complete, there will be such a directory $ oracle_home \ tg4msql

2. Create the file initsql2000.ora in the $ oracle_hometg4msqladmin directory.The content is as follows:
HS_FDS_CONNECT_INFO = home-30b98e1e20.test # home-30b98e1e20 is the SQL Server Name
HS_FDS_TRACE_LEVEL = OFF
HS_FDS_RECOVERY_ACCOUNT = RECOVER
HS_FDS_RECOVERY_PWD = RECOVER

3. Configure LISTENER. ORA

(SID_DESC =
(GLOBAL_DBNAME = tg4sql) # You can name it yourself.
(PROGRAM = tg4msql)
(SID_NAME = sql2000) # Same as sql2000 in initsql2000.ora.
(ORACLE_HOME = E: \ oracle \ product \ 10.1.0 \ Db_1)
)

4. Use the "service" in Windows to restart the Oracle LISTENER and DATABASE services

5. Configure tnsnames. ora

Sql2000 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP) (HOST = home-30b98e1e20) (PORT = 1521 ))
)
(CONNECT_DATA =
(SID = sql2000)
)
(HS = OK)
)

6. Create a DATABASE LINK

Create database link DB_ SQL CONNECT TO SA IDENTIFIED BY PASSWORD USING 'sql2000 ';

7. Test

Select * from t1 @ sql2000;

Note:

1. HS_FDS_CONNECT_INFO = the service name in the home-30b98e1e20.test is written as localhost or local will be suspended during the test;
2. When using DBLINK, set GLOBAL_NAME in spfile:
If it is true, use the full name of DBLINK, which can be found in all_db_links;
If it is FALSE, you do not have to use the full name. When the ORA-02019: to find the connection description for a remote database appears, use the full name, such:

Select * from t1@sql2000.ORACLE.COM

 

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.