当前位置:网站首页>Docker中安装Oracle数据库
Docker中安装Oracle数据库
2022-06-29 01:13:00 【杰肥啊】
前言
楼主安装Oracle的初衷是为了学习一下如何安装,然后从中得到一些安装经验,顺便以后如果学习Oracle数据库相关知识的时候,以至于不会在安装环节卡住了,学习门槛瞬间降低。
安装
1.访问Docker镜像仓库官网

2.找到对应版本
#这个快
docker pull registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g
可能需要一点时间,因为比较大。
自己如果尝试配置可以参考这个镜像的说明

3.查看镜像
等拉取好了镜像之后,docker images 查看一下镜像是否拉取成功。
docker images

4.启动Oracle
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 oracle /bin/bash
#切换root用户 #密码:helowin
su root
第一种方式
加载
.bash_profile文件,我们可以先用命令cat /home/oracle/.bash_profile查看一下里面的内容,通过查看我们可以知道里面定义了ORACLE_HOME,ORACLE_SID之类的配置。source /home/oracle/.bash_profile第二种方式
修改
/etc/profile文件,将ORACLE_HOME和ORACLE_SID配置到其中,然后生效。vi /etc/profile #配置内容 export ORACLE_HOME=/home/oracle/app/oracle/product/11.2.0/dbhome_2 export ORACLE_SID=helowin export PATH=$ORACLE_HOME/bin:$PATH #配置文件生效 source /etc/profile
创建软连接
ln -s $ORACLE_HOME/bin/sqlplus /usr/bin
登录sqlplus
#切换回oracle用户
su oracle
sqlplus /nolog
connect / as sysdba
#修改system帐号的密码
alter user system identified by 123456;
#修改sys帐号的密码
alter user sys identified by 123456;
创建一个用户(看自己了)
#创建用户
create user jiefei identified by jiefei;
#赋权限
grant connect,resource,dba to jiefei;
工具连接
这里楼主用的是Navicat Premium工具连接Oracle数据库进行测试。


边栏推荐
- 第七天 脚本与特效
- 《Reinforcement learning based parameters adaption method for particleswarm optimization》代码复现
- linux7(centos7)设置oracle11开机自启动
- 同期群分析是什么?教你用 SQL 来搞定
- Streaming media cluster application and configuration: how to deploy multiple easycvr on one server?
- 成功解决(机器学习分割数据问题):ModuleNotFoundError: No module named ‘sklearn.cross_validation‘
- Uvm:factory mechanism
- Finally understand the difference between DOM XSS and reflection XSS
- Breadth first search to catch cattle
- Check the open source projects of yyds in June!
猜你喜欢
![[image processing] image curve adjustment system based on MATLAB](/img/9c/176473a0083f075e54a45fbb4ed6ea.png)
[image processing] image curve adjustment system based on MATLAB

What is redis

Advanced Installer Architect创作工具

Jbridge bridging frame technology for AI computing power landing

Day 7 scripts and special effects

What is the difference between the history and Western blotting
![User login (remember the user) & user registration (verification code) [using cookie session technology]](/img/31/c84c1e15aa1c73814c4ad643e3dd36.png)
User login (remember the user) & user registration (verification code) [using cookie session technology]

Finally understand the difference between DOM XSS and reflection XSS

Day 8 script and audio

Misunderstanding of innovation by enterprise and it leaders
随机推荐
[MCU club] design of classroom number detection based on MCU [simulation design]
Connected to rainwater series problems
User login (remember the user) & user registration (verification code) [using cookie session technology]
多维分析预汇总应该怎样做才管用?
Ensemble de données sur les visages masqués et méthode de génération des visages masqués
The function of Schottky diode in preventing reverse connection of power supply
Large-scale case applications to developing post-click conversion rate estimation with MTL
Different subsequence problems I
WPF 实现心电图曲线绘制
What is the difference between the history and Western blotting
同期群分析是什么?教你用 SQL 来搞定
最新Justnews主题源码6.0.1开心版+社交问答插件2.3.1+附教程
【温度检测】基于matlab GUI热红外图像温度检测系统【含Matlab源码 1920期】
机构加密资产产品上周流出4.23亿美元资金,创历史新高
2022年启牛商学院证券账户开户安全的嘛?
利用kubernetes资源锁完成自己的HA应用
分析框架——用户体验度量数据体系搭建
成功解决(机器学习分割数据问题):ModuleNotFoundError: No module named ‘sklearn.cross_validation‘
戴口罩人脸数据集和戴口罩人脸生成方法
Advanced Installer Architect创作工具