Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2245900
  • 博文数量: 310
  • 博客积分: 6853
  • 博客等级: 准将
  • 技术积分: 2833
  • 用 户 组: 普通用户
  • 注册时间: 2005-08-04 16:41
文章分类

全部博文(310)

文章存档

2013年(17)

2012年(42)

2011年(76)

2010年(71)

2009年(99)

2007年(2)

2006年(1)

2005年(2)

分类: Oracle

2009-12-06 21:36:50

原始网址:

Instant Client的安装:
  1. Download and install the Instant Client shared libraries and Oracle JDBC class libraries to a directory, such as instantclient.

  2. Set the library path environment variable to the directory from step 1. For example, on UNIX, set LD_LIBRARY_PATH to instantclient. On Windows, set PATH to locate the instantclient directory.

  3. Add the full pathnames of the JDBC class libraries to the CLASSPATH environment variable.(一般在应用服务器中的classpath环境中已经包含该jar文件,不需要在环境变量中单独设置这个classpath)

  4. (一般环境)Set the library loading path in your environment to the directory in Step 2 ("instantclient"). On many UNIX platforms, LD_LIBRARY_PATH is the appropriate environment variable. On Windows, PATH should be used.
  5. (注意AIX环境) Set the library loading path in your environment to the directory in Step 2 ("instantclient"). On AIX, LIBPATH is the appropriate environment variable.(只用设置LIBPATH,不用设置LD_LIBRARY_PATH!如果不设置LIBPATH,将会导致websphere中jdk退出。)
Oracle Universal Installer by selecting the Instant Client option.

Instant Client can be also installed from the Oracle Universal Installer by selecting the Instant Client option. The installation should be done into an empty directory. As with the OTN install, you must set the LD_LIBRARY_PATH environment variable to the instant client directory to operate in the Instant Client mode.


具备admin功能的客户端配置会更复杂。

The location of the Instant Client shared libraries and JDBC class libraries in a full client installation is:

On Linux or UNIX:

  • libociei.so library is in $ORACLE_HOME/instantclient

  • libclnstsh.so.10.1, libocijdbc10.so, and libnnz10.so are in $ORACLE_HOME/lib

  • The JDBC class libraries are in $ORACLE_HOME/jdbc/lib

On Windows:

  • oraociei10.dll library is in ORACLE_HOME\instantclient

  • oci.dll, oraocijdbc10.dll, and orannzsbb10.dll are in ORACLE_HOME\bin

  • The JDBC class libraries are in ORACLE_HOME\jdbc\lib

By copying these files to a different directory, setting the library path to locate this directory, and adding the pathnames of the JDBC class libraries to CLASSPATH, you can enable running the JDBC OCI application in the Instant Client mode.


两种lib只能配置其中一种:

If you have an Oracle home on your computer, then you should not have the ORACLE_HOME/lib and Instant Client directories in the library path environment variable simultaneously, regardless of the order in which they appear in the variable. That is, only one of ORACLE_HOME/lib directory (for non-Instant Client operation) or Instant Client directory (for Instant Client operation) should be specified in the library path environment variable.



更复杂的配置:
tnsnames.ora

The connect string can also be stored in the tnsnames.ora file. For example, consider that the tnsnames.ora file contains the following:

conn_str = (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=server6)(PORT=1573))
(CONNECT_DATA=(SERVICE_NAME=rdbms3.server6.us.alchemy.com)))

Naming methods that require TNS_ADMIN to locate configuration files continue to work if the TNS_ADMIN environment variable is set.
The TNS_ADMIN environment variable specifies the directory where the tnsnames.ora file is located. However, TNS_ADMIN does not specify the full path of the tnsnames.ora file, instead it specifies the directory

替代方案
If the TNS_ADMIN environment variable is not set and TNSNAMES entries, such as inst1, are used, then the ORACLE_HOME environment variable must be set and the configuration files are expected to be in the $ORACLE_HOME/network/admin directory.


更进一步,空链接串
The empty connect string is not supported. However, an alternate way to use the empty connect string is to set the TWO_TASK environment variable on UNIX, or the LOCAL variable on Windows, to either a tnsnames.ora entry or an Oracle Net keyword-value pair.
If TWO_TASK or LOCAL is set to a tnsnames.ora entry, then the tnsnames.ora file must be loaded by the TNS_ADMIN or ORACLE_HOME setting.
setenv TWO_TASK conn_str

timezlrg.dat的配置

In the Instant Client mode, if the ORA_TZFILE variable is not set, then the smaller, default, timezone.dat file from the Data Shared Library is used. If the larger timezlrg.dat file is to be used from the Data Shared Library, then set the ORA_TZFILE environment variable to the name of the file without any absolute or relative path names. That is:

On UNIX:

setenv ORA_TZFILE timezlrg.dat

On Windows:

set ORA_TZFILE timezlrg.dat

在完整客户端情况下:
If the driver is not operating in the Instant Client mode, then the ORA_TZFILE variable, if set, names a complete path name, as it does in previous Oracle Database releases.



阅读(1502) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~