1,拉取 docker 镜像:docker pull registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g
1.1 , 该镜像由阿里云提供,比较大,可能需要下载一会
1.2,所有者用户 root 密码 helowin
1.3,oracle 所有者用户 oracle
1.4,oracle 安装路径 /home/oracle/app/oracle
1.5,oracle 版本 oracle_11g
2,创建并运行一个容器
2.1,查询镜像是否下载成功 :docker images
2.2,运行该镜像:docker run -d -p 1521:1521 --name oracle registry.aliyuncs.com/helowin/oracle_11g
3,进入容器修改账号密码
3.1,检查容器是否运行成功
3.2,进入容器:docker exec -it oracle bash
3.3,进入 root 账:su root
3.4,输入密码:helowin
3.5,编辑环境变量 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
3.6,使得修改失效: source /etc/profile
3.7,切换到 oracle 用户: su oracle
3.8,使用 sqlplus 连接到 oracle: sqlplus /nolog => conn /as sysdba
3.9,修改 sys 和 system 的密码并且修改密码的有效时间为无限
alter user system identified by oracle;
alter user sys identified by oracle;
ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;
4,外部连接,连接的几个参数吐下
IP: 本机 ip
端口: 1521
SID:helowin
账号:system
密码:oracle
原文地址:原文