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

    宛如智障,暗藏锋芒
  • 相关阅读:
    ListView具有多种item布局——实现微信对话列
    CSDN 2013年度博客之星评选——分享几张厦门杭州的美图
    不做旁观者,给博主最有力的支持——博客之星评选,期待您的支持,谢谢路过的朋友投上您宝贵的一票
    Android应用中使用及实现系统“分享”接口
    android手势创建及识别
    JSON数据源的多值参数实现
    葡萄城报表本地设计器
    如何设计带查询条件的报表
    巧用SQL语句补足不完全数据报表
    表格数据分组报表
  • 原文地址:https://www.cnblogs.com/zienzir/p/13612816.html
Copyright © 2011-2022 走看看