LINUX系统下ORACLE19C客户端安装步骤

服务器系统版本:CentOS 7.4

Oracle客户端安装包(19C版本)下载地址:
https://www.oracle.com/database/technologies/instant-client/linux-x86-64-downloads.html

现阶段19c版本已下载完毕,上传至服务器;

2.切换至root用户,将安装包放在根目录的 opt/oracle下

(上传服务器的时候可以先上传到有权限的文件夹,再移动到opt/oracle)例:

mv /home/app/oarcle/*.rpm /opt/oracle/

3.执行安装命令 ,rpm -ivh rpm包名,安装顺序注意一下,basic、devel,其他的随意。安装完成后会在根目录下的usr/lib下生产oracle目录。

安装命令:

rpm -ivh oracle-instantclient19.12-basic-19.12.0.0.0-1.x86_64.rpm

rpm -ivh oracle-instantclient19.12-devel-19.12.0.0.0-1.x86_64.rpm

rpm -ivh oracle-instantclient19.12-jdbc-19.12.0.0.0-1.x86_64.rpm

rpm -ivh oracle-instantclient19.12-odbc-19.12.0.0.0-1.x86_64.rpm

rpm -ivh oracle-instantclient19.12-sqlplus-19.12.0.0.0-1.x86_64.rpm

rpm -ivh oracle-instantclient19.12-tools-19.12.0.0.0-1.x86_64.rpm

4.root用户在/usr/lib/oracle/19.12/client64下创建tnsnames.ora文件,内容为(按需要设置sid跟host的值):

–创建tnsnames.ora

touch tnsnames.ora

SID =

(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = TCP)(HOST = XXX.XXX.XXX.XXX)(PORT = XXXX))

)

(CONNECT_DATA =

(SERVER = DEDICATED)

(SERVICE_NAME = XXXX)

)

)

5.配置环境变量

切换至普通用户,vi ~/.bash_profile 。添加如下内容。保存退出后,source ~/.bash_profile 刷新配置信息

export ORACLE_HOME=/usr/lib/oracle/19.12/client64

export TNS_ADMIN=/usr/lib/oracle/19.12/client64

export TNS=/usr/lib/oracle/19.12/client64

export NLS_LANG=AMERICAN_AMERICA.AL32UTF8

export LD_LIBRARY_PATH= O R A C L E H O M E / l i b : ORACLE_HOME/lib: ORACLEHOME/lib:LD_LIBRARY_PATH

PATH= P A T H : PATH: PATH:HOME/bin: O R A C L E H O M E / b i n : ORACLE_HOME/bin: ORACLEHOME/bin:ORACLE_HOME/lib

6.验证部署结果

继续普通用户,使用命令 sqlplus username/passwd@SID 验证,能正常登陆数据库即为安装成功。

sqlplus -v
sqlplus XXXX/XXXX@XXX

你可能感兴趣的:(linux,运维,服务器)