當前位置: 妍妍網 > 碼農

在Docker中快速使用各個版本(從10g到23ai)的Oracle資料庫

2024-05-10碼農

映像地址

為了測試需要,麥老師制作了各個版本的Oracle資料庫環境,下載地址如下:

1# oracle
2nohup docker pull registry.cn-hangzhou.aliyuncs.com/lhrbest/oracle23ai:1.0 &
3nohup docker pull registry.cn-hangzhou.aliyuncs.com/lhrbest/oracle23cfree:1.0 &
4nohup docker pull registry.cn-hangzhou.aliyuncs.com/lhrbest/oracle21c_ee_db_21.3.0.0 &
5nohup docker pull registry.cn-hangzhou.aliyuncs.com/lhrbest/oracle19clhr_asm_db_12.2.0.3:2.0 &
6nohup docker pull registry.cn-hangzhou.aliyuncs.com/lhrbest/oracle18clhr_rpm_db_12.2.0.2:2.0 &
7nohup docker pull registry.cn-hangzhou.aliyuncs.com/lhrbest/oracle_12cr2_ee_lhr_12.2.0.1:2.0 &
8nohup docker pull registry.cn-hangzhou.aliyuncs.com/lhrbest/oracle_12cr1_ee_lhr_12.1.0.2:2.0 &
9nohup docker pull registry.cn-hangzhou.aliyuncs.com/lhrbest/oracle_11g_ee_lhr_11.2.0.4:2.0 &
10nohup docker pull registry.cn-hangzhou.aliyuncs.com/lhrbest/oracle_11g_ee_lhr_11.2.0.3:2.0 &
11nohup docker pull registry.cn-hangzhou.aliyuncs.com/lhrbest/oracle_10g_ee_lhr_10.2.0.5:2.0 &
12nohup docker pull registry.cn-hangzhou.aliyuncs.com/lhrbest/oracle_10g_ee_lhr_10.2.0.1:2.0 &
13
14
15# 23ai版本
16docker rm -f lhrora23ai
17docker run -itd --name lhrora23ai -h lhrora23ai \
18 -p 1531:1521 -p 31389:3389 \
19 -v /sys/fs/cgroup:/sys/fs/cgroup \
20--privileged=true lhrbest/oracle23ai:1.0 \
21 /usr/sbin/init
22
23 docker exec -it lhrora23ai bash
24
25
26
27
28# 23c免費開發者版本
29docker rm -f lhroracle23c
30docker run -itd --name lhroracle23c -h lhroel87 \
31 -p 10531:1521 -p 38389:3389 \
32 -v /sys/fs/cgroup:/sys/fs/cgroup \
33--privileged=true lhrbest/oracle23cfree:1.0 \
34 /usr/sbin/init
35
36 docker exec -it lhroracle23c bash
37
38
39
40# 21c 二進制安裝
41docker run -d --name lhroracle21c -h lhroracle21c \
42 -p 5510:5500 -p 55100:5501 -p 1530:1521 -p 3400:3389 \
43 -v /sys/fs/cgroup:/sys/fs/cgroup \
44--privileged=true lhrbest/oracle21c_ee_db_21.3.0.0 \
45 /usr/sbin/init
46
47
48
49# 19c ASM
50docker run -itd -h lhr2019ocpasm --name lhr2019ocpasm \
51 -p 1555:1521 -p 5555:5500 -p 55550:5501 -p 555:22 -p 3400:3389 \
52--privileged=true \
53 lhrbest/oracle19clhr_asm_db_12.2.0.3:2.0 init
54
55# 對於ASM,① ASM磁盤指令碼:/etc/initASMDISK.sh,請確保指令碼/etc/initASMDISK.sh中的內容都可以正常執行
56# ② 需要在宿主機上安裝以下軟體
57yum install -y kmod-oracleasm
58wget https://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/getPackage/oracleasm-support-2.1.11-2.el7.x86_64.rpm
59wget https://download.oracle.com/otn_software/asmlib/oracleasmlib-2.0.12-1.el7.x86_64.rpm
60rpm -ivh *.rpm
61
62systemctl enable oracleasm.service
63oracleasm init
64oracleasm status
65
66
67
68# 19c rpm方式安裝
69docker run -itd -h lhrora19c --name lhrora19c \
70 -p 1529:1521 -p 5509:5500 -p 55090:5501 -p 229:22 -p 3399:3389 \
71--privileged=true \
72 lhrbest/oracle19clhr_rpm_db_12.2.0.3:2.0 init
73
74# 18c rpm方式安裝
75docker run -itd -h lhrora18c --name lhrora18c \
76 -p 1528:1521 -p 5508:5500 -p 55080:5501 -p 228:22 -p 3398:3389 \
77--privileged=true \
78 lhrbest/oracle18clhr_rpm_db_12.2.0.2:2.0 init
79
80# 12.2.0.1 二進制安裝
81docker run -itd --name lhrora1221 -h lhrora1221 \
82 -p 1526:1521 -p 5526:5500 -p 55260:5501 -p 226:22 -p 3396:3389 \
83--privileged=true \
84 lhrbest/oracle_12cr2_ee_lhr_12.2.0.1:2.0 init
85
86# 12.1.0.2 二進制安裝
87docker run -itd --name lhrora1212 -h lhrora1212 \
88 -p 1525:1521 -p 5525:5500 -p 55250:5501 -p 225:22 -p 3395:3389 \
89--privileged=true \
90 lhrbest/oracle_12cr1_ee_lhr_12.1.0.2:2.0 init
91
92# 11.2.0.4 二進制安裝
93docker run -itd --name lhrora11204 -h lhrora11204 -p 3394:3389 \
94 -p 1524:1521 -p 1124:1158 -p 224:22 \
95--privileged=true \
96 lhrbest/oracle_11g_ee_lhr_11.2.0.4:2.0 init
97
98# 11.2.0.3 二進制安裝
99docker run -itd --name lhrora11203 -h lhrora11203 -p 3393:3389 \
100 -p 1523:1521 -p 1123:1158 -p 223:22 \
101--privileged=true \
102 lhrbest/oracle_11g_ee_lhr_11.2.0.3:2.0 init
103
104# 10.2.0.5 二進制安裝,-h參數不能變
105docker run -itd --name lhrora10205 -h lhrora10g -p 3380:3389 \
106 -p 1512:1521 -p 212:22 \
107--privileged=true \
108 lhrbest/oracle_10g_ee_lhr_10.2.0.5:2.0 init
109
110
111# 10.2.0.1 二進制安裝,-h參數不能變
112docker run -itd --name lhrora10201 -h lhrora10g -p 3379:3389 \
113 -p 1511:1521 -p 211:22 \
114--privileged=true \
115 lhrbest/oracle_10g_ee_lhr_10.2.0.1:2.0 init

使用方法

之前也詳細說明過一些映像的使用方法

23ai:

https://xmmup.com/zaidockerzhongkuaisutiyanoracle-23aiban.html

23c:

https://www.xmmup.com/zaidockerzhongkuaisutiyanoracle-23cmianfeikaifazheban.html

21c:

https://www.xmmup.com/dbbao76zaidockerzhongzhixu2bujikeyongyouoracle-21chuanjing.html

19c ASM:

https://www.xmmup.com/dbbao4zhixu2bujikeyongyouoracle19cdeasmdbhuanjing.html

https://www.xmmup.com/dbbao4zhixu2bujikeyongyouoracle19cdeasmdbhuanjing.html

18c:

https://www.xmmup.com/dbbao10zaidockerzhongzhixu2bujikeyongyouoracle-18chuanjing.html

11g:

https://www.xmmup.com/dbbao14zaidockerzhongzhixu2bujikeyongyouoracle-11gqiyebanhuanjing11-2-0-4.html

https://www.xmmup.com/dbbao11zaidockerzhongzhixu2bujikeyongyouoracle-11gqiyebanhuanjing11-2-0-3.html

12.2.0.1:

https://www.xmmup.com/dbbao12zaidockerzhongzhixu2bujikeyongyouoracle-12cr212-2-0-1qiyebanhuanjing.html

12.1.0.2:

https://www.xmmup.com/dbbao13zaidockerzhongzhixu2bujikeyongyouoracle-12cr112-1-0-2qiyebanhuanjing.html