当前位置:网站首页>docker部署oracle
docker部署oracle
2022-07-07 12:03:00 【今朝花落悲颜色】
1.拉取镜像
docker pull registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g
2.启动容器
docker run -d -p 1521:1521 --name oracle11g registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g
执行 docker ps 命令确认容器启动成功
3.进行配置 ,首先执行如下命令进入 oracle容器环境中:
docker
exec
-it oracle11g bash
接着执行如下命令切换到 oracle 数据库的 root 用户下(密码为:helowin)
su root
编辑 profile 文件:
vi /etc/profile
在末尾处添加如下 ORACLE 环境变量参数后保存退出:
export ORACLE_HOME=/home/oracle/app/oracle/product/11.2.0/dbhome_2
export ORACLE_SID=helowin
export PATH=
$ORACLE_HOME
/bin:
$PATH
接着执行如下命令创建软连接:
ln -s
$ORACLE_HOME
/bin/sqlplus /usr/bin
然后执行如下命令切换到 oracle 用户:
su - oracle
接着依次执行如下命令登录 sqlplus:
sqlplus /nolog
conn /
as
sysdba
执行如下命令将 system 和 sys 两个账户的密码设为 123456:
alter user system identified by 123456;
alter user sys identified by 123456;
ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;
我们还可以执行如下命令解锁 scott 用户,同时将其密码设置为 123456:
alter user scott account unlock;
alter user scott identified by 123456;
commit;
配置完毕后,连续执行多个 exit 即可退出容器,返回到宿主机。
连接测试,我们使用客户端工具连接下这个 Oracle 数据库(其中 SID 为 helowin),可以发现连接成功:
边栏推荐
- 手把手教会:XML建模
- 参数关键字Final,Flags,Internal,映射关键字Internal
- Build a secure and trusted computing platform based on Kunpeng's native security
- Excellent open source system recommendation of ThinkPHP framework
- 接口自动化测试-接口间数据依赖问题解决
- 3D detection: fast visualization of 3D box and point cloud
- 2022-7-6 beginner redis (I) download, install and run redis under Linux
- postgresql array类型,每一项拼接
- MySQL error 28 and solution
- 高等數學---第八章多元函數微分學1
猜你喜欢
随机推荐
PHP中用下划线开头的变量含义
Leecode3. Longest substring without repeated characters
How does MySQL control the number of replace?
PC端页面如何调用QQ进行在线聊天?
FCOS3D label assignment
Cinnamon taskbar speed
What are the principles for distinguishing the security objectives and implementation methods that cloud computing security expansion requires to focus on?
Parameter keywords final, flags, internal, mapping keywords internal
2022-7-6 初学redis(一)在 Linux 下下载安装并运行 redis
现在网上开户安全么?那么网上开户选哪个证券公司?
Redis只能做缓存?太out了!
Supply chain supply and demand estimation - [time series]
TPG x AIDU | AI leading talent recruitment plan in progress!
Vmware 与主机之间传输文件
postgresql array类型,每一项拼接
Solve the cache breakdown problem
Move base parameter analysis and experience summary
Laravel form builder uses
118. 杨辉三角
Mysql怎样控制replace替换的次数?