zoukankan      html  css  js  c++  java
  • 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

  • 相关阅读:
    jenkins集成python时出现"Non-ASCII character 'xe6' in file"错误解决方法
    【转】/bin/bash^M: bad interpreter: No such file or directory
    解决Jenkins中执行jmeter脚本后不能发报告(原报告被覆盖、新报告无法保存)的问题
    【转】shell脚本中如何传入参数
    Hibernate学习笔记
    struts2学习笔记
    oracle表空间相关SQL语句
    javaMail
    Mysql 5.7.7
    设计模式之享元模式
  • 原文地址:https://www.cnblogs.com/javayanglei/p/13616390.html
Copyright © 2011-2022 走看看