linux上使用sqlplus远程访问oracle

转载请注明出处:http://www.cnblogs.com/blazer/p/5049291.html

Centos6.4 

从oracle官网找到Instant Client下载地址:

http://www.oracle.com/technetwork/cn/topics/linuxsoft-100466-zhs.html

下载basic和sqlplus

我这里下载的是

instantclient-basic-linux32-11.2.00.1.zip

instantclient-sqlplus-linux32-11.2.00.1.zip

解压到同一个目录下

我这里的解压后的目录是这个样子

ll /home/www/oracle_client_linux

然后需要将该目录加入到环境变量

vi ~/.bashrc
# .bashrc

# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc
fi

# User specific aliases and functions

PATH=$PATH:$HOME/bin

export PATH

LD_LIBRARY_PATH=/home/www/oracle_client_linux

export LD_LIBRARY_PATH

标红的部分是新加入的环境变量

然后使用命令就可以直接登录了

home/www/oracle_client_linux/sqlplus $user_name/$password@hostname:$port/$service_name

标红的部分是变量

改成对应意思的字串就行

进去后如下界面:

好了,可以在上面执行命令了。

原文地址:https://www.cnblogs.com/blazer/p/5049291.html