当前位置:网站首页>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數據庫進行測試。


边栏推荐
- 大厂裁员潮下,测试人员路在何方?
- EasyCVR新建用户后,视频调阅页面不能点击的问题修复
- 广度度优先搜索实现抓牛问题
- Is it safe to open a securities account at qiniu business school in 2022?
- FSS object storage how to access the Intranet
- How many locks are added to an update statement? Take you to understand the underlying principles
- [Fire Detection] forest fire detection system based on Matlab GUI (with panel) [including Matlab source code phase 1921]
- Mask wearing face data set and mask wearing face generation method
- 《Reinforcement learning based parameters adaption method for particleswarm optimization》代码复现
- 有了这款工具,自动化识别验证码再也不是问题
猜你喜欢

Blazor University (34)表单 —— 获得表单状态

EasyCVR接入Ehome协议的设备,无法观看设备录像是什么原因?

致我们曾经遇到过的接口问题
![[MCU club] design of blind water cup based on MCU [physical design]](/img/06/93d7a8fd97cdccbc639d2a95b10826.jpg)
[MCU club] design of blind water cup based on MCU [physical design]

《Reinforcement learning based parameters adaption method for particleswarm optimization》代码复现

深度优先搜索实现抓牛问题

Seven mistakes in IT Governance and how to avoid them

Statistical learning method (4/22) naive Bayes

统计学习方法(4/22)朴素贝叶斯

使用.Net驱动Jetson Nano的OLED显示屏
随机推荐
免疫组化和免疫组学之间的区别是啥?
[MCU club] design of classroom number detection based on MCU [simulation design]
UVM: message mechanism
广度度优先搜索实现抓牛问题
Successfully solved (machine learning data segmentation problem): modulenotfounderror: no module named 'sklearn cross_ validation‘
Sword finger offer 14- I. cut rope
Large-scale case applications to developing post-click conversion rate estimation with MTL
Code repetition of reinforcement learning based parameters adaptation method for particlewarn optimization
Blazor University (34) forms - get form status
Flask-SQLAlchemy的基本使用
What is redis
Seven mistakes in IT Governance and how to avoid them
大型网站架构基础之笔记
Check the open source projects of yyds in June!
Nodejs安装和下载
大厂裁员潮下,测试人员路在何方?
统计学习方法(4/22)朴素贝叶斯
同期群分析是什么?教你用 SQL 来搞定
Day 7 scripts and special effects
致我们曾经遇到过的接口问题