当前位置:操作系统 > Unix/Linux >>

Instant Client for linux

Instant Client for linux
 
sometime for some reason,ex. you can't install on the host,not get the install package,or others.but you want connnect the oracle database via sqlplus only,in times you can use oracle Instant Client,the package very small than database or client package.
i will show how-to use the package conn the database.
0. download the package and extract file to ~/oraclient.
[gtlions@o564gtser1 ~]$ ll oraclient/
total 185224
-rwxrwxr-x 1 gtlions gtlions     25308 Sep 17  2011 adrci
-rw-rw-r-- 1 gtlions gtlions       437 Sep 17  2011 BASIC_README
-rwxrwxr-x 1 gtlions gtlions     46228 Sep 17  2011 genezi
-r--r--r-- 1 gtlions gtlions       368 Sep 17  2011 glogin.sql
-rwxrwxr-x 1 gtlions gtlions  52761218 Sep 17  2011 libclntsh.so.11.1
-r-xr-xr-x 1 gtlions gtlions   7955322 Sep 17  2011 libnnz11.so
-rwxrwxr-x 1 gtlions gtlions   1971762 Sep 17  2011 libocci.so.11.1
-rwxrwxr-x 1 gtlions gtlions 118408281 Sep 17  2011 libociei.so
-r-xr-xr-x 1 gtlions gtlions    164836 Sep 17  2011 libocijdbc11.so
-r-xr-xr-x 1 gtlions gtlions   1503303 Sep 17  2011 libsqlplusic.so
-r-xr-xr-x 1 gtlions gtlions   1477446 Sep 17  2011 libsqlplus.so
-r--r--r-- 1 gtlions gtlions   2095661 Sep 17  2011 ojdbc5.jar
-r--r--r-- 1 gtlions gtlions   2714016 Sep 17  2011 ojdbc6.jar
-r-xr-xr-x 1 gtlions gtlions      9352 Sep 17  2011 sqlplus
-rw-rw-r-- 1 gtlions gtlions       441 Sep 17  2011 SQLPLUS_README
-rw-rw-r-- 1 gtlions gtlions       177 May  6 12:01 tnsnames.ora
-rwxrwxr-x 1 gtlions gtlions    191237 Sep 17  2011 uidrvci
-rw-rw-r-- 1 gtlions gtlions     66779 Sep 17  2011 xstreams.jar
 
1. edit env file .bash_profile like follow lines.
[gtlions@o564gtser1 ~]$ cat .bash_profile   
# .bash_profile
 
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi
 
# User specific environment and startup programs
export LD_LIBRARY_PATH=/home/gtlions/oraclient
export PATH=$PATH:~/oraclient
export TNS_ADMIN=~/oraclient
[gtlions@o564gtser1 ~]$ source .bash_profile
 
2. manual edit ~/oraclient/tnsnames.ora connect strings.
[gtlions@o564gtser1 ~]$ cat oraclient/tnsnames.ora
ora11g =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 10.46.1.3)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = ora11g)
    )
  )
 
3. connect it.
[gtlions@o564gtser1 ~]$ sqlplus gtlions/000000@ora11g
 
SQL*Plus: Release 11.2.0.3.0 Production on Mon May 6 12:17:46 2013
 
Copyright (c) 1982, 2011, Oracle.  All rights reserved.
 
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
 
SQL> select * from v$version;
 
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
PL/SQL Release 11.2.0.2.0 - Production
CORE    11.2.0.2.0      Production
TNS for IBM/AIX RISC System/6000: Version 11.2.0.2.0 - Production
NLSRTL Version 11.2.0.2.0 - Production
 
-EOF-
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,