前言

我们在手动安装oracle数据库时,安装步骤纷繁复杂,耗时较长

在此介绍如何使用docker快速安装oracle 11g

一、docker 及其安装环境

操作系统:

[root@centos7 ~]# cat /etc/redhat-release
CentOS Linux release 7.7.1908 (Core)

docker 版本:

[root@centos7 ~]# docker -v
Docker version 1.13.1, build 7f2769b/1.13.1

docker 安装方式:

yum update && yum -y install docker

docker 使用详细信息可查看 https://www.cnblogs.com/murry/p/9332747.html

二、docker 镜像拉取以及启动

docker hub 镜像拉取以及查看

docker pull jaspeen/oracle-11g
REPOSITORY TAG IMAGE ID CREATED SIZE
docker.io/jaspeen/oracle-11g latest 0c8711fe4f0f 4 years ago 281 MB

创建宿主机 oracle 安装目录以及数据目录

mkdir -p /server/oracle
mkdir -p /server/dpdump

下载 oracle 并存放于服务器中

oracle 下载网址:https://www.oracle.com/database/technologies/oracle-database-software-downloads.html

[root@centos7 oracle]# ls
linux.x64_11gR2_database_1of2 linux.x64_11gR2_database_2of2

解压缩并删除安装包

[root@centos7 oracle]# ls
database

启动 docker

docker run -d --privileged -p 1521:1521 -v /server/oracle:/install -v /server/dpdump:/opt/oracle/dpdump --name=oracle11g jaspeen/oracle-11g

启动命令解析:

-d :后台运行容器,并返回容器ID;

--privieged:开启特权模式;

-p:宿主机与 docker 的端口映射;

-v:绑定一个数据卷;

--name:起一个容器名;

启动后查看容器运行状况

[root@centos7 oracle]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c5e913b4e96b jaspeen/oracle-11g "/assets/entrypoin..." 3 days ago Up 3 seconds 0.0.0.0:1521->1521/tcp, 8080/tcp oracle11g

此时一个 oracle 11g docker 已经启动

三、自己的 docker 镜像制作

由于版权问题,拉取下来的 docker 镜像是不包含任何版本的 oracle 的

故在启动 docker 后,需要创建一个自己的镜像以备使用

提交 docker 镜像以及查看

[root@centos7 oracle]# docker commit oracle11g oracle11g-installed
[root@centos7 oracle]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
oracle11g-installed latest 4a55732efad1 3 days ago 2.83 GB
docker.io/jaspeen/oracle-11g latest 0c8711fe4f0f 4 years ago 281 MB

进入 docker 容器内查看

一共有两种方式,可以使用容器ID或者使用 docker run 时设置的 name

[root@centos7 oracle]# docker exec -it c5e913b4e96b bash
[root@c5e913b4e96b /]#
[root@centos7 oracle]# docker exec -it oracle11g bash
[root@c5e913b4e96b /]#

当然,可以设置一个别名,更方便进入容器内

[root@centos7 oracle]# vim ~/.bashrc
末行加入:
alias oracle='docker exec -it c5e913b4e96b bash' 使文件生效:
source ~/.bashrc

至此一个 oracle 11g 容器制作完成

更多详细使用方式以及信息、dockerfile 请查看 docker hub:

https://hub.docker.com/r/jaspeen/oracle-11g

使用 docker 快速安装 oracle 11g的更多相关文章

  1. Oracle安装部署之linux(redhat/centos)快速安装oracle 11g rac

    安装oracle 11gR2 RAC 一.网络规划及安装虚拟主机 主机名 主机版本 Ip rac1.localdomain Redhat 6.5 RAC节点1 192.168.100.11 rac2. ...

  2. 利用Docker快速部署Oracle环境

    工作中需要频繁使用Oracle环境,但是每次搭建起来比较消耗时间,本想通过虚拟机模板的方式来快速安装oracle vm,但是每次改ip等环境也很耗时,因此想到docker中有没有已经做好的images ...

  3. centos安装oracle 11g 完全图解

    摘要: 说明: Linux服务器操作系统:CentOS 5.8 32位(注意:系统安装时请单独分区/data用来安装oracle数据库) Linux服务器IP地址:192.168.21.150 Ora ...

  4. 在Windows 10上安装Oracle 11g数据库出现的问题及解决

    在Windows 10上安装Oracle 11g数据库,并且很多次出现过:当安装的进度条进行到快要结束的时候弹出一个提示框.如下: [Java(TM)2 Platform Standard Editi ...

  5. 安装Oracle 11g RAC R2 之Linux DNS 配置

    Oracle 11g RAC 集群中引入了SCAN(Single Client Access Name)的概念,也就是指集群的单客户端访问名称.SCAN 这个特性为客户端提供了单一的主机名,用于访问集 ...

  6. Oracle Linux 6.3下安装Oracle 11g R2(11.2.0.3)

    本文主要描写叙述了在Oracle Linux 6.3下安装Oracle 11gR2(11.2.0.3).从Oracle 11g開始,Oracle官方站点不再提供其Patch的下载链接,须要使用Meat ...

  7. 安装ORACLE 11g 64位 pl/sql无法进入的问题。

    转载自网上的内容: 1)安装Oracle 11g 64位 2)安装32位的Oracle客户端( instantclient-basic-win32-11.2.0.1.0)下载地址:http://www ...

  8. windows 8 安装 oracle 11g 报错:command line option syntax error,type command/? for help

    windows 8 安装 oracle 11g 报错:command line option syntax error,type command/? for help 在windows8操作系统上安装 ...

  9. CentOS Linux 系统 安装oracle 11g

    CentOS Linux 系统 安装oracle 11g 在Linux系统上安装oracle是比较麻烦,需要配置各种变量啥的,o(︶︿︶)o ,但是没办法,有些东西你总的去接触,而且接触理解的越早越深 ...

随机推荐

  1. 十七,k8s集群指标API及自定义API

    目录 资源指标: Metrics-Server 资源指标: Metric-Server介绍 Metric-Server部署 下载yaml文件 因为有墙, 所以提前下载image镜像, 当然也可以手动修 ...

  2. LoadRunner(3)

    一.性能测试的策略 重要的:基准测试.并发测试.在线综合场景测试 递增测试.极限测试... 1.基准测试:Benchmark Testing 含义:就是单用户测试,单用户.单测试点.执行n次: 作为后 ...

  3. C. Vasily the Bear and Sequence Codeforces 336C(枚举,思维)

    C. Vasily the Bear and Sequence time limit per test 1 second memory limit per test 256 megabytes inp ...

  4. Eclipse创建Servers没有Apache选项

    help->install new software加入网址是http://download.eclipse.org/releases/Neon,最后一个是你eclipse的版本.得到一系列的插 ...

  5. 粗暴,干就完了----徐晓冬似的C语言自学笔记---字符数组相关技术

    字符串拼接函数 strcat() 字符串----作为很多编程语言的鼻祖C语言,没有字符串类型,取而代之的字符数组,很多数组在声明的时候会给定数组长度,然而我们却可以这样写 char mywords[] ...

  6. Redis:Linux环境部署Redis(1)

    简介 1.介绍 Redis是开源的(BSD许可)内存数据结构存储,用作数据库,缓存和消息代理.它支持数据结构,例如 字符串,哈希,列表,集合,带范围查询的排序集合,位图,超日志,带有半径查询的流空间索 ...

  7. 爬虫代理池源代码测试-Python3WebSpider

    元类属性的使用 来源: https://github.com/Python3WebSpider/ProxyPool/blob/master/proxypool/crawler.py 主要关于元类的使用 ...

  8. Navicat连接虚拟机上的mysql

    刚刚在虚拟主机上安装mysql,  想使用Navicat 操作mysql.  但是连接不上 报错: 2003 - can't connect to MySQL server on '192.168.1 ...

  9. 【Python之路】特别篇--微信Web网页版通信的全过程分析

    文章所使用Python版本为py3.5 1.微信服务器返回一个会话ID 微信Web版本不使用用户名和密码直接登录,而是采用二维码登录,所以服务器需要首先分配一个唯一的会话ID,用来标识当前的一次登录. ...

  10. 如何复制word的图文到ueditor中自动上传?

    官网地址http://ueditor.baidu.com Git 地址 https://github.com/fex-team/ueditor 参考博客地址 http://blog.ncmem.com ...