Connect to Oracle DB using ODBC

I am developing an application that needs to be rewritten using a "slightly documented" legacy Oracle database. To start this process, I want to start creating a view in this database using ODBC links in the MS Access database so that I can figure out the database structure, but I cannot figure out how to set up an ODBC connection with Oracle DB.

I was able to connect using the host name and service and view the database using SQL Developer; but i cant figure out how to configure ODBC. I run Windows 7 and installed Oracle 11g, Oracle Express Edition, Instant Client, and ODBC extensitons; but in the ODBC installation, Oracle wants me to select the TNS service name, but there is no one to select, and there is no place to specify the host. I tried setting up TNS in tnsnames.ora; but I'm not sure I know the right place for this file.

I really thought it would be the easy part; but actually it wasn’t.

+5
source share
4 answers

Go to the panel > Administration > Data Sources (ODBC)

DSN "". , Microsoft ODBC Oracle.

enter image description here

"". "", " " "". " ODBC", " ...", " ".

+2

tnsnames.ora - Oracle . Oracle ( " | Oracle Oracle Home Name | Configuration and Migration Tools | Net Configuration Assistant" ), " ", ( ) TNS . , .

, tnsnames.ora % Oracle Home%\network\ADMIN\tnsnames.ora, .

<TNS alias> = 
  (DESCRIPTION = 
    (ADDRESS = (PROTOCOL = TCP)(HOST = <hostname or IP>)(PORT = <port>)) 
    (CONNECT_DATA = 
      (SERVER = DEDICATED) 
      (SERVICE_NAME = <database service name>) 
    ) 
  ) 
+1

tnsnames.ora SERVICE_NAME SID. .

0

1. TNSNAMES.ORA .   XE =   ( =     (ADDRESS_LIST =       (ADDRESS =         (PROTOCOL = TCP)         (HOST = 192.168.2.116)         ( = 1521)       )     )     (CONNECT_DATA =       (SERVICE_NAME = XE)     )   )

  1. Windows (ControlPanel → → ..) 2-1. PATH   c:\oraclexe\instantclient_11_2\--- instantclient 2-2.   TNS_ADMIN c:\oraclexe\instantclient_11_2\- >   NLS_LANG = JAPANESE_JAPAN.JA16SJISTILDE
  2. Windows cd c:\Windows\SysWow64 < - 32- ODBC 64- Win7 odbcad32.exe : ICODBC < - : XE : system .
0

All Articles