centos7上安装oracle的sqlplus客户端

1、下载安装软件
oracle-instantclient11.2-basic-11.2.0.3.0-1.x86_64.rpm
oracle-instantclient11.2-devel-11.2.0.3.0-1.x86_64.rpm
oracle-instantclient11.2-sqlplus-11.2.0.3.0-1.x86_64.rpm
2、配置环境变量
cat <<EOF >> /etc/profile
export ORACLE_HOME=/usr/lib/oracle/11.2/client64
export TNS_ADMIN=\$ORACLE_HOME
export PATH=\$PATH:\$ORACLE_HOME/bin
export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:\$ORACLE_HOME/lib
#解决oracle查询汉字乱码
export NLS_LANG="AMERICAN_AMERICA.AL32UTF8"
EOF
3、让环境变量生效
source /etc/profile
4、配置服务
cat <<EOF >$ORACLE_HOME/tnsnames.ora
rktest =
   (DESCRIPTION =
      (ADDRESS_LIST =
        (ADDRESS = (PROTOCOL = TCP)(HOST = 10.64.39.117)(PORT = 1521))
      )
       (CONNECT_DATA = 
          (SERVICE_NAME = RKTESTDB)
     )
   )

EOF	
5、测试
sqlplus user/passwd@rktest

posted @ 2021-08-09 17:06  苍茫宇宙  阅读(1328)  评论(0编辑  收藏  举报