原 【DB宝74】在Docker中分分钟拥有Oracle EMCC 13.5环境
一、从Docker Hub或阿里云镜像下载小麦苗上传的镜像文件
- 小麦苗的Docker Hub的地址:https://hub.docker.com/u/lhrbest
- EMCC 13.5下载的地址:https://hub.docker.com/r/lhrbest/lhremcc135/tags?page=1&ordering=last_updated
注意:
1、保证磁盘空间至少100G
2、内存需要至少8G
3、配置swap到8G
1 2 3 4 5 6 | # 从Docker hub下载,网络不好时,一般比较慢 docker pull lhrbest/lhremcc135:1.0 # 可以选择从阿里云下载 docker pull registry.cn-hangzhou.aliyuncs.com/lhrbest/lhremcc135:1.0 # 从阿里云下载后可以tag成如下形式 docker tag registry.cn-hangzhou.aliyuncs.com/lhrbest/lhremcc135:1.0 lhrbest/lhremcc135:1.0 |
镜像大概21G左右,解压后大约50G左右,所以请保留充足的空间,至少100G才能运行(不说了,Oracle的产品就是这么耗磁盘空间,耗内存)。执行过程如下:
1 2 3 4 | [root@docker35 ~]# docker images | grep emcc lhrbest/lhremcc135 1.0 d5eb85007b8a 7 weeks ago 51.4GB registry.cn-hangzhou.aliyuncs.com/lhrbest/lhremcc135 1.0 d5eb85007b8a 7 weeks ago 51.4GB [root@docker35 ~]# |
二、创建容器并启动EMCC 13.5环境
1 2 3 4 5 6 7 8 9 10 | # 1、创建容器 docker run -d --name lhremcc135 -h lhremcc135 \ -p 31521:1521 -p 35500:5500 -p 35501:5501 -p 37803:7803 -p 3135:3389 \ -v /sys/fs/cgroup:/sys/fs/cgroup \ --privileged=true \ lhrbest/lhremcc135:1.0 init # 2、进入容器 docker exec -it lhremcc135 bash |
接下来需要等待,因为环境启动比较慢。
检查环境是否启动:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | [root@docker35 ~]# docker run -d --name lhremcc135 -h lhremcc135 \ > -p 31521:1521 -p 35500:5500 -p 35501:5501 -p 37803:7803 -p 3135:3389 \ > -v /sys/fs/cgroup:/sys/fs/cgroup \ > --privileged=true \ > lhrbest/lhremcc135:1.0 init f27dfe96e56cccf75c9931cf66e263b00ec0cee816060c43d8ac58f51a0c7966 [root@docker35 ~]# [root@docker35 ~]# docker ps | grep emcc f27dfe96e56c lhrbest/lhremcc135:1.0 "init" 5 minutes ago Up 5 minutes 0.0.0.0:31521->1521/tcp, 0.0.0.0:3135->3389/tcp, 0.0.0.0:35500->5500/tcp, 0.0.0.0:35501->5501/tcp, 0.0.0.0:37803->7803/tcp lhremcc135 [root@docker35 ~]# [root@docker35 ~]# docker exec -it lhremcc135 bash [root@lhremcc135 /]# su - oracle Last login: Thu Jul 8 15:27:55 CST 2021 on pts/0 [oracle@lhremcc135 ~]$ lsnrctl status LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 08-JUL-2021 15:28:42 Copyright (c) 1991, 2019, Oracle. All rights reserved. Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521)) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 19.0.0.0.0 - Production Start Date 08-JUL-2021 15:25:43 Uptime 0 days 0 hr. 3 min. 0 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File /opt/oracle/product/19c/dbhome_1/network/admin/listener.ora Listener Log File /opt/oracle/diag/tnslsnr/lhremcc135/listener/alert/log.xml Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=lhremcc135)(PORT=1521))) Services Summary... Service "lhrsdb" has 1 instance(s). Instance "lhrsdb", status READY, has 1 handler(s) for this service... The command completed successfully [oracle@lhremcc135 ~]$ [oracle@lhremcc135 ~]$ sas SQL*Plus: Release 19.0.0.0.0 - Production on Thu Jul 8 15:28:56 2021 Version 19.3.0.0.0 Copyright (c) 1982, 2019, Oracle. All rights reserved. Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.3.0.0.0 SYS@lhrsdb> select open_mode from v$database; OPEN_MODE -------------------- READ WRITE SYS@lhrsdb> show parameter sga NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ allow_group_access_to_sga boolean FALSE lock_sga boolean FALSE pre_page_sga boolean TRUE sga_max_size big integer 3G sga_min_size big integer 0 sga_target big integer 3G unified_audit_sga_queue_size integer 1048576 SYS@lhrsdb> show parameter pga NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ pga_aggregate_limit big integer 4G pga_aggregate_target big integer 1G |
数据库已经启动,接下来,查询EMS是否启动,若未启动,则需要手动启动:
感谢麦老师
我swap 加到8G 能成功
报错:
我刚新申请了一台ECS,CentOS 7.9,45G内存,可以运行的: