ICode9

精准搜索请尝试: 精确搜索
首页 > 数据库> 文章详细

Docker Oracle DataBase 19c

2021-07-10 12:35:17  阅读:322  来源: 互联网

标签:database 19.3 ORACLE oracle https Oracle Docker docker 19c


系统为 CentOS7,安装 Docker:https://www.cnblogs.com/jhxxb/p/11410816.html

 

一、下载构建脚本

wget https://codeload.github.com/oracle/docker-images/zip/refs/heads/main -O docker-images-main.zip
sudo yum install -y unzip
unzip docker-images-main.zip

 

二、下载构建所需的安装包

cd docker-images-main/OracleDatabase/SingleInstance/dockerfiles/19.3.0/
# https://www.oracle.com/database/technologies/oracle19c-linux-downloads.html
wget https://download.oracle.com/otn/linux/oracle19c/190000/LINUX.X64_193000_db_home.zip?AuthParam=1625820213_e8029c8bed6986229cbc39f533ce6977 -O LINUX.X64_193000_db_home.zip

 

三、构建

cd docker-images-main/OracleDatabase/SingleInstance/dockerfiles/
./buildContainerImage.sh -e -v 19.3.0 -o '--build-arg SLIMMING=false'

 

四、运行

docker run --name oracle-19c \
-p 1521:1521 -p 5500:5500 \
-e ORACLE_SID=ORCLCDB \
-e ORACLE_PDB=ORCLPDB1 \
-e ORACLE_PWD=root \
oracle/database:19.3.0-ee

# 查看日志
docker logs -f oracle-19c

选项说明

docker run --name <container name> \
-p <host port>:1521 -p <host port>:5500 \
-e ORACLE_SID=<your SID> \
-e ORACLE_PDB=<your PDB name> \
-e ORACLE_PWD=<your database passwords> \
-e INIT_SGA_SIZE=<your database SGA memory in MB> \
-e INIT_PGA_SIZE=<your database PGA memory in MB> \
-e ORACLE_EDITION=<your database edition> \
-e ORACLE_CHARACTERSET=<your character set> \
-e ENABLE_ARCHIVELOG=true \
-v [<host mount point>]:/opt/oracle/oradata \
oracle/database:19.3.0-ee

Parameters:
   --name:        The name of the container (default: auto generated).
   -p:            The port mapping of the host port to the container port.
                  Two ports are exposed: 1521 (Oracle Listener), 5500 (OEM Express).
   -e ORACLE_SID: The Oracle Database SID that should be used (default: ORCLCDB).
   -e ORACLE_PDB: The Oracle Database PDB name that should be used (default: ORCLPDB1).
   -e ORACLE_PWD: The Oracle Database SYS, SYSTEM and PDB_ADMIN password (default: auto generated).
   -e INIT_SGA_SIZE:
                  The total memory in MB that should be used for all SGA components (optional).
                  Supported 19.3 onwards.
   -e INIT_PGA_SIZE:
                  The target aggregate PGA memory in MB that should be used for all server processes attached to the instance (optional).
                  Supported 19.3 onwards.
   -e ORACLE_EDITION:
                  The Oracle Database Edition (enterprise/standard).
                  Supported 19.3 onwards.
   -e ORACLE_CHARACTERSET:
                  The character set to use when creating the database (default: AL32UTF8).
   -e ENABLE_ARCHIVELOG:
                  To enable archive log mode when creating the database (default: false).
                  Supported 19.3 onwards.
   -v /opt/oracle/oradata
                  The data volume to use for the database.
                  Has to be writable by the Unix "oracle" (uid: 54321) user inside the container!
                  If omitted the database will not be persisted over container recreation.
   -v /opt/oracle/scripts/startup | /docker-entrypoint-initdb.d/startup
                  Optional: A volume with custom scripts to be run after database startup.
                  For further details see the "Running scripts after setup and on startup" section below.
   -v /opt/oracle/scripts/setup | /docker-entrypoint-initdb.d/setup
                  Optional: A volume with custom scripts to be run after database setup.
                  For further details see the "Running scripts after setup and on startup" section below.
View Code

 

五、连接

docker exec -it oracle-19c bash
sqlplus / as sysdba

sqlplus sys/<your password>@//localhost:1521/<your SID> as sysdba
sqlplus system/<your password>@//localhost:1521/<your SID>
sqlplus pdbadmin/<your password>@//localhost:1521/<Your PDB name>

Oracle Enterprise Manager Express:https://localhost:5500/em/,登录时 Container Name 留空,用户名为 system 或 sys

密码

若未指定 ORACLE_PWD 参数,可在输出日志中搜索 ORACLE PASSWORD FOR SYS, SYSTEM AND PDBADMIN: 找到密码

或者直接修改密码

docker exec <container name> ./setPassword.sh <your password>

 


https://github.com/oracle/docker-images/tree/main/OracleDatabase/SingleInstance

https://www.cnblogs.com/xiaoyuxixi/p/13739596.html

https://www.jianshu.com/p/f0139aff1746

标签:database,19.3,ORACLE,oracle,https,Oracle,Docker,docker,19c
来源: https://www.cnblogs.com/jhxxb/p/14991326.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有