virtual swap space on solaris
25 June 2008
有人对solaris上的swap space提出了如下的疑问:
swap -l:
swapfile dev swaplo blocks free
/dev/vx/dsk/bootdg/swapvol 40,75002 16 33540080 33540080
swap -s :
total: 55705168k bytes allocated + 273872k reserved = 55979040k used, 15937056k available
top:
load averages: 8.08, 7.88, 7.52 00:06:43
361 processes: 355 sleeping, 1 zombie, 5 on cpu
CPU states: % idle, % user, % kernel, % iowait, % swap
Memory: 64G real, 7482M free, 53G swap in use, 15G swap free
swap -l显示的是physical swap file的大小 33540080 (blocks) * 512 (blocksize) = 16377MB,实际使用的physical swap file是0 (blocks - free blocks),而top中显示的是53G swap in use。swap -s中used的大小为55979040k (53.4G),和top的值相符。那么实际使用的swap space大小究竟是多少,physical swap space究竟是多少。
上面几个不同的数据确实让人迷惑,不过如果我们了解了solaris的virtual swap space机制,一切就很好理解了。写之前百度了一下,没有发现有文章很好的解释这个概念。
virtual swap space和virtual memory不同,注意不要混淆了。virtual swap space是在swap space之上虚拟的一层swap space。
先说说传统的方法,当application创建virtual memory是,要在swap space上reserve一段空间以便当physical memory不够的时候可以换出到swap space上。所以有physical swap space的大小最好为physical memory两倍大小的说法。
引入virtual swap space后,这一部分reserve的swap space是虚拟的,而不是真实的physical swap space。当有真实数据写入physical memory page的时候,这部分virtual swap状态转为reserved and allocated.这时候swap还是虚拟的swap space,并没有在physical swap space上创建,所以swap -l显示实际使用的physical swap space为0。只有当真正有swap out发生,也就是要将memory page的内容写入swap的时候,才会使用physical swap space。在这样的机制下,不需要像上面说的2倍物理内存大的swap space,系统也可以正常的运行。上面的例子中物理内存为64G大小,physical swap file大小仅为16G大小。
所以上面top里面显示了53G swap space (virtual swap space),而swap -l中swap space显示16G (physical swap space),使用的physical swap space 为0
swap -s中的 “used” 也是指的virtual swap space上reserved和reserved & allocated swap space的大小
功夫熊猫
22 June 2008
周五跑去新世界,本来不是特意去看电影的,因为从杜莎夫人蜡像馆里面出来离吃饭时间还早,想想上去看看有什么电影可以看的。
顺便说下,杜莎夫人蜡像馆里面的黑暗迷宫里面的鬼竟然是真人扮演,够劲的。
跑到顶楼一看刚好是功夫熊猫上映的日子,作为动画片的fans,没理由错过的:)
电影蛮搞笑的,整个剧院里面笑声不断,动画特技也不错,情节嘛比较老套,典型的励志型好莱坞动画片情节。
个人感觉蛮值得一看的

弈城围棋关闭
2 June 2008
六月一号,曾经红红火火的弈城围棋(www.eweiqi.com)关闭了.
很难想象办的如此成功,拥有如此多棋迷的一个网站说关就关了,大家还都没有慌过神来.难道围棋也是一种网游?
摆在广大棋迷面前一个很现实的问题就是:以后去哪里下棋
QQ上面赖皮的太多,而且高手不多.达到300分后很难找到相同分数的对手,即使找到了,很多人高举免战牌.
Tom的速度是个问题.我是上海电信,晚上上去能下完一盘棋不掉线的几率很小.
清风围棋和Tom一样同样存在速度上的问题.
Sina是老牌的围棋网,我没有用过,不知道速度如何,听别人说最近一段时间上面人很多,都是从弈城分流过去的
棋魂围棋网(www.qihun8.com) 就在弈城发布要关门消息后刚刚开张的,现在还在公测阶段.我也上去注册了个号,不过你水平再高都只能从3D注册起,现在上面地雷好多啊,一不小心就输出去了.我刚上去第一盘差点就挂掉,最后打起精神才勉勉强强扳回局势.现在整个系统还不是很稳定,也常常有断线发生.不过因为是国人自己开发的系统,所以不用担心像弈城这样的问题.
孩子快抓紧妈妈的手
21 May 2008
孩子快抓紧妈妈的手
——为汶川地震死去的孩子而作
作者: 无名氏
孩子
快
抓紧妈妈的手
去天堂的路太黑了
妈妈怕你碰了头
快抓紧妈妈的手
让妈妈陪你走
妈妈
怕
天堂的路太黑
我看不见你的手
自从倒塌的墙
把阳光夺走
我再也看不见
你柔情的眸
孩子
你走吧
前面的路
再也没有忧愁
没有读不完的课本
和爸爸的拳头
你要记住
我和爸爸的模样
来生还要一起走
妈妈
别担忧
天堂的路有些挤
有很多同学朋友
我们说不哭
哪一个人的妈妈都是我们的妈妈
哪一个孩子都是妈妈的孩子
没有我的日子
你把爱给活的孩子吧
妈妈
你别哭
泪光照亮不了
我们的路
让我们自己
慢慢地走
妈妈
我会记住你和爸爸的模样
记住我们的约定
来生一起走
TX enqueue Mode 4的一点补充
12 May 2008
在06年的一篇blog TX lock中简略的解释了下TX enqueue的类型和对应的例子。
最近在数据库维护中又有了一点新的发现。
前面文章中提到Mode=4的TX lock又分为下面三种情况
* ITL entry数目不够
* Unique key的约束
* Bitmap index entry
再补充几种情况:
* Index block spilt
* Foreign key enforcement
* Alter tablespace … read only;
* Free Lists slot waits
* Possible with two phase commit
* Extent allocation slow in DMT tablespace
前面几种情况一些文档中多多少少有所提及,index block split较为常见。
最后一种extent allocation slow是实际中遇到的。在DMT的tablespace中,当free extent很多,但不满足分配条件时就会出现extent分配慢的情况,实际中分配一个extent需要8,9秒钟。从而导致大量的session wait在TX-4 enqueue上。
目前还没有找到文档有关于这个的相关说明,也许是因为DMT已经退出历史舞台了吧。
Speak to Me
9 May 2008
两年前我推荐给大家两个锻炼英语口语的播客网站:推荐两个不错的英文播客
现在EnlishPod已经不再更新了,但是以前的节目还是可以下载的,聊天性质的podcast,我蛮喜欢的
ESLPOD还是在持续不断的更新,语速慢了点,侧重于语言点的讲解
今天看到另一个学习英语的网站,办的也蛮不错的,推荐给大家: Speak2me
BTW, if you are learning Chinese, here is a wonderful chinese podcast website for you: ChinesePod
杭州湾大桥全线通车
1 May 2008
彩虹飞来为天桥,巨龙卧波笑海风。今天下午3时40分,随着180辆仪仗车南北双向对开,全长36公里世界上最长的跨海大桥——杭州湾跨海大桥试运营通车。这一长江三角洲一体化进程中的重要时刻,将永留史册。
五月底去宁波吃海鲜,哈哈哈


早睡早起
21 April 2008
很多人和我一样希望早起,但是确总是晚睡晚起,虽然自己也知道这对健康不好,不过就像文章中说的要靠一个人的力量做到早睡早起是非常困难的。
我看了几个早起团网站,没有找到一个合适的,大部分都是台湾的,感觉早起的生活网做的最好,不过全是鸟文。
想想自己用google online doc做一个吧,于是就有了下面这个sheet,google online doc的表格画图不支持时间格式,所以只能用800代替8:00。8点钟起床是我的target:)
我share出来了,大家也可以把自己加上去啊,比比看谁起得更早:)
文档地址是: http://spreadsheets.google.com/ccc?key=psyrzQaZuXmO7-SaDV3DGPw&hl=en
保持队形
17 April 2008
今天MSN刚上线,就收到一短消息,内容大致是建议加(L)China到MSN名字
当时也没注意,随手就关掉了
到了下午的时候,打开MSN,上面的名字全是Love China的前缀
晕哦,一片红,看上去倒是蛮震撼的
到baidu上面去google了一下(这话说的),这是网友自发组织的一个爱国活动,表达自己支持和拥护北京奥运的决心。
好吧,既然这样,大家都保持队形好了:)

Oracle Senior DBA Wanted
2 April 2008
Description:
The Oracle DBA is a member of a top DBA Team responsible for eBay global Oracle database system.
Responsibilities:
· Work with different team member to deploy ebay application with proper oracle technology design/implementation;
· Good skill in English communication both verbal and written.
· Have experience with SQL*Review/Tuning, and Data model design.
· Design and document architecture and procedures around back-end database
· Keep management database configuration and tuning
· Manage and support a large site database environment with Oracle and Solaris
· Establish and follow best practices for enterprise monitoring, troubleshooting and maintenance
· In charge of database security and backup/restore
Key Success Factors
· 5+ years experience in Oracle administration,
· be very clear with oracle concepts, basic administration.
· With basic understanding of instance/SQL tuning
· Very clear about how to do troubleshooting. Strong at problem analysis and resolve.
· Solid knowledge of operating system internals such as Unix, Linux
· Strong decision-making skills, take charge personality, and the ability to drive a plan to completion
· Professional Shell/Perl programming experience preferred
· Familiar with SAN/Veritas , Or other storage management software
· Be able to work under high pressure,able to work flexible hours as required by business priorities
· enthusastic about e-commerce operations,
· great team player, warm-hearted and self-motivated Good teamwork spirit
· Strong communication skills both in mandarin and English, as this position will need to be in contact with USA team during the office time
Qualification:
· Education: Bachelor degree in computer science or equivalent education
· Experience Level: 5+ years Oracle DBA experience in production DBA position. It is a huge plus if the candidate support large enterprise system environment supporting mission-critical systems and applications.
· Technical Qualifications:
. 5+ years experience with Oracle DBA experience.
. Experience with Unix servers, Solaris experience is best.
. Best to have support oracle database in Unix box.
. Experience with Veritas Volume Manager and File System, VCS, or other storage/cluster management software.
. Experience with system monitoring and management software
· Communication skills: Effective communication skills including written and verbal in English.







