转储文件甲骨文 11 docker

dump file oracle 11 docker

我用的是docker oracle数据库Oracle Database 11g Express Edition Release 11.2.0.2.0 我试图导入一个文件 dmp,但出现以下错误

docker-compose.yml

version: '3'

services:

  oracle:
    image: jaspeen/oracle-xe-11g
    container_name: oracle11g
    volumes:
      - ~/docker/data:/u01/app/oracle jaspeen/oracle-xe-11g
    ports:
      - "1529:1521"
      - "8081:8080"
      - "2222:22"

命令

docker exec -it oracle11g sqlplus
Enter user-name: SYS as SYSDBA
Enter password: oracle

SQL> CREATE TABLESPACE DEV_SPACE DATAFILE 'dev_space.dat' SIZE 500M AUTOEXTEND ON NEXT 10M;
SQL> DEFINE NEW_USER = 'scoemploi';
SQL> CREATE USER &NEW_USER. IDENTIFIED BY "1234";
SQL> GRANT CONNECT, RESOURCE, CREATE JOB, CREATE VIEW, CREATE ANY CONTEXT TO &NEW_USER;
SQL> ALTER USER &NEW_USER QUOTA UNLIMITED ON USERS;
SQL> ALTER USER &NEW_USER DEFAULT TABLESPACE DEV_SPACE;


SQL> CREATE OR REPLACE DIRECTORY docker_vol AS '/u01/app/oracle';
SQL> GRANT READ, WRITE ON DIRECTORY docker_vol TO scoemploi;

sudo docker exec -it oracle11g impdp scoemploi/1234 DUMPFILE=docker_vol:scoemploi2020.DMP FULL=Y


ORA-39001: invalid argument value
ORA-39000: bad dump file specification
ORA-31640: unable to open dump file "/u01/app/oracle/scoemploi2020.DMP" for read
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3

您的 docker

中需要包含 scoemploi2020.DMP

docker cp /hostpath/scoemploi2020.DMP demo1:/u01/app/oracle

docker exec -it demo1 chmod +rxw /u01/app/oracle/scoemploi2020.DMP