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.
- 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.
- Download two .rpm packages from Oracle.
-
32-BIT VERSION:
Linux x86 (32-Bit)
64-BIT VERSION: Linux x86-64 (64-Bit) - 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
- Install the application alien to convert the .rpm packages to .deb which is the required format by Ubuntu. Install it by executing:
1$sudoapt-getinstallalien - Go to the folder where the .rpm packages are located.
1$sudoalien -k oracle-instantclient*.rpm - The .deb packages are ready to be installed.
1$sudodpkg -i oracle-instantclient*basic*.deb2$sudodpkg -i oracle-instantclient*sqlplus*.deb - 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.
where version and client should be populated according to your own specific settings.
1$exportLD_LIBRARY_PATH=/usr/lib/oracle/@@version@@/@@client@@/lib - To make sure that the library is always exported. Put the exported line to /.bashrc} located in your home directory.
1$ gedit ~/.bashrc - Install another dependency needed by SQL Plus.
-
For Ubuntu 9.1:
For Ubuntu 10.4:1$sudoapt-getinstalllibaio1$sudoapt-getinstalllibaio1 - Delete the .rpm and .deb files.
Troubleshooting:
- libsqlplus not exported.
1sqlplus: errorwhileloading shared libraries: libsqlplus.so: cannotopenshared objectfile: No suchfileor directory2libaio not available.1sqlplus: errorwhileloading shared libraries: libaio.so.1: cannotopenshared objectfile: No suchfileor directory - Startup error about unknown tags. Just ignore this.
1error: incorrectformat: 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
本文提供了一步一步的指南,详细介绍了如何在Linux Ubuntu系统上安装和配置Oracle SQL*Plus,包括下载所需软件包、转换文件格式、安装软件、设置环境变量以及解决常见错误的方法。
781

被折叠的 条评论
为什么被折叠?



