Fork me on GitHub

Docker安装Oracle11g

拉取镜像

#拉取镜像
docker pull registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g
#查看镜像
docker images

镜像比较大(6.9G),可能拉取时间会很久,需要耐心等待
image

创建容器

docker run -d -p 1521:1521 --name oracle registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g
#查看运行的容器
docker ps

进入容器

docker exec -it oracle /bin/bash

image

操作oracle

cd /home/oracle/
#source是为了使环境变量生效,不生效时不识别ORACLE_BASE等环境变量
source .bash_profile

#登录oracle
sqlplus /nolog
#以管理员身份进行连接
conn /as sysdba

#更改默认密码,新建用户
alter user system identified by system;
alter user sys identified by sys;

create user oracle identified by oracle;
grant connect,resource,dba to oracle;
ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;
alter system set processes=2000 scope=spfile;

image

参考: https://www.cnblogs.com/mike666/p/13999397.html

posted @ 2023-03-30 22:55  秋夜雨巷  阅读(181)  评论(0)    收藏  举报