我创建了一个本地oracle数据库,但是我的卷没有保存我的用户。我执行以下操作。
1) docker login
2) docker-compose up
3) docker exec -it <container id> bin/bash
4) sqlplus / as sysdba
5) alter session set "_ORACLE_SCRIPT"=true;
6) create user admin identified by admin;
7) GRANT CREATE SESSION, CREATE DATABASE LINK, CREATE MATERIALIZED VIEW,
CREATE PROCEDURE, CREATE PUBLIC SYNONYM, CREATE ROLE,CREATE SEQUENCE,
CREATE SYNONYM, CREATE TABLE,
CREATE TRIGGER, CREATE TYPE, CREATE VIEW, UNLIMITED TABLESPACE to admin;
docker-compose.yml
version: "3"
services:
database:
image: "store/oracle/database-enterprise:12.2.0.1-slim"
ports:
- "1521:1521"
environment:
- DB_SID=XE
- DB_PASSWD=admin
volumes:
- oracle-database:/opt/oracle/oradata
volumes:
oracle-database:
但是,当我先运行docker-compose down
然后运行up
时,我必须再次重复所有步骤,以确认该音量不起作用。以前有人遇到过这个问题吗?