Docker 学习之Oracle11g安装
一.下载镜像
oracle 镜像比较大,我们这里使用阿里镜像。
docker pull registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g
docker images
重命名镜像名字:
docker tag 3fa112fd3642 oracle_11g
二.创建运行容器
docker run -d -p 1521:1521 --name oracle11g oracle_11g
返回容器ID成功,我们进入容器
docker exec -it oracle11g bash
此时,用户为oracle,我们切换为root用户。
su root
输入密码:helowin
编辑配置文件 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
切换回oracle
su oracle
以操作系统方式认证
sqlplus /nolog
更改系统账户的密码
alter user system identified by system;
alter user sys identified by sys;
ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;
你也可以,创建一个用户并分配权限
create user mydb identified by mydb;
grant connect,resource,dba to mydb;
到现在你可以使用Navicat连接
注意以下信息:
IP: 本机 ip
端口: 1521
SID:helowin
账号:system
密码:system
我采用Idea 测试