• 周六. 9 月 14th, 2024

5G编程聚合网

5G时代下一个聚合的编程学习网

热门标签

centos7上安装oracle的sqlplus客户端

admin

11 月 28, 2021
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

做一个决定,并不难,难的是付诸行动,并且坚持到底。

发表回复