Oracle在Docker中的安装

安装Oracle11g

  1. 拉取镜像
    1
    docker pull registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g
  2. 创建容器
    1
    docker run -d -p 1521:1521 --name oracle11g registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g
  3. 进入镜像进行配置
    1
    docker exec -it oracle11g bash
  4. 切换用户
    1
    su root
         密码:helowin
    
  5. 编辑文件
    1
    2
    3
    4
    5
    vim /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
  6. 创建软连接
    1
    ln -s $ORACLE_HOME/bin/sqlplus /usr/bin
  7. 切换到oracle用户
    1
    su - oracle
  8. 登录sqlplus修改sys密码
    1
    2
    3
    4
    5
    sqlplus /nolog
    conn /as sysdba

    alter user system identified by system;
    alter user sys identified by sys;
  9. 创建用户
    1
    create user test identified by test;
  10. 赋权
    1
    grant connect,resource,dba to test;