编程知识 cdmana.com

oracle19c docker-compose安装

1、docker-compose.yml

oracle:
  image: heartu41/oracle19c
  container_name: oracle19c
  privileged: true
  environment:
    - TZ=Asia/Shanghai
    - ORACLE_SID=ORCL
    - ORACLE_PDB=ORCLPDB1
    - ORACLE_BASE=/opt/oracle
    - ORACLE_HOME=/opt/oracle/product/19c/dbhome_1
    - PATH=/opt/oracle/product/19c/dbhome_1/bin:/opt/oracle/product/19c/dbhome_1/OPatch/:/usr/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
  volumes:
    - /data/oracle19c/oradata:/opt/oracle/oradata
  ports:
    - "1521:1521"
    - "18080:8080"
    - "15313:5500"
  restart: always

2、在本机创建目录/data/oracle19c/oradata   用来持久化数据

3、常用命令

连接Oracle:sqlplus / as sysdba

切换到PDB:alter session set container=ORCLPDB1;

创建表空间:CREATE TABLESPACE HFZF DATAFILE '/opt/oracle/oradata/ORCL/PDBHFZF01.DBF' SIZE 4096M AUTOEXTEND ON NEXT 100M;
CREATE temporary TABLESPACE HFZF_TEMP tempfile '/opt/oracle/oradata/ORCL/PDBHFZF_TEMP.DBF' SIZE 1024M AUTOEXTEND ON NEXT 10M;

创建用户:create user HFZF identified by hfzf  default tablespace HFZF Temporary tablespace HFZF_TEMP;

授权:grant dba to hfzf;

grant connect to hfzf;

修改密码永久有效:ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;

版权声明
本文为[xxjin]所创,转载请带上原文链接,感谢
https://my.oschina.net/xxjin/blog/4840170

Scroll to Top