eated.
5. 编辑expdp配置文件:
[oracle11g@Node1 expdp_dir]$ vi link_10g.par
userid=user/pwd
directory=expdp_dirdumpfile=link_10g.dumplogfile=link_10g.logtables=puser.l_rnetwork_link=link_10g
6. 执行expdp:
[oracle11g@Node1 expdp_dir]$ expdp parfile=link_10g.par
Export: Release 11.2.0.1.0 - Production on Mon May 18 13:40:45 2015
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
ORA-31631: privileges are required
ORA-39149: cannot link privileged user to non-privileged user
这回又提示ORA-31631和ORA-39149两个错误。
[oracle11g@Node1 expdp_dir]$ oerr ora 31631
31631, 00000, "privileges are required"
// *Cause: The necessary privileges are not available for operations such
// as: restarting a job on behalf of another owner, using a device
// as a member of the dump file set, or ommiting a directory
// object associated with any of the various output files.
// Refer to any following error messages for additional information.
// *Action: Select a different job to restart, try a different operation, or
// contact a database administrator to acquire the needed privileges.
提示是缺少权限。
[oracle11g@Node1 expdp_dir]$ oerr ora 39149
39149, 00000, "cannot link privileged user to non-privileged user"
// *Cause: A Data Pump job initiated be a user with
// EXPORT_FULL_DATABASE/IMPORT_FULL_DATABASE roles specified a
// network link that did not correspond to a user with
// equivalent roles on the remote database.
// *Action: Specify a network link that maps users to identically privileged
// users in the remote database.
这个错误提示的更加明确,提示使用dblink并且具有EXPORT_FULL_DATABASE/IMPORT_FULL_DATABASE角色的执行用户,对应远端的用户并没有相应的角色权限。有点绕,简单讲,就是我这里使用expdp的数据库用户user,是有DBA权限的,因此具有EXPORT_FULL_DATABASE/IMPORT_FULL_DATABASE角色权限,但远端数据库用户puser只是普通用户,没有此权限,因此有这个提示错误。
解决方案1:
远端库中设置:
SQL> grant exp_full_database to puser;
Grant succeeded.
再次执行expdp:
[oracle11g@Node1 expdp_dir]$ expdp parfile=link_10g.par
Export: Release 11.2.0.1.0 - Production on Mon May 18 13:51:37 2015
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Starting "USER"."SYS_EXPORT_TABLE_01": user/******** parfile=link_10g.par
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/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
. . exported "PUSER"."L_R" 20.49 KB 28 rows
Master table "BISAL"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded
******************************************************************************
Dump file set for USER.SYS_EXPORT_TABLE_01 is:
/home/oracle11g/expdp_dir/link_10g.dump
Job "USER"."SYS_EXPORT_TABLE_01" successfully com