« November 2004 | 首页

1 2 3 4 5 6 7 8 9 10 11 12 13 (Page 1 of 13)



| January 2005 »

December 31, 2004

2005年的期待

今天是 2004 年的最后一天。新年似乎没有什么欢乐的气氛,全世界的目光都在关注印度洋的海啸。据说死亡人数还在不断上升。2004 年回首,真是最坏的一年。全世界局部冲突依然不断,国内接连不断的矿难、伊拉克纷飞战火、俄罗斯人质事件、朝鲜核危机下的饥饿人民,还有年末这印度洋吃人的海啸......

每个人都有个小板凳,我的不带入 2005 年 -- 仿 胡马个

2005 年,我希望,世界上不再掀起新的战争,现在的战乱国家得到和平;

2005 年,我希望,我们国家法制更为健全,不再有那么多的冤假错案;

2005 年,我希望,台海局势得到和缓或是干脆开战,而中日关系那就继续交恶,直到永远;

2005 年,我希望,能听到崔健的新专辑,不管是叫做《农村包围城市》还是《滚动的蛋》;

2005 年,我希望,能看到更多的真正的艺术,代表广大人民群众的最真实声音,而不是欢歌笑语粉饰太平瞎扯淡;

2005 年,我希望,IT 新技术盛宴给我们带来生活上的享受,BLOG 由量变到质变;

2005 年,我希望,自己多结交朋友,能多学点技术,用技术给社会多创造点价值,顺便赚点钱;

2005 年,我希望,能看到姜文被禁的电影解冻;冯小刚的《温故1942》真的像史诗;杰克逊这样的小伙子不再受到媒体的困扰没个完;

2005 年,我希望,每个人早晨醒来都能感受到阳光的温暖;光明驱散黑暗;

2005 年,我希望,家里人平安,GF 和我不用再去医院,俺家小猫更好玩

2005 年,我希望,不只是希望......

December 30, 2004

Scaling Oracle8i

Scaling Oracle8i - Building Highly Scalable System Architectures

Scaling Oracle8i

虽说一些内容已经有些过时,但一些章节中的基本原则还是值得一看。以下几章很有特色:

  • 第二章、Hardware Architectures and I/O Subsystems
  • 第三章、Benchmark Concepts and Design
  • 第七章、Introduction to UNIX

版权信息:

At last, Scale Abilities' co-founder James Morle's highly acclaimed book is available for free viewing and download under a Creative Commons license. Don't be fooled by the "8i" in the title - the principles and concepts presented in this book are still completely valid today!
The book is available in two forms - a PDF version that can be downloaded, copied, distributed, given away or put on your website, and an HTML version which will only be available at www.scaleabilities.co.uk. The PDF will remain mostly static, but the HTML version will be modified over time, thus the reasoning for a central location. Of course, the HTML version is perfect for linking to, and this is highly encouraged!

电子版本:

December 29, 2004

V$SESSION_EVENT - Oracle Wait Interface Memo

v$session_event 记载了当前连接到数据库的所有会话的统计信息,从名字上也可以看出来,这是个会话级(Session Level)的动态视图。

继续以 Oracle Wait Interface: A Practical Guide to Performance Diagnostics & Tuning 这本书为参考,分析 OWI 。先看看v$session_event 的数据结构:

SQL> desc v$session_event
 Name                                   Null?    Type
 -------------------------------------- -------- --------------------------
 SID                                             NUMBER
 EVENT                                           VARCHAR2(64)
 TOTAL_WAITS                                     NUMBER
 TOTAL_TIMEOUTS                                  NUMBER
 TIME_WAITED                                     NUMBER
 AVERAGE_WAIT                                    NUMBER
 MAX_WAIT                                        NUMBER
 TIME_WAITED_MICRO                               NUMBER
 EVENT_ID                                        NUMBER //10g's New Column

SQL> 

V$SESSION_EVENT 语句由 X$KSLES (Kernel Service Current Session statistics) 和 x$ksled(Kernel Service Latch Event Descriptors) 这两个固定表得来。(致谢:抽取脚本由 Rudolf 友情提供,下载 )

SELECT s.inst_id, s.kslessid, d.kslednam, s.ksleswts, s.kslestmo,
       ROUND (s.kslestim / 10000), ROUND (s.kslestim / (10000 * s.ksleswts)),
       ROUND (s.kslesmxt / 10000), s.kslestim, d.ksledha sh
  FROM x$ksles s, x$ksled d
 WHERE s.ksleswts != 0 AND s.kslesenm = d.indx;

v$session_event 结构中包含 SID ,要想获取其中的内容,可能需要首先获取 SID 信息。可以通过 v$session 视图来做到,也可以利用 DBMS_SUPPORT 包来获取 SID 。要注意:在 Oracle RDBMS 9.2.0.1 与 9.2.0.2 中,因为 Bug:2429929 的影响,V$SESSION_EVENT.SID 是错误的(需要在该值的基础上+1)。

常用的 SQL 举例:

SQL> col sid      format 999
SQL> col event    format a30
SQL> col username format a8
SQL> SELECT   b.SID,
  2           DECODE (b.username,
  3                   NULL, SUBSTR (b.program, 18),
  4                   b.username
  5                  ) username,
  6           a.event, a.total_waits , a.time_waited ,
  7           a.average_wait, a.max_wait
  8      FROM v$session_event a, v$session b
  9     WHERE b.SID = a.SID and b.username='SCOTT'
 10  ORDER BY 1, 4;

 SID USERNAME EVENT                          TOTAL_WAITS TIME_WAITED AVERAGE_WAIT   MAX_WAIT
---- -------- ------------------------------ ----------- ----------- ------------ ----------
 217 SCOTT      SQL*Net more data from client            2           0            0          0
 217 SCOTT      SQL*Net break/reset to client            2           0            0          0
 217 SCOTT      SQL*Net more data to client             11           0            0          0
 217 SCOTT      SQL*Net message from client             88      151790         1725      85964
 217 SCOTT      SQL*Net message to client               89           0            0          0


SQL> 

v$session_event 中比较重要的列是 TIME_WAITED 与 MAX_WAIT 。MAX_WAIT 列记载了每个会话每个时间的最大等待时间。可以通过执行

execute dbms_system.kcfrms;

来重置该列信息。Ora-600 写了一篇 新的Oracle时间信息特性 。内容很有参考价值。

December 28, 2004

When One Can Call Oneself EXPERT

什么样的人可以自称是 Oracle 专家? Oracle-L 列表中 Carlos Reyes 提出了这个问题(Here),是出版了多少本书?有多少年的经验?还是其他什么资格才可以?看起来似乎很平常但也没有正确答案的问题,却引了不少人来讨论。有一些答案很有意思,值得仔细琢磨。

比如有人说,"There are no experts, only specialists"。 Freeman Robert 这么说:

1. There are things I never quite understood right.
2. Things I didn't know that I thought I should know.
3. That there are things that I knew at one time, that I completley have forgotten (I hate this one the worst I think).

也有相反的 Connor McDonald (http://www.oracledba.co.uk/) 比较狂:

I've always been an expert...Its just finding exactly what precisely I'm an expert in, that's the challenge

Jonathan Gennick (http://gennick.com/)更为赞成:

I have expertise in writing SQL queries

这样的说法,因为一旦说了

I am an expert in writing SQL queries

这样的话,会被人误认为

I know everything there is to know about writing SQL queries

多数人还是不敢称自己为 expert ,不过也有人承认,在商业场合,可能是另外一回事了。

本站相关标签|Tags Cloud