linux安装oracle client客户端远程连接数据库
linux安装oracle client客户端远程连接数据库。
1.到oracle官网下载basic,sqlplus,devel三个软件包
oracle-instantclient11.2-basic-11.2.0.4.0-1.x86_64.tar
oracle-instantclient11.2-sqlplus-11.2.0.4.0-1.x86_64.tar
oracle-instantclient11.2-devel-11.2.0.4.0-1.x86_64.tar
2.到root用户下创建一个oracle文件夹
mkdir-p /root/oracle
3.将下载的三个软件包全部解压到oracle文件夹下
tar -zxvf 软件包名(不要忘记加后缀)
4.oracle client客户端不会自动生成tnsnames.ora和listener.ora文件,所以需要从本地导入服务器oracle文件夹
5修改文件配置
vi tnsnames.ora
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.169.1.109)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
6.配置环境变量
vi .bash_profile
export ORACLE_HOME=/usr/lib/oracle/11.2/client64
export TNS_ADMIN=$ORACLE_HOME/network/admin
export NLS_LANG='simplified chinese_china'.ZHS16GBK
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export PATH=$ORACLE_HOME/bin:$PATH
7.生效环境变量
source .bash_profile
echo $OARCLE_HOME
8.测试
/root/oracle/sqlplus username/password@orcl
9.如果出现权限不足
#chmod 777 filename