当前位置: 首页 > news >正文

ORACLE 21容器安装

###ORACLE 21容器安装
步骤1:下载镜像

docker pull container-registry.oracle.com/database/free:latest

步骤2:运行

方法一:
执行以下命令,<oracle-db>可以自定义,运行后SYS, SYSTEM and PDBADMIN users会产生随机密码

podman run -d --name <oracle-db> container-registry.oracle.com/database/free:latest

改变随机密码:

podman exec <oracle-db> ./setPassword.sh <your_password>

访问告警日志

podman logs <oracle-db>

访问数据库容器

进容器内:

podman exec -it <oracle-db> sqlplus sys/<your_password>@FREE as sysdba
podman exec -it <oracle-db> sqlplus system/<your_password>@FREE
podman exec -it <oracle-db> sqlplus pdbadmin/<your_password>@FREEPDB1

外部连接端口

发现容器端口

podman port <oracle-db>
sqlplus sys/<your password="">@//localhost:<port mapped="" to="" 1521="">/FREE as sysdba
sqlplus system/<your password="">@//localhost:<port mapped="" to="" 1521="">/FREE
sqlplus pdbadmin/<your password="">@//localhost:<port mapped="" to="" 1521="">/FREEPDB1

运行脚本:

安装后可运行脚本,运行时mount目录

podman run -d --name <oracle-db> -v \
/home/oracle/myScripts:/opt/oracle/scripts/startup \
container-registry.oracle.com/database/free:latest

###Oracle True Cache

建立网络

podman network create tc_net

检查网络

podman inspect tc_net | grep -iw ‘subnet’

运 行primary database

podman run -td –name pri-db-free \
–hostname pri-db-free \
–net=tc_net \
–ip \
-p :1521 \
–secret=oracle_pwd \
–secret=oracle_pwd_priv_key \
–add-host=”tru-cc-free:” \
-e ENABLE_ARCHIVELOG=true \
-e ENABLE_FORCE_LOGGING=true \
-v [:]/opt/oracle/oradata \
container-registry.oracle.com/database/free:latest

运 行free true cache

podman run -td –name tru-cc-free \
–hostname tru-cc-free \
–net=tc_net \
–ip \
-p :1521 \
–secret=oracle_pwd \
–secret=oracle_pwd_priv_key \
–add-host=”pri-db-free:” \
-e TRUE_CACHE=true \
-e PRIMARY_DB_CONN_STR=:1521/FREE \
-e PDB_TC_SVCS=”FREEPDB1:sales1:sales1_tc;FREEPDB1:sales2:sales2_tc;FREEPDB1:sales3:sales3_tc;FREEPDB1:sales4:sales4_tc” \
-v [:]/opt/oracle/oradata \
container-registry.oracle.com/database/free:latest

方法二:

podman run --name <container name=""> \
-P | -p <host port="">:1521 \
-e ORACLE_PWD=<your database="" passwords=""> \
-e ORACLE_CHARACTERSET=<your character="" set=""> \
-e ENABLE_ARCHIVELOG=true \
-e ENABLE_FORCE_LOGGING=true \
-v [<host mount="" point="">:]/opt/oracle/oradata \
container-registry.oracle.com/database/free:latest

character:AL32UTF8

Parameters:
--name: The name of the container (default: auto generated)
-P | -p: The port mapping of the host port to the container port.
Only one port is exposed: 1521 (Oracle Listener)
-e ORACLE_PWD: The Oracle AI Database SYS, SYSTEM and PDB_ADMIN password (default: auto generated)
-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: true)
-e ENABLE_FORCE_LOGGING:
To enable force logging mode when creating the database (default: true)
-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
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
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.

####Podman 密码安全
步骤一:产生RSA

mkdir /opt/.secrets/
cd /opt/.secrets
openssl genrsa -out key.pem
openssl rsa -in key.pem -out key.pub -pubout

步骤二:创建明文密码文件

vi /opt/.secrets/pwdfile.txt

步骤三:用私钥加密密码文件

openssl pkeyutl -in /opt/.secrets/pwdfile.txt -out /opt/.secrets/pwdfile.enc -pubin -inkey /opt/.secrets/key.pub -encrypt
rm -rf /opt/.secrets/pwdfile.txt

步骤四:创建podman secrets

podman secret create oracle_pwd /opt/.secrets/pwdfile.enc
podman secret create oracle_pwd_priv_key /opt/.secrets/key.pub

步骤五:将podman secret用于容器

podman run --name <container_name> --secret=oracle_pwd --secret=oracle_pwd_priv_key container-registry.oracle.com/database/free:latest

 


http://www.jsqmd.com/news/257846/

相关文章:

  • 为什么日本夫妇在婚礼上的开销比美国夫妇多
  • paperxie 毕业论文写作工具:从 “卡壳焦虑” 到 “高效输出” 的破局之道
  • 润色后的热补丁更新业务连续性验证:测试工程师的实战指南
  • Kubernetes - TerraForm
  • 基于Springboot+Vue+Web的图书借阅管理信息系统(源码+lw+部署文档+讲解等)
  • 基于Springboot+Vue的Javaweb的《战舰世界》游戏百科信息系统(源码+lw+部署文档+讲解等)
  • qt之pro配置条件编译
  • 基于Springboot+Vue的JavaWeb的图书馆管理系统(源码+lw+部署文档+讲解等)
  • 优质服务的胶囊液体灌装厂家有哪些,天宏机械推荐吗? - 工业品牌热点
  • 区块链智能合约执行结果可验证性验收:2026实证研究与未来展望
  • ‌航空调度系统灾备切换可靠性测试框架‌——面向测试工程师的实战方法论
  • 基于Springboot+Vue的Java的宠物用品系统(源码+lw+部署文档+讲解等)
  • 基于Springboot+Vue的JavaWeb的城市花园小区维修管理系统(源码+lw+部署文档+讲解等)
  • 晶振包地以及晶振不能靠近板边
  • 基于Springboot+Vue的JavaWeb的大学生房屋租赁系统(源码+lw+部署文档+讲解等)
  • 管理信息系统作业:输入输出设计详解
  • 南京市浦口江宁六合溧水高淳区英语雅思培训辅导机构推荐,2026权威出国雅思课程中心学校口碑排行榜推荐 - 老周说教育
  • 3.2 CLIP模型深度剖析:实现以图搜图的核心技术
  • Microsoft Office LTSC 2021 for Mac (Microsoft 365) 16.105 - 文档、电子表格、演示文稿和电子邮件
  • 基于Springboot+Vue的Java的流浪宠物领养平台系统(源码+lw+部署文档+讲解等)
  • 智能客服多轮对话意图识别验收:软件测试从业者实用指南
  • Kubernetes - Azure devops
  • Day16综合案例--渲染学生信息表
  • OpenGL第八版开发环境搭建与配置教程
  • 【赵渝强老师】国产金仓数据库的段、区、块
  • WPS Office for Mac 2025 冬季更新 12.1.24703 - 写作、表格处理、PPT 制作和 PDF 编辑
  • 南京市玄武秦淮建邺鼓楼栖霞雨花台区英语雅思培训辅导机构推荐,2026权威出国雅思课程中心学校口碑排行榜推荐 - 老周说教育
  • 吐血推荐8个AI论文软件,专科生毕业论文搞定!
  • Microsoft SQL Server 2025 RTM GDR CU1 (2026 年 1 月安全更新 累计更新)
  • 基于Springboot+Vue的JavaWeb的美食交流宣传系统(源码+lw+部署文档+讲解等)