• ContOS Docker 安装 oracle


    ContOS Docker 安装 oracle

    一、Mac 导出镜像

    1. 查看 id

    ➜  docker docker images
    REPOSITORY                                             TAG                 IMAGE ID            CREATED             SIZE
    ubuntu                                                 18.04               6526a1858e5d        2 weeks ago         64.2MB
    registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g   latest              3fa112fd3642        4 years ago         6.85GB
    ➜  docker
    

    2. 导出到本地文件夹

    docker save -o orcale.tar 3fa112fd3642
    

    3. 上传到 ContOS 中

    3cv7

    二、ContOS 导入镜像

    1. 导入

    docker load -i orcale.tar
    

    2. 查看,创建 tag

    [root@CentOS-Yang yang]# docker images
    REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
    orcale11g           1.1.1               3fa112fd3642        4 years ago         6.85 GB
    [root@CentOS-Yang yang]# docker tag 3fa112fd3642 orcale11g:1.1.1
    

    3. 创建一个容器

    docker run -d -p 1521:1521 --name oracle orcale11g:1.1.1
    

    4. 启动容器

    docker start oracle
    

    进入镜像设置配置

    1、进入镜像

    docker exec -it oracle bash
    

    2、切换到 root 用户

    [root@CentOS-Yang yang]# docker exec -it oracle bash
    [oracle@350abb822cf0 /]$ su root
    # 密码是 helowin
    Password:
    [root@350abb822cf0 /]#
    

    3、 编辑 /etc/profile 文件

    vi /etc/profile
    
    # 在文件最后面加上 ORACLE 环境变量
    export ORACLE_HOME=/home/oracle/app/oracle/product/11.2.0/dbhome_2
     
    export ORACLE_SID=ORCL
     
    export PATH=$ORACLE_HOME/bin:$PATH
    # :wq 保存退出
    

    4、创建软链接

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

    5、登陆 sqlpuus 修改 sys、system 用户密码,并参加一个用户

    -- 切换为 oracle 用户
    [root@8c2a36142ed9 ~]# su - oracle
    -- 进入
    [oracle@8c2a36142ed9 ~]$ sqlplus /nolog
    
    SQL*Plus: Release 11.2.0.1.0 Production on Thu Sep 3 20:46:10 2020
    
    Copyright (c) 1982, 2009, Oracle.  All rights reserved.
    
    -- 登陆
    SQL> conn/as sysdba
    Connected.
    -- 更改 用户名为 system 的用户的密码为 system
    SQL> alter user system identified by system;
    
    User altered.
    
    -- 更改 用户名为 user 的用户的密码为 sys
    SQL>  alter user sys identified by sys;
    
    User altered.
    
    -- 创建一个用户 用户名 yang 密码 1
    SQL> create user yang identified by 1;
    
    User created.
    
    -- 给 yang 权限
    SQL> grant connect,resource,dba to yang;
    
    Grant succeeded.
    
    -- 更改默认配置文件限制
    SQL> ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;
    
    Profile altered.
    -- 退出
    SQL>exit
    
    

    三、idea 连接

    xVi

    四、Navicat 登陆

    wcW2

  • 相关阅读:
    java免费空间!最简单的openshift免费空间上传代码教程!和FTP一样简单!
    医疗大数据解决方案
    十大经典排序算法的JS版
    读取某个目录下的所有图片并显示到pictureBox
    一些植物查询的网站链接
    植物野外识别速查图鉴
    Winform改变Textbox边框颜色
    Microsoft Access数据库操作类(C#)
    自定义GroupBox
    ArrayList用法整理
  • 原文地址:https://www.cnblogs.com/javayanglei/p/13616390.html
Copyright © 2020-2023  润新知