Instant Client for linux

本文指导您如何通过较小的Oracle Instant Client包连接数据库,包括下载、编辑环境变量、配置tnsnames.ora文件和使用SQL*Plus进行连接。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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-
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值