目录
2.下载安装包 LINUX.X64_193000_db_home.zip
最近一个自有项目同时用到oracle和mysql(后续会去IOE),搭建演示环境操作系统选择了当下较新版本的OS和DB。下面为大家描述在Centos8上安装Oracle 19c具体过程以及遇到的问题。
1.配置centos8的yum源
[root@oracledb home]# cat /etc/redhat-release //查看当前源
[root@oracledb home]# cd /etc/yum.repos.d //查看配置文件
[root@oracledb home]# CentOS-Base.repo //这是系统自带的yum源
[root@oracledb home]# mkdir bak
[root@oracledb home]# mv *.repo bak/
[root@oracledb home]# wget http://mirrors.aliyun.com/repo/Centos-8.repo //下载匹配的源配置文件
[root@oracledb home]# yum clean all
[root@oracledb home]# yum makecache //生成缓存
2.下载安装包 LINUX.X64_193000_db_home.zip
下载地址:https://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html
3.安装前准备工作
3.1创建组和用户
[root@oracledb home]# /usr/sbin/groupadd -g 54321 oinstall
[root@oracledb home]# /usr/sbin/groupadd -g 54322 dba
[root@oracledb home]# /usr/sbin/groupadd -g 54323 oper
[root@oracledb home]# /usr/sbin/useradd -u 54321 -g oinstall -G dba,oper oracle
3.2修改用户密码
[root@oracledb home]# passwd oracle
3.3关闭防火墙、selinux
//关闭防火墙
[root@oracledb home]# /bin/systemctl stop firewalld.service
[root@oracledb home]# /bin/systemctl disable firewalld.service
//关闭:将SELINUX设置为disabled
[root@oracledb home]# cat /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
#SELINUX=enforcing
SELINUX=disabled
# SELINUXTYPE= can take one of these three values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
3.4创建工作的目录,并赋予相应的权限
[root@oracledb home]# mkdir -p /u01/app/oracle/product/19.2.0/db_1
[root@oracledb home]# chown -R oracle:oinstall /u01/
[root@oracledb home]# chmod -R 775 /u01/
3.5配置Oracle的环境变量
[root@oracledb home]# su oracle
[oracle@oracledb home]$ vim .bash_profile
[oracle@oracledb home]$ cd ~
[oracle@oracledb ~]$ vim .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
ORACLE_SID=sanshi;export ORACLE_SID
ORACLE_UNQNAME=sanshi;export ORACLE_UNQNAME
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/19.2.0/db_1; export ORACLE_HOME
NLS_DATE_FORMAT="YYYY:M