Centos 7.9 一键安装 Oracle 12CR2 单机

前言

Oracle 一键安装脚本,演示 CentOS7.9 一键安装 Oracle 12CR2 单机 non-CDB 多实例(20240116)过程(全程无需人工干预)。(脚本包括 ORALCE PSU/OJVM 等补丁自动安装)

⭐️ 脚本下载地址:Shell脚本安装Oracle数据库

安装准备

  • 1、安装好操作系统,建议安装图形化
  • 2、配置好网络
  • 3、挂载本地 ISO 镜像源
  • 4、上传软件安装包(安装基础包,补丁包)
  • 5、上传一键安装脚本:OracleShellInstall

环境信息

bash 复制代码
[root@localhost ~]# cat /etc/os-release
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"

[root@localhost ~]# ip a
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:0c:29:4d:e5:4b brd ff:ff:ff:ff:ff:ff
    inet 192.168.200.151/24 brd 192.168.200.255 scope global noprefixroute ens33
       valid_lft forever preferred_lft forever
    inet6 fe80::c56:de4d:f34b:72bd/64 scope link noprefixroute
       valid_lft forever preferred_lft forever

[root@localhost ~]# ls /mnt/cdrom/
CentOS_BuildTag  GPL       LiveOS    RPM-GPG-KEY-CentOS-7
EFI              images    Packages  RPM-GPG-KEY-CentOS-Testing-7
EULA             isolinux  repodata  TRANS.TBL

[root@localhost ~]# ll /soft
-rw-r--r-- 1 root root    3817244 Apr 10 16:20 glibc-2.17-326.el7_9.x86_64.rpm
-rw-r--r-- 1 root root 3453696911 Apr 10 16:18 LINUX.X64_122010_db_home.zip
-rw-r--r-- 1 root root     192431 Apr 10 16:18 OracleShellInstall
-rw-r--r-- 1 root root  138325588 Apr 10 16:18 p35926712_122010_Linux-x86-64.zip
-rw-r--r-- 1 root root 1148325873 Apr 10 16:18 p35966787_122010_Linux-x86-64.zip
-rw-r--r-- 1 root root  127629034 Apr 10 16:18 p6880880_122010_Linux-x86-64.zip
-rw-r--r-- 1 root root     340033 Apr 10 16:20 rlwrap-0.46.1.tar.gz

确保安装环境准备完成后,即可执行一键安装。

安装命令

使用标准生产环境安装参数(安装过程若失败,脚本支持重复执行安装):

bash 复制代码
# 根据脚本 README 或者 -h 命令提示,编辑好一键安装命令,进入 /soft 目录执行安装:
./OracleShellInstall -lf ens33 \
-n h12c2 \
-o orcl1,orcl2 \
-opa 35966787 \
-jpa 35926712 \
-op oracle \
-dp oracle \
-redo 500 \
-opd Y

安装过程

bash 复制代码
   ███████                             ██          ████████ ██               ██  ██ ██                    ██              ██  ██
  ██░░░░░██                           ░██         ██░░░░░░ ░██              ░██ ░██░██                   ░██             ░██ ░██
 ██     ░░██ ██████  ██████    █████  ░██  █████ ░██       ░██       █████  ░██ ░██░██ ███████   ██████ ██████  ██████   ░██ ░██
░██      ░██░░██░░█ ░░░░░░██  ██░░░██ ░██ ██░░░██░█████████░██████  ██░░░██ ░██ ░██░██░░██░░░██ ██░░░░ ░░░██░  ░░░░░░██  ░██ ░██
░██      ░██ ░██ ░   ███████ ░██  ░░  ░██░███████░░░░░░░░██░██░░░██░███████ ░██ ░██░██ ░██  ░██░░█████   ░██    ███████  ░██ ░██
░░██     ██  ░██    ██░░░░██ ░██   ██ ░██░██░░░░        ░██░██  ░██░██░░░░  ░██ ░██░██ ░██  ░██ ░░░░░██  ░██   ██░░░░██  ░██ ░██
 ░░███████  ░███   ░░████████░░█████  ███░░██████ ████████ ░██  ░██░░██████ ███ ███░██ ███  ░██ ██████   ░░██ ░░████████ ███ ███
  ░░░░░░░   ░░░     ░░░░░░░░  ░░░░░  ░░░  ░░░░░░ ░░░░░░░░  ░░   ░░  ░░░░░░ ░░░ ░░░ ░░ ░░░   ░░ ░░░░░░     ░░   ░░░░░░░░ ░░░ ░░░

请选择安装模式 [单机(si)/单机ASM(sa)/集群(rac)] : si

数据库安装模式: single

请选择数据库版本 [11/12/19/21] : 12

数据库版本:     12

OracleShellInstall 开始安装(安装过程可查看日志:/soft/print_ora_install_20240410213819.log)
正在检查操作系统是否符合安装条件......已完成 (耗时: 0 秒)
正在去除密码复杂度配置......已完成 (耗时: 0 秒)
正在配置 YUM 源......已完成 (耗时: 1 秒)
单机数据库重装,停止并删除运行数据库......已完成 (耗时: 1 秒)
正在获取操作系统信息......已完成 (耗时: 1 秒)
正在配置 Swap......已完成 (耗时: 48 秒)
正在配置防火墙......已完成 (耗时: 2 秒)
正在配置 selinux......已完成 (耗时: 1 秒)
正在配置 nsyctl......已完成 (耗时: 1 秒)
正在安装依赖包......已完成 (耗时: 50 秒)
正在配置主机名和 /etc/hosts......已完成 (耗时: 1 秒)
正在创建用户和组......已完成 (耗时: 1 秒)
正在创建安装目录......已完成 (耗时: 1 秒)
正在配置 Avahi-daemon 服务......已完成 (耗时: 14 秒)
正在配置透明大页 && NUMA && 磁盘 IO 调度器......已完成 (耗时: 1 秒)
正在配置操作系统参数 sysctl......已完成 (耗时: 1 秒)
正在配置 RemoveIPC......已完成 (耗时: 1 秒)
正在配置用户限制 limit......已完成 (耗时: 1 秒)
正在配置 shm 目录......已完成 (耗时: 1 秒)
正在安装 rlwrap 插件......已完成 (耗时: 13 秒)
正在配置用户环境变量......已完成 (耗时: 1 秒)
正在解压 Oracle 安装包以及补丁......已完成 (耗时: 70 秒)
正在安装 Oracle 软件以及补丁......已完成 (耗时: 650 秒)
正在创建监听......已完成 (耗时: 3 秒)
正在创建数据库......已完成 (耗时: 1210 秒)
正在优化数据库......已完成 (耗时: 18 秒)

恭喜!Oracle 单机安装成功 (耗时: 2092 秒),现在是否重启主机:[Y/N]

连接测试

bash 复制代码
[root@h12c2:/root]$ so
[oracle@h12c2:/home/oracle]$ opatch lspatches
35926712;OJVM RELEASE UPDATE 12.2.0.1.240116 (35926712)
35966787;Database Jan 2024 Release Update : 12.2.0.1.240116 (35966787)

OPatch succeeded.

[oracle@h12c2:/home/oracle]$ lsnrctl status

LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 10-APR-2024 22:21:44

Copyright (c) 1991, 2016, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=h12c2)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 12.2.0.1.0 - Production
Start Date                10-APR-2024 22:21:21
Uptime                    0 days 0 hr. 0 min. 22 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/12.2.0/db/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/h12c2/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=h12c2)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "orcl1" has 1 instance(s).
  Instance "orcl1", status READY, has 1 handler(s) for this service...
Service "orcl1XDB" has 1 instance(s).
  Instance "orcl1", status READY, has 1 handler(s) for this service...
Service "orcl2" has 1 instance(s).
  Instance "orcl2", status READY, has 1 handler(s) for this service...
Service "orcl2XDB" has 1 instance(s).
  Instance "orcl2", status READY, has 1 handler(s) for this service...
The command completed successfully
相关推荐
chenyang_8811 分钟前
MySQL——statement对象详解
数据库·mysql·oracle
fengzhuzhigu26 分钟前
Go源码--channel源码解读
开发语言·后端·golang
AskHarries1 小时前
Spring Boot集成jacoco实现单元测试覆盖统计
java·spring boot·后端
全职计算机毕业设计1 小时前
基于springboot的工作绩效管理系统的设计与实现+文档
java·spring boot·后端
Mero技术博客2 小时前
第四节:如何使用注解方式从IOC中获取bean(自学Spring boot 3.x的第一天)
java·spring boot·后端·spring·微服务
花花鱼2 小时前
spring boot (shiro)+ websocket测试连接不上的简单检测处理
java·spring boot·后端
人才程序员2 小时前
【Rust入门】猜数游戏
开发语言·c++·后端·单片机·游戏·rust·c
人才程序员2 小时前
【Rust入门】生成随机数
开发语言·数据库·后端·单片机·rust
uccs3 小时前
go 中一些其他的用法
后端·go
y5236483 小时前
ASP.NET Core 使用Log4net
后端·asp.net