CentOS7安装Oracle

本文介绍如何在CentOS7上安装Oracle 19c数据库,包括必要的依赖库安装、预安装步骤及Oracle数据库主体的安装过程。文中还提供了配置环境变量的方法以及启动1521端口监听的具体指令。

CentOS7安装Oracle

前言

版本说明

oracle-database-ee=19c-1.0-1.x86_64.rpm

相关链接:

  • oracle 下载地址:https://www.oracle.com/database/technologies/oracle-database-software-downloads.html
  • 官方安装教程:https://docs.oracle.com/en/database/oracle/oracle-database/19/ladbi/running-rpm-packages-to-install-oracle-database.html#GUID-BB7C11E3-D385-4A2F-9EAF-75F4F0AACF02
  • compat-libstdc+±33 下载地址:http://www.rpmfind.net/linux/rpm2html/search.php?query=compat-libstdc+±33
  • compat-libcap1 下载地址:http://rpmfind.net/linux/RPM/centos/7.8.2003/x86_64/Packages/compat-libcap1-1.10-7.el7.x86_64.html

安装

前置安装

  • compat-libstdc+±33 下载地址:http://www.rpmfind.net/linux/rpm2html/search.php?query=compat-libstdc+±33
  • compat-libcap1 下载地址:http://rpmfind.net/linux/RPM/centos/7.8.2003/x86_64/Packages/compat-libcap1-1.10-7.el7.x86_64.html
curl -o  compat-libstdc++-33-3.2.3-72.el7.i686.rpm http://www.rpmfind.net/linux/centos/7.8.2003/os/x86_64/Packages/compat-libstdc++-33-3.2.3-72.el7.i686.rpm
curl -o compat-libcap1-1.10-7.el7.x86_64.rpm  http://rpmfind.net/linux/centos/7.8.2003/os/x86_64/Packages/compat-libcap1-1.10-7.el7.x86_64.rpm
yum localinstall -y compat-libcap1-1.10-7.el7.x86_64.rpm
yum localinstall -y compat-libstdc++-33-3.2.3-72.el7.i686.rpm

Oracle 预安装

  • oracle-database-preinstall 下载地址:https://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/

打开下载网址,搜索 oracle-database-preinstall 并下载

curl -o oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm https://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/getPackage/oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm
yum -y localinstall oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm

安装 Oracle

  • oracle 下载地址:https://www.oracle.com/database/technologies/oracle-database-software-downloads.html

下载 oracle 安装后,上传到 temp 目录下,执行操作

cd /tmp
yum -y localinstall oracle-database-ee-19c-1.0-1.x86_64.rpm

在这里插入图片描述

初始化

# 注意需要很长的时间创建 oracle 实例
/etc/init.d/oracledb_ORCLCDB-19c configure

在这里插入图片描述

配置Oracle环境

编辑 /home/oracle/.bash_profile 配置文件,添加如下内容,

重新加载配置文件(source /home/oracle/.bash_profile

export  ORACLE_BASE=/opt/oracle
export  ORACLE_HOME=/opt/oracle/product/19c/dbhome_1
export  ORACLE_SID=ORCLCDB
export  PATH=$ORACLE_HOME/bin:$PATH:$HOME/.local/bin:$HOME/bin
export  LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib
export  NLS_LANG=AMERICAN_AMERICA.UTF8 

修改 oracle 用户的密码

passwd oracle

切换 oracle 用户登录 Oracle 数据库

su oracle
sqlplus / as sysdba

登录用户名选择:sys as sysdba ,密码:change_on_install

修改 system 密码

SQL> password system

启动1521端口监听

使用 oracle 用户,启动1521端口监听

su oracle
# 进入 $ORACLE_HOME/bin 目录下
cd /opt/oracle/product/19c/dbhome_1/bin
# 重新加载配置
source /home/oracle/.bash_profile
# 启动1521端口监听
./lsnrctl start

# 命令
./lsnrctl stop
./lsnrctl start
./lsnrctl status

在这里插入图片描述

连接测试

使用 DataGrip 连接,service_name=ORCLCDBUser=system ,密码是自己设置的,如图:

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Simba1949

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值