目录

Oracle Docker版教程

docker安装Oracle数据库

1
docker pull registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g

Docker创建数据库

1
docker run --name oracle_11g -d -p 1521:1521 registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g

配置

  1. 进入容器里
1
winpty docker exec -it oracle_11g bash
  1. 配置一下环境变量,执行su root后,输入密码 helowin(数据库名字)

  2. vi /etc/profile 并在文件最后添加如下命令

1
2
3
export ORACLE_HOME=/home/oracle/app/oracle/product/11.2.0/dbhome_2
export ORACLE_SID=helowin
export PATH=$ORACLE_HOME/bin:$PATH
  1. 使变量生效,接着切换为 oracle用户就可以正常使用了
1
2
3
4
5
source /etc/profile

ln -s $ORACLE_HOME/bin/sqlplus /usr/bin

su - oracle
  1. 登录sqlplus并修改sys、system用户密码
1
2
3
4
5
6
7
8
9
sqlplus /nolog

conn /as sysdba

alter user system identified by oracle;

alter user sys identified by oracle;

ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;
  1. exit退出

  2. 查看一下oracle实例状态

1
lsnrctl status
  1. 服务名要填写helowin(上面写的),账号:system,密码:oracle