程序员人生 网站导航

How to Diagnose Oracle Data Pump-如何给数据泵添加诊断信息

栏目:数据库应用时间:2014-12-26 08:36:26

11g的数据泵(expdp/impdp)还是有很多bug,常常遇到莫名的卡死现象,让人手足无措,最近看了1篇文章,其实在进行数据泵导出导入的时候,可以进行日志跟踪

Parameter: TRACE

启用跟踪功能,只需要在DataPump(expdp)或DataPump(impdp)的时候添加1个trace参数,对其指定1个7位数的106进制。前3个数字启用跟踪特定的数据泵组件,而通常最后4位数字为:0300。任何前导零的可以省略,跟踪参数指定的值是不辨别大小写的。

TRACE = 04A0300
 or:
TRACE=4a0300

注意该参数的使用必须要有特定的权限,否则会报ORA⑶1631毛病

% expdp scott/tiger DIRECTORY=my_dir DUMPFILE=expdp_s.dmp LOGFILE=expdp_s.log TABLES=emp TRACE=480300 Export: Release 10.2.0.3.0 - Production on Friday, 19 October, 2007 13:46:33 Copyright (c) 2003, 2005, Oracle. All rights reserved. Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Production With the Partitioning, Oracle Label Security, OLAP and Data Mining Scoring Engine options ORA⑶1631: privileges are required
这类情况,我们只需要授与 EXP_FULL_DATABASE 或IMP_FULL_DATABASE角色
CONNECT / AS SYSDBA GRANT exp_full_database TO scott; % expdp scott/tiger DIRECTORY=my_dir DUMPFILE=expdp_s.dmp LOGFILE=expdp_s.log TABLES=emp TRACE=480300

这里的参数为480300,其他Trace的参数及跟踪的数据泵组件对应的例子有:

-- Example of combination (last 4 digits are usually 0300): 40300 to trace Process services 80300 to trace Master Control Process (MCP) 400300 to trace Worker process(es) -- + 4C0300 to trace Process services and Master Control and Worker processes
生成的跟踪日志的格式1般以下:

-- Run a Data Pump job with full tracing: -- This results in two trace files in BACKGROUND_DUMP_DEST: -- Master Process trace file: <SID>_dm<number>_<process_id>.trc -- Worker Process trace file: <SID>_dw<number>_<process_id>.trc -- And one trace file in USER_DUMP_DEST: -- Shadow Process trace file: <SID>_ora_<process_id>.trc

如何找到参数文件的位置? 

Data Pump trace files 写在BACKGROUND_DUMP_DEST 和USER_DUMP_DEST.

<strong>Data Pump Master Control Process (MCP).</strong> Format : <SID>_dm<number>_<process_id>.trc Example: ORCL_dm00_2896.trc or: ORCL_dm01_3422.trc (for second active Master Control Process) Location: BACKGROUND_DUMP_DEST or <ADR_HOME>/trace <strong>Data Pump Worker Process trace file.</strong> Format : <SID>_dw<number>_<process_id>.trc Example: ORCL_dw01_2936.trc or: ORCL_dw01_2844.trc and ORCL_dw02_2986.trc (if PARALLEL=2) Location: BACKGROUND_DUMP_DEST or <ADR_HOME>/trace <strong>Data Pump Shadow Process trace file.</strong> Format : <SID>_ora_<process_id>.trc Example: ORCL_ora_3020.trc Location: USER_DUMP_DEST or <ADR_HOME>/trace

 跟踪日志生成案例

<pre name="code" class="sql">Trace file /u01/app/product/oracle/diag/rdbms/hnyy/hnyy1/trace/hnyy1_dm00_28574120.trc Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP, Data Mining and Real Application Testing options ORACLE_HOME = /u01/app/product/oracle/db_1 System name: AIX Node name: orcl1 Release: 1 Version: 6 Machine: 00F6C6C64C00 Instance name: hnyy1 Redo thread mounted by this instance: 1 Oracle process number: 559 Unix process pid: 28574120, image: oracle@orcl1 (DM00) *** 2014⑴2-05 13:06:38.154 *** SESSION ID:(8851.28833) 2014⑴2-05 13:06:38.154 *** CLIENT ID:() 2014⑴2-05 13:06:38.154 *** SERVICE NAME:(SYS$USERS) 2014⑴2-05 13:06:38.154 *** MODULE NAME:() 2014⑴2-05 13:06:38.154 *** ACTION NAME:() 2014⑴2-05 13:06:38.154 KUPP:13:06:38.142: Current trace/debug flags: 00480300 = 4719360 *** MODULE NAME:(Data Pump Master) 2014⑴2-05 13:06:38.195 *** ACTION NAME:(SYS_EXPORT_FULL_01) 2014⑴2-05 13:06:38.195 KUPC:13:06:38.194: Setting remote flag for this process to FALSE prvtaqis - Enter prvtaqis subtab_name upd prvtaqis sys table upd KUPM:13:06:38.336: Attached to control queue as MCP KUPM:13:06:38.345: While starting, control queue subscriber count is: 2 KUPP:13:06:38.346: Initialization complete for master process DM00 KUPM:13:06:38.405: Entered main loop KUPM:13:06:38.640: ****IN DISPATCH at 47198, request type=1001 KUPM:13:06:38.640: Current user is: SYSTEM KUPM:13:06:38.640: hand := DBMS_DATAPUMP.OPEN ('EXPORT', 'FULL', '', 'SYS_EXPORT_FULL_01', '', '2'); *** 2014⑴2-05 13:06:40.338 K UPM:13:06:40.337: Resumable enabled KUPM:13:06:40.346: Entered state: DEFINING KUPM:13:06:40.346: initing file system kwqberlst !retval block kwqberlst rqan->lagno_kwqiia 7 kwqberlst rqan->lascn_kwqiia > 0 block kwqberlst rqan->lascn_kwqiia 7 kwqberlst ascn ⑴500723611 lascn 22 KUPM:13:06:42.700: ****IN DISPATCH at 47202, request type=1035 KUPM:13:06:42.700: Current user is: SYSTEM KUPM:13:06:42.700: DBMS_DATAPUMP.SET_PARAMETER (hand, 'CLIENT_COMMAND', 'system/******** dumpfile=dump:full20141204b_%U_db.dmp logfile=dump:full_expdp1204b_db.log full=y exclude=STATISTICS,PACKAGE,FUNCTION,PROCEDURE,INDEX,TABLE:"IN (select table_name from dba_tab KUPM:13:06:42.700: les where table_name in ('电子病历图形','检验图象结果','检验报告图象') and owner='ZLHIS')" cluster=n TRACE=480300 '); KUPM:13:06:42.700: In Check_param_dependency with name: CLIENT_COMMAND KUPM:13:06:42.703: ****OUT DISPATCH, request type=1035, response type =2041 kwqberlst !retval block kwqberlst rqan->lagno_kwqiia 7 kwqberlst rqan->lascn_kwqiia > 0 block kwqberlst rqan->lascn_kwqiia 7 kwqberlst ascn ⑴500723611 lascn 22 KUPM:13:06:42.750: ****IN DISPATCH at 47202, request type=1022 KUPM:13:06:42.750: Current user is: SYSTEM KUPM:13:06:42.750: DBMS_DATAPUMP.ADD_FILE (hand, 'full20141204b_%U_db.dmp', 'DUMP', 0, , 1);










------分隔线----------------------------
------分隔线----------------------------

最新技术推荐