Configure odbc transparent gateway for oracle Access to IPVs DB

Source: Internet
Author: User
Tags ini odbc create database

Recently, we helped customers configure the odbc transparent gateway to access IPVs db in oracle through DB link.

A simple record:

(1) configuration of listener. ora and tnsnames. ora:

[Wsj81 @ localhost admin] $ cat listener. ora
# Listener. ora Network Configuration File:/wsj/oracle/app/product/11.2.0/dbhome_1/network/admin/listener. ora
# Generated by Oracle configuration tools.
 
SID_LIST_ORCL =
(SID_LIST =
(SID_DESC =
(SID_NAME = pgdb)
(ORACLE_HOME =/wsj/oracle/app/product/11.2.0/dbhome_1)
(ENV = "LD_LIBRARY_PATH =/usr/lib64:/wsj/oracle/app/product/11.2.0/dbhome_1/lib: usr/local/lib ")
(PROGRAM = dg4odbc)
    )
  )
 
ORCL =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP) (HOST = 19.89.64.111) (PORT = 1531 ))
      )
    )
  )
 
 
[Wsj81 @ localhost admin] $
[Wsj81 @ localhost admin] $ cat tnsnames. ora
Pgdb =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = tcp) (HOST = 19.89.64.111) (PORT = 1521 ))
(CONNECT_DATA = (SID = pgdb ))
(HS = OK)
  )

(2) transparent gateway configuration. The two files are under $ ORACLE_HOME/hs/admin.

[Wsj81 @ localhost admin] $ cat odbc. ini
[Pgdb]
Driver =/usr/local/lib/psqlodbcw. so
Setup =/usr/lib64/libodbc. so
Description = POSTGRESQL
Servername = 88.23.19.121
Port = 5434
Protocl = 6.4
FetchBufferSize = 99
Username = S
Password = abcd4321
Database = pgdb
ReadOnly = no
Debug = 1
ConnSettings =
[Wsj81 @ localhost admin] $
[Wsj81 @ localhost admin] $
[Wsj81 @ localhost admin] $
[Wsj81 @ localhost admin] $ cat initpgdb. ora
HS_FDS_CONNECT_INFO = pgdb
HS_FDS_TRACE_LEVEL = 255
HS_FDS_SHAREABLE_NAME =/usr/lib64/libodbc. so
HS_LANGUAGE = AMERICAN_AMERICA.ZHS16GBK
Set ODBCINI =/wsj/oracle/app/product/11.2.0/dbhome_1/hs/admin/odbc. ini
[Wsj81 @ localhost admin] $
Create a db link

SQL> create database link pgdb connect to "S" identified by "abcd4321" using 'pgdb ';
 
Database link created.
 
SQL>

Test the connection. Note that double quotation marks must be added to the table in pg:

SQL> select * from "t1" @ pgdb;
 
No rows selected
 
SQL>

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.