暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

在Docker中快速使用Oracle的各个版本(从10g到21c)的数据库

DB宝 2022-09-16
793

为了测试需要,麦老师制作了各个版本的Oracle数据库环境,下载地址如下:

 1# oracle
2nohup docker pull registry.cn-hangzhou.aliyuncs.com/lhrbest/oracle21c_ee_db_21.3.0.0 &
3nohup docker pull registry.cn-hangzhou.aliyuncs.com/lhrbest/oracle19clhr_asm_db_12.2.0.3:2.0 &
4nohup docker pull registry.cn-hangzhou.aliyuncs.com/lhrbest/oracle18clhr_rpm_db_12.2.0.2:2.0 &
5nohup docker pull registry.cn-hangzhou.aliyuncs.com/lhrbest/oracle_12cr2_ee_lhr_12.2.0.1:2.0 &
6nohup docker pull registry.cn-hangzhou.aliyuncs.com/lhrbest/oracle_12cr1_ee_lhr_12.1.0.2:2.0 &
7nohup docker pull registry.cn-hangzhou.aliyuncs.com/lhrbest/oracle_11g_ee_lhr_11.2.0.4:2.0 &
8nohup docker pull registry.cn-hangzhou.aliyuncs.com/lhrbest/oracle_11g_ee_lhr_11.2.0.3:2.0 &
9nohup docker pull registry.cn-hangzhou.aliyuncs.com/lhrbest/oracle_10g_ee_lhr_10.2.0.5:2.0 &
10nohup docker pull registry.cn-hangzhou.aliyuncs.com/lhrbest/oracle_10g_ee_lhr_10.2.0.1:2.0 &
11
12# 21c 二进制安装
13docker run -d --name lhroracle21c -h lhroracle21c \
14  -p 5510:5500 -p 55100:5501 -p 1530:1521  -p 3400:3389 \
15  -v /sys/fs/cgroup:/sys/fs/cgroup \
16  --privileged=true lhrbest/oracle21c_ee_db_21.3.0.0 \
17  /usr/sbin/init
18
19
20
21# 19c ASM
22docker run -itd -h lhr2019ocpasm --name lhr2019ocpasm \
23  -p 1555:1521 -p 5555:5500 -p 55550:5501 -p 555:22 -p 3400:3389 \
24  --privileged=true \
25  lhrbest/oracle19clhr_asm_db_12.2.0.3:2.0 init
26
27# 对于ASM,① ASM磁盘脚本:/etc/initASMDISK.sh,请确保脚本/etc/initASMDISK.sh中的内容都可以正常执行
28# ② 需要在宿主机上安装以下软件
29yum install -y kmod-oracleasm
30wget https://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/getPackage/oracleasm-support-2.1.11-2.el7.x86_64.rpm
31wget https://download.oracle.com/otn_software/asmlib/oracleasmlib-2.0.12-1.el7.x86_64.rpm
32rpm -ivh *.rpm
33
34systemctl enable oracleasm.service
35oracleasm init
36oracleasm status
37
38
39
40# 19c rpm方式安装
41docker run -itd -h lhrora19c --name lhrora19c  \
42  -p 1529:1521 -p 5509:5500 -p 55090:5501 -p 229:22 -p 3399:3389 \
43  --privileged=true \
44  lhrbest/oracle19clhr_rpm_db_12.2.0.3:2.0 init
45
46# 18c rpm方式安装
47docker run -itd -h lhrora18c --name lhrora18c \
48  -p 1528:1521 -p 5508:5500 -p 55080:5501 -p 228:22 -p 3398:3389 \
49  --privileged=true \
50  lhrbest/oracle18clhr_rpm_db_12.2.0.2:2.0 init
51
52# 12.2.0.1 二进制安装
53docker run -itd --name lhrora1221 -h lhrora1221 \
54  -p 1526:1521 -p 5526:5500 -p 55260:5501 -p 226:22 -p 3396:3389 \
55  --privileged=true \
56  lhrbest/oracle_12cr2_ee_lhr_12.2.0.1:2.0 init
57
58# 12.1.0.2 二进制安装
59docker run -itd --name lhrora1212 -h lhrora1212 \
60  -p 1525:1521 -p 5525:5500 -p 55250:5501 -p 225:22 -p 3395:3389 \
61  --privileged=true \
62  lhrbest/oracle_12cr1_ee_lhr_12.1.0.2:2.0 init
63
64# 11.2.0.4 二进制安装
65docker run -itd --name lhrora11204 -h lhrora11204 -p 3394:3389 \
66  -p 1524:1521 -p 1124:1158 -p 224:22 \
67  --privileged=true \
68  lhrbest/oracle_11g_ee_lhr_11.2.0.4:2.0 init
69
70# 11.2.0.3 二进制安装
71docker run -itd --name lhrora11203 -h lhrora11203 -p 3393:3389 \
72  -p 1523:1521 -p 1123:1158 -p 223:22 \
73  --privileged=true \
74  lhrbest/oracle_11g_ee_lhr_11.2.0.3:2.0 init
75
76# 10.2.0.5 二进制安装,-h参数不能变
77docker run -itd --name lhrora10205 -h lhrora10g -p 3380:3389 \
78  -p 1512:1521  -p 212:22 \
79  --privileged=true \
80  lhrbest/oracle_10g_ee_lhr_10.2.0.5:2.0 init
81
82
83# 10.2.0.1 二进制安装,-h参数不能变
84docker run -itd --name lhrora10201 -h lhrora10g -p 3379:3389 \
85  -p 1511:1521  -p 211:22 \
86  --privileged=true \
87  lhrbest/oracle_10g_ee_lhr_10.2.0.1:2.0 init  


之前也详细说明过一些镜像的使用方法,例如:

在Docker中只需2步即可拥有Oracle 21c环境

【DB宝10】在Docker中只需2步即可拥有Oracle18c环境

【DB宝11】在Docker中只需2步即可拥有Oracle 11g企业版环境(11.2.0.3)

【DB宝12】在Docker中只需2步即可拥有Oracle 12cR2(12.2.0.1)企业版环境

【DB宝13】在Docker中只需2步即可拥有Oracle 12cR1(12.1.0.2)企业版环境

【DB宝14】在Docker中只需2步即可拥有Oracle 11g企业版环境(11.2.0.4)

【DB宝7】如何在Docker容器中一步一步安装配置Oracle19c的ASM+DB环境

【DB宝3】在Docker中使用rpm包的方式安装Oracle 19c

DB宝4




本文结束。


• 微信公众号:DB宝,作者:小麦苗
• 作者博客地址:
www.xmmup.com
• 作者微信:db_bao

• 作者QQ:646634621,QQ群:230161599、618766405
• 提供Oracle OCP、OCM、高可用(rac+dg+ogg)和MySQL DBA培训
• 版权所有,欢迎分享本文,转载请保留出处

• 若有侵权请联系小麦苗删除

    ★DB宝分享的IT资料:https://mp.weixin.qq.com/s/Iwsy-zkzwgs8nYkcMz29ag
    ★DB宝笔试面试详解:https://mp.weixin.qq.com/s/Vm5PqNcDcITkOr9cQg6T7w

    长按下图识别二维码,关注小麦苗的微信公众号:DB宝,学习最实用的数据库技术。

    文章转载自DB宝,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

    评论