SQL Server database access to Oracle Database

Source: Internet
Author: User

Recently, we want to implement a business. We need to query the corresponding data in the Oracle Core database based on the table data in the SQL Server database, and then make statistics in the SQL Server database. therefore, we need to implement the DBlink from the SQL Server database to the Oracle database to pull the data out of the Oracle database.
Preparations: 1. the SQL Server database must be installed;2. An Oracle client must be available. The client version is no lower than that of the Oracle database;3. Configure the tnsnames. ora file (Path: $ ORACLE_HOME $ \ db_1 \ NETWORK \ ADMIN \ tnsnames. ora)

OrclDBLink = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.0.2) (PORT = 1521 )) ) (CONNECT_DATA = (SERVICE_NAME = ORCL. SNDA. COM) ) )
4. test whether the tns configuration is successful. Use sqlplus name to log on in the command line window. If the configuration is successful, the tnsname. ora configuration is correct.

Create a connection Server 1. Configure on the general page ,:
2. Configure on the Security page ,:

Test Access to the Oracle database 1. SELECT * FROM  DBLINK .. HR. EMPLOYEES The query object must be in uppercase. If you want to query a field in uppercase, the connection server is followed by two points [..]
2. SELECT * FROM  Openquery (DBLINK, 'select * from hr. EMPLOYEES '); This method is 50% faster than the previous method, which is equivalent to directly connecting to 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.