How does the Oracle database correctly access SYBASE data?

Source: Internet
Author: User
Tags sybase sybase client sybase database

The following article describes how to access SYBASE-related data in an Oracle database and how to configure the transparent gateway for Sybase, I hope this will help you in your future studies.

1. Install Sybase client on the server where Oracle is located (or install Oracle and Sybase servers on the same server) to ensure that Oracle can access the Sybase database;

2. Install the transparent gateway for Sybase option, which must be customized. Correctly select the Sybase installation directory;

3. Select a sid string to be assigned to the Sybase Database. For example, tg4sybs sets the dll PATH of Sybase to the environment variable PATH (this step is very important );

4. Modify the initialization file. The default value is:

 
 
  1. Oracle _HOME\tg4sybs\admin\inittg4sybs.ora 

Set parameters

 
 
  1. HS_FDS_CONNECT_INFO 

Format:

 
 
  1. HS_FDS_CONNECT_INFO= server_name. database_name[,INTERFACE= interface_file]  
  2. server_name. database_name  

Is case sensitive.

INTERFACE (optional)

Example:

# This is a sample agent init file that contains the HS parameters that are # needed for the Transparent Gateway for Sybase # HS init parameters # HS_FDS_CONNECT_INFO = parameters = OFFHS_FDS_RECOVERY_ACCOUNT = records = RECOVER ## environment variables required for Sybase # set SYBASE = d: \ sybase

In the above example

Server_name is migration_serv

Database_name is tax

5. Configure the listener of the Oracle network service. The configuration file is listener. ora.

Default path:

 
 
  1. Oracle _HOME\network\admin 

Add as follows:

SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (SID_NAME = gateway_sid) (Oracle _ HOME = Oracle _ home_directory) (PROGRAM = tg4sybs) gateway_sid is the sid string selected by 3.

Oracle _ home_directory is Oracle _ HOME

If tg4sybs is SYBASE specific. If it is another database, it will be different.

Example:

 
 
  1. (SID_DESC=(SID_NAME=tg4sybs) (Oracle _HOME = D:\Oracle \ora92)(PROGRAM=tg4sybs))  

6. Stop listening

 
 
  1. lsnrctl stop 

Restart the listener

 
 
  1. lsnrctl start 

7. Configure Oracle server tnsnames. ora to enable Oracle to access sybase

Connect_descriptor = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = host_name) (PORT = port_number) (CONNECT_DATA = (SID = gateway_sid) (HS = OK )) connect_descriptor is a connection string. It can be used as any parameter. It is generally sybs.

Host_name: name of the Oracle server

Port_number: Oracle listening port

Gateway_sid is the sid string selected by 3.

Example:

 
 
  1. sybs=(DESCRIPTION=(ADDRESS_LIST =(ADDRESS=(PROTOCOL=TCP) 
    (HOST= dw-server1)(PORT= 1521))) (CONNECT_DATA=(SID= tg4sybs))(HS=OK)) 

8. Create a database link

For example:

 
 
  1. CREATE DATABASE LINK sybs CONNECT TO sa IDENTIFIED BY prient USING 'SBYS' ; 

You can access the sybase Database.

Note that the table name and field name of the sybase database should be added with double quotation marks when accessing the Oracle database in lower case ""

For example:

 
 
  1. SQL〉select "a" from "b"@sybs; 

The above content is an introduction to Oracle's access to SYBASE data. I hope you will have some gains.

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.