oracle19c-图形安装(centos7)

目录

  • 一.环境准备
    • 1.关闭防火墙
    • 2.关闭SELINUX
    • 3.配置本地yum源
    • 4.安装ORACLE先决条件的软件包
    • 5.修改LINUX的内核文件
    • 6.添加下列参数到/etc/security/limits.conf
    • 7.添加下列条目到/etc/pam.d/login
    • 8.环境变量中添加下列语句
    • 9.创建文件目录和相应的用户
    • 10.配置oracle用户的环境变量
    • 11.上传软件并解压
  • 二.图形安装
    • 第一步 执行安装命令
    • 第二步 配置监听
    • 第三步 创建数据库
    • 第四步 测试
  • 三.设置开机自启

19c安装包
链接:https://pan.baidu.com/s/1qqd9tAKZC80-jAODq6URhw
提取码:odnq
–来自百度网盘超级会员V2的分享

compat-libstdc+±33-3.2.3-72.el7.x86_64 文件
链接:https://pan.baidu.com/s/1IqxhTqcjh2fSFnRcuoElNw
提取码:pnqt
–来自百度网盘超级会员V2的分享

环境centos7 4核16G
带图形 server with Gui

一.环境准备

1.关闭防火墙

#检查防火墙状态
systemctl status firewalld.service

#暂时关闭防火墙,下次启动时防火墙仍随系统启动而启动
systemctl stop firewalld.service

#彻底永久关闭防火墙
systemctl disable firewalld.service

2.关闭SELINUX

vi /etc/selinux/config
将内容
SELINUX=enforcing
更改为
SELINUX=disabled

或者命令关闭selinux
sed -i's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config

3.配置本地yum源

[root@localhost ~]# mkdir /yums
[root@localhost ~]# cd /run/media/root/CentOS\ 7\ x86_64/Packages/
[root@localhost Packages]# cp * /yums
[root@localhost Packages]# cd /yums
[root@localhost yums]# createrepo .
......
[root@localhost yums]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# rm -rf *
[root@localhost yum.repos.d]# vim yum.local.repo
[local]
name=yum local repo
baseurl=file:///yums
gpgcheck=0
enable=1
[root@localhost yum.repos.d]# yum clean all
Loaded plugins: fastestmirror, langpacks
Cleaning repos: local
Cleaning up list of fastest mirrors

[root@localhost yum.repos.d]# yum repolist

4.安装ORACLE先决条件的软件包

yum install -y bc
yum install -y compat-libcap1*
yum install -y compat-libcap*
yum install -y binutils 
yum install -y compat-libstdc++-33 
yum install -y elfutils-libelf 
yum install -y elfutils-libelf-devel 
yum install -y gcc 
yum install -y gcc-c++ 
yum install -y glibc-2.5 
yum install -y glibc-common 
yum install -y glibc-devel 
yum install -y glibc-headers 
yum install -y ksh libaio 
yum install -y libaio-devel 
yum install -y libgcc 
yum install -y libstdc++ 
yum install -y libstdc++-devel 
yum install -y make 
yum install -y sysstat 
yum install -y unixODBC 
yum install -y unixODBC-devel
yum install -y binutils*
yum install -y compat-libstdc*
yum install -y elfutils-libelf*
yum install -y gcc*
yum install -y glibc*
yum install -y ksh*
yum install -y libaio*
yum install -y libgcc*
yum install -y libstdc*
yum install -y make*
yum install -y sysstat*
yum install -y libXp*
yum install -y glibc-kernheaders
yum install -y net-tools-*

5.修改LINUX的内核文件

#修改配置
vi /etc/sysctl.conf
kernel.shmmax = 277495689510912
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586
fs.file-max = 6815744
kernel.shmall = 67747971072
net.ipv4.tcp_max_tw_buckets = 6000
net.ipv4.ip_local_port_range = 9000 65500
net.ipv4.tcp_tw_recycle = 0
net.ipv4.tcp_tw_reuse = 1
#net.core.somaxconn = 262144
net.core.netdev_max_backlog = 262144
net.ipv4.tcp_max_orphans = 262144
net.ipv4.tcp_max_syn_backlog = 262144
net.ipv4.tcp_synack_retries = 2
net.ipv4.tcp_syn_retries = 1
net.ipv4.tcp_fin_timeout = 1
net.ipv4.tcp_keepalive_time = 30
net.ipv4.tcp_keepalive_probes = 6
net.ipv4.tcp_keepalive_intvl = 5
net.ipv4.tcp_timestamps = 0
fs.aio-max-nr = 1048576
net.ipv4.conf.all.rp_filter = 2
net.ipv4.conf.default.rp_filter = 2

#生成系统参数
sysctl -p 

6.添加下列参数到/etc/security/limits.conf

vi /etc/security/limits.conf

oracle   soft   nofile    1024
oracle   hard   nofile    65536
oracle   soft   nproc    16384
oracle   hard   nproc    16384
oracle   soft   stack    10240
oracle   hard   stack    32768
oracle   hard   memlock    134217728
oracle   soft   memlock    134217728

7.添加下列条目到/etc/pam.d/login

vim /etc/pam.d/login

session required /lib/security/pam_limits.so
session required pam_limits.so

8.环境变量中添加下列语句

vim /etc/profile

if [ $USER = "oracle" ]; then
   if [ $SHELL = "/bin/ksh" ]; then
      ulimit -p 16384
      ulimit -n 65536
      else
      ulimit -u 16384 -n 65536
   fi
fi

#生成环境变量
source /etc/profile

9.创建文件目录和相应的用户

groupadd oinstall
groupadd dba
groupadd oper
useradd -g oinstall -G dba,oper oracle

mkdir -p /u01/app/oracle
mkdir -p /u01/oraInventory
chown -R oracle.oinstall /u01
chown -R oracle:oinstall /u01/app/oracle
chmod -R 775 /u01/app/oracle

#19c需要额外创建
--ORACLE的HOME目录
mkdir -p /u01/app/oracle/product/19c/db_1    
chown -R oracle:oinstall /u01/app/oracle/product/

10.配置oracle用户的环境变量

su - oracle

vim .bash_profile

export EDITOR=vi
export TMP=/tmp  
export TMPDIR=$TMP
export ORACLE_SID=orcl
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/19c/db_1
export INVENTORY_LOCATION=/u01/oraInventory
export TNS_ADMIN=$ORACLE_HOME/network/admin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export NLS_LANG="AMERICAN_AMERICA.AL32UTF8"
export NLS_DATE_FORMAT="YYYY-MM-DD HH24:MI:SS"
export PATH=$ORACLE_HOME/bin:/bin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/X11R6/bin:$PATH:$HOME/bin
umask 022

source .bash_profile

参数说明
export EDITOR=vi  默认的编辑器是vi
export TMP=/tmp   ORACLE默认的临时目录是/tmp
export TMPDIR=$TMP 临时目录生成
export ORACLE_SID=orcl  ORACLE实例名称是orcl
export ORACLE_BASE=/u01/app/oracle   ORACLE的基本目录 
export ORACLE_HOME=$ORACLE_BASE/product/19c/db_1  ORACLE数据库的HOME目录
export INVENTORY_LOCATION=/u01/oraInventory       ORACLE安装时的inventory
export TNS_ADMIN=$ORACLE_HOME/network/admin     ORACLE的网络主目录
export LD_LIBRARY_PATH=$ORACLE_HOME/lib         ORACLE的库文件目录
export NLS_LANG="AMERICAN_AMERICA.AL32UTF8"  ORACLE的字符集 不过我们弃用 因为我们使用UTF8
export NLS_DATE_FORMAT="YYYY-MM-DD HH24:MI:SS" ORACLE的日期格式 我们使用会话的方式修改 弃用
export PATH=$ORACLE_HOME/bin:/bin:/usr

11.上传软件并解压

#上传到/u01/app/oracle/product/19c/db_1
chown -R oracle:oinstall   压缩包

#切换oracle账户
su - oralce
unzip 压缩包

二.图形安装

第一步 执行安装命令

#root执行
[root@localhost oracle]# export DISPLAY=:0.0
[root@localhost oracle]# xhost +
access control disabled, clients can connect from any host

#oracle执行
[oracle@localhost db_1]# export DISPLAY=:0.0
[oracle@localhost db_1]# xhost +
access control disabled, clients can connect from any host
#开始安装
[oracle@localhost db_1]# ./runInstaller 

1)下一步
oracle19c-图形安装(centos7)_第1张图片
2)创建单实例 下一步
oracle19c-图形安装(centos7)_第2张图片
3)企业版 下一步
oracle19c-图形安装(centos7)_第3张图片
4)目录 下一步
oracle19c-图形安装(centos7)_第4张图片
5)清单目录 下一步
oracle19c-图形安装(centos7)_第5张图片
6)下一步
oracle19c-图形安装(centos7)_第6张图片
7)下一步
oracle19c-图形安装(centos7)_第7张图片
oracle19c-图形安装(centos7)_第8张图片
8)执行先决条件检查
oracle19c-图形安装(centos7)_第9张图片
执行检查,勾选忽略,下一步
oracle19c-图形安装(centos7)_第10张图片
yes
oracle19c-图形安装(centos7)_第11张图片
9)执行安装
oracle19c-图形安装(centos7)_第12张图片
oracle19c-图形安装(centos7)_第13张图片
10)中间会让我们用root账户执行两个脚本
oracle19c-图形安装(centos7)_第14张图片

[root@localhost ~]# /u01/oraInventory/orainstRoot.sh 
Changing permissions of /u01/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.

Changing groupname of /u01/oraInventory to oinstall.
The execution of the script is complete.
[root@localhost ~]# /u01/app/oracle/product/19c/db_1/root.sh
Performing root user operation.

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /u01/app/oracle/product/19c/db_1

Enter the full pathname of the local bin directory: [/usr/local/bin]: 
   Copying dbhome to /usr/local/bin ...
   Copying oraenv to /usr/local/bin ...
   Copying coraenv to /usr/local/bin ...


Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Oracle Trace File Analyzer (TFA - Standalone Mode) is available at :
    /u01/app/oracle/product/19c/db_1/bin/tfactl

Note :
1. tfactl will use TFA Service if that service is running and user has been granted access
2. tfactl will configure TFA Standalone Mode only if user has no access to TFA Service or TFA is not installed

oracle19c-图形安装(centos7)_第15张图片

11)安装完成

第二步 配置监听

#oracle账户执行
netca

oracle19c-图形安装(centos7)_第16张图片
oracle19c-图形安装(centos7)_第17张图片
oracle19c-图形安装(centos7)_第18张图片
oracle19c-图形安装(centos7)_第19张图片
oracle19c-图形安装(centos7)_第20张图片
oracle19c-图形安装(centos7)_第21张图片

oracle19c-图形安装(centos7)_第22张图片
关闭就可以了

第三步 创建数据库

#oracle账户执行
dbca

1)创建数据库
oracle19c-图形安装(centos7)_第23张图片
2)高级配置
oracle19c-图形安装(centos7)_第24张图片
3)下一步
oracle19c-图形安装(centos7)_第25张图片
4)oracle实例名称 下一步
oracle19c-图形安装(centos7)_第26张图片
5)下一步
oracle19c-图形安装(centos7)_第27张图片
6)下一步
oracle19c-图形安装(centos7)_第28张图片
7)下一步
oracle19c-图形安装(centos7)_第29张图片
oracle19c-图形安装(centos7)_第30张图片

8)设置内存大小
oracle19c-图形安装(centos7)_第31张图片
设置字符集
oracle19c-图形安装(centos7)_第32张图片
9)下一步
oracle19c-图形安装(centos7)_第33张图片
10)使用统一的密码
oracle19c-图形安装(centos7)_第34张图片
11)创建数据库
oracle19c-图形安装(centos7)_第35张图片
oracle19c-图形安装(centos7)_第36张图片
oracle19c-图形安装(centos7)_第37张图片
oracle19c-图形安装(centos7)_第38张图片

oracle安装成功

第四步 测试

[oracle@localhost ~]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Mon Aug 28 02:42:50 2023
Version 19.3.0.0.0

Copyright (c) 1982, 2022, Oracle.  All rights reserved.


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

oracle19c-图形安装(centos7)_第39张图片

三.设置开机自启

oracle配置开机自启
1.  vim /etc/oratab
      N修改成Y
     /u01/app/oracle/product/19c/db_1:Y  
2. vim /usr/bin/oracle.sh

  #! /bin/bash 
/u01/app/oracle/product/19c/db_1/bin/lsnrctl start
/u01/app/oracle/product/19c/db_1/bin/dbstart /u01/app/oracle/product/19c/db_1
3. 给权限chmod 777 /usr/bin/oracle.sh
4.  vim  /etc/systemd/system/oracle19c.service
  
[Unit]
Description=Oracle19c
After=syslog.target network.target
[Service]
LimitMEMLOCK=infinity
LimitNOFILE=65535
Type=oneshot
RemainAfterExit=yes
User=oracle
Environment="ORACLE_HOME=/u01/app/oracle/product/19c/db_1"
ExecStart=/usr/bin/oracle.sh
[Install]
WantedBy=multi-user.target
5.systemctl enable oracle19c
6.systemctl is-enabled oracle19c.service   #查看服务是否是开机自启动

你可能感兴趣的:(ORACLE,数据库,oracle)