如何获取数据泵dm和dw进程的 Strace (Doc ID 1411563.1)
How To Get A Strace Of The Data Pump dm And dw Process(es) (Doc ID 1411563.1)
APPLIES TO:
Oracle Database - Enterprise Edition - Version 10.1.0.2 and later
Information in this document applies to any platform.
NOTE:
In the images and/or the document content below, the user information and data used represents fictitious data. Any similarity to actual persons, living or dead, is purely coincidental and not intended in any manner.
GOAL
This document shows how you can get an strace of the data pump dm and dw processes. 本文档说明了如何获得数据泵dm和dw进程的strace。
This may be required to be done in certain circumstances when need to trace OS level calls from these processes. 在某些情况下,当需要跟踪来自这些进程的OS级调用时,可能需要这样做。
Since data pump is run from the server side and work is done by dw process and coordinated by dm process cannot start strace with the client expdp. 由于数据泵是从服务器端运行的,并且工作是由dw进程完成的,并且由dm进程协调,因此无法使用客户端expdp启动strace。
You will want to start this on a database that spawns minimal new connections because will be attaching to the Process SPawner (psp) process to capture any children that are spawned. 您将要在产生最少新连接的数据库上启动此数据库,因为它将附加到Process SPawner(psp)进程以捕获产生的所有子级。
This will include the dm and dw processes that are spawned from the database for a data pump job as well as any other processes under that database sid. 这将包括从数据库中为数据泵作业派生的dm和dw进程,以及该数据库sid下的任何其他进程。
SOLUTION
First, determine the pid of the psp process for that sid. 首先,确定该sid的psp进程的pid。
Can do that with OS command 可以用OS命令做到这一点
>ps -es|grep psp
Example output showing pid 19377 for sid S112W6:
grdbms 19377 1 0 22:24 ? 00:00:00 ora_psp0_S112W6
Or you can use query to determine process pid in SQLPlus: 或者,您可以使用查询来确定SQLPlus中的进程pid
set linesize 120 set pagesize 120 column spid heading 'OSpid' format a8 column pid heading 'Orapid' format 999999 column sid heading 'Sess id' format 99999 column serial# heading 'Serial#' format 999999 column status heading 'Status' format a8 column username heading 'oracleuser' format a12 column osuser heading 'OS user' format a12 column program heading 'Program' format a20 SELECT p.spid, p.pid, s.sid, s.serial#, s.status, s.username, s.osuser, s.program FROM v$process p,v$session s WHERE s.paddr ( + ) = p.addr order by p.pga_alloc_mem desc;
Example of sample output:
Then, based on the pid of the psp process start strace with following: 然后,基于psp进程的pid,使用以下命令启动strace
Example for pid 19377:
OSpid Orapid Sess id Serial# Status oracleuser OS user Program -------- ------- ------- ------- -------- ------------ ------------ -------------------- 19377 3 187 1 ACTIVE SYSTEM grdbms oracle@celclnx7.us.oracle.com(PSP0)
Use of -ff will start trace on ALL new child processes under that db sid. 使用-ff将开始对该db sid下的所有新子进程进行跟踪
strace -f -ff -o strace_expdp.out -p 19377
Start the export. Do not use parallelism unless required to reproduce problem 开始导出。除非需要重现问题,否则不要使用并行。
Example:
expdp content=metadata_only schemas=system dumpfile=expdp02.dmp logfile=expdp02.log directory=data_pump_dir
Immediately after expdp started, determine the pid of the dm and dw process either at OS command or from the query aboveOr using the earlier SQL query:
expdp启动后,立即在OS命令或从上面的查询中或者使用较早的SQL查询来确定dm和dw进程的pid
>ps -ef|grep S112W6
OSpid Orapid Sess id Serial# Status oracleuser OS user Program -------- ------- ------- ------- -------- ------------ ------------ -------------------- 5565 23 193 27 ACTIVE SYSTEM grdbms oracle@celclnx7.us.oracle.com(DM00) 8569 24 7 11 ACTIVE SYSTEM grdbms oracle@celclnx7.us.oracle.com(DW00)
If expdp fails quickly and did not get a chance to determine sid of these processes, just grep the files in the trace directory when done for
如果expdp快速失败,并且没有机会确定这些进程的sid,则在完成以下操作后,只需grep跟踪目录中的文件
ora_dw
and
ora_dm
>grep -li "ora_dw" *
strace_expdp.out.8569
You can stop the strace by using <ctrl-c> 您可以使用<ctrl-c>停止strace
Upload the strace corresponding to dm and dw process for the failed data pump job
上传与失败的数据泵作业的dm和dw进程对应的strace