通过dblink使用expdp能不能导出9i库的数据?

expdp/impdp是10g推出的导入导出工具,9i下是没有该工具的,有人提议用10g的expdp,通过dblink导出9i的数据,乍一听感觉是那么回事,但究竟行不行,咱们实验说明。

1. 登录到一台10g/11g的服务器,首先创建连接到9i库TEST的一个链接tlink:

SQL> create database link tlink connect to test identified by test using ‘TEST’;Database link created.

2. 编辑expdp导出的配置文件:

userid=user/pwd- expdp使用的本机数据库用户directory=expdp_dir- directory路径dumpfile=testtkt.dumplogfile=testtkt.logtables=test.t_r- 要导出的9i库表t_rnetwork_link=tlink- 链接到的9i库dblink

3. 执行expdp:

[oracle11g@Node1 expdp_dir]$ expdp parfile=tlink.parExport: Release 11.2.0.1.0 – Production on Mon May 18 13:35:57 2015Copyright (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 ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing optionsORA-39006: internal errorORA-39065: unexpected master process exception in DISPATCHORA-00904: "SYS"."KUPM$MCP"."GET_ENDIANNESS": invalid identifierORA-39097: Data Pump job encountered unexpected error -904提示一系列ORA错误。

expdp不像exp,他是将导出转变成一个Oracle内部的job任务,有一点可以证明,就是使用exp导出时用ctrl+c中断,此时导出过程整体中断,如果使用expdp导出时用ctrl+c中断,此时导出过程并未中断,因为其已经转变为Oracle的一个任务,和客户端无关,退出交互模式后,会进入export的命令行模式,有status、start、stop等命令可以用。

从上面的报错可以看到ORA-00904: "SYS"."KUPM$MCP"."GET_ENDIANNESS": invalid identifier,关于904的错误描述:

[oracle11g@Node1 expdp_dir]$ oerr ora 90400904, 00000, "%s: invalid identifier"// *Cause:// *Action:说明是找不到对应的标识符,再看看SYS.KUPM$MCP大概是什么:

SQL> desc sys.KUPM$MCP;PROCEDURE CLOSE_JOBFUNCTION DISPATCH RETURNS KUPC$_MESSAGE Argument NameTypeIn/Out Default? —————————— ———————– —— ——– REQUESTKUPC$_MESSAGEINPROCEDURE FILE_LOG_MESSAGE Argument NameTypeIn/Out Default? —————————— ———————– —— ——– ERRCODENUMBERIN PARAMETER1VARCHAR2INDEFAULT PARAMETER2VARCHAR2INDEFAULT PARAMETER3VARCHAR2INDEFAULT PARAMETER4VARCHAR2INDEFAULT PARAMETER5VARCHAR2INDEFAULT PARAMETER6VARCHAR2INDEFAULT PARAMETER7VARCHAR2INDEFAULT PARAMETER8VARCHAR2INDEFAULTPROCEDURE FILE_TO_WORKER Argument NameTypeIn/Out Default? —————————— ———————– —— ——– MESSAGEKUPC$_MESSAGEINFUNCTION GET_ENDIANNESS RETURNS NUMBERPROCEDURE MAIN Argument NameTypeIn/Out Default? —————————— ———————– —— ——– JOB_NAMEVARCHAR2IN JOB_OWNERVARCHAR2IN RESTART_JOBBINARY_INTEGERIN DEBUG_INFOBINARY_INTEGERINPROCEDURE MAINLOOPPROCEDURE SET_DEBUG Argument NameTypeIn/Out Default? —————————— ———————– —— ——– DEBUG_FLAGSBINARY_INTEGERINFUNCTION VALIDATE_EXPRESSION RETURNS NUMBER Argument NameTypeIn/Out Default? —————————— ———————– —— ——– EXPR_VALUEVARCHAR2IN其实他包含了若干函数,GET_ENDIANNESS是其中一个(从名称上看,,貌似是获得“大小端信息”),显然是没找到对应函数,忘了从什么地方看到过关于这个函数的描述(如果哪位高人记得,可以回复下),他在9i中是不存在的,可以证明expdp导出过程是需要调用这个函数的,但这个函数在9i中是没有定义的,因此9i下是不能使用expdp。

4. 我们接着看dblink导出10g以上版本的库

SQL> create database link ldplink connect to puser identified by puser_pwd using ‘link_10g’;Database link created.5. 编辑expdp配置文件:[oracle11g@Node1 expdp_dir]$ vi link_10g.paruserid=user/pwddirectory=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 2015Copyright (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 ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing optionsORA-31631: privileges are requiredORA-39149: cannot link privileged user to non-privileged user

这回又提示ORA-31631和ORA-39149两个错误。

[oracle11g@Node1 expdp_dir]$ oerr ora 3163131631, 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.

那我想明天可以是我的来世。

通过dblink使用expdp能不能导出9i库的数据?

相关文章:

你感兴趣的文章:

标签云: