oracle 甲骨文 11g。即使创建了架构,也无法导入转储文件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11377779/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 04:18:54  来源:igfitidea点击:

Oracle 11g. Unable to import dump files, even though schema is created

oracleoracle11g

提问by Aazim

I have created a user in Oracle 11gR2, using the following script

我在 Oracle 11gR2 中创建了一个用户,使用以下脚本

create user          cata
identified by        cata
default   tablespace tbs
temporary tablespace temp;

grant DBA to cata;

After trying to import a dump file using the command

尝试使用以下命令导入转储文件后

impdp system/password@ORCL11 schemas=cata dumpfile=cata.dmp logfile=log.txt

i'm getting the following error

我收到以下错误

ORA-39002: invalid operation ORA-39165: Schema ATGDB_CATA was not found.

ORA-39002:无效操作 ORA-39165:未找到架构 ATGDB_CATA。

Surprisingly, when i try to export a dump from the same schema, i'm able to do that. So, if the schema was not created properly then i should not be able to export the dump file as well, right ?

令人惊讶的是,当我尝试从同一架构导出转储时,我能够做到这一点。因此,如果架构未正确创建,那么我也不能导出转储文件,对吗?

I have also checked in dba_users & the schema is created. Is there anything else that i can do which could resolve this problem

我还检查了 dba_users 并创建了架构。我还能做些什么来解决这个问题

回答by GWu

Out of the error message I guess that the original schema name was "atgdb_cata".

在错误消息中,我猜原始模式名称是“atgdb_cata”。

As you are now trying to import into a schema named "cata" you need to specify the parameter remap_schema

当您现在尝试导入名为“cata”的架构时,您需要指定参数 remap_schema

So for your case: impdp system/password@ORCL11 schemas=atgdb_cata dumpfile=cata.dmp logfile=log.txt remap_schema=atgdb_cata:cata

所以对于你的情况: impdp system/password@ORCL11 schemas=atgdb_cata dumpfile=cata.dmp logfile=log.txt remap_schema=atgdb_cata:cata

回答by user2492995

Grant the roles of read and write on the Directory in which you created to the New User: EX:

授予新用户对您创建的目录的读写角色:EX:

GRANT READ, WRITE ON DIRECTORY dir_name TO NEW_USER:

Also grant the following role to the new user:

还为新用户授予以下角色:

GRANT IMP_FULL_DATABASE TO NEW_USER;

Thanks! NC

谢谢!数控

回答by JAYAPRAKASH

ORA-39002: invalid operation ORA-39070: Unable to open the log file. ORA-29283: invalid file operation ORA-06512: at "SYS.UTL_FILE", line 536 ORA-29283: invalid file operation

ORA-39002: 无效操作 ORA-39070: 无法打开日志文件。ORA-29283:文件操作无效 ORA-06512:在“SYS.UTL_FILE”,第 536 行 ORA-29283:文件操作无效

SOLUTION: create or replace directory test_ dir as 'FOLDER_NAME' ;

解决方案:创建或替换目录 test_ dir 为 'FOLDER_NAME' ;

that 'FOLDER_NAME' must has that dump file

'FOLDER_NAME' 必须有那个转储文件

step : 1 create folder SAMPLE under orcle_installed_path/sql/SAMPLE put that dump file into that SAMPLE folder.

步骤: 1 在 orcle_installed_pa​​th/sql/SAMPLE 下创建文件夹 SAMPLE 将该转储文件放入该 SAMPLE 文件夹中。

go to bin and execute ./sqlplus and login SQL>create or replace directory test_ dir as 'SAMPLE' ;

转到 bin 并执行 ./sqlplus 并登录 SQL>create or replace directory test_ dir as 'SAMPLE' ;

SQL> SQL> GRANT READ, WRITE on directory test_dir to 'USER';

SQL> SQL> GRANT READ,在目录 test_dir 上写入 'USER';

SQL> GRANT IMP_FULL_DATABASE to 'USER'; exit then impdb to import that dump

SQL> 将 IMP_FULL_DATABASE 授予“用户”;退出然后 impdb 导入该转储