大叔经验分享(93)centos安装oracle客户端
1 下载客户端
官方下载地址:https://www.oracle.com/database/technologies/instant-client/linux-x86-64-downloads.html
下载
Basic Package (RPM)
SQL*Plus Package (RPM)
2 安装
# rpm -ivh oracle-instantclient19.5-basic-19.5.0.0.0-1.x86_64.rpm
# rpm -ivh oracle-instantclient19.5-sqlplus-19.5.0.0.0-1.x86_64.rpm
3 环境变量
#vi ~/.bash_profile export ORACLE_BASE=/usr/lib/oracle/19.5 export ORACLE_HOME=$ORACLE_BASE/client64 export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH export TNS_ADMIN=$ORACLE_BASE/admin export NLS_LANG=AMERICAN_AMERICA.AL32UTF8
4 配置TNS
# mkdir -p $ORACLE_HOME/network/admin # vi $ORACLE_HOME/network/admin/tnsnames.ora alias = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.1)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl) ) )
注意该文件格式要求严格,缩进必须为空格,否则会报解析错误;
5 SQLPLUS测试
# sqlplus xxx/xxx@alias
---------------------------------------------------------------- 结束啦,我是大魔王先生的分割线 :) ----------------------------------------------------------------
- 由于大魔王先生能力有限,文中可能存在错误,欢迎指正、补充!
- 感谢您的阅读,如果文章对您有用,那么请为大魔王先生轻轻点个赞,ありがとう