1、安装依赖包
先安装:
[root@localhost mnt]# rpm -ivh compat-libcap1-1.10-7.el7.x86_64.rpm
libnsl-2.28-127.el8.x86_64
libaio-devel-0.3.112-1.el8.x86_64
compat-libstdc++-33-3.2.3-72.el7.x86_64
compat-libcap1-1.10-7.el7.x86_64
再安装:
[root@localhost mnt]# yum -y install oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm
此包将会设置好Oracle相关组和用户,权限也自动设置好
2、修改用户密码:
[root@localhost mnt]# passwd oracle
3、关闭防火墙还有selinux
防火墙:
[root@localhost ~]# systemctl stop firewalld.service //停止防火墙服务
[root@localhost ~]# systemctl disable firewalld.service //开机不启动防火墙
selinux:
[root@localhost ~]# vi /etc/selinux/config
SELINUX=disabled
4、配置Oracle的环境变量
首先
[root@localhost ~]# su - oracle
输入
[oracle@localhost ~]$ vi .bash_profile
在,编辑模式下输入
复制代码
ORACLE_SID=orcl;export ORACLE_SID
ORACLE_UNQNAME=orcl;export ORACLE_UNQNAME
ORACLE_BASE=/opt/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/19c/dbhome_1; export ORACLE_HOME
NLS_DATE_FORMAT="YYYY:MM:DDHH24:MI:SS"; export NLS_DATE_FORMAT
NLS_LANG=american_america.ZHS16GBK; export NLS_LANG
TNS_ADMIN=$ORACLE_HOME/network/admin; export TNS_ADMIN
ORA_NLS11=$ORACLE_HOME/nls/data; export ORA_NLS11
PATH=.:${JAVA_HOME}/bin:${PATH}:$HOME/bin:$ORACLE_HOME/bin:$ORA_CRS_HOME/bin
PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin
export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/oracm/lib
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib
export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE
CLASSPATH=${CLASSPATH}:$ORACLE_HOME/jlib
CLASSPATH=${CLASSPATH}:$ORACLE_HOME/rdbms/jlib
CLASSPATH=${CLASSPATH}:$ORACLE_HOME/network/jlib
export CLASSPATH
THREADS_FLAG=native; export THREADS_FLAG
export TEMP=/tmp
export TMPDIR=/tmp
复制代码
保存之后退出。
[root@localhost oracle]# source .bash_profile
[root@localhost oracle]# echo $ORACLE_BASE
/opt/oracle
5、修改内核参数
首先退出到root用户,然后输入
[root@localhost ~]# vi /etc/sysctl.conf
编辑模式下,输入相关的变量
复制代码
fs.file-max = 6815744
kernel.sem = 250 32000 100 128
kernel.shmmni = 4096
kernel.shmall = 1073741824
kernel.shmmax = 4398046511104
kernel.panic_on_oops = 1
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range = 9000 65500
复制代码
然后输入
sysctl --system
生效
6、下面开始安装数据库软件
[root@localhost mnt]# rpm -ivh oracle-database-ee-19c-1.0-1.x86_64.rpm
Oracle19c默认安装路径:/opt/oracle
7、安装成功之后,创建数据库实例和监听器
[root@localhost ~]# startx
[root@localhost ~]# export DISPLAY=:0 //图形界面授予本地终端
[root@localhost db_1]# xhost +
access control disabled, clients can connect from any host //此信息表示图形界面授予成功
[root@localhost db_1]# su oracle
[oracle@localhost ~]$ dbca //使用Oracle图形界面安装实例和监听器