栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

使用docker安装Oracle(根据官网整理)

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

使用docker安装Oracle(根据官网整理)

使用docker安装Oracle
  1. docker 登录Oracle仓库的账号。(没有的话,要去Oracle官网注册)
docker login -u 用户名 -p 密码 https://container-registry.oracle.com
  1. 拉取镜像并启动容器(请保持足够空间的内存与磁盘大小)
docker run -d --name container_name 
 -p host_port:1521 -p host_port:5500 
 -e ORACLE_SID=cdb-system-identifer 
 -e ORACLE_PDB=pdb-name 
 -e ORACLE_PWD=oracle-user-password 
 -e INIT_SGA_SIZE=cdb-database-sga-memory-in-mb 
 -e INIT_PGA_SIZE=cdb-database-pga-memory-in-mb 
 -e ORACLE_EDITION=ee-or-se-database-edition  
 -e ORACLE_CHARACTERSET=character-set 
 -e ENABLE_ARCHIVELOG=[true|false]
 -v [host-mount-point:]/opt/oracle/oradata 
container-registry.oracle.com/database/enterprise:21.3.0

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 PDBADMIN password. (Default: auto-generated)
 -e INIT_SGA_SIZE:       The total memory in MB that should be used for all SGA components (Optional)
 -e INIT_PGA_SIZE:       The target aggregate PGA memory in MB that should be used for all server processes attached to the instance (Optional)
 -e ORACLE_EDITION:      The Oracle Database Edition [enterprise|standard]. (Default: enterprise)
 -e ORACLE_CHARACTERSET: The character set that you want used when creating the database. (Default: AL32UTF8)
 -e ENABLE_ARCHIVELOG    The ARCHIVELOG mode. By default, set to false. 
                         If set to true, then ARCHIVLOG mode is enabled in the database (for fresh database creation only)
 -v /opt/oracle/oradata
                         The data volume that you want used for the database. Must be writable by the oracle user (uid: 54321) inside the container
                         If omitted, then 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 section "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 that you want run after database setup.
                         For further details see the "Running scripts after setup and on startup" section below.

示例:

docker run -d --name oracle
-p 1521:1521 -p 5500:5500  
-e ORACLE_SID=huangwen  
-e ORACLE_PDB=huangwen  
-e ORACLE_PWD=huangwen  
-v /opt/oracle/oradata 
container-registry.oracle.com/database/enterprise:21.3.0
  1. 检查一下是否连接成功
docker exec -it dbname sqlplus sys/cdb-user-password@cdb-sid as sysdba
# 示例:
docker exec -it oracle sqlplus sys/huangwen@ORCLCDB as sysdba
  1. 最后附上官网地址
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/888315.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号