Ubuntu 22.04 一键安装 Oracle 11GR2 单机

前言

Oracle 一键安装脚本,演示华为 Ubuntu 22.04 一键安装 Oracle 11GR2 单机版过程(全程无需人工干预)。

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

安装准备

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

环境信息

# 主机版本
root@Ubuntu22:/soft# cat /etc/os-release 
PRETTY_NAME="Ubuntu 22.04.4 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.4 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy

# 网络信息
root@Ubuntu22:/soft# ip a
2: ens160: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:0c:29:e9:de:06 brd ff:ff:ff:ff:ff:ff
    altname enp3s0
    inet 192.168.6.123/24 brd 192.168.6.255 scope global dynamic noprefixroute ens160
       valid_lft 84800sec preferred_lft 84800sec
    inet6 fe80::d5b7:70e3:c953:9b59/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever

# 连接外网测试
root@Ubuntu22:/soft# ping www.baidu.com
PING www.a.shifen.com (180.101.50.188) 56(84) bytes of data.
64 bytes from 180.101.50.188 (180.101.50.188): icmp_seq=1 ttl=53 time=5.32 ms
64 bytes from 180.101.50.188 (180.101.50.188): icmp_seq=2 ttl=53 time=5.24 ms
64 bytes from 180.101.50.188 (180.101.50.188): icmp_seq=3 ttl=53 time=5.75 ms
64 bytes from 180.101.50.188 (180.101.50.188): icmp_seq=4 ttl=53 time=5.79 ms
64 bytes from 180.101.50.188 (180.101.50.188): icmp_seq=5 ttl=53 time=5.91 ms
64 bytes from 180.101.50.188 (180.101.50.188): icmp_seq=6 ttl=53 time=5.76 ms

# 安装包存放在 /soft 目录下
root@Ubuntu22:/soft# ls -l
-rwxr-xr-x 1 root root     217523  66 11:33 OracleShellInstall
-rwx------ 1 root root 1395582860  66 11:27 p13390677_112040_Linux-x86-64_1of7.zip
-rwx------ 1 root root 1151304589  66 11:27 p13390677_112040_Linux-x86-64_2of7.zip

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

安装命令

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

# 根据脚本 README 或者 -h 命令提示,编辑好一键安装命令,进入 /soft 目录执行安装:
./OracleShellInstall -lf ens160 `# local ip ifname`\
-n Ubuntu22 `# hostname`\
-op oracle `# oracle password`\
-d /u01 `# software base dir`\
-ord /oradata `# data dir`\
-o lucifer `# dbname`\
-dp oracle `# sys/system password`\
-ds AL32UTF8 `# database character`\
-ns AL16UTF16 `# national character`\
-redo 100 `# redo size`\
-opd Y `# optimize db`

安装过程

   ███████                             ██          ████████ ██               ██  ██ ██                    ██              ██  ██
  ██░░░░░██                           ░██         ██░░░░░░ ░██              ░██ ░██░██                   ░██             ░██ ░██
 ██     ░░██ ██████  ██████    █████  ░██  █████ ░██       ░██       █████  ░██ ░██░██ ███████   ██████ ██████  ██████   ░██ ░██
░██      ░██░░██░░█ ░░░░░░██  ██░░░██ ░██ ██░░░██░█████████░██████  ██░░░██ ░██ ░██░██░░██░░░██ ██░░░░ ░░░██░  ░░░░░░██  ░██ ░██
░██      ░██ ░██ ░   ███████ ░██  ░░  ░██░███████░░░░░░░░██░██░░░██░███████ ░██ ░██░██ ░██  ░██░░█████   ░██    ███████  ░██ ░██
░░██     ██  ░██    ██░░░░██ ░██   ██ ░██░██░░░░        ░██░██  ░██░██░░░░  ░██ ░██░██ ░██  ░██ ░░░░░██  ░██   ██░░░░██  ░██ ░██
 ░░███████  ░███   ░░████████░░█████  ███░░██████ ████████ ░██  ░██░░██████ ███ ███░██ ███  ░██ ██████   ░░██ ░░████████ ███ ███
  ░░░░░░░   ░░░     ░░░░░░░░  ░░░░░  ░░░  ░░░░░░ ░░░░░░░░  ░░   ░░  ░░░░░░ ░░░ ░░░ ░░ ░░░   ░░ ░░░░░░     ░░   ░░░░░░░░ ░░░ ░░░ 


注意:本脚本仅用于新服务器上实施部署数据库使用,严禁在已运行数据库的主机上执行,以免发生数据丢失或者损坏,造成不可挽回的损失!!!                                                                                  

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

数据库安装模式: single                                                                           

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

数据库版本:     11                                                                               

!!! 免责声明:当前操作系统版本是 [ Ubuntu 22.04.4 LTS ] 不在 Oracle 官方支持列表,本脚本只负责安装,请确认是否继续安装 (Y/N): [Y] 

OracleShellInstall 开始安装,详细安装过程可查看日志: tail -2000f /soft/print_shell_install_.log                                                                                  

正在去除密码复杂度配置......已完成 (耗时: 0)
正在配置网络软件源......已完成 (耗时: 35)
正在获取操作系统信息......已完成 (耗时: 1)
正在安装依赖包......已完成 (耗时: 164)
正在配置 Swap......已完成 (耗时: 2)
正在配置防火墙......已完成 (耗时: 1)
正在配置 selinux......已完成 (耗时: 0)
正在配置主机名和 /etc/hosts......已完成 (耗时: 0)
正在创建用户和组......已完成 (耗时: 1)
正在创建安装目录......已完成 (耗时: 0)
正在配置 Avahi-daemon 服务......已完成 (耗时: 3)
正在配置透明大页 && NUMA && 磁盘 IO 调度器......已完成 (耗时: 7)
正在配置操作系统参数 sysctl......已完成 (耗时: 1)
正在配置 RemoveIPC......已完成 (耗时: 0)
正在配置用户限制 limit......已完成 (耗时: 1)
正在配置 shm 目录......已完成 (耗时: 1)
正在配置用户环境变量......已完成 (耗时: 1)
正在解压 Oracle 安装包以及补丁......已完成 (耗时: 34)
正在安装 Oracle 软件以及补丁......已完成 (耗时: 270)
正在创建监听......已完成 (耗时: 4)
正在创建数据库......已完成 (耗时: 231)
正在优化数据库......已完成 (耗时: 20)

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

正在重启当前节点主机......     

连接测试

查看系统版本:

[root@Ubuntu22:/root]# cat /etc/os-release 
PRETTY_NAME="Ubuntu 22.04.4 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.4 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy

查看 Oracle 版本以及补丁:

[oracle@Ubuntu22:/home/oracle]$ sqlplus -v

SQL*Plus: Release 11.2.0.4.0 Production

[oracle@Ubuntu22:/home/oracle]$ opatch lspatches
此 Oracle 主目录中未安装任何中间补丁程序。

查看监听:

[oracle@Ubuntu22:/home/oracle]$ lsnrctl stat

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 06-JUN-2024 12:17:25

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date                06-JUN-2024 12:15:09
Uptime                    0 days 0 hr. 2 min. 16 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/11.2.0/db/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/Ubuntu22/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=Ubuntu22)(PORT=1521)))
Services Summary...
Service "lucifer" has 1 instance(s).
  Instance "lucifer", status READY, has 1 handler(s) for this service...
Service "luciferXDB" has 1 instance(s).
  Instance "lucifer", status READY, has 1 handler(s) for this service...
The command completed successfully

连接数据库:

[oracle@Ubuntu22:/home/oracle]$ sas

SQL*Plus: Release 11.2.0.4.0 Production on Thu Jun 6 12:17:26 2024

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

show parameter name

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
cell_offloadgroup_name               string
db_file_name_convert                 string
db_name                              string      lucifer
db_unique_name                       string      lucifer
global_names                         boolean     FALSE
instance_name                        string      lucifer
lock_name_space                      string
log_file_name_convert                string
processor_group_name                 string
service_names                        string      lucifer
sys@LUCIFER 2024-06-06 12:17:29> 

数据库连接正常。

  • 17
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

Lucifer三思而后行

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

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

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

打赏作者

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

抵扣说明:

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

余额充值