Oracle

無法將 11g2 中製作的 DMP 文件導入 Oracle 18c

  • March 10, 2022

我的作業系統=CENTOS 7

Oracle=18c XE

我正在嘗試導入從 XE 11g2 導出的 DMP 文件,現在嘗試將其導入 18c XE。以下是錯誤:

[root@linux gsw]# impdp user/pass remap_tablespace=SYSTEM:myUserName remap_tablespace=USERS:myUserName dumpfile=myUserName.dmp directory=myUserName

Import: Release 18.0.0.0.0 - Production on Thu Jun 4 01:09:34 2020
Version 18.4.0.0.0

Copyright (c) 1982, 2018, Oracle and/or its affiliates.  All rights reserved.

Connected to: Oracle Database 18c Express Edition Release 18.0.0.0.0 - Production
ORA-31626: job does not exist
ORA-31633: unable to create master table "myUserName.SYS_IMPORT_FULL_05"
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 95
ORA-06512: at "SYS.KUPV$FT", line 1142
ORA-01950: no privileges on tablespace 'USERS'
ORA-06512: at "SYS.KUPV$FT", line 1035
ORA-06512: at "SYS.KUPV$FT", line 1023

我所做的是:

create TABLESPACE myUserName
DATAFILE '/opt/oracle/oradata/XE/myUserName01.dbf' SIZE 10M
AUTOEXTEND ON
NEXT 512K
MAXSIZE 250M;

ALTER DATABASE 
DATAFILE '/opt/oracle/oradata/XE/myUserName01.dbf'
AUTOEXTEND ON
MAXSIZE UNLIMITED;

SQL> ALTER USER myUserName quota unlimited on myUserName;

User altered.

SQL> create user myUserName identified by pass;

User created.

SQL> grant connect, resource to myUserName;

Grant succeeded.

SQL> grant read, write on directory myUserName to myUserName;

Grant succeeded.

SQL> grant create database link to myUserName;

Grant succeeded.

SQL> grant create table to myUserName;

Grant succeeded.

更新-1

SQL> GRANT CREATE ANY TABLE TO myUserName;

Grant succeeded.

SQL> GRANT UNLIMITED TABLESPACE TO myUserName;

Grant succeeded.

現在錯誤更改為:

Import: Release 18.0.0.0.0 - Production on Thu Jun 4 01:39:50 2020
Version 18.4.0.0.0

Copyright (c) 1982, 2018, Oracle and/or its affiliates.  All rights reserved.

Connected to: Oracle Database 18c Express Edition Release 18.0.0.0.0 - Production
ORA-39001: invalid argument value
ORA-39000: bad dump file specification
ORA-39143: dump file "/opt/oracle/admin/XE/dpdump/myUserName/myUserName_110516.dmp" may be an original export dump file

最好的祝福

將以下內容添加到 impdp 命令中:

VERSION=11.2.0

問題 #1:嘗試將對象儲存到您沒有配額的表空間中。

當您為您的帳戶創建表空間時,您並沒有將其設置為您的使用者的預設表空間,因此,在創建沒有顯式表空間子句的對象時,它會嘗試將它們放入

$$ wrong $$帳戶沒有配額的表空間。繁榮! 問題 #2:錯誤的轉儲文件規範

您不能像我們曾經對imp所做的那樣指定轉儲文件的完整路徑。

相反,您使用

$$ database $$ 目錄對象並將轉儲文件放入$$ file system $$該目錄引用的目錄:

SQL> create or replace directory MY_DIR 
    as '/opt/oracle/admin/XE/dpdump/myUserName' ; 

SQL> grant read, write on directory MY_DIR to myUserName ; 

$ impdp user/pass \
   directory=MY_DIR \
   dumpfile=myUserName.dmp \
   remap_tablespace=SYSTEM:myUserName \
   remap_tablespace=USERS:myUserName \

我建議從 SYSTEM 表空間“借用”對像是個壞主意。

我不明白你為什麼要這樣做

如果您要定期執行此操作,我強烈建議您查看錢包以儲存憑據,而不是在命令行上指定。

引用自:https://dba.stackexchange.com/questions/268454