重庆思庄Oracle、KingBase、PostgreSQL、Redhat认证学习论坛
标题:
如何确定一个dmp文件是传统export(exp)导出的还是DataPump Export(expdp)导出的?
[打印本页]
作者:
刘泽宇
时间:
5 天前
标题:
如何确定一个dmp文件是传统export(exp)导出的还是DataPump Export(expdp)导出的?
方法:
DBMS_DATAPUMP.GET_DUMPFILE_INFO()存储过程可以从dump文件中获取信息。
Filetype返回以下文件类型: 1: Data Pump dump file 2: original Export dump file在SQL*Plus中,用以下方法获取dump文件的信息:
(注意:替换 <DMP file name> 和 <DMP File Directory> 为实际值)
-- Dump file(test.dmp) is saved in the /tmp/test.
SQL> conn /as sysdba
SQL> create or replace directory test as '/tmp/test';
Directory created.
SQL> set serveroutput on
declare
v_filetype NUMBER; -- 0=unknown 1=expdp 2=exp 3=ext
v_info_table sys.ku$_dumpfile_info; -- PL/SQL table with file info
begin
dbms_datapump.get_dumpfile_info(
filename => 'test.dmp',
directory => upper('test'),
info_table => v_info_table, filetype => v_filetype);
dbms_output.put_line('Filetype : ' || v_filetype);
end;
/
SQL>
Filetype : 2
PL/SQL procedure successfully completed.
欢迎光临 重庆思庄Oracle、KingBase、PostgreSQL、Redhat认证学习论坛 (http://bbs.cqsztech.com/)
Powered by Discuz! X3.2