expdp_impdp使用network_link遠端使用者需要EXP_FULL_DATABASE角色

warehouse發表於2011-06-27

沒有EXP_FULL_DATABASE角色,會出現下面錯誤:

ORA-31631: privileges are required
ORA-39149: cannot link privileged user to non-privileged user

[@more@]

SQL> create database link pdbl connect to rman identified by rman using 'catalog';

資料庫連結已建立。
--=============================================
C:>expdp directory=mydir dumpfile=rman.dmp network_link=pdbl tables=t

Export: Release 10.2.0.1.0 - Production on Monday, 27 June, 2011 14:17:37

Copyright (c) 2003, 2005, Oracle. All rights reserved.

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
ORA-31631: privileges are required
ORA-39149: cannot link privileged user to non-privileged user

--=============================================
C:>impdp network_link=pdbl tables=t

Import: Release 10.2.0.1.0 - Production on Monday, 27 June, 2011 14:18:22

Copyright (c) 2003, 2005, Oracle. All rights reserved.

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
ORA-31631: privileges are required
ORA-39149: cannot link privileged user to non-privileged user
--=============================================

C:>sqlplus as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on 星期一 6月 27 15:15:19 2011

Copyright (c) 1982, 2005, Oracle. All rights reserved.


連線到:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> grant EXP_FULL_DATABASE to rman;

授權成功。

SQL>

--=======================================

C:>expdp directory=mydir dumpfile=rman.dmp network_link=pdbl tables=db

Export: Release 10.2.0.1.0 - Production on Monday, 27 June, 2011 15:15:30

Copyright (c) 2003, 2005, Oracle. All rights reserved.

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
Starting "TEST2"."SYS_EXPORT_TABLE_01": directory=mydir dumpfile=rman.dmp network_link=pdbl tables=db
Estimate in progress using BLOCKS method...
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 64 KB
Processing object type TABLE_EXPORT/TABLE/TABLE
Processing object type TABLE_EXPORT/TABLE/INDEX/INDEX
Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
. . exported "RMAN"."DB" 6.476 KB 1 rows
Master table "TEST2"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded
******************************************************************************
Dump file set for TEST2.SYS_EXPORT_TABLE_01 is:
C:TEMPRMAN.DMP
Job "TEST2"."SYS_EXPORT_TABLE_01" successfully completed at 15:15:43
--===================================
C:>impdp network_link=pdbl tables=db remap_schema=(rman:test2)

Import: Release 10.2.0.1.0 - Production on Monday, 27 June, 2011 15:20:56

Copyright (c) 2003, 2005, Oracle. All rights reserved.

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
Starting "TEST2"."SYS_IMPORT_TABLE_01": network_link=pdbl tables=db remap_schema=(rman:test2)
Estimate in progress using BLOCKS method...
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 64 KB
Processing object type TABLE_EXPORT/TABLE/TABLE
ORA-39151: Table "TEST2"."DB" exists. All dependent metadata and data will be skipped due to table_exists_action of skip
Processing object type TABLE_EXPORT/TABLE/INDEX/INDEX
Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
Job "TEST2"."SYS_IMPORT_TABLE_01" completed with 1 error(s) at 15:21:06
--===============================
--建立dblink時connect遠端db的rman使用者需要被授予EXP_FULL_DATABASE角色,否則出現錯誤:ORA-39149

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/19602/viewspace-1051684/,如需轉載,請註明出處,否則將追究法律責任。

相關文章