当前位置:网站首页>Docker 下 Oracle 安装与配置
Docker 下 Oracle 安装与配置
2022-07-29 21:16:00 【JAVA·D·WangJing】
一、Docker 版本

二、拉取 nacos 镜像
docker pull registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g
三、查看本地镜像
docker images
四、启动容器
# 默认启动容器的方式
docker run -d -it -p 1521:1521 --name oracle11g --restart=always registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g
# 持久化启动的方式
docker run -d -it -p 1521:1521 --name oracle --restart=always --mount source=oracle_vol,target=/home/oracle/app/oracle/oradata registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g五、安装成功,查看容器运行状况
docker ps
六、容器内环境配置
# 进入容器
docker exec -it oracle11g bash
# 切换到 root 用户
su root
# 密码为 helowin
helowin
# docker容器配置环境变量不是在 /etc/profile 中,容器启动不会走这个文件;可以将环境变量的配置设置在 /home/oracle/.bashrc 文件下,这样可以省略掉软连接的创建 ln -s $ORACLE_HOME/bin/sqlplus /usr/bin
# 编辑环境变量
vi /home/oracle/.bashrc
# 文件末尾添加如下命令
export ORACLE_HOME=/home/oracle/app/oracle/product/11.2.0/dbhome_2
export ORACLE_SID=helowin
export PATH=$ORACLE_HOME/bin:$PATH
# 刷新环境变量
source /home/oracle/.bashrc 
七、进入 oracle 命令行
# 进入 oracle 命令行
su - oracle
sqlplus /nolog
# 使用 “操作系统认证” 的方式,登录oracle conn / as sysdba
conn / as sysdba
# 查询所有可用的库
select instance_name from v$instance;
# 查询所有可用的用户
show user;
注:这个阿里的镜像,所有的密码都是统一:helowin
八、测试链接(本地连接,所以可以使用system账户)

注:以上内容仅提供参考和交流,请勿用于商业用途,如有侵权联系本人删除!
边栏推荐
猜你喜欢

第3章业务功能开发(线索关联市场活动,插入数据并查询)

【AD】【持续更新ing】关于AD设计过程中一些小细节

全景教程丨VR全景拍摄如何拍摄日出和日落的场景?

第3章业务功能开发(线索关联市场活动,动态搜索)

华为畅享50 Pro评测:HarmonyOS加持 更流畅更安全

ALBERT: A Lite BERT for Self-supervised Learning of Language Representations

酷客导航助你商场轻松购物,业务办理不迷茫

【ORM框架:Sequelize的查询】

Second Best PyTorch Beginner Course; Thesis Writing Guide; Using µGo to Develop a Mini Compiler; Super Efficient Use of Transformer's Extension Library; Frontier Papers | ShowMeAI News Daily

SwiftUI CoreData 教程之如何加速搜索速度
随机推荐
Analysis of Crypto in Pi 2
Verilog 加法器设计
How to implement your personal knowledge base?
无文件落地免杀的初尝试思考(上)
普洛斯荣获两项“数据中心绿色等级评估”5A级认证
Xshell 7 prompts "To continue using this program, you must apply the latest update or use a new version"
程序员自由工作的三大痛点?一文教你统统解决
惠普服务器硬盘指示灯不亮或显示蓝色
三品牌下半年将带来多款新品,东风日产将迎来“产品大潮”
防火墙——SNAT和DNAT策略的原理及应用、防火墙规则的备份和还原
Numpy数组处理(二)
1. Promise usage in JS, 2. The concept and usage of closures, 3. The difference between the four methods and areas of object creation, 4. How to declare a class
Jenkins 如何玩转接口自动化测试?
leetcode122. Best Time to Buy and Sell Stock II 买卖股票的最佳时机 II(简单)
Liu Genghong, boys and girls, come here!Sports data analysis and mining!(with a full set of code and data sets)
SAP ABAP OData 服务 Data Provider Class 的 GET_ENTITYSET 方法实现指南试读版
First thoughts on the first attempt to avoid killing without a file (Part 1)
Panorama Tutorial丨How to shoot sunrise and sunset scenes in VR panoramic shooting?
SwiftUI CoreData 教程之如何加速搜索速度
基于PaddleSpeech搭建个人语音听写服务
