sql*plus是随同oracle软件一起安装的,可执行文件位于:
$ORACLE_HOME/bin/sqlplus
linux下用户环境设置,以便使用sql*plus:
oracle_home:
类似opt/oracle11g/product/11.2.0/dbhome_1
path:
必须包含oracle home下面的bin目录.
ld_library_path:
必须包含oracle home下面的lib目录.
oracle_sid:
可以使用echo检查这些会话参数的设置。
也可以选择编辑 .bash_profile文件,把这些参数加入。
[root@zeng ~]# su - linux
[linux@zeng ~]$ export ORACLE_HOME=/opt/oracle11g/product/11.2.0/dbhome_1
[linux@zeng ~]$ export PATH=$ORACLE_HOME/bin:$PATH
[linux@zeng ~]$ export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
[linux@zeng ~]$ export ORACLE_SID=oracle
[linux@zeng ~]$ sqlplus
SQL*Plus: Release 11.2.0.1.0 Production on Tue Feb 14 22:20:17 2012
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Enter user-name: hr
Enter password:
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>