1 拉取oracle_11g镜像:
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 -v /home/oracle/app/oracle/product/11.2.0/dbhome_2:/home/oracle/app/oracle/product/11.2.0/dbhome_2
3 查看容器启动状态: docker ps | grep oracle11g
4 进入oracle11g容器进行配置: docker exec -it oracle11g bash
5 切换到root用户下进行配置: su root 输入密码: helowin
6 编辑profile文件配置ORACLE环境变量: vi /etc/profile ,并添加如下内容, 保存退出后使配置生效 source /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
7 创建软连接: ln -s $ORACLE_HOME/bin/sqlplus /usr/bin
8 切换到oracle 用户: su - oracle
9 登录sqlplus并修改sys、system用户密码:
sqlplus /nolog # 登录
conn /as sysdba # 连接
alter user sys identified by sys; # 修改密码
ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;
exit;
10 查看一下oracle实例状态: lsnrctl status




