zoukankan      html  css  js  c++  java
  • [docker] run oracle 11g in docker

    1.  find docker file and pull

    1.1. docker search oracle

    search docker images or you can also search oracle-11g at github.

    1.2 docker pull jaspeen/oracle-11g

    2.  download oracle 11g linux install file from oracle website and extract to <install_folder>, make sure under the <install_folder>, the extracted folder is "database".

      <install_folder>
        └─database
            ├─doc
            ├─install
            ├─response
            ├─rpm
            ├─sshsetup
            ├─stage
            ├─runInstaller
            └─welcome.html

    and under the above example folder, the directory tree would show "install"... etc.

    ps: make sure it's linux version even you are in windows and mac os.

    3. install oracle-11g with docker

    docker run --privileged --name oracle11g -p 1521:1521 -v /home:/install jaspeen/oracle-11g
    

     /home is the <install_folder>

    there's gonna be a lot of logs printed, make sure to wait installation period finished with 100% prompted.

    and after that, other logs would also be prompt, just open anther terminal to exit it.

    to check the installation status:

      docker ps -a

    CONTAINER ID        IMAGE                COMMAND                  CREATED             STATUS                      PORTS                                                                             NAMES
    7f53f07c93e5        jaspeen/oracle-11g   "/assets/entrypoint...."   About an hour ago   Up About an hour            0.0.0.0:1521->1521/tcp, 8080/tcp                                                  oracle11g
    

    in any case, if the installation come with exception, just remove the container with tag or image id:

    docker rm oracle11g

    or

    docker ps -l

    docker rm ******

    4. run the docker image 

    just in case container not running after above commands, try:

    docker start -i oracle11g

    5. run with command

    docker exec -it container_id(oracle11g)  [command]

    eg: docker exec -it oracle11g /bin/bash

    6. switch to sudo user

    su - oracle

    7. login in with sysdba

    sqlplus / as sysdba

    8. unlock account

    after login with sysdba, unlock scott with:

    alter user scott account unlock

    9. connecft with scott

    conn scott/tiger

    after login in with scott, you need to enter new password(can be same with old password).

    10. connect with IDE, such as sql developer

    ip: localhost

    port:1521

    sid: orcl

    宛如智障,暗藏锋芒
  • 相关阅读:
    'Neither SQLALCHEMY_DATABASE_URI nor SQLALCHEMY_BINDS is set.
    flask os.environ 的作用
    flask 中xx.init_app(app)方法
    win10安装ubuntu双系统遇到的问题
    福大软工 · 最终作业
    福大软工 · 第十二次作业
    Beta 冲刺(7/7)
    Beta 冲刺(6/7)
    常用正则
    使用elementUI动态增减表单项 且 使用自定义校验
  • 原文地址:https://www.cnblogs.com/zienzir/p/13612816.html
Copyright © 2011-2022 走看看