eygle.com   eygle.com
eygle.com  
 

« March 28, 2008 | Blog首页 | April 1, 2008 »



March 30, 2008

resize datafile 与 checkpoint

作者:eygle

出处:http://blog.eygle.com

Resize datafile会触发一个文件级检查点,今天讲课的时候和大家提到过这个,记录一下。

SQL> select file#,checkpoint_change# from v$datafile;

    FILE# CHECKPOINT_CHANGE#
---------- ------------------
        1            695055
        2            695055
        3            695055
        4            695244

SQL> alter database datafile 4 resize 150M;

数据库已更改。

SQL> select file#,checkpoint_change# from v$datafile;

    FILE# CHECKPOINT_CHANGE#
---------- ------------------
        1            695055
        2            695055
        3            695055
        4            695513

通过10046事件的跟踪可以得到如下信息:
PARSING IN CURSOR #1 len=37 dep=0 uid=55 oct=35 lid=55 tim=3564309578 hv=1298948616 ad='1b676e34'
alter database datafile 4 resize 150M
END OF STMT
PARSE #1:c=0,e=575,p=0,cr=0,cu=0,mis=1,r=0,dep=0,og=1,tim=3564309572
BINDS #1:
WAIT #1: nam='control file sequential read' ela= 315 file#=0 block#=1 blocks=1 obj#=15 tim=3564313625
WAIT #1: nam='control file sequential read' ela= 12452 file#=1 block#=1 blocks=1 obj#=15 tim=3564326138
WAIT #1: nam='control file sequential read' ela= 306 file#=0 block#=16 blocks=1 obj#=15 tim=3564326477
WAIT #1: nam='control file sequential read' ela= 309 file#=0 block#=18 blocks=1 obj#=15 tim=3564326830
WAIT #1: nam='control file sequential read' ela= 304 file#=0 block#=24 blocks=1 obj#=15 tim=3564327167
WAIT #1: nam='control file sequential read' ela= 272 file#=0 block#=1 blocks=1 obj#=15 tim=3564327531
WAIT #1: nam='control file sequential read' ela= 294 file#=1 block#=1 blocks=1 obj#=15 tim=3564327853
WAIT #1: nam='control file sequential read' ela= 306 file#=0 block#=16 blocks=1 obj#=15 tim=3564328185
WAIT #1: nam='control file sequential read' ela= 302 file#=0 block#=18 blocks=1 obj#=15 tim=3564328516
WAIT #1: nam='control file sequential read' ela= 265 file#=0 block#=24 blocks=1 obj#=15 tim=3564328811
WAIT #1: nam='control file sequential read' ela= 272 file#=0 block#=29 blocks=1 obj#=15 tim=3564329113
WAIT #1: nam='control file sequential read' ela= 287 file#=0 block#=1 blocks=1 obj#=15 tim=3564329537
WAIT #1: nam='control file sequential read' ela= 314 file#=1 block#=1 blocks=1 obj#=15 tim=3564329879
WAIT #1: nam='control file sequential read' ela= 302 file#=0 block#=16 blocks=1 obj#=15 tim=3564330208
WAIT #1: nam='control file sequential read' ela= 265 file#=0 block#=18 blocks=1 obj#=15 tim=3564330500
WAIT #1: nam='control file sequential read' ela= 285 file#=0 block#=24 blocks=1 obj#=15 tim=3564330814
WAIT #1: nam='db file sequential read' ela= 8821 file#=4 block#=1 blocks=1 obj#=15 tim=3564339667
WAIT #1: nam='control file sequential read' ela= 33339 file#=0 block#=1 blocks=1 obj#=15 tim=3564373162
WAIT #1: nam='control file sequential read' ela= 437 file#=1 block#=1 blocks=1 obj#=15 tim=3564373650
WAIT #1: nam='control file sequential read' ela= 24730 file#=0 block#=16 blocks=1 obj#=15 tim=3564398418
WAIT #1: nam='control file sequential read' ela= 23061 file#=0 block#=18 blocks=1 obj#=15 tim=3564421533
WAIT #1: nam='control file sequential read' ela= 399 file#=0 block#=24 blocks=1 obj#=15 tim=3564421972
WAIT #1: nam='control file sequential read' ela= 50820 file#=0 block#=29 blocks=1 obj#=15 tim=3564472834
WAIT #1: nam='db file sequential read' ela= 310 file#=4 block#=1 blocks=1 obj#=15 tim=3564473221
WAIT #1: nam='control file sequential read' ela= 60260 file#=0 block#=1 blocks=1 obj#=15 tim=3564578332
WAIT #1: nam='control file sequential read' ela= 358 file#=1 block#=1 blocks=1 obj#=15 tim=3564578746
WAIT #1: nam='control file sequential read' ela= 1275 file#=0 block#=16 blocks=1 obj#=15 tim=3564580057
WAIT #1: nam='control file sequential read' ela= 27222 file#=0 block#=18 blocks=1 obj#=15 tim=3564607310
WAIT #1: nam='control file sequential read' ela= 44185 file#=0 block#=276 blocks=1 obj#=15 tim=3564651733
WAIT #1: nam='rdbms ipc reply' ela= 156 from_process=7 timeout=21474836 p3=0 obj#=15 tim=3564652138
WAIT #1: nam='rdbms ipc reply' ela= 111237 from_process=7 timeout=21474836 p3=0 obj#=15 tim=3564763405
WAIT #1: nam='enq: TC - contention' ela= 140565 name|mode=1413677062 checkpoint ID=65561 0=0 obj#=15 tim=3564904012
WAIT #1: nam='control file sequential read' ela= 15946 file#=0 block#=1 blocks=1 obj#=15 tim=3564920080
WAIT #1: nam='control file sequential read' ela= 46993 file#=1 block#=1 blocks=1 obj#=15 tim=3564967119
WAIT #1: nam='control file sequential read' ela= 507 file#=0 block#=16 blocks=1 obj#=15 tim=3564967713
WAIT #1: nam='control file sequential read' ela= 41552 file#=0 block#=18 blocks=1 obj#=15 tim=3565009295
WAIT #1: nam='control file sequential read' ela= 34059 file#=0 block#=24 blocks=1 obj#=15 tim=3565043406
WAIT #1: nam='db file sequential read' ela= 8263 file#=4 block#=1 blocks=1 obj#=15 tim=3565051844
WAIT #1: nam='db file single write' ela= 11451 file#=4 block#=1 blocks=1 obj#=15 tim=3565064066
WAIT #1: nam='control file parallel write' ela= 10822 files=2 block#=23 requests=2 obj#=15 tim=3565074960
WAIT #1: nam='control file parallel write' ela= 662 files=2 block#=17 requests=2 obj#=15 tim=3565075670
WAIT #1: nam='control file parallel write' ela= 141511 files=2 block#=15 requests=2 obj#=15 tim=3565217227
WAIT #1: nam='control file parallel write' ela= 29720 files=2 block#=1 requests=2 obj#=15 tim=3565247022
WAIT #1: nam='db file sequential read' ela= 1351 file#=4 block#=1 blocks=1 obj#=15 tim=3565248434
WAIT #1: nam='db file single write' ela= 648 file#=4 block#=1 blocks=1 obj#=15 tim=3565249118
WAIT #1: nam='control file parallel write' ela= 82890 files=2 block#=18 requests=2 obj#=15 tim=3565332047
WAIT #1: nam='control file parallel write' ela= 70058 files=2 block#=16 requests=2 obj#=15 tim=3565402181
WAIT #1: nam='control file parallel write' ela= 10081 files=2 block#=1 requests=2 obj#=15 tim=3565412337
WAIT #1: nam='rdbms ipc reply' ela= 100245 from_process=5 timeout=21474836 p3=0 obj#=15 tim=3565891056
XCTEND rlbk=0, rd_only=1
EXEC #1:c=0,e=1742396,p=0,cr=0,cu=4,mis=0,r=0,dep=0,og=1,tim=3566052040
WAIT #1: nam='log file sync' ela= 17727 buffer#=1501 p2=0 p3=0 obj#=15 tim=3566070054
WAIT #1: nam='SQL*Net message to client' ela= 6 driver id=1111838976 #bytes=1 p3=0 obj#=15 tim=3566070146
WAIT #1: nam='SQL*Net message from client' ela= 4508479 driver id=1111838976 #bytes=1 p3=0 obj#=15 tim=3570578677
=====================
注意这里的几个重要等待:
WAIT #1: nam='enq: TC - contention' ela= 140565 name|mode=1413677062 checkpoint ID=65561 0=0 obj#=15 tim=3564904012
WAIT #1: nam='db file single write' ela= 11451 file#=4 block#=1 blocks=1 obj#=15 tim=3565064066
WAIT #1: nam='db file sequential read' ela= 1351 file#=4 block#=1 blocks=1 obj#=15 tim=3565248434
WAIT #1: nam='db file single write' ela= 648 file#=4 block#=1 blocks=1 obj#=15 tim=3565249118

这里的TC队列就是线程检查点(Thread Checkpoint)的含义,后面同时记录了checkpoin ID。
db file single write 在文档里这样记录:This event is used to wait for the writing of the file headers.
也就是指对于数据文件头的写入操作,这就是和检查点操作对应的写操作。
注意,随后的db file sequential read也是对于数据文件4,block号为1开始,读取的第一个数据块。

-The End-


Posted by eygle at 9:50 PM | Comments (2)


《深度解析Oracle》之《从等待分析开始》

作者:eygle

出处:http://blog.eygle.com

今天下午,完成了《深度解析Oracle》的第六次课程:《从等待分析开始》,这一节的内容是从等待事件入手,讲解性能优化方面的内容。

这次的内容,希望能够让大家掌握最基本的问题定位方法,找到躲在表象后的问题本质,至于如何解决问题,那就要依据不同情况来分析。

此外,我一直主张:Oracle是一个牵一发动全身的系统。在学习过程中必须将数据库当作一个动态的系统,将我们的知识协同调动起来,才能更好的理解Oracle数据库的架构。
在这个过程中,10046事件可以帮助我们获得对于数据库更加直观的认识。

本次课程的PPT可以在以下地址下载:
http://www.eygle.com/pdf/OracleWaitInterface.rar

接下来还有两次课程,希望大家能够和我一起坚持到最后。

-The End-

Posted by eygle at 9:05 PM | Comments (1)


参加 2008 CSDN 第二次英雄会有感

作者:eygle

出处:http://blog.eygle.com

昨天,去参加了CSDN举行的第二次英雄大会,深感不虚此行,去年CSDN的英雄会有些不尽人意之处,今年有了很大进步。

本来差一点不能成行,周五在家里忙了一天,安装了三台海尔空调(支持国货希望不要带来太多的麻烦),晚上8点半又跑去建行为客户处理紧急性能问题,回到家已经1点多,2点睡觉,早上8点钟勉强怕起来,斗争了半天,还是跑了过去。

到场晚了一点(阴雨绵绵的天气使北京的路更加不顺畅),没有听到蒋涛的发言,现场从CSDN的一个版主发言看其,接着说颁奖仪式,然后是几个主题演讲。
第一个大块时间演讲时中国雅虎首席架构师曾宏威讲的《互联网开放平台技术和应用的未来趋势》,这个报告听下来感觉有点无味,中国雅虎说起来在国内并没有推出一个真正成功的应用,不管是Web1.0的还是Web2.0的,再加上收购的Flickr在国内被GFW之后,雅虎真正为国内所使用的服务其实相当有限,如果雅虎总是拿过去的成功来说事,总让人感觉有祥林嫂的感觉。
个人感觉,这个环节如果让阿里巴巴的人来讲,或许更有可听之处,阿里的淘宝、支付宝等在国内都属于顶级的成功应用,比中国雅虎说出来这些更有吸引之处。

对比下来,上午最后一讲,Google中国首席战略官郭去疾讲互联网云计算倒是让人精神一震,虽然演讲没有涉及多少具体的技术内容,但是作为一个众人瞩目企业的战略和技术逸闻也颇让大家津津有味。

中间还有一个《移动互联网》的主题演讲,这个演讲的节奏非常非常的慢,让我左右两边的哥们都成功睡着了。

这次英雄会的电梯演讲(Elevator Pitch Show Time )环节安排的很不错,紧凑快速而充满盎然的趣味,这是上午活动的一个亮点。

下午的活动又是以一个快速紧张的电梯演讲开始,然后是孟岩、刘韧主持的两个论坛。
不得不说这两个主持人非常到位,而且嘉宾的表现也很精彩,我认认真真的听完两个论坛才离开现场。

孟岩主持的CTO论坛,有五位CTO到场,其中的美女CTO Diane Yu 最为引人注目,现在的叽歪大屏幕,不住有人赞赏Diane的风度,她关于用心来关注员工成长与职业生涯发展的观点也赢得了现场的听众

在最后刘韧主持的创业论坛中,周立功的表现非常抢眼,整个论坛几乎成了周老个人表演的舞台,其真诚坦率、风趣幽默而又充满激情的表达,其职业生涯之路的曲折、挫败以及成功深深吸引了现场的听众,老周反复说的一句话:想不成功也难!经典。
海内的创始人王兴给我的印象也很深,他的发言简短明确深和主题,看起来是爽快而能敏于行的人。

总之,这是一次成功的大会,认认真真的听下来,从这次大会上学到了很多东西,感谢CSDN。

-The End-

Posted by eygle at 9:40 AM | Comments (3)



CopyRight © 2004-2008 eygle.com, All rights reserved.