首页 > 数据库 >docker 部署oracle

docker 部署oracle

时间:2023-02-22 22:33:44浏览次数:32  
标签:Feb 22 部署 32 -- oracle 20 docker root

一、获取oracle docker-image

https://github.com/oracle/docker-images

git clone https://github.com/oracle/docker-images.git

将oracle安装包放到对应的目录下面

[root@base 19.3.0]# pwd
/opt/oracle/docker-images/OracleDatabase/SingleInstance/dockerfiles/19.3.0
[root@base 19.3.0]# ll
total 2988100
-rwxr-xr-x 1 root root       2474 Feb 22 20:32 checkDBStatus.sh
-rwxr-xr-x 1 root root        904 Feb 22 20:32 checkSpace.sh
-rw-r--r-- 1 root root         63 Feb 22 20:32 Checksum.ee
-rw-r--r-- 1 root root         63 Feb 22 20:32 Checksum.se2
-rw-r--r-- 1 root root       5313 Feb 22 20:32 configTcps.sh
-rwxr-xr-x 1 root root       8689 Feb 22 20:32 createDB.sh
-rw-r--r-- 1 root root       1567 Feb 22 20:32 createObserver.sh
-rw-r--r-- 1 root root       9204 Feb 22 20:32 dbca.rsp.tmpl
-rw-r--r-- 1 root root       6878 Feb 22 20:32 db_inst.rsp
-rw-r--r-- 1 root root       4911 Feb 22 20:32 Dockerfile
-rwxr-xr-x 1 root root       2712 Feb 22 20:32 installDBBinaries.sh
-rw-r--r-- 1 root root 3059705302 Feb 22 20:35 LINUX.X64_193000_db_home.zip       <<<<<<
-rw-r--r-- 1 root root       2013 Feb 22 20:32 relinkOracleBinary.sh
-rwxr-xr-x 1 root root      10698 Feb 22 20:32 runOracle.sh
-rwxr-xr-x 1 root root       1021 Feb 22 20:32 runUserScripts.sh
-rwxr-xr-x 1 root root       1141 Feb 22 20:32 setPassword.sh
-rwxr-xr-x 1 root root       1057 Feb 22 20:32 setupLinuxEnv.sh
-rwxr-xr-x 1 root root        679 Feb 22 20:32 startDB.sh

二、开始制作镜像

2.1 docker安装

[root@test opt]# docker --version
Docker version 23.0.1, build a5ee5b1

2.2 制作镜像

2.2.1 报错处理

[root@base dockerfiles]# pwd
/opt/oracle/docker-images/OracleDatabase/SingleInstance/dockerfiles
[root@base dockerfiles]# ll
total 28
drwxr-xr-x 2 root root  126 Feb 22 20:32 11.2.0.2
drwxr-xr-x 2 root root 4096 Feb 22 20:32 12.1.0.2
drwxr-xr-x 2 root root 4096 Feb 22 20:32 12.2.0.1
drwxr-xr-x 2 root root 4096 Feb 22 20:32 18.3.0
drwxr-xr-x 2 root root  140 Feb 22 20:32 18.4.0
drwxr-xr-x 2 root root 4096 Feb 22 20:34 19.3.0
drwxr-xr-x 2 root root 4096 Feb 22 20:32 21.3.0
-rwxr-xr-x 1 root root 7091 Feb 22 20:32 buildContainerImage.sh
[root@base dockerfiles]# ./buildContainerImage.sh -v 19.3.0 -e -i
Checking Docker version.
Docker version is below the minimum required version 17.09
Please upgrade your Docker installation to proceed.
[root@base dockerfiles]#

解决方法:
将buildContainerImage.sh中 MIN_DOCKER_VERSION="17.09" 修改为 MIN_DOCKER_VERSION="17.9"

2.2.2 制作完成

.....
Oracle Database container image for 'ee' version 19.3.0 is ready to be extended:

    --> oracle/database:19.3.0-ee

  Build completed in 1091 seconds.
.....
# 看到以上信息则表示制作完成

# 查看
[root@base dockerfiles]# docker images
REPOSITORY        TAG         IMAGE ID       CREATED         SIZE
oracle/database   19.3.0-ee   b86218da14c8   2 minutes ago   6.68GB

三、以容器方式运行

docker run --name oracle19c -d -p 1521:1521 -p 5500:5500 -p 2484:2484 -e ORACLE_SID=ORCL -e ORACLE_PWD=root -e ENABLE_ARCHIVELOG=true -e ENABLE_TCPS=true -v /opt/oracle:/home/oracle b86218da14c8

运行完成:

image-20230222212708981

检验:

[root@test ~]# docker exec -it oracle19c /bin/bash
bash-4.2$ sqlplus system/root as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Wed Feb 22 13:31:19 2023
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

SQL> show pdbs;

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 ORCLPDB1                       READ WRITE NO
SQL>

标签:Feb,22,部署,32,--,oracle,20,docker,root
From: https://www.cnblogs.com/likaifei/p/17146254.html

相关文章

  • Docker入门学习
    一、安装Docker(Linux)#1、yum包更新到最新yumupdate#2、安装需要的软件包,yum-util提供yum-config-manager功能,另外两个是devicemapper驱动依赖的yuminstall......
  • Tomcat部署
    Tomcat部署资源:1.在Tomcat目录文件下的conf/context.xml文件夹中添加<Environmentname="tjndi"value="hellothisisnewsproject"type="java.lang.String"/>2.......
  • 统信系统部署es
    rpm-ivhjdk-17.0.4.1_linux-x64_bin.rpmgroupaddes&&useradd-d/home/es-gesestar-xzvfelasticsearch-8.5.2-linux-x86_64.tar.gzln-selasticsearch-8.5.2e......
  • docker run指定gpu运行
    要在dockerrun命令中指定GPU,您需要使用--gpus标志。例如,要在容器中使用所有可用的GPU,您可以运行以下命令:dockerrun--gpusallyour_image您还可以使用以下选......
  • Hyperledger Fabric部署与测试(Ubuntu)
    Fabric部署与测试Fabric部署与测试最正确的还是参照官方链接:HyperledgerFabric官方链接ok,接下来开始部署Fabric。(以Ubuntu为例)一、部署Fabric1.前期准备安装gits......
  • centos7.6 k8s 1.23.2 docker version 23.0.1 init
      dockerpullregistry.aliyuncs.com/google_containers/kube-apiserver:v1.23.2kubeadminit--kubernetes-version=v1.23.2--image-repositoryregistry.aliyuncs......
  • k8s工作端二进制部署-kubelet
    本文章是 k8s二进制高可用集群部署 的分支。详细步骤请参考目录。二进制下载地址压缩包下载:https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG......
  • 项目部署构建中node-sass构建突然失败
    项目中部署安装node-sass失败,由于node版本导致的问题使用dart-sass替换node-sass1.卸载node-sassnpmuninstallnode-sass 2.安装dart-sassnpminstallsasss......
  • Docker相关
    一、安装在Ubuntu22.04LTS中安装:1、更新Ubuntu(用的是清华源)$sudoaptupdate$sudoaptupgrade$sudoaptfull-upgrade2.添加Docker库首先,安装必要的证书......
  • ChilloutMix 腾讯云服务器快速部署
    背景  前两天在某公众号的软文刷到了AI绘画领域最新的ChilloutMix模型。大概是下面这张图的效果:激动的心颤抖的手,学了这么多年计算机,就是为了走在时代前沿,事到......