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

    宛如智障,暗藏锋芒
  • 相关阅读:
    在Ubuntu/Centos使用 Let's Encrypt 证书部署 HTTPS的方法
    Ubuntu14.04安装配置LAMP环境(php5.6)
    centos6 php5.4 升級到php 5.6
    为自己的2017年定个计划
    收益的一些话
    学习瓦力部署系统的项目配置和上线部署
    统计进仓和出仓数量随时间变化的剩余数量流程图
    Codeigniter 获取当前的控制器名称和方法名称
    [记]Windows 系统下设置Nodejs NPM全局路径
    [记]Cordova安装插件选择插件版本
  • 原文地址:https://www.cnblogs.com/zienzir/p/13612816.html
Copyright © 2011-2022 走看看