• docker安装oracle


    1.下载镜像

    docker pull registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g

    2.创建快速搭建脚本build.sh

    #!/bin/bash
    #启动镜像
    containId=`docker ps -a |grep -i oracle11g|awk '{print $1}'`
    FDIR=$(dirname $(readlink -f "$0"))
    if [[ ! $containId ]] ;then
            echo "target container not exist!"
    else
            echo "target container exist , ID = "$containId
            docker stop $containId
            docker rm $containId
            echo "success delete container "$containId
    fi
    
    docker run -d -p 1521:1521  -v $FDIR/data/oracle:/data/oracle  --name oracle11g --restart always  registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g
    sleep 3
    docker logs -f --tail 100 oracle11g

    3.启动脚本并进入容器进行配置

    sh build.sh
    docker exec -it oracle11g bash

     root密码:helowin

    su - root
    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

    source /etc/profile

    创建软连接:

    ln -s $ORACLE_HOME/bin/sqlplus /usr/bin

     数据库配置:

    su - oracle
    
    sqlplus /nolog 
    
    conn /as sysdba;
    
    修改密码:
    alter user system identified by system;
    alter user sys identified by sys;
    alter profile default limit password_life_time unlimited;
    
    创建用户:
    create user test identified by test;
    
    并给用户赋予权限:
    grant connect,resource,dba to test;
    
    用户解锁:
    alter user test account unlock;
    
    自动增加表空间容量:
    alter tablespace users add datafile '/home/oracle/app/oracle/oradata/helowin/users02.dbf' size 10240m autoextend on next 1024m maxsize unlimited;
    
    扩大共享内存:
    alter system set SHARED_POOL_SIZE='150M' SCOPE=spfile;
    
    shutdown immediate;
    
    startup;

    原文地址:

    https://blog.csdn.net/u012725623/article/details/122013707

  • 相关阅读:
    ASP.NET MVC 扩展相关
    新.NET开发十大必备工具
    c#调用存储过程两种方法
    TweakUI取消pc喇叭声
    baidu mp3竟然还加密,太扯了
    NTLM在使用代理服务器的情况下,第三次握手可能出错
    httpclient解析gzip网页
    eclipse不能自动编译工程的解决方法
    bat设置环境变量
    java的ZipOutputStream压缩文件的两个问题(乱码和每次zip后文件md5变化)
  • 原文地址:https://www.cnblogs.com/xiaofengfree/p/16313259.html
Copyright © 2020-2023  润新知