拉取镜像
docker pull registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g
AI 代码解读
创建并启动容器
docker run -d -p 1521:1521 --name oracle11g registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g
AI 代码解读
进入oracle11g容器进行配置
docker exec -it oracle11g bash
AI 代码解读
切换到root用户下进行配置
su root 密码为:helowin
AI 代码解读
编辑profile文件配置ORACLE环境变量
vi /etc/profile
AI 代码解读
在最下边添加如下内容:
export ORACLE_HOME=/home/oracle/app/oracle/product/11.2.0/dbhome_2 export ORACLE_SID=helowin export PATH=$ORACLE_HOME/bin:$PATH
AI 代码解读
让配置立刻生效
source /etc/profile
AI 代码解读
创建软连接
ln -s $ORACLE_HOME/bin/sqlplus /usr/bin
AI 代码解读
切换到oracle 用户
su - oracle
AI 代码解读
登录sqlplus并修改sys、system用户密码
sqlplus /nolog
conn /as sysdba
AI 代码解读
修改sys、system用户密码并刷新权限
alter user system identified by oracle;
alter user sys identified by oracle;
ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;
AI 代码解读
退出:
exit;
AI 代码解读
查看一下oracle实例状态
lsnrctl status
AI 代码解读
使用plsql连接oracle服务端
服务名:helowin(一定要填写helowin)
密码:oracle(上边设置的密码)