一文搞懂Docker的安装
h:ttps://blog.csdn.net/qq_44895681/article/details/105540702

环境

CentOS 7.5

Docker 20.10.2

Oracle_11g

安装Oracle数据库

1.搜索oracle镜像

docker search oracle

[root@localhost ~]# docker search oracle
NAME                                  DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED
oraclelinux                           Official Docker builds of Oracle Linux.         731       [OK]
jaspeen/oracle-11g                    Docker image for Oracle 11g database            169                  [OK]
oracleinanutshell/oracle-xe-11g                                                       138
wnameless/oracle-xe-11g-r2            Oracle Express Edition 11g Release 2 on Ubun…   58
absolutapps/oracle-12c-ee             Oracle 12c EE image with web management cons…   46
araczkowski/oracle-apex-ords          Oracle Express Edition 11g Release 2 on Ubun…   30                   [OK]
truevoly/oracle-12c                   Copy of sath89/oracle-12c image (https://git…   27
bofm/oracle12c                        Docker image for Oracle Database                24                   [OK]
datagrip/oracle                       Oracle 11.2 & 12.1.0.2-se2 & 11.2.0.2-xe        20                   [OK]
quillbuilduser/oracle-18-xe           Oracle 18c XE Image for Quill Testing Purpos…   20
openweb/oracle-tomcat                 A fork off of Official tomcat image with Ora…   8                    [OK]
binarybabel/oracle-jdk                Oracle JDKs (Alpine, CentOS, Debian) rebuilt…   5                    [OK]
iamseth/oracledb_exporter             A Prometheus exporter for Oracle modeled aft…   3
18fgsa/oracle-client                  Hosted version of the Oracle Container Image…   2
paulosalgado/oracle-java8-ubuntu-16   Oracle Java 8 on Ubuntu 16.04 LTS.              2                    [OK]
softwareplant/oracle                  oracle db                                       2                    [OK]
arm64v8/oraclelinux                   Official Docker builds of Oracle Linux.         1
roboxes/oracle7                       A generic Oracle Linux 7 base image.            1
publicisworldwide/oracle-core         This is the core image based on Oracle Linux…   1                    [OK]
amd64/oraclelinux                     Official Docker builds of Oracle Linux.         1
toolsmiths/oracle7-test                                                               0
bitnami/oraclelinux-extras            Oracle Linux base images                        0                    [OK]
bitnami/oraclelinux-runtimes          Oracle Linux runtime-optimized images           0                    [OK]
pivotaldata/oracle7-test              Oracle Enterprise Linux (OEL) image for GPDB…   0
gizmotronic/oracle-java               Ubuntu 16.04 image with Oracle Java             0                    [OK]

2.拉取阿里云oracle镜像

docker pull registry.aliyuncs.com/helowin/oracle_11g 或者 docker pull registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g

[root@localhost ~]# docker pull registry.aliyuncs.com/helowin/oracle_11g
Using default tag: latest
latest: Pulling from helowin/oracle_11g
ed5542b8e0e1: Already exists
a3ed95caeb02: Already exists
1e8f80d0799e: Already exists
Digest: sha256:4c12b98372dfcbaafcd9564a37c8d91456090a5c6fb07a4ec18270c9d9ef9726
Status: Image is up to date for registry.aliyuncs.com/helowin/oracle_11g:latest
registry.aliyuncs.com/helowin/oracle_11g:latest

3.查看镜像拉取情况

docker iamges

[root@localhost ~]# docker images
REPOSITORY                                             TAG          IMAGE ID       CREATED       SIZE
...
registry.aliyuncs.com/helowin/oracle_11g               latest       3fa112fd3642   5 years ago   6.85GB

4.创建并启动oracle容器

持久化启动方式:docker run  -itd -p 1521:1521 --name oracle_11g --restart=always -v /mnt/oracle_data/app:/opt/oracle/app -v /mnt/oracle_data/dpdump:/opt/oracle/dpdump  -v  /mnt/oracle_data/oraInventory:/opt/oracle/oraInventory registry.aliyuncs.com/helowin/oracle_11g

5.查看创建的oracle本地数据映射目录

在创建启动oracle容器的时候会自动在宿主机上创建相关的数据映射目录。

[root@localhost ~]# ll /mnt/oracle_data/
总用量 0
drwxr-xr-x. 2 root root 6 2月   9 23:12 app
drwxr-xr-x. 2 root root 6 2月   9 23:12 dpdump
drwxr-xr-x. 2 root root 6 2月   9 23:12 oraInventory

6.查看进程与启动状态

[root@localhost ~]# netstat -antulp
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:1521            0.0.0.0:*               LISTEN      35497/docker-proxy
......[root@localhost ~]# ss -antulp | grep :1521
tcp    LISTEN     0      128       *:1521                  *:*                   users:(("docker-proxy",pid=35497,fd=4))[root@localhost ~]# docker ps
CONTAINER ID   IMAGE                                      COMMAND                  CREATED        STATUS        PORTS                    NAMES
3edfba76f476   registry.aliyuncs.com/helowin/oracle_11g   "/bin/sh -c '/home/o…"   42 hours ago   Up 42 hours   0.0.0.0:1521->1521/tcp   oracle_11g

7.以退出不中断容器的方式进入容器

[root@localhost ~]# docker exec -it oracle_11g bash
[oracle@3edfba76f476 /]$

8.配置容器内环境变量

[root@localhost ~]# docker exec -it oracle_11g bash1.切换为root用户# 密码默认为 helowin
[oracle@3edfba76f476 /]$ su root
Password:                                2.添加环境变量
[root@3edfba76f476 /]# vi /etc/profile
...61 export ORACLE_HOME=/home/oracle/app/oracle/product/11.2.0/dbhome_263 export ORACLE_SID=helowin65 export PATH=$ORACLE_HOME/bin:$PATH
...3.使配置生效
[root@3edfba76f476 /]# source  /etc/profile4.创建软链接
[root@3edfba76f476 /]# ln -s $ORACLE_HOME/bin/sqlplus /usr/bin

9.操作oracle

1.切换回oracle用户
[root@3edfba76f476 /]# su - oracle2.登录sqlplus
[oracle@3edfba76f476 ~]$ sqlplus /nologSQL*Plus: Release 11.2.0.1.0 Production on Sat Jan 30 16:32:18 2021Copyright (c) 1982, 2009, Oracle.  All rights reserved.SQL> conn /as sysdba;
Connected.3.修改sys、system用户密码
SQL> alter user system identified by 123456;SQL> alter user sys identified by 123456;SQL> alter profile default limit PASSWORD_LIFE_TIME UNLIMITED;4.创建用户
SQL> create user root identified by 123456;SQL> grant connect,resource,dba to root;SQL> show user;      # 查看当前用户
USER is "SYS"SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

10.查看oracle实例状态

lsnrctl status

[oracle@434bcfed5c5d ~]$ lsnrctl statusLSNRCTL for Linux: Version 11.2.0.1.0 - Production on 09-FEB-2022 23:37:27Copyright (c) 1991, 2009, 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.1.0 - Production
Start Date                09-FEB-2022 23:28:42
Uptime                    0 days 0 hr. 8 min. 45 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /home/oracle/app/oracle/product/11.2.0/dbhome_2/network/admin/listener.ora
Listener Log File         /home/oracle/app/oracle/diag/tnslsnr/434bcfed5c5d/listener/alert/log.xml
Listening Endpoints Summary...(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=434bcfed5c5d)(PORT=1521)))
Services Summary...
Service "helowin" has 1 instance(s).Instance "helowin", status READY, has 1 handler(s) for this service...
Service "helowinXDB" has 1 instance(s).Instance "helowin", status READY, has 1 handler(s) for this service...
The command completed successfully

注意:外部工具连接数据库时,需要配置开放防火墙相应端口。若是阿里云,则需要开放安全组。

11.使用工具连接oracle容器


配置好的oracle容器可以commit成新的镜像,方便以后直接启动运行;也可以把commit的新镜像save导出,方便其他机器load导入镜像直接使用!

↓↓↓↓↓↓

最近刚申请了个微信公众号,上面也会分享一些运维知识,大家点点发财手关注一波,感谢大家。 【原创公众号】:非著名运维 【福利】:公众号回复 “资料” 送运维自学资料大礼包哦!

Docker安装Oracle_11g数据库并配置相关推荐

  1. 使用 Docker 安装 Zabbix,并配置自定义监控项

    使用 Docker 安装 Zabbix,并配置自定义监控项 一.Zabbix 简介 1.监控功能 2.Zabbix 工作原理 3.Zabbix 组件 4.Zabbix 进程 二.使用 Zabbix 配 ...

  2. Docker安装FireBird数据库

    Docker安装FireBird数据库 Supported tags and respective Dockerfile links 2.5-sc, 2.5.8-sc (2.5-sc/Dockerfi ...

  3. Docker安装gbase8s数据库教程

    本章教程介绍如何利用Docker安装gbase8s数据库. 目录 一. 搜索镜像 二.拉取镜像 三.启动容器 四.数据库连接 一. 搜索镜像 docker search gbase8s 二.拉取镜像 ...

  4. Mac系统下使用Docker安装oracle数据库?(亲测有效)

    参考文章 https://www.runoob.com/docker/macos-docker-install.html https://blog.csdn.net/qq_37145397/artic ...

  5. docker安装mysql及相关配置、运行细节和常见报错解决方案

    安装.运行 需要特别注意-v挂载到本机的目录的权限问题,否则报错:ERROR 2002 (HY000): Can't connect to local MySQL server through soc ...

  6. sqlserver去掉密码强度验证_安装sql2008数据库引擎配置时,提示sa密码强度不满足要求怎么办?...

    展开全部 设置带有数字,符号,大写字母,小写字母,还有8个位数以上的密码 Microsoft SQL Server2008安装配置过程:e69da5e887aa32313133353236313431 ...

  7. docker安装logstash及logstash配置

    一.logstash跟es有版本对照关系 了解对照关系,决定要安装的logstash版本 二.ELK出现的原因 三.Logstash工作原理 Logstash事件处理管道有三个阶段:输入→过滤器→输出 ...

  8. docker 安装mysql_docker|docker安装mysql数据库

    javaDEMO 本网站记录了最全的各种JavaDEMO ,保证下载,复制就是可用的,包括基础的, 集合的, spring的, Mybatis的等等各种,助力你从菜鸟到大牛,记得收藏哦~~https: ...

  9. 在Redhat 7下安装MySQL数据库 和 配置

    LInux下MySQL 我们这里 主要使用的就是红帽Linux http://dev.mysql.com/downloads/mysql 自己在这个链接上下载,可能会很慢 但是不知道为什么CSDN不许 ...

最新文章

  1. 移动端 UI 适配最佳实践(中)
  2. Map集合根据key,value排序
  3. Centos查看进程命令
  4. 控制按键的 几种方法
  5. pytorch test单张图片_PyTorch的元学习库:Torchmeta
  6. 2023王道计算机考研数据结构第一章-绪论
  7. php mysql 去重,数据库文本去重
  8. Accidental override: The following declarations have the same JVM signature (getWindow()Landroid/vie
  9. 什么是PaaS? 平台即服务的解释
  10. 下载keep运动软件_keep运动软件下载
  11. IDEA mybatis XML文件格式化问题
  12. 基于Javaweb实现的人脸识别+GPS定位考勤系统
  13. 2018年搞笑诺贝尔奖揭晓:坐过山车能甩出肾结石
  14. JXTA HelloWorld on JXSE 2.5 【一】
  15. 一个定时器实现IO模拟pwm,呼吸灯效果
  16. 大夏天解渴,喝茶,喝凉白开
  17. zabbix的搭建和简单使用
  18. php采集新闻数据插入数据库,PHP采集www.php.cn的文章,并存入数据库。
  19. 杂谈——什么是Google Fuchsia ?
  20. 北京积分落户2018年与2019年分析

热门文章

  1. windows下最简单实用的拼接合并视频方法
  2. 网络推广之关键字与搜索引擎
  3. 搜索引擎流量控制的重要性
  4. 闹钟提醒,哪款备忘录便签软件可以用闹钟设置提醒?
  5. 大鹅跌倒,波司登难立?
  6. javaSE基础进阶知识笔记2
  7. ICT:IT与CT的融合之路
  8. 石器时代单机版 – 80后的初恋网游
  9. python爬取饿了么订单_python爬虫:爬取某图外卖数据有这篇文章就够了
  10. 02.springBoot配置easyExcel