March 31, 2007
接受邀请 成为CSDN专家顾问
作者:eygle
出处:http://blog.eygle.com
昨天,收到了CSDN寄来的聘书和一份礼物,成为了CSDN《程序员》杂志的特邀专家顾问:
此前接受了CSDN的邀请,作为数据库方面的顾问,在数据库技术方面对《程序员》杂志的相关栏目进行建议和审阅。
以前CSDN是我一直高频访问的网站之一,最初的Blog写作也是从CSDN开始的,可是后来由于CSDN的Blog稳定性太差,最终放弃了那个Blog,构建了现在的eygle.com站点。
现在对CSDN的访问度已经下降,《程序员》杂志也很少再读到了,希望这次能够重新开始新的阅读,再次从杂志中受益;也希望能够不辜负CSDN诸位同仁的信任,担起顾问两个字的含义。
-The End-
Posted by eygle at 5:14 PM | Comments (5)
LGWR与AIX上的进程优先级
作者:eygle
出处:http://blog.eygle.com
早上,Kamus电话问我一个关于AIX上进程优先级的问题。
大体情况是这样的:
用户的事务及提交非常频繁,大约每秒要执行20000个事务,每个事务都需要独立提交。
在压力测试情况下,用户发现最终的数据库瓶颈出现在LGWR上。
最显著的等待是LOG FILE SYNC,最终发现问题出在LGWR进程,由于该进程活动过于频繁,该进程在系统上的nice值被调至68,AIX上缺省进程nice值为60,nice值越高表示优先级越低。
经过renice之后,系统性能恢复正常。
问题在于能否将进程nice值固定,据说询问了IBM工程师,说没有办法。
我搜索了一下,找到了解决方案,记录一下。
根据IBM的文章AIX 5 performance series: CPU monitoring and tuning,我们可以通过setpri调用来固定进程的优先级:
Using the setpri() and thread_setsched() subroutinesThere are now two system calls that allow users to make individual processes or threads to be scheduled with fixed priority. The setpri() system call is process-oriented and thread_setsched() is thread-oriented. Use caution when calling these two subroutines, since improper use might cause the system to hang.
An application that runs under the root user ID can invoke the setpri() subroutine to set its own priority or the priority of another process. The target process is scheduled using the SCHED_RR scheduling policy with a fixed priority. The change is applied to all the threads in the process. Note the following two examples:
retcode = setpri(0, 45);
Gives the calling process a fixed priority of 45.
retcode = setpri(1234, 35);
Gives the process with PID of 1234 a fixed priority of 35.
If the change is intended for a specific thread, the thread_setsched() subroutine can be used:
retcode = thread_setsched(thread_id,priority_value, scheduling_policy)
The parameter scheduling_policy can be one of the following: SCHED_OTHER, SCHED_FIFO, or SCHED_RR.When SCHED_OTHER is specified as the scheduling policy, the second parameter (priority_value) is ignored.
由于没有AIX的环境,我没有测试,但是相信官方文档的说法应该没有问题。
Oracle建议在AIX上将Oracle进程优先级固定为40,Metalink上可以找到相关文档。
其他参考链接:
http://www-128.ibm.com/developerworks/aix/library/au-aixprocesscontrol/
http://www-128.ibm.com/developerworks/aix/library/au-aix5_cpu/index.html
-The End-
Posted by eygle at 2:08 PM | Comments (4)
March 29, 2007
光纤存储、SUN遭遇莫名故障
作者:eygle
出处:http://blog.eygle.com
前几天,一台连接EMC存储的数据库主机挂了,给出的错误信息如下:
scsi: [ID 107833 kern.notice] Requested Block: 0 Error Block: 0
scsi: [ID 107833 kern.notice] Vendor: DGC Serial Number: 2E0000F8FACL
scsi: [ID 107833 kern.notice] Sense Key: Unit Attention
scsi: [ID 107833 kern.notice] ASC: 0x2a (), ASCQ: 0x80, FRU: 0x0
scsi: [ID 107833 kern.warning] WARNING: /pci@8,600000/fibre-channel@1/sd@1,18 (sd299):
Error for Command: read Error Level: Retryable
由于有HA起作用,数据库切换到其他服务器运行。
从错误信息看起来,是存储的读写出现了问题。
进一步检查,发现光纤交换机出了点故障:
Error 63
--------
0x101c9810 (tThad): Mar 27 05:23:29
WARNING FW-STATUS_SWITCH, 3, Switch status changed from DOWN/FAILED to HEALTHY/OK
目前的判断是,可能是光纤交换机的短时故障导致了光纤通道中断,结果导致主机直接Down机。
可是重起之后异常出现了,运行在这个主机上的数据库奇慢无比,即使切换到其他主机情况也没有好转。
EMC存储上没有任何错误,目前怀疑相关LUN的数据存在问题,导致I/O缓慢。
有谁遇到过类似问题么?
-The End-
Posted by eygle at 3:20 PM | Comments (13)
March 27, 2007
DBA警世录:有多少错误可以再犯
作者:eygle
出处:http://blog.eygle.com
前几天写过一篇短文,有些习惯DBA需要养成,其中提到几点建议以帮助DBA减少错误。
今天,一个同事又犯下一个低级的错误,导致了数据库故障。
所以确切的说,是SA的错误而不应该是DBA的责任,然而影响的毕竟还是数据库业务。
错误是这样犯下的,一台数据库服务器出了点故障,SA去检查重起信息,他试图键入如下一条命令:
last |grep reboot
然而不幸得是grep被他漏掉了,然后主机就被成功的reboot了。
晕倒,这样的错误也不容易出现的吧。
然后该我来启动数据库:
$ sqlplus "/ as sysdba"SQL*Plus: Release 10.2.0.1.0 - Production on Tue Mar 27 10:33:12 2007
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup
ORA-01078: failure in processing system parameters
ORA-01565: error in identifying file '+DATADG/boss/spfileboss.ora'
ORA-17503: ksfdopn:2 Failed to open file +DATADG/boss/spfileboss.ora
ORA-15077: could not locate ASM instance serving a required diskgroup
SQL> exit
Disconnected
报错,原来是ASM的数据库,先来启动ASM实例:
$ export ORACLE_SID=+ASM
$ sqlplus "/ as sysdba"SQL*Plus: Release 10.2.0.1.0 - Production on Tue Mar 27 10:35:51 2007
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup
ASM instance startedTotal System Global Area 130023424 bytes
Fixed Size 1976920 bytes
Variable Size 102880680 bytes
ASM Cache 25165824 bytes
ASM diskgroups mounted
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining Scoring Engine options
再来启动数据库实例:
$ export ORACLE_SID=boss
$ sqlplus "/ as sysdba"SQL*Plus: Release 10.2.0.1.0 - Production on Tue Mar 27 10:36:18 2007
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup
ORACLE instance started.Total System Global Area 1115684864 bytes
Fixed Size 1984440 bytes
Variable Size 520099912 bytes
Database Buffers 587202560 bytes
Redo Buffers 6397952 bytes
Database mounted.
Database opened.
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining Scoring Engine options
最后启动监听器:
$ lsnrctl startLSNRCTL for Solaris: Version 10.2.0.1.0 - Production on 27-MAR-2007 10:37:03
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Starting /opt/oracle/product/10.2.0/bin/tnslsnr: please wait...
TNSLSNR for Solaris: Version 10.2.0.1.0 - Production
System parameter file is /opt/oracle/product/10.2.0/network/admin/listener.ora
Log messages written to /opt/oracle/product/10.2.0/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=db480.hurray.com.cn)(PORT=1521)))Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Solaris: Version 10.2.0.1.0 - Production
Start Date 27-MAR-2007 10:37:03
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /opt/oracle/product/10.2.0/network/admin/listener.ora
Listener Log File /opt/oracle/product/10.2.0/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=db480.hurray.com.cn)(PORT=1521)))
The listener supports no services
The command completed successfully
搞定。
记录一下,存此警世。
-The End-
Posted by eygle at 11:03 AM | Comments (7)
March 26, 2007
生命的律动
作者:eygle
出处:http://blog.eygle.com
昨天晚上,感觉到了小Baby在踢妈妈的肚皮,轻轻地...扑扑..
一个小生命在成长啊,春天来了,小家伙也在加快成长。
健健康康的,茁茁壮壮的.
希望Baby健康、希望妈妈快乐,期待一家人尽快团聚,^_^
Posted by eygle at 2:10 PM | Comments (5)
March 25, 2007
eygle的菜谱:金钩玉条
作者:eygle
出处:http://blog.eygle.com
在超市里看到青翠可爱的茭白,忍不住买了回来。然后开始查食谱,看茭白要怎么做。
配料首先是金钩:
即干虾仁又名虾米、海米、开洋等。虾米是用鹰爪虾、脊尾白虾、羊毛虾和周氏新对虾等加工的熟干品。虾米是著名的海味品,有较高的营养价
然后是白条,也就是茭白:
又名茭笋,菰笋、茭瓜,是我国的特产蔬菜,与莼菜、鲈鱼并称为"江南三大名菜"。由于其质地鲜嫩,味甘实,被视为蔬菜中的佳品,与荤共炒。
至于做法就很简单了:
1.将茭白顺长一剖为二,切成细条,至于多多宽,请随意,网上说"5厘米长,如铅笔般粗细的茭白条",我的刀工好,切得要细得多,嘿嘿。
2.海米用水冲一下,放入碗内,倒入黄酒,加水与海米平,浸泡30分钟。
我时间紧,这一步略去了。
3.将茭白条放入开水锅中焯一下,然后捞出
用清盐少许,放入炒锅中,例入海米及泡过的水,加精盐少许,加盖用中火,煮5分钟后加入味精,浇上麻油,盛盘上桌。
恩,基本上差不多,我的金钩白条也做好了,味道着实不错。
不过由于茭白含有较多的草酸,会导致钙质不容易被人体所吸收,凡患肾脏疾病、尿路结石或尿中草酸盐类结晶较多者,不宜多食。
看来孕妇也不宜多食,尝尝鲜就可以了。
-The End-
Posted by eygle at 4:58 PM | Comments (7)
沾衣欲湿杏花雨 吹面不寒杨柳风
作者:eygle
出处:http://blog.eygle.com
昨天天气很好,暖暖的,感受到春天的气息。
忽然就想起了那首诗:
古木阴中系短篷,杖藜扶我过桥东。 沾衣欲湿杏花雨,吹面不寒杨柳风
这是中学时学过的《绝句》,出自《千家诗》,作者志南是南宋时和尚。
春天来了,是应该出去走走的季节了,建议大家多外出,不要待在家里,浪费了春光。
-The End-
Posted by eygle at 12:06 PM | Comments (15)
March 23, 2007
开卷《中国IT应用技术蓝皮书》
作者:eygle
出处:http://blog.eygle.com
上周去IT168,拿到了这本:中国IT应用技术蓝皮书。
这本书是ITPUB技术年会的成果,最主要的部分来自此前Itpub的一次大规模技术问卷调查,这些调查反映了当前IT领域的现状,经过分析后展现出来;第二部分包含会上专题演讲的内容;第三部分是年会的部分优秀论文选登。
我应该是第一批拿到这本书的,今天空下来仔细翻看,发现很多内容极具价值值得仔细阅读。
书中问卷分析部分,关于数据库的章节是我撰稿的,从数据分析中我得到了很多有价值的信息;第二部分包含我的一个讲稿;第三部分包含我的一篇分析文章。
这些文章都没有在本站出现过,以后有空贴出来。
这本书的电子版可以在网上下载得到:
http://www.itpub.net/732134.html
-The End-
Posted by eygle at 8:59 PM | Comments (2)
March 20, 2007
更改导出文件字符集的小工具
作者:eygle
出处:http://blog.eygle.com
想不到现在这种年代还有机会修改导出文件字符集。
于是试用了一下dcba的小工具dmp2utf8 。
您别说,还真是方便:
D:\OraDoc\OracleTools\dump2utf8>dmp2utf8.exe cnationtbl.dmp 256D:\OraDoc\OracleTools\dump2utf8>cat cnationtbl.dmp|od -t x1|head
0000000000 03 01 00 45 58 50 4F 52 54 3A 56 30 38 2E 30 30
0000000020 2E 30 35 0A 55 4C 45 41 56 45 0A 52 54 41 42 4C
0000000040 45 53 0A 32 30 34 38 0A 30 0A 35 33 30 0A 34 30
0000000060 30 30 0A 00 01 00 01 00 01 00 20 20 20 20 20 20
0000000100 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
*
0000000140 20 20 20 20 20 20 20 20 54 75 65 20 4D 61 72 20
0000000160 32 30 20 31 36 3A 34 37 3A 33 33 20 32 30 30 37
0000000200 64 00 00 00 00 60 01 1F 0F 05 0B 0C 03 0C 0C 05
0000000220 04 05 0D 06 09 07 08 05 0E 05 06 05 0F 02 EC EBD:\OraDoc\OracleTools\dump2utf8>dmp2utf8.exe cnationtbl.dmp 852
D:\OraDoc\OracleTools\dump2utf8>cat cnationtbl.dmp|od -t x1|head
0000000000 03 03 54 45 58 50 4F 52 54 3A 56 30 38 2E 30 30
0000000020 2E 30 35 0A 55 4C 45 41 56 45 0A 52 54 41 42 4C
0000000040 45 53 0A 32 30 34 38 0A 30 0A 35 33 30 0A 34 30
0000000060 30 30 0A 00 01 00 01 00 01 00 20 20 20 20 20 20
0000000100 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
*
0000000140 20 20 20 20 20 20 20 20 54 75 65 20 4D 61 72 20
0000000160 32 30 20 31 36 3A 34 37 3A 33 33 20 32 30 30 37
0000000200 64 00 00 00 00 60 01 1F 0F 05 0B 0C 03 0C 0C 05
0000000220 04 05 0D 06 09 07 08 05 0E 05 06 05 0F 02 EC EB
特别是文件大的时候,手工修改效率就太低了,用dcba这个工具,很简单,还省了解释的麻烦,一条命令就搞定了。感谢dcba,哈哈!
-The End-
Posted by eygle at 5:27 PM | Comments (6)
March 19, 2007
收到Oracle ACE的名牌
作者:eygle
出处:http://blog.eygle.com
今天上午,收到了Oracle寄来的包裹,拆开来,里面包含了一个ACE的名牌,一件黑色的T恤衫。
-The End-
Posted by eygle at 9:03 PM | Comments (27)








