docker 安装 oracle

  1. 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
  3. docker start oracle11g
  4. docker exec -it oracle11g bash
  5. su root
    • 密码:helowin
    • (可选)修改root密码
      • passwd root
  6. 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
      
    • 由此可知SID为helowin, 或通过执行env | grep SID得到, 连接时用得到
  7. vi ~oracle/.bashrc
    • 添加
      export ORACLE_HOME=/home/oracle/app/oracle/product/11.2.0/dbhome_2
      export ORACLE_SID=helowin
      export PATH=$ORACLE_HOME/bin:$PATH
      
  8. source /etc/profile
  9. ln -s $ORACLE_HOME/bin/sqlplus /usr/bin
  10. su oracle
  11. sqlplus /nolog
    • 执行不成功则source ~oracle/.bashrc, 然后再执行一次
    • conn /as sysdba
    • ALTER USER SYSTEM IDENTIFIED BY "yourpwd00";
      • yourpwd00 为你的密码, 可自定义
  12. 参考链接: https://blog.csdn.net/qq_38380025/article/details/80647620
posted @ 2019-09-17 08:58  twfb  阅读(744)  评论(0编辑  收藏  举报