一、下载oracle 12g sqlplus软件
linux 64位操作系统,oracle安装包地址
http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html
oracle-instantclient12.1-basic-12.1.0.2.0-1.x86_64.rpm
二、安装rpm包
rpm -ivh oracle-instantclient12.1-basic-12.1.0.2.0-1.x86_64.rpm
rpm -ivh oracle-instantclient12.1-sqlplus-12.1.0.2.0-1.x86_64.rpm
三、指定sqlplus运行所需要的库
由于是RPM包安装的,因此,oracle客户端默认所在的路径为/usr/lib/oracle/12.1/client64/lib/
#vi /etc/ld.so.conf
在最后加入:/usr/lib/oracle/12.1/client64/lib/
四、重启ldconfig
ldconfig
五、启动sqlplus
sqlplus /nolog
一、配置oracle环境变量
#vi /etc/profile最后加入
export ORACLE_HOME=/usr/lib/oracle/12.1/client64/
export LD_LIBRARY_PATH=:$ORACLE_HOME/lib:/usr/local/lib:$LD_LIBRARY_PATH:.
export TNS_ADMIN=$ORACLE_HOME
export PATH=$PATH:$ORACLE_HOME/bin:.
六、配置连接tnsnames.ora
#cd $ORACLE_HOME加入
test =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = ip)(PORT = 1521))
)
(CONNECT_DATA =
(SID = test )
(SERVER=DEDICATED )
)
)
七、启动
# sqlplus 用户名/密码@test