123
 123

Tip: 看不到本站引用 Flickr 的图片? 下载 Firefox Access Flickr 插件 | AD: 订阅 DBA notes --

2008-06-09 Mon

21:10 如何将Unix Time转换为系统时间 (2160 Bytes) » Oracle Life

©作者:eygle 发布在 eygle.com

Unix Time向常规时间转换,通过简单的javascript就可以实现,以下通过javascript脚本提供一个将Unix Time转换为系统时间的脚本.

转换 Unix timestamp 为 Date/time
(based on seconds since standard epoch of 1/1/1970)

UNIX TimeStamp:
 

相关文章|Related Articles

评论数量(0)|Add Comments

本文网址:

19:31 小议延迟事务的提交(三) (636 Bytes) » yangtingkun
描述事务与SET CONSTRAINTS语句的关系。小议延迟事务的提交(一):http://yangtingkun.itpub.net/post/468/463933小议延迟事务的提交(二):http://yangtingkun.itpub.net/post/468/463985上面一篇讨论了延迟事务对DDL隐式提交的影响,这里简单讨论一下事务与设置延迟约束的关系。首先设置延迟约束的语句不必是事务中的第一条语句:SQL> SELECT * FROM T;未选定行SQL> INSERT INTO T VALUES (1, 'A');已创建 1 行。SQL> SET CONSTRAINTS ALL DEFERRED;约束条件已设置。SQL> INSERT INTO T VALUES (1, 'B');已创建 1 行。这个例子中,在事...
18:02 Estimating Undo Space needed for LVM Snapshot (8331 Bytes) » MySQL Performance Blog

We know MySQL Backups using LVM are pretty cool (check out mylvmbackup) or MMM though it is quite typical LVM is not configurable properly to be usable for MySQL Backups.

Quite frequently I find LVM installed on the system but no free space left to be used as snapshot undo space, which means LVM is pretty much unusable for backups or required space is very small - created without good understanding on how much space do you need for undo.

LVM Snapshot works kind of like Multi Versioning in Innodb - when you write the new data the new version for the block is stored in undo space. When snapshot is being read if the block is being remapped it is read from the undo location.

The LVM Snapshots versioning is however different from database Multi Versioning because only one old version per snapshot is needed while in databases you often would have multiple old versions of row stored.

Such structure allows us to understand the overhead you can expect from LVM. Writes suffer the penalty when it is the first time block is written to since snapshot was created. In this case single write is transformed to 2 writes, however similar to Innodb DoubleWrite the overhead is not double - the blocks written to the snapshot can be buffered few blocks at once using relatively sequential IO. Also if you modify same block again there is almost no overhead, and there is no space requirements.

Another issue with LVM snapshot it may convert pretty much sequential IO done while scanning the files to somewhat random IO - because blocks which need to be read from undo space will require disk seek, unless they are buffered already. This means your backup speed can be slower than you would expect especially in case you have a lot of scattered modifications.

Now back to our question of space requirements for MySQL Backups using LVM. As you can see from the description above in theory this would be the set of data which gets at least one modification during the period of backup. This is simple, however how do you find that ?

One simple though not very reliable way is to look at VMSTAT or IOSTAT. Find out number of KB being written to the given LVM volume per second. Now keep in account Innodb double write buffer (so writes to Innodb tablespace are double) and the fact you are probably not writing completely different data all the time you can reduce this number. The half of that number is often good ballpark figure.
So if I see 10MB/sec written to device I would assume I need 5MB of undo space per second of backup. Now say my backup takes 1 hour which is 3600 second - This means 18GB worth of undo space should be enough. Though you may wish to give you some breathing space.

Of course depending on database or workload this may need to be adjusted. If you have 10GB database size (including logs etc) you will not need 18GB undo snapshot no matter how heavy IO is. Also if you know the IO pattern, say most of traffic comes from batch updates updating pretty much every page in 10GB table you can account for that as well.

If you want to get really accurate number you better to use your experience - run the backup and see how snapshot growths during the process so you can see how correct was your original estimates.

Assuming you have already some space allocated for LVM undo space and it is not overly large - what can you do to keep space requirements to minimum ?

First do not place logs in LVM, I mean binary logs, slow query log, general query log etc, if they get any serious traffic. You can use other techniques to get consistent binary logs in the backup and you do not want query log and general logs anyway. However DO place Innodb Log Files on the same LVM volume as you need them to be snapshoted at the same time as tablespaces. The logs are especially nasty because they are always expanded so if you get 10GB worth of logs during the time of backup you will need 10GB of undo space.

Second, limit batch activities - Backups are often done at night when server activity is minimal, but this is also the time when you might want to do maintainence or batch job, which well may require a lot of undo space. Running ALTER TABLE or OPTIMIZE TABLE will cause table rebuild and use a lot of space. Batch jobs such as recounting rating summary tables recreation etc are also possible trouble makers.

Third,Use dedicated LVM volume for MySQL Instance. This is good idea for many reason and control over snapshot size is yet another one. If you just have one “/” snapshot which holds everything you may get a lot of junk IO activity causing overhead and eating LVM undo space. For example MySQL on disk temporary files and tables can waste quite a lot of such space.

The last advice I would give on snapshot space estimation would be not to try to save too much on it. Hard drive space is often cheap these days and so it may be better of allocating a bit more space for LVM snapshot and having piece of mind. Also keep in mind you can allocate undo space for any physical volume - it does not have to be same 15K RPM RAID10 volume your data lives. It can be single SATA hard drive (and so you may be able to allow full database size for undo space without thinking). If such hard drive dies you will only use snapshot but not your data, so it is pretty safe.
Though of course you should consider performance overheads mentioned in such operation.

Actually exactly this configuration could be lifesaver if you have system with LVM setup but zero free space and you would like to setup replication for large database with little no - connect USB hard drive place LVM snapshot on it and you can copy your database without shutting down server. Though I would only recommend doing it “once” to migrate to the server with proper LVM configuration with no downtime as it is too fragile for every day use. If you can’t use USB hard drive - NBD (Network Block Device) or iSCSI would also work.


Entry posted by peter | No comment

Add to: delicious | digg | reddit | netscape | Google Bookmarks

17:03 提高执行力的4条途径 (5847 Bytes) » 生活帮-LifeBang

我们知道的路永远比走的路多,所以现在越来越多的企业和个人都开始关心执行力的问题,比如:企业咨询师说:“应用这项新的管理方法之后,企业效率将提高40%”,现在很少有决策者会为这句话买单,取而代之的是基层管理者的汇报:“新的流程和标准确实将我们的效率提高了40%”,听到这句话以后,决策者才会掏腰包付钱~

这说明了有了好的理念并不一定能带来好的效果,导致这种现象的原因是:执行力。

先把公司企业战略放到一边不谈,聊聊我们个人的执行力问题~

很多人都在按照GTD的方法组织自己的工作、生活,或者应该这样说:很多人都想用的方法去组织自己的工作、生活

方法本身并不复杂,只要掌握了五个水平流程(哪五个水平流程?)即可上手实施,但是却极少有人坚持下来,这里面原因是多方面的,比如说:

  1. 文化背景差异
  2. 生活习惯不同
  3. 执行力不强

等等,其中第一点和第二点都有很好的解决办法:比如GTD的朴素化、建立良好习惯等等。

今天主要和大家分享一下提高执行力的方法:

从简单的、小的事情做起

我们一开始可能没有那么强的毅力,也没有建立起好的习惯,但是我们可以从简单的、小的事情做起,来逐步达到我们的目的,举个例子来说:你给自己定下的目标是每天30个俯卧撑,可能一开始很难达到,那我们先从每天20个开始,每隔一个星期增加3个,这样一个月下来基本上就可以达到目标了。

还可以举个例子,你想改变你人际关系的现状:你可以先从定期给朋友打电话聊天沟通感情开始,给自己定一个计划,每天和一个朋友聊天5分钟,每周参加一次朋友的聚会,等等,相信几个月下来,你的人际关系一定可以得到改善。

不断提醒做事的目的

个人认为某些事情是靠目标驱动的,当我们有很明确的目标的时候,就会产生动力,产生执行力,因此可以采用在白板上写下目标,或者在桌面醒目位置写下目标的方法,不断的刺激自己、提醒自己,相信完成目标的力量会源源不断的产生。

和他人分享

与他人分享你的目标可以产生下面几个效果:

  • 相当于回顾一次产生这个目标的动机,达成目标的方法
  • 帮助你再次整理自己的思路
  • 或许他人恰好有非常好的经验,可以帮助你少走弯路
  • 或许他人有合适的人脉给你推荐

何乐而不为??

将任务分解

对于“今年家庭总收入比去年提高一倍”这样的目标能否达成我不置可否,但是最起码你这样写下你的目标失败的几率更大一些,如果你能将这个目标进行一次分解的话,相信会更有利于你的达成,或许你可以将它分解为“购买公共基金进行为期一年的投资”或者是“闲暇时间制作手工艺品在淘宝上售出获得收入”或者是“将另一套比较小的房子租赁出去”,当然,这只是任务分解的第一步,在往下走你需要考虑“哪只基金比较好?我需要具备哪些投资知识?什么时候是适当的买入时机?”等等等等。。。。总之分解的越细越好

标签:, ,

相关内容

12:40 What do I need to run a guest machine in fully virtualization mode? (2624 Bytes) » Red Hat Magazine

The processor must support Hardware-Assisted Virtual Machine (HVM).

To check if the processor supports HVM use the following command:

  • For Intel processors:
  •    grep -i vmx /proc/cpuinfo

  • For AMD processors:
  •    grep -i svm /proc/cpuinfo

  • If nothing returns, then fully virtualization guests will not run. 


In the BIOS verify virtualization is enabled:

  • To check if the BIOS is enabled, issue the following command:

       grep -i hvm /sys/hypervisor/properties/capabilities

  • If nothing returns; reboot the system and enable the BIOS, look for the setting relating to virtualization, HVM, VT, VMX or SVM.
  • The BIOS may contains different names for the virtualization setting; check the hardware manual or contact the hardware vendor for more details.

Red Hat’s customer service and support teams receive technical support questions from users all over the world. Red Hat technicians add the questions and answers to Red Hat Knowledgebase on a daily basis. Access to Red Hat Knowledgebase is free. Red Hat Magazine offers a preview into the Red Hat Knowledgebase by highlighting some of the most recent entries. The information provided in this article is for your information only. The origin of this information may be internal or external to Red Hat. While Red Hat attempts to verify the validity of this information before it is posted, Red Hat makes no express or implied claims to its validity.

09:15 智能狂拼测试版 (2576 Bytes) » Fenng's shared items in Google Reader

听说智能狂拼新版本已经进入半公开测试阶段,于是下载了080606的α版本。
整体来说存在不少问题,不建议安装使用:
1、界面方案不稳定,可能暂时出现缓冲行、状态栏、候选句子和字无法显示的问题;
2、自定义编码方案生成之后只能够删除重新生成,不能修改;
3、候选句子、模糊音功能暂时无效;
4、引号等标点的自动配对问题很多;
5、部分设置随机生效失效;
6、有的无关偏僻字会进入首选句子,比如 fou 出现了“不”,ru 出现了“女”,yu 出现了“吾”。

相比3.3的版本,目前看得到的改进点有:
1、Tab 进如英文输入状态之后也可以直接输入数字了,中英文数字标点混合输入的能力有了加强,相应的,切换是否显示候选数字的快捷键没有了;
2、支持通过邮箱同步配置,不过因为还是测试版,所以没有试用这个功能;
3、新增了声母定位和字母候选方式;
4、修正了3.3版本中普遍存在的“初始化错误”问题;
5、识别成功率有了提高。
其他新功能见这里(页面还没有做好)。


0条回复 | Trackback | Feed | Talk | Twitter | Flickr | 豆瓣 | 邮件联系 | 创作共用协议

05:32 解开PPLive之结 (2045 Bytes) » Fenng's shared items in Google Reader
当我从PPlive出来的时候,基本上是属于满怀怨恨的心情。今天,当我站在姚欣的角度,处理当年和我同样的情况时,只能说那时的我高调地过头。

不过对于处理这件事情的手法来说,姚欣更加符合一个决策人角色。当时的他快刀斩乱麻,及时制止更加恶化的情况出现。而我却抱着一丝侥幸,过多的给予和放纵导致出现不可挽回的局面。今天我还可以是姚欣的朋友,而我的处理不及时让和我演绎同样一个故事的角色抓狂,哪里还有朋友的情面?

同样的事情还是有一些本质区别,那时情况再怎么不好,我依然还是在努力做事;而发生这样情况的另一人却选择自暴自弃。

后来和PPLIVE的另一个创始人的长谈,联系这所有的事情,得出创业中几个避免忌讳的经验:

1,确定谁是领导核心;
2,不允许有男女朋友同时存在;
3,不可把感情拿到创业中,错误的事情关系再好也要及时处理,不可留有任何情面;
4,集中权力,不允许出现左右逢源的现象;
5,创业中不允许任何人有所松懈;
6,待遇必须按照实际能力与责任心成正比;
7,清除制造无谓事端,打小算盘的人;
8,创业合作者提供的不仅是资金与技术,每个人必须卓有成效地推动集体前进;
9,熟悉相关法律法规。

总之要强调的是,做企业不可参入任何个人感情因素。过多的放任,带来的不仅是整个企业的损失,更甚至于牵涉到法律问题。不可善小而不为,更不可恶小而为之,换到这个情景之中就是:不可因为认为很小的事情而不去做,更不可因为方便或无所谓而做。创业中的每一个细节都必须牢牢地把握,不可掉以轻心。
05:19 我爱杭州,我爱阿里巴巴 (3224 Bytes) » Fenng's shared items in Google Reader
刚刚看到中央9播的杭州千岛湖的旅游广告片,有感而发,写个小东西。

这几年,我去过杭州4次,第一次去就爱上了这个城市,每次去都有不同的收获。温润的空气、路边的法国梧桐、闹市区里面的西湖,口感新鲜的千岛湖啤酒,散落在城市中的水系,等等这一切都让我觉得非常美好。

2006年2月,第一次去,去参加阿里巴巴集团的年会。刚刚组建的团队,近于完美的氛围,一群刚刚彼此熟悉的年轻人一起坐火车到了杭州。2月的北京还是冬天,我们每个人穿着厚厚的衣服,急匆匆的在街上走来走去。2月的杭州已经春气盎然,在完成了公司的演出任务以后又参加了阿里巴巴集团的年会,团队感和归属感一直充溢在我们的心头。在2月温暖的春日阳光下,我们一起在西湖边上骑自行车,苏堤、白堤给我们的印象是那么深刻。那景色、那阳光、那欢乐,在一个近乎梦幻的团队氛围内就那么流淌着,每当想起那些时光,我总是感到无比幸福和怀念。在杭州,喝过这辈子到目前为止最爽的一顿酒,千岛湖啤酒合着温暖的团队让我彻夜未眠。吃过令人销魂的小笼包,知味观给我的印象也挺深刻。第一次来,对杭州还没有什么方向感,只能看着地图问问出租车司机。

2006年10月,第二次去,去参加第二节网志年会。这时候的我已经取得了一些进步,正在摸爬滚打中前行,这一次对杭州的感觉有些不同。白天1个人从会场跑出去逛街,晚上去西湖边上看音乐喷泉,往来于整个莫干山路,写下了上万字的流水帐。10月的杭州不是很热,第二次来杭州了,已经可以乘坐公共汽车出行,对杭州也有方向感了,这时候的杭州对我来说已经变的不陌生。

2008年3月,第三次去,去参加爱阿里巴巴集团的年会。这次去杭州的心情颇为复杂,我的团队也几经变化,06年一起的一次去杭州的很多同事已经离开,剩下的几个人已经混迹于不同的团队里,我们甚至住在了几个不同的酒店。但晚上仍然会聚集在一起,聊天、喝酒、逛西湖,另外这次还一起去了上海和苏州。由此可见、对杭州的了解已经不是一个过路人的层面了。这次去杭州很累,很多人都发了疯的互相联系和玩,我称为在底下“风起云涌”,浩二称为“80后的纠结”。这次去杭州,已经物是人非,西湖还在哪儿,温润的空气如常,千岛湖啤酒依旧,人和事情却变化了很多。

2008年5月,第四次去,去参加阿里巴巴集团的集体婚礼。终于如愿以偿和宝贝儿一起骑车逛了西湖,吃了销魂的小笼包,看了音乐喷泉,还在西湖上坐了船。

我相信,以后还会不止一次的去杭州,也许很多人都对杭州没有什么感觉,但我很喜欢这个城市。我爱杭州,我爱阿里巴巴。
04:08 一年过了一年 - 生日之日 (2069 Bytes) » Oracle Life

©作者:eygle 发布在 eygle.com

昨天,又过了一个生日,现在的感觉是时间流逝的飞快,儿子一天一天在长大,而我呢,就一天一天的老去了!

老婆为了给我庆祝生日,早早的就买好了保利剧院的两张票,《功夫诗-九卷》,这是保利剧院编排演出的一场戏,将功夫融入了舞蹈编排,通过声色光影的效果,美轮美奂的展现出来。感觉真的是非常精彩。

全剧的总导演叫 刘震,一头长发,结束的时候带领所有演员出来谢幕,现场掌声不断,气氛热烈而融洽。

那九卷的名字分别是:
《净》、《经》、《勤》、《灵》、《听》、《形》、《定》、《倾》、《境》

现场字幕的介绍有些蛇足,其实有这几个字就够了。

相关文章|Related Articles

评论数量(5)|Add Comments

本文网址:

2008-06-08 Sun

20:08 刚刚从广西桂林回来 » Fenng's shared items in Google Reader
17:39 xp安装了SP3以后无法更新的解决办法 » Fenng's shared items in Google Reader
14:53 Scientific Method » Oracle Scratchpad
03:39 上海过客 » NinGoo@Net
02:06 Generating lots of rows using connect by - safely! » Tanel Poder's blog: Core IT for geeks and pros
01:25 [经典重温](2005.02.26)中国农民真的更苦吗? » Fenng's shared items in Google Reader

2008-06-07 Sat

20:01 小议延迟事务的提交 » yangtingkun