Oracle Instant Client Configuration Methods

Download the corresponding version of Instant Client from the Oracle website, taking 10.2.0.4 as an example, including the following parts:

instantclient-basic-win32-10.2.0.4.zip
instantclient-jdbc-win32-10.2.0.4.zip
instantclient-odbc-win32 -10.2.0.4.zip
instantclient-sdk-win32-10.2.0.4.zip
instantclient-sqlplus-win32-10.2.0.4.zip
where instantclient-basic-win32-10.2.0.4.zip is required.

Method 1:

1. Unzip to D:/instantclient_10_2
2. Add D:/instantclient_10_2 to the PATH environment variable
3. Add the following environment variables:
TNS_ADMIN=D:/instantclient_10_2
NLS_LANG=SIMPLIFIED CHINESE_CHINA.ZHS16GBK (*)
ORACLE_HOME=D: /instantclient_10_2 (*)
(*): optional
4. Edit tnsnames.ora to set the local NET service name

Use sqlplus to test:
sqlplus username/password@local NET service name


Method 2:
1.解压至D:/instantclient_10_2/BIN中,并建立D:/instantclient_10_2/NETWORK/ADMIN目录
2.编辑注册表ORA.REG文件:
===============================
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE/SOFTWARE/ORACLE]
"inst_loc"="C://Program Files//Oracle//Inventory"

[HKEY_LOCAL_MACHINE/SOFTWARE/ORACLE/KEY_OraClient10g_home1]
"ORACLE_HOME"="D://instantclient_10_2"
"ORACLE_HOME_NAME"="OraClient10g_home1"
"ORACLE_GROUP_NAME"="Oracle - OraClient10g_home1"
"ORACLE_BUNDLE_NAME"="Enterprise"
"NLS_LANG"="TRADITIONAL CHINESE_TAIWAN.ZHT16MSWIN950"
"ORACLE_HOME_KEY"="SOFTWARE//ORACLE//KEY_OraClient10g_home1" 3. Double-click to import the registry
=================================


4. Edit the oracle.key file and add a line SOFTWARE/ORACLE/KEY_OraClient10g_home1, which corresponds to the key in ORA.REG.
5. Add D:/instantclient_10_2/BIN to the PATH environment variable
6. Add the sqlnet.ora file to D:/instantclient_10_2/NETWORK/ADMIN, including the following two lines:
SQLNET.AUTHENTICATION_SERVICES= (NTS)
NAMES.DIRECTORY_PATH= (TNSNAMES , EZCONNECT)
7. Add tnsnames.ora file to tnsnames.ora in D:/instantclient_10_2/NETWORK/ADMIN

Example:
EXTPROC_CONNECTION_DATA =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
    )
    (CONNECT_DATA =
      (SID = PLSExtProc)
      (PRESENTATION = RO)
    )
  )

MYORA =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = MYDB)
    )
  )

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326606625&siteId=291194637