手机版
你好,游客 登录 注册
背景:
阅读新闻

使用隐含Trace参数诊断Oracle Data Pump故障

[日期:2014-05-18] 来源:Linux社区  作者:realkid4 [字体:大 中 小]

4、Impdp导入过程

 

在Trace过程中,我们也可以如10046跟踪过程一样,添加SQL跟踪。Data Pump本质上工作还是一系列的SQL语句,很多时候的性能问题根源都是从SQL着手的。

 

切换到SQL跟踪模式也比较简单,一般是在Trace数值后面添加1。我们使用导入过程进行实验。

 

 

--处理之前

[root@SimpleLinux trace]# ls -l

total 4

-rw-r----- 1 Oracle oinstall 552 Sep 11 10:49 alert_ora11g.log

 

[oracle@SimpleLinux dumpdata]$ impdp \"/ as sysdba\" directory=dumpdir dumpfile=scott_dump.dmp remap_schema=scott:test trace=480301 parallel=2

 

Import: Release 11.2.0.3.0 - Production on Wed Sep 11 10:50:14 2013

 

Copyright (c) 1982, 2011, Oracle and/or its affiliates.All rights reserved.

 

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

Master table "SYS"."SYS_IMPORT_FULL_01" successfully loaded/unloaded

Starting "SYS"."SYS_IMPORT_FULL_01":"/******** AS SYSDBA" directory=dumpdir dumpfile=scott_dump.dmp remap_schema=scott:test trace=480301 parallel=2

Processing object type SCHEMA_EXPORT/USER

Processing object type SCHEMA_EXPORT/SYSTEM_GRANT

Processing object type SCHEMA_EXPORT/ROLE_GRANT

Processing object type SCHEMA_EXPORT/DEFAULT_ROLE

Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA

Processing object type SCHEMA_EXPORT/TABLE/TABLE

Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA

. . imported "TEST"."T_MASTER":"P1"42.43 KB982 rows

. . imported "TEST"."T_MASTER":"P2"88.69 KB1859 rows

. . imported "TEST"."T_SLAVE":"P1"412.2 KB11268 rows

. . imported "TEST"."T_SLAVE":"P2"975.7 KB21120 rows

. . imported "TEST"."DEPT"5.929 KB4 rows

. . imported "TEST"."EMP"8.562 KB14 rows

. . imported "TEST"."SALGRADE"5.859 KB5 rows

. . imported "TEST"."BONUS"0 KB0 rows

Processing object type SCHEMA_EXPORT/TABLE/COMMENT

Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX

Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT

Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS

Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT

Job "SYS"."SYS_IMPORT_FULL_01" successfully completed at 10:50:24

 

 

查看跟踪目录。

 

 

[root@SimpleLinux trace]# ls -l

total 7588

-rw-r----- 1 oracle oinstall739 Sep 11 10:50 alert_ora11g.log

-rw-r----- 1 oracle oinstall 1916394 Sep 11 10:50 ora11g_dm00_4422.trc

-rw-r----- 1 oracle oinstall9446 Sep 11 10:50 ora11g_dm00_4422.trm

-rw-r----- 1 oracle oinstall 2706475 Sep 11 10:50 ora11g_dw00_4424.trc

-rw-r----- 1 oracle oinstall15560 Sep 11 10:50 ora11g_dw00_4424.trm

-rw-r----- 1 oracle oinstall 2977812 Sep 11 10:50 ora11g_ora_4420.trc

-rw-r----- 1 oracle oinstall12266 Sep 11 10:50 ora11g_ora_4420.trm

-rw-r----- 1 oracle oinstall29795 Sep 11 10:50 ora11g_p000_4426.trc

-rw-r----- 1 oracle oinstall526 Sep 11 10:50 ora11g_p000_4426.trm

-rw-r----- 1 oracle oinstall30109 Sep 11 10:50 ora11g_p001_4428.trc

-rw-r----- 1 oracle oinstall524 Sep 11 10:50 ora11g_p001_4428.trm

-rw-r----- 1 oracle oinstall8430 Sep 11 10:50 ora11g_p002_4430.trc

-rw-r----- 1 oracle oinstall184 Sep 11 10:50 ora11g_p002_4430.trm

-rw-r----- 1 oracle oinstall8432 Sep 11 10:50 ora11g_p003_4432.trc

-rw-r----- 1 oracle oinstall204 Sep 11 10:50 ora11g_p003_4432.trm

 

 

目录生成的Trace文件,都是10046格式的Raw文件。截取片段如下:

 

 

=====================

PARSING IN CURSOR #13035136 len=51 dep=2 uid=0 ct=3 lid=0 tim=1378867817703043 hv=1523794037 ad='360b079c' sqlid='b1wc53ddd6h3p'

select audit$,options from procedure$ where obj#=:1

END OF STMT

PARSE #13035136:c=0,e=96,p=0,cr=0,cu=0,mis=0,r=0,dep=2,og=4,plh=1637390370,tim=1378867817703039

EXEC #13035136:c=0,e=79,p=0,cr=0,cu=0,mis=0,r=0,dep=2,og=4,plh=1637390370,tim=1378867817703178

FETCH #13035136:c=0,e=53,p=0,cr=3,cu=0,mis=0,r=1,dep=2,og=4,plh=1637390370,tim=1378867817703248

STAT #13035136 id=1 cnt=1 pid=0 pos=1 bj=221 p='TABLE ACCESS BY INDEX ROWID PROCEDURE$ (cr=3 pr=0 pw=0 time=53 us cost=2 size=47 card=1)'

STAT #13035136 id=2 cnt=1 pid=1 pos=1 bj=231 p='INDEX UNIQUE SCAN I_PROCEDURE1 (cr=2 pr=0 pw=0 time=24 us cost=1 size=0 card=1)'

CLOSE #13035136:c=0,e=7,dep=2,type=1,tim=1378867817703387

=====================

 

 

5、结论

 

Oracle Data Pump已经非常成熟,也越来越多被人们接受。Trace参数尤其存在的历史背景,相信使用的机会越来越少。不过,作为研究内部机制的用途,还是比较有用的。

 

linux
相关资讯       Oracle参数  Oracle Data Pump  Oracle Trace 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款