当前位置: 首页 > news >正文

<八> Docker安装oracle11.2.0.4库

1、docker下载oracle11.2.0.4镜像

# 可以选择从阿里云下载,一般比较快

docker pull registry.cn-hangzhou.aliyuncs.com/lhrbest/oracle_11g_ee_lhr_11.2.0.4:1.0

 镜像大概2.95G左右,解压后大约7.6G左右,所以请保留充足的空间。执行过程如下:

[root@docker36 ~]docker pull registry.cn-hangzhou.aliyuncs.com/lhrbest/oracle_11g_ee_lhr_11.2.0.4:1.0
1.0: Pulling from lhrbest/oracle_11g_ee_lhr_11.2.0.4
5dd797628260: Already exists 
ea1a739ab78d: Pull complete 
593d06e585fc: Pull complete 
Digest: sha256:7a2c2bf264cc9e5b5608deb98abe388c61d8fe2c981ee3475b0d2a38bb1fd8b4
Status: Downloaded newer image for registry.cn-hangzhou.aliyuncs.com/lhrbest/oracle_11g_ee_lhr_11.2.0.4:1.0
registry.cn-hangzhou.aliyuncs.com/lhrbest/oracle_11g_ee_lhr_11.2.0.4:1.0[root@docker36 ~]docker tag registry.cn-hangzhou.aliyuncs.com/lhrbest/oracle_11g_ee_lhr_11.2.0.4:1.0  lhrbest/oracle_11g_ee_lhr_11.2.0.4:1.0[root@docker36 ~]docker images
lhrbest/oracle_11g_ee_lhr_11.2.0.4                                       1.0                 18261f9fdcf0        43 minutes ago      7.61GB
registry.cn-hangzhou.aliyuncs.com/lhrbest/oracle_11g_ee_lhr_11.2.0.4     1.0                 18261f9fdcf0        43 minutes ago      7.61GB

2、查看镜像

docker images

 

3、查看容器

 docker ps -a

 

4、如果③ 查看的容器不存在,那么先创建容器

 # 创建容器
docker run -itd --name lhrora11204 -h lhrora11204 --privileged=true -p 1521:1521 -p 222:22  -p 1158:1158 lhrbest/oracle_11g_ee_lhr_11.2.0.4:1.0 init# 进入容器
docker exec -it lhrora11204 bash# 启动数据库和监听
su - oracle
lsnrctl start
sqlplus / as sysdba
startup
exit

执行过程:

[root@docker36 ~]# docker exec -it lhrora11204 bash
[root@lhrora11204 /]#
[root@lhrora11204 /]# su - oracle
[oracle@lhrora11204 ~]$ 
[oracle@lhrora11204 ~]$ lsnrctl startLSNRCTL for Linux: Version 11.2.0.4.0 - Production on 24-JUL-2020 09:20:41Copyright (c) 1991, 2013, Oracle.  All rights reserved.Starting /u01/app/oracle/product/11.2.0.4/dbhome_1/bin/tnslsnr: please wait...TNSLSNR for Linux: Version 11.2.0.4.0 - Production
System parameter file is /u01/app/oracle/product/11.2.0.4/dbhome_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/lhrora11204/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=lhrora11204)(PORT=1521)))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                24-JUL-2020 09:20:41
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/11.2.0.4/dbhome_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/lhrora11204/listener/alert/log.xml
Listening Endpoints Summary...(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=lhrora11204)(PORT=1521)))
The listener supports no services
The command completed successfully[oracle@lhrora11204 ~]$ sasSQL*Plus: Release 11.2.0.4.0 Production on Fri Jul 24 09:20:50 2020Copyright (c) 1982, 2013, Oracle.  All rights reserved.Connected to an idle instance.SYS@LHR11G> startup 
ORACLE instance started.Total System Global Area  325685248 bytes
Fixed Size                  2252944 bytes
Variable Size             188747632 bytes
Database Buffers          130023424 bytes
Redo Buffers                4661248 bytes
Database mounted.
Database opened.
SYS@LHR11G> 
SYS@LHR11G> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options[oracle@lhrora11204 ~]$ emctl status dbconsole
Oracle Enterprise Manager 11g Database Control Release 11.2.0.4.0 
Copyright (c) 1996, 2013 Oracle Corporation.  All rights reserved.
https://lhrora11204:1158/em/console/aboutApplication
Oracle Enterprise Manager 11g is not running. 
------------------------------------------------------------------
Logs are generated in directory /u01/app/oracle/product/11.2.0.4/dbhome_1/lhrora11204_LHR11G/sysman/log 
[oracle@lhrora11204 ~]$ emctl start dbconsole 
Oracle Enterprise Manager 11g Database Control Release 11.2.0.4.0 
Copyright (c) 1996, 2013 Oracle Corporation.  All rights reserved.
https://lhrora11204:1158/em/console/aboutApplication
Starting Oracle Enterprise Manager 11g Database Control ...... started. 
------------------------------------------------------------------
Logs are generated in directory /u01/app/oracle/product/11.2.0.4/dbhome_1/lhrora11204_LHR11G/sysman/log 
[oracle@lhrora11204 ~]$ emctl status dbconsole
Oracle Enterprise Manager 11g Database Control Release 11.2.0.4.0 
Copyright (c) 1996, 2013 Oracle Corporation.  All rights reserved.
https://lhrora11204:1158/em/console/aboutApplication
Oracle Enterprise Manager 11g is running. 
------------------------------------------------------------------
Logs are generated in directory /u01/app/oracle/product/11.2.0.4/dbhome_1/lhrora11204_LHR11G/sysman/log

5、数据库使用

[oracle@lhrora11204 ~]$ lsnrctl statusLSNRCTL for Linux: Version 11.2.0.4.0 - Production on 24-JUL-2020 09:23:08Copyright (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                24-JUL-2020 09:20:41
Uptime                    0 days 0 hr. 2 min. 26 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/11.2.0.4/dbhome_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/lhrora11204/listener/alert/log.xml
Listening Endpoints Summary...(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=lhrora11204)(PORT=1521)))
Services Summary...
Service "LHR11G" has 1 instance(s).Instance "LHR11G", status READY, has 1 handler(s) for this service...
Service "LHR11GXDB" has 1 instance(s).Instance "LHR11G", status READY, has 1 handler(s) for this service...
The command completed successfully
[oracle@lhrora11204 ~]$ sasSQL*Plus: Release 11.2.0.4.0 Production on Fri Jul 24 09:23:10 2020Copyright (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 optionsSYS@LHR11G> select * from v$version;BANNER
----------------------------------------------------------------------------------------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
PL/SQL Release 11.2.0.4.0 - Production
CORE    11.2.0.4.0      Production
TNS for Linux: Version 11.2.0.4.0 - Production
NLSRTL Version 11.2.0.4.0 - ProductionSYS@LHR11G> select * from v$tablespace;TS# NAME                                                         INCLUD BIGFIL FLASHB ENCRYP
---------- ------------------------------------------------------------ ------ ------ ------ ------0 SYSTEM                                                       YES    NO     YES1 SYSAUX                                                       YES    NO     YES2 UNDOTBS1                                                     YES    NO     YES4 USERS                                                        YES    NO     YES3 TEMP                                                         NO     NO     YES6 EXAMPLE                                                      YES    NO     YES6 rows selected.SYS@LHR11G> 

6、创建库实例

#创建表空间
CREATE TABLESPACE mytbsDATAFILE '/u01/app/oracle/oradata/LHR11G/mytbs01.dbf'SIZE 1GAUTOEXTEND ON;
#创建用户及密码
CREATE USER prove IDENTIFIED BY proveDEFAULT TABLESPACE mytbs TEMPORARY TABLESPACE temp;
#赋权
GRANT CONNECT, RESOURCE TO prove;

7、测试

localhost:1521@LHR11G prove/prove

连接正常,oracle启动成功!

http://www.lryc.cn/news/610580.html

相关文章:

  • 亚马逊账号关联全解析:从风险底层逻辑到高阶防控策略
  • 计算机视觉CS231n学习(3)
  • Vulnhuntr:用于识别远程可利用漏洞的开源工具
  • 《C++初阶之STL》【模板参数 + 模板特化 + 分离编译】
  • PCIe Base Specification解析(七)
  • 私有云盘新体验:FileRise在cpolar的加持下如何让数据管理更自由?
  • 24. 前端-js框架-Vue
  • Redis内存耗尽时的应对策略
  • K8S的NetworkPolicy使用教程
  • 升级 Elasticsearch 到新的 AWS Java SDK
  • iouring系统调用及示例
  • 学习游戏制作记录(将各种属性应用于战斗以及实体的死亡)8.5
  • 从循环嵌套到拓扑编排:LangGraph如何重构Agent工作流
  • 面向对象的七大设计原则
  • 【2025WACV-目标检测方向】
  • 目标检测、分割的数据增强策略
  • 智慧社区物业管理平台登录流程全解析:从验证码到JWT认证
  • 分布式网关技术 + BGP EVPN,解锁真正的无缝漫游
  • Java 异步编程工具类 CompletableFuture 详细介绍
  • CodeRush AI 助手进驻 Visual Studio:AiGen/AiFind 亮相(四)
  • 自然语言翻译--seq2seq
  • JavaWeb(苍穹外卖)--学习笔记17(Websocket)
  • 【题解】P3172 [CQOI2015] 选数(倍数莫反做法)
  • Spring-rabbit使用实战六
  • 智慧会所:科技赋能,开启休闲新体验
  • 计算机算术5-整形除法
  • 代码训练营DAY53 第十一章:图论part04
  • bpf系统调用及示例
  • K8S 性能瓶颈排查
  • CVE-2017-8291源码分析与漏洞复现(PIL远程命令执行漏洞)