首页 > 数据库 >docker/docker-compose安装Oracle11gr2

docker/docker-compose安装Oracle11gr2

时间:2022-10-08 17:24:28浏览次数:61  
标签:compose -- create user oracle docker Oracle11gr2 1521

docker/docker-compose安装Oracle11gr2

使用镜像wnameless/oracle-xe-11g-r2(Oracle12c使用absolutapps/oracle-12c-ee) 登录用户密码sys/oracle 实例信息XE
查询镜像:docker search oracle

sqlplus可能用到的相关操作

-- 监听操作
lsnrctl status/stop/start

-- 登录
sqlplus system/oracle@//localhost:1521/orcl

-- 登录修改密码等
sqlplus /nolog
connect sys/oracle as sysdba;
alter user sys identified by newpassword;
alter user system identified by newpassword;
create user xxx identified by password;
grant create session to xxx;
grant create table,unlimited tablespace to xxx;
grant select any table to xxx;
GRANT UPDATE ANY TABLE,DROP ANY TABLE,INSERT ANY TABLE TO xxx;
alter system set O7_DICTIONARY_ACCESSIBILITY=true scope=spfile;

-- 查看实例
select instance_name from v$instance;
-- 查看表空间
select TABLESPACE_NAME, FILE_NAME from dba_data_files;
-- 创建表空间
create tablespace user_data logging datafile '/u01/app/oracle/oradata/XE/user_data01.dbf' size 50m autoextend on next 50m maxsize 20480m extent management local;
-- 查看临时表空间
select TABLESPACE_NAME, FILE_NAME from dba_temp_files;
-- 创建临时表空间
create temporary tablespace user_temp tempfile '/u01/app/oracle/oradata/XE/user_temp01.dbf' size 50m autoextend on next 50m maxsize 20480m extent management local;
-- 创建用户
create user username identified by password default tablespace user_data temporary tablespace user_temp;

-- 给用户授予权限
grant connect,resource,dba to username;

使用docker

docker run --name oracle -d -p 1521:1521 -e ORACLE_ALLOW_REMOTE=true wnameless/oracle-xe-11g-r2

使用docker-compose

version: '3'

services:
  oracle11gr2:
    image: wnameless/oracle-xe-11g-r2
    container_name: oracle11gr2
    environment:
      # 时区上海
      TZ: Asia/Shanghai
    ports:
      - "8080:8080"
      - "1521:1521"
    # volumes:
      # - ./data/oracle:/u01/app/oracle
    privileged: true
    # restart: always
    networks:
      - my_net
    deploy:
      resources:
        limits:
          cpus: 0.25
          memory: 1g
        reservations:
          # cpus: 0.2
          memory: 1g

networks:
  my_net:
    driver: bridge
    ipam:
      config:
        - subnet: 172.30.0.0/16

登录信息

hostname: localhost
port: 1521
sid: xe
username: system
password: oracle

plsql链接

XE =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 43.***.***.37 )(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = XE)
    )
  )

标签:compose,--,create,user,oracle,docker,Oracle11gr2,1521
From: https://www.cnblogs.com/muphy/p/16769579.html

相关文章

  • docker网络模式分类
    docker有四种网络模式bridge模式host模式container模式none模式Docker跨host网络:overlay、macvlan......
  • [转]深入理解Docker ulimit(docker容器启动报错library initialization failed - unab
    原文地址:深入理解Dockerulimit-DockOne.io【编者的话】Docker大规模应用后,如果你没踩过坑,说出去肯定没人信。昨天就遇到一个ulimit的经典问题:业务Container内ulimit值......
  • docker 无法执行systemctl:System has not been booted with systemd as init system
    背景Systemhasnotbeenbootedwithsystemdasinitsystem(PID1).Can'toperate.Failedtoconnecttobus:Hostisdown解决办法运行容器的时候加上参数--pri......
  • Centos 离线安装Docker
    原文出自 Centos7离线安装Docker-简书(jianshu.com)下载Docker并安装docker包下载地址#下载docker-20.10.0包https://download.docker.com/linux/static/stable/x......
  • 【 云原生 | Docker 】- 一文了解Docker
    随着互联网时代的到来,计算机的各项技术都有了巨大提高,推动了虚拟化、容器化技术的产生和发展,以及现在的云原生时代的到来,都极大提高了其资源利用率。DockerDocker本身不......
  • docker 容器重启失败
    [root@localhostconfig]#dockerrestart2d3039aab086Errorresponsefromdaemon:Cannotrestartcontainer2d3039aab086:driverfailedprogrammingexternalconn......
  • mac通过docker一键部署MySQL8
    目录mac通过docker一键部署MySQL8一、前言二、系统配置三、安装步骤Dockerhub查看镜像地址1、一键安装1.1、克隆脚本1.2、安装程序1.2.1、程序安装详情1.3、初始化用户1.3.......
  • docker搭建yapi接口文档系统、Idea中上传接口、在线调用
    一、前言在我们后端开发中,必不可少的是接口的交接,有很多种方式,常见的就是swagger,不过这个侵入性太强了。还有就是接口文档的框架,比如今天小编带大家一起搭建的yapi,在公司......
  • Centos7_docker509错误
    CentOS7Dockerx509:certificatesignedbyunknownauthority解决方案registry-1.docker.io/v2/1.echo-n|openssls_client-showcerts-connectregistry-1.doc......
  • docker 安装 elasticsearch
    1.拉取镜像:sudodockerpullelasticsearch:7.12.02.创建docker容器挂载目录:sudomkdir-pv/opt/elasticsearch/configsudomkdir-pv/opt/elasticsearch/datasu......