oracle中导入dmp文件失败[ORA-31685,ORA-39083,ORA-01932,ORA-31684]

时间:2017-05-15 18:19:15

标签: oracle oracle11g oracle-sqldeveloper

我在做什么

我获得了一个UAT环境,用于本地数据库设置的dmp文件。我按照here描述的程序进行了操作。

错误

以下是我得到的错误,似乎我的本地用户名缺少一些我无法弄清楚的角色。我确实为'SYSTEM'用户授予了ADMIN / DBA权限。

Master table "SYSTEM"."UAT" successfully loaded/unloaded
Starting "SYSTEM"."UAT":
Processing object type SCHEMA_EXPORT/USER
ORA-31685: Object type USER:"SYSTEM" failed due to insufficient privileges. Failing sql is:
ALTER USER "SYSTEM" IDENTIFIED BY VALUES 'DABD3C3A967782B6' DEFAULT TABLESPACE "UAT01" TEMPORARY TABLESPACE "TEMP01"
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
ORA-39083: Object type ROLE_GRANT failed to create with error:
ORA-01932: ADMIN option not granted for role 'CONNECT'
Failing sql is:
GRANT "CONNECT" TO "SYSTEM"
ORA-39083: Object type ROLE_GRANT failed to create with error:
ORA-01932: ADMIN option not granted for role 'RESOURCE'
Failing sql is:
GRANT "RESOURCE" TO "SYSTEM"
Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
ORA-31685: Object type DEFAULT_ROLE:"SYSTEM" failed due to insufficient privileges. Failing sql is:
ALTER USER "SYSTEM" DEFAULT ROLE "CONNECT", "RESOURCE"
Processing object type SCHEMA_EXPORT/TABLESPACE_QUOTA
ORA-31685: Object type TABLESPACE_QUOTA:"SYSTEM" failed due to insufficient privileges. Failing sql is:
DECLARE   TEMP_COUNT NUMBER;   SQLSTR VARCHAR2(200); BEGIN   SQLSTR := 'ALTER USER "SYSTEM" QUOTA UNLIMITED ON "UAT01"';  EXECUTE IMMEDIATE SQLSTR;EXCEPTION   WHEN OTHERS THEN    IF SQLCODE = -30041 THEN       SQLSTR := 'SELECT COUNT(*) FROM USER_TABLESPACES               WHERE TABLESPACE_NAME = ''UAT01'' AND CONTENTS = ''TEMPORARY''';      EXECUTE IMMEDIATE SQLSTR INTO TEMP_COUNT;      IF TEMP_COUNT

将CONNECT,RESOURCE角色提供给系统用户WITH admin选项后,我收到以下错误。

SYSTEM USER WITH ROLES

Master table "SYSTEM"."IMPORT_JOB_SQLDEV_101" successfully loaded/unloaded
Starting "SYSTEM"."IMPORT_JOB_SQLDEV_101":  
Processing object type SCHEMA_EXPORT/USER
ORA-39083: Object type USER failed to create with error:
ORA-00959: tablespace 'UAT01' does not exist
Failing sql is:
ALTER USER "SYSTEM" IDENTIFIED BY VALUES 'DABD3C3A967782B6' DEFAULT TABLESPACE "UAT01" TEMPORARY TABLESPACE "TEMP01"
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
Processing object type SCHEMA_EXPORT/TABLESPACE_QUOTA
ORA-39083: Object type TABLESPACE_QUOTA failed to create with error:
ORA-00959: tablespace 'UAT01' does not exist
Failing sql is:
DECLARE   TEMP_COUNT NUMBER;   SQLSTR VARCHAR2(200); BEGIN   SQLSTR := 'ALTER USER "SYSTEM" QUOTA UNLIMITED ON "UAT01"';  EXECUTE IMMEDIATE SQLSTR;EXCEPTION   WHEN OTHERS THEN    IF SQLCODE = -30041 THEN       SQLSTR := 'SELECT COUNT(*) FROM USER_TABLESPACES               WHERE TABLESPACE_NAME = ''UAT01'' AND CONTENTS = ''TEMPORARY''';      EXECUTE IMMEDIATE SQLSTR INTO TEMP

先谢谢所有人!!

1 个答案:

答案 0 :(得分:2)

您需要在导入转储之前创建所有需要的表空间。转储导入不会创建数据库所需的物理文件