Running Oracle's SQL Plus in Linux Ubuntu

Refer to: http://gm.matias.ph/running-oracles-sql-plus-in-linux-ubuntu-2010-08-04

SQL*Plus is an Oracle command-line utility program that can run SQL and PL/SQL commands interactively or from a script. Programmers and DBAs commonly use it as the default available fundamental interface in almost any Oracle software installation.This is a howto to use Oracle's SQL Plus application to access Oracle database without installing the Oracle software suite.

  1. Create an account with Oracle to be able to download the required files. It's free. If you already have one, then proceed to the next step.
  2. Download two .rpm packages from Oracle.
    32-BIT VERSION: Linux x86 (32-Bit)
    64-BIT VERSION: Linux x86-64 (64-Bit)
  3. Select the version of Oracle that you prefer to use.
    • Instant Client Package - Basic All files required to run OCI, OCCI, and JDBC-OCI applications
    • Instant Client Package - SQL*Plus Additional libraries and executable for running SQL*Plus with Instant Client
  4. Install the application alien to convert the .rpm packages to .deb which is the required format by Ubuntu. Install it by executing:
    1$ sudoapt-get install alien
  5. Go to the folder where the .rpm packages are located.
    1$ sudoalien -k oracle-instantclient*.rpm
  6. The .deb packages are ready to be installed.
    1$ sudodpkg -i oracle-instantclient*basic*.deb
    2$ sudodpkg -i oracle-instantclient*sqlplus*.deb
  7. Add the library to classpath. The library files are installed in the system but are not set to be found by SQL Plus. To do this, create an environment variable called LD_LIBRARY_PATH in order for SQL*Plus to locate them.
    1$ exportLD_LIBRARY_PATH=/usr/lib/oracle/@@version@@/@@client@@/lib
    where version and client should be populated according to your own specific settings.
  8. To make sure that the library is always exported. Put the exported line to /.bashrc} located in your home directory.
    1$ gedit ~/.bashrc
  9. Install another dependency needed by SQL Plus.
    For Ubuntu 9.1:
    1$ sudoapt-get install libaio
    For Ubuntu 10.4:
    1$ sudoapt-get install libaio1
  10. Delete the .rpm and .deb files.

Troubleshooting:

  1. libsqlplus not exported.
    1sqlplus: error whileloading shared libraries: libsqlplus.so: cannot openshared object file: No suchfile or directory
    2libaio not available.
    1sqlplus: error whileloading shared libraries: libaio.so.1: cannot openshared object file: No suchfile or directory
  2. Startup error about unknown tags. Just ignore this.
    1error: incorrect format: unknown tag

For both cases, please follow the last two steps of the instructions.

Updated (25.2.2010):

  • Different libaio package name for Ubuntu 10.4.
  • Thanks for the tips, in Ubuntu 10.4 I must type:sudo apt-get install libaio1instead ofsudo apt-get install libaio
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值