eygle.com   eygle.com
eygle.com  
 

« October 22, 2005 | Blog首页 | October 24, 2005 »



October 23, 2005

周末看片-关于莉莉周的一切

作者:eygle

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

All.About.Lily.Chou.Chou
刚刚看完了《关于莉莉周的一切》这部电影,居然真的是从头看到了结束。

以前这部片子的DVD曾经在家里放了很久,后来被朋友拿走,一直都没有动过;这次是帮一个朋友下载,索性慢慢看来。

岩井俊二据说有日本王家卫之称,从这一部看来,是有些道理的。
很优美的风景,舒缓、迷离,仿佛梦境般的剧情,展示的却是压抑、痛苦、暴力、甚至血腥的残酷青春。

同曾经看过的《鬼子来了》一样,这部片子给我的感觉就是真实,梦境般不真实的真实。

不想说的更多。

Posted by eygle at 7:35 PM | Comments (4)


了解raw trace文件的各项内容

作者:eygle

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

今天浏览metalink,看到这篇Interpreting Raw SQL_TRACE,比较老的一篇文章了,但是确实很有用,所以决定大略翻译一下吧。

我们知道有几种方法可以得到一个SQL语句执行时后台的trace文件,一个是用SQL_TRACE,一个是用DBMS_SUPPORT包或者DBMS_SYSTEM包,还有一种就是直接使用10046 event。

使用10046 event的方法大致如下:

alter session set events '10046 trace name context forever, level 12';

your sql statement...

alter session set events '10046 trace name context off';

其中的level有1,4,8,12几个选项,其中1相当于设置SQL_TRACE=TRUE之后的结果,4包括1的结果和绑定变量的实际值,8包括1的结果和等待事件的情况,12则同时包含1的结果,绑定变量的实际值和等待事件情况,所以可以说level 12是最为详细的trace了。

同时我们也知道,对于trace结果,oracle提供了tkprof实用程序用来格式化trace文件,提供一份更容易读懂的trace结果。

那么为什么还要直接读取trace文件呢?最重要的是tkprof的结果是不包含绑定变量值的,同时也不包括真正的SQL执行顺序,而trace文件中我们则可以看到按照时间排列的parse,binds,executes,fetch等等,这在某西场合下是很有用处的。还有就是,如果你能够直接读取这些让人看得眼晕的trace,是不是会有一种很爽,很大师的感觉:-)

当然如果我们要根据一些标准(比如CPU时长,磁盘读取量等)进行trace中的SQL排序,那么tkprof是我们唯一的选择,可以参看coolyl(丫现在迷恋WOW,已经不理朝政了:-D)的Tkprof工具介绍和分析

下面是metalink中的这篇文章的大体翻译,大部分名词用英文反而更好,就不强加翻译了,相信大家都看得懂。当然也是比较懒的原因:-)

文本总结了trace结果原始输出文件中的内容。

----------------------------------------------------------------------------
APPNAME mod='%s' mh=%lu act='%s' ah=%lu
----------------------------------------------------------------------------

APPNAME:Application name setting。在Oracle 7.2和以上版本中出现。这个名称可以由DBMS_APPLICATION_INFO包来设定。
mod:Module name
mh:Module hash value
act:Action
ah:Action hash value

比如:APPNAME mod='SQL*Plus' mh=3669949024 act='' ah=4029777240

----------------------------------------------------------------------------
PARSING IN CURSOR # len=X dep=X uid=X oct=X lid=X tim=X hv=X ad='X'
statement....
END OF STMT
----------------------------------------------------------------------------

CURSOR:Cursor number
len :Length of SQL statement,SQL语句的长度
dep :Recursive depth of the cursor,当前SQL语句的递规深度,如果为0则表示是用户提交的SQL,为1则是由于用户SQL而导致Oracle后台自己执行的SQL,为2则是由1级SQL继续诱发的下一级SQL。
uid :Schema user id of parsing user
oct :Oracle command type.
lid :Privilege user id.
tim :Timestamp。在Oracle9i之前单位是1/100秒,9i则是1/1,000,000秒。利用这个值可以计算一个SQL执行了到底多长时间。这个值就是当前行被写入trace文件时数据库V$TIMER视图的值。
hv :Hash id.
ad :SQLTEXT address,SQLTEXT的地址,跟V$SQLAREA和V$SQLTEXT视图中的ADDRESS字段值相等。
statement :The actual SQL statement being parsed.

----------------------------------------------------------------------------
PARSE ERROR #%d:len=%ld dep=%d uid=%ld oct=%d lid=%ld tim=%lu err=%d
statement....
----------------------------------------------------------------------------

PARSE ERROR :在Oracle 7.2以上版本中解析的错误会写入trace文件中。
len :Length of SQL statement.
dep :Recursive depth of the statement
uid :User id.
oct :Oracle command type (if known).
lid :Privilege user id.
tim :Timestamp.
err :Oracle error code (e.g. ORA-XXXXX) reported
statement :The SQL statement that errored.

----------------------------------------------------------------------------
PARSE #:c=0,e=0,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=4,tim=0
EXEC #:c=0,e=0,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=4,tim=0
FETCH #:c=0,e=0,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=4,tim=0
UNMAP #:c=0,e=0,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=4,tim=0
----------------------------------------------------------------------------

PARSE :Parse a statement. 解析一个SQL
EXEC :Execute a pre-parsed statement. 执行已经解析完毕的SQL
FETCH :Fetch rows from a cursor. 从游标中得到数据,通常指select返回记录
UNMAP :如果游标使用了临时表(temporary table), 当游标关闭的时候将会看到UNMAP
c :CPU time (100th's of a second in Oracle7 ,8 and 9).
e :Elapsed time (100th's of a second Oracle7, 8. Microseconds in Oracle 9 onwards).
p :Number of physical reads.
cr :Number of buffers retrieved for CR reads.
cu :Number of buffers retrieved in current mode.
mis :Cursor missed in the cache.
r :Number of rows processed.
dep :Recursive call depth (0 = user SQL, >0 = recursive).
og :Optimizer goal: 1=All_Rows, 2=First_Rows, 3=Rule, 4=Choose
tim :Timestamp (large number in 100ths of a second).

比如:FETCH #2:c=0,e=106,p=0,cr=3,cu=0,mis=0,r=1,dep=1,og=4,tim=6005498548671

----------------------------------------------------------------------------
ERROR #%d:err=%d tim=%lu
----------------------------------------------------------------------------

执行或者fetch之后出现的SQL Error
err :Oracle error code (e.g. ORA-XXXXX) at the top of the stack.
tim :Timestamp.

----------------------------------------------------------------------------
STAT # id=N cnt=0 [pid=0 pos=0 obj=0 op='SORT AGGREGATE ']
----------------------------------------------------------------------------

CURSOR的执行计划.
CURSOR :Cursor which the statistics apply to.
id :Line of the explain plan which the row count applies to (从1开始).
cnt :Number of rows for this row source.
pid :Parent id of this row source.
pos :Position in explain plan.
obj :Object id of row source (if this is a base object).
op : The row source access operation.

比如:

STAT #2 id=2 cnt=0 pid=1 pos=1 obj=510 op='TABLE ACCESS BY INDEX ROWID OBJECT_USAGE (cr=2 r=0 w=0 time=83 us)'
STAT #2 id=3 cnt=1 pid=2 pos=1 obj=511 op='INDEX RANGE SCAN I_STATS_OBJ# (cr=1 r=0 w=0 time=43 us)'

----------------------------------------------------------------------------
XCTEND rlbk=%d rd_only=%d
----------------------------------------------------------------------------

XCTEND是事务结束的标志.
rlbk :1 if a rollback was performed, 0 if no rollback (commit).
rd_only :1 if transaction was read only, 0 if changes occurred.

----------------------------------------------------------------------------
BINDS #%d:
bind 0: dty=2 mxl=22(22) mal=00 scl=00 pre=00 oacflg=03 oacfl2=0 size=24 offset=0
bfp=02fedb44 bln=22 avl=00 flg=05
value=10
----------------------------------------------------------------------------

BIND :Variables bound to a cursor.
bind N :The bind position being bound.
dty :Data type.
mxl :Maximum length of the bind variable (private max len in paren).
mal :Array length.
scl :Scale.
pre :Precision.
oacflg :Special flag indicating bind options
oacflg2 :Continuation of oacflg
size :Amount of memory to be allocated for this chunk
offset :Offset into this chunk for this bind buffer
bfp :Bind address.
bln :Bind buffer length.
avl :Actual value length (array length too).
flg :Special flag indicating bind status
value :The actual value of the bind variable.

比如:

BINDS #4:
bind 0: dty=2 mxl=22(22) mal=00 scl=00 pre=00 oacflg=08 oacfl2=1 size=24 offset=0
bfp=ffffffff7ce64ee0 bln=22 avl=01 flg=05
value=0
bind 1: dty=1 mxl=32(11) mal=00 scl=00 pre=00 oacflg=18 oacfl2=1 size=32 offset=0
bfp=ffffffff7ce6b128 bln=32 avl=11 flg=05
value="TABCOMPART$"
bind 2: dty=2 mxl=22(22) mal=00 scl=00 pre=00 oacflg=08 oacfl2=1 size=24 offset=0
bfp=ffffffff7ce6bae8 bln=24 avl=02 flg=05
value=1

----------------------------------------------------------------------------
WAIT #: nam="" ela=0 p1=0 p2=0 p3=0
----------------------------------------------------------------------------

WAIT :An event that we waited for.
nam :What was being waited for.
ela :Elapsed time for the operation.
p1 :P1 for the given wait event.
p2 :P2 for the given wait event.
p3 :P3 for the given wait event.

比如 (Full Table Scan):
WAIT #1: nam="db file scattered read" ela= 5 p1=4 p2=1435 p3=25
在游标1上经历了"db file scattered read"等待事件,一共等了0.05秒,在读取File 4,从1435 block开始,读了25个block

比如 (Index Scan):
WAIT #1: nam="db file sequential read" ela= 4 p1=4 p2=1224 p3=1
在游标1上经历了"db file sequential read"等待事件,一共等了0.04秒,在读取file 4,block 1224,读取了这一个block

对于每一个等待事件的含义和p1,p2,p3表示的意思,可以参考Oracle Database Reference文档的Oracle Wait Events章节。

Posted by eygle at 3:25 AM | Comments (5)


关于oracle的版权信息-一些你可能不知道的,一些可以看出Oracle野心的...

作者:eygle

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

今天从游戏中抽身出来,终于觉得整日游戏实在不是正常的事儿,还好,对于Unix,对于Oracle在重新审视一下之后,仍然保有不小的兴趣,OK,开始正常一些的学习吧。

重新安装了Kaspersky Anti Virus,中间要求重启无数次,现在又要重启,先发布本篇-未完待续。

在Kaspersky疯狂检查了我的硬盘之后,让我们继续前面的文章。

以往从来没有想去认真读一次Oracle的版权声明,今天打开Oracle10gR2的文档,忽然想到d.c.b.a的那件事儿,于是就索性从头开始读一下这篇文章。

一些我想大家都应该去知道的,虽然国内的版权概念实在是比较淡薄,但想来会越来越好的。

Oracle10g分为4个版本,分别是:
1。Oracle Database Standard Edition One,最基本的商业版本,包括基本的数据库功能。
2。Oracle Database Standard Edition ,标准版,包括上面那个版本的功能和RAC,只有在10g的标准版中才开始包含RAC
3。Oracle Database Enterprise Edition,企业版,虽说是最强劲的版本,但是并不是所有我们常用的功能都在这个版本中,很多东西仍然是要额外付费的,后面会说到。
4。Oracle Database Personal Edition,个人版,除了不支持RAC之外包含企业版的所有功能,但是注意的是,只有Windows平台上才提供个人版。

下面来看一下,在Standard Edition One和Standard Edition中不支持的功能(只是选了一些大家比较常见或者常用的功能),注意,这些功能除了RAC之外仍然包含在个人版中。
1。Oracle Data Guard,想要高可用性的人不要选择标准版了
2。一些Online操作,比如Online index maintenance,Online table redefinition等
3。备份和恢复的某些操作受限,比如不支持Block级别的恢复(Block-level media recovery),不支持并行备份和恢复(Parallel backup and recovery),多重备份(Duplexed backup sets)等等
4。Flashback功能,在标准版中Flashback Table,Flashback Database, Flashback Transaction Query都是不支持的
5。VPD(Virtual Private Database)不支持
6。FGA(Fine-grained auditing)不支持
7。Partitioning,注意哈注意,分区也是不支持的
8。Data compression,比如表压缩,分区压缩都不支持
9。Bitmapped index and bitmapped join index,呵呵,想做数据仓库的就不要妄图选择标准版了
10。Export transportable tablespace,仍然要注意,这里只是导入不支持,但是Import transportable tablespace,包括跨平台的import都是支持的,也就是说你如果选择了标准版,那么想把数据库简单地转移到其它平台上是比较费劲的事情了
11。一堆并行操作都不支持,包括Parallel query,Parallel DML,Parallel index build,Parallel Data Pump export and import,也就是Oracle认为你既然选择了标准版,那么你的数据一定不大了,既然不大,那么也就用不到并行去提高应用的性能了,所以,全部给咯喳掉
12。不支持Streams,又少了一个高可用性的可行性方案
13。不支持Advanced Replication的multimaster方式,再少一个高可用性方案,当然实体化视图的复制方案仍然是支持的
14。Connection Manager不支持,其实可能用的人也比较少吧

限制多多,选择标准版的人们实在是要小心了啊。

继续看,我们将要接触到Oracle的野心了

先摘抄一段原文看看:

When used with Oracle Real Application Clusters in a clustered server environment, Oracle Database Standard Edition requires the use of Oracle Clusterware. Third-party clusterware management solutions are not supported. In addition, Automatic Storage Management (ASM) must be used to manage all database-related files, including datafiles, online logs, archive logs, control file, spfiles, and the flash recovery area. Third-party volume managers and file systems are not supported for this purpose.

意思就是标准版在10g中不是已经支持RAC了吗?是,是支持了没错,但是人家oracle是有限制的,如果要在标准版中用RAC,那么只能使用Oracle Clusterware(不支持其它任何第三方群集软件),同时必须使用ASM来做数据文件的存储管理(其它任何第三方的卷管理和文件系统都不支持)。

记得曾经讨论过Oracle在持续地扩展自己的地盘,不仅仅是做一个数据库软件,同样不仅仅是作一些其它的ERP,CRM软件,而是将触角深入到这些软件的底层基础上,也就是群集,存储,文件系统,Oracle在缔造一个帝国,这个帝国里面可以没有其它任何第三方软件(目前看来当然要除去操作系统),全部的解决方案都由Oracle来提供。

但是一个新的卷管理,一个新的文件系统要被人接受谈何容易,所以Oracle说了,想选用标准版,想省钱是吧,没问题,那么你就要用我的解决方案,说白了,就是从娃娃抓起,大公司不会用标准版,而可能发展为大公司的小公司从一开始就是在Oracle的解决方案下成长起来的,那么长大之后很大的可能性仍然是Oracle整体方案的忠实用户。所谓长江后浪推前浪,前浪死在沙滩上,迟早的事情。

当然Oracle仍然还是有些人性的,因为我们得到下面的这些承诺:

A separate Oracle Database can be installed and used as a Recovery Manager (RMAN) repository without additional license requirements,并且A separate Oracle Database can be installed and used as a Oracle Enterprise Manager Grid Control (OEM Grid Control) repository without additional license requirements。

如果要安装另外一个数据库作为RMAN repository 或者OEM Grid Control repository那么不需要另外付费了,如果这个也要另付费,估计要疯掉.....

下面的这段各位要仔细看了,这些都是都是要另外付费的,Oracle说了“The fact that these options, packs, or products may be included in product CDs or downloads or described in documentation that you receive does not authorize you to use them without purchasing appropriate licenses.”,也许你购买的CD中,你下载的软件中,你拿到的文档中都由这些东西,但是这不代表你可以不付钱就用它们,言下之意就是靠诸君自觉了,别让我逮着你就用吧。

另外一个概念就是,如果你购买了最低级的那个Standard One的版本,那么下面这些东西即使你想付钱也不能买,因为那个版本压根儿就不支持。哪些东西呢?

1。RAC,企业版和标准版里面已经包括了,不需要另外付费
2。Partitioning,分区啊分区,不用会死人的,不过以前我们的公司单独购买过吗?貌似没有.....
3。Data Mining,数据挖掘,高深,eygle学过?
4。Advanced Security,安全性选项,网络传输加密什么的,不用
5。Label Security,基于FGA的安全性选项,没玩过
6。OLAP,数据分析,没玩过,eygle好像也学过?
7。Spatial,GIS的,从来没用过
8。Oracle Management Packs,就是那堆我们安装了之后在OEM中就可以用的调优工具,其实我们一直在用盗版的哦

Posted by kamus at 1:44 AM | Comments (11)


奇妙之旅-纵横双龙山之二

作者:eygle

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

寂寞独自香

然后是爬山,有点曲折却不高,运动量也不大。然而山上的空气很好,秋意正浓,顿时心情舒畅起来。

爬山结束开始野炊,一只蜜蜂不知道怎么钻进了我们装食品的背包,我拿东西的时候只觉得手腕上一阵剧痛,一只蜜蜂狠狠的教训了我:(,眼看着手腕就肿了起来,还好不是毒蛇啮臂,俺也就保住了这只手腕:)

这期间还有另外一个环节,根据玩游戏的成绩计算得分,然后给各队发放虚拟货币,用以竞拍各种稀缺资源,如烤鸡等(个个都饿得直流口水啊)。结果这个环节又出了意外,有3个队联合起来以单个队根本无法竞争的价格把烤鸡席卷一空。搞的俺们义愤填膺,可也没有办法,看来没有监管拍卖也不容易啊。然后还出了假币,有的队伍把50的当成500来用,我再晕啊!

下山的时候还有一个小插曲,走在半路,穿越一个村庄时,忽然听见前面一声尖叫,一个女孩倒在旁边人身上,所有人不知所措。
问了半天,说出一个字:鸡。

原来女孩怕鸡。俺们CEO贡献了一件外套,蒙住女孩的头,两个人一直扶着走出山谷。
这是俺第一次遇到害怕鸡的女孩。

Posted by eygle at 12:08 AM | Comments (4)



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