设为首页 加入收藏

TOP

通过dblink使用expdp能不能导出9i库的数据?(二)
2015-07-24 10:21:27 来源: 作者: 【 】 浏览:2
Tags:通过 dblink 使用 expdp 不能 导出 数据
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
首页 上一页 1 2 3 下一页 尾页 2/3/3
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇MongoDB介绍和安装 下一篇MyISAM和InnoDB存储引擎的区别

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·Python 数据分析与可 (2025-12-26 21:51:20)
·从零开始学Python之 (2025-12-26 21:51:17)
·超长干货:Python实 (2025-12-26 21:51:14)
·为什么 Java 社区至 (2025-12-26 21:19:10)
·Java多线程阻塞队列 (2025-12-26 21:19:07)