<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet href='http://rss.ningoo.net/styles/feedsky1.xsl' type='text/xsl' ?><!--这是一个由Feedsy提供技术支持的Feed，为了提高读者阅读的体验，以及满足用户美化自己Feed的需要，我们设计了多种精美的Feed模板，提供给大家选择，所有最终呈现出来的样式，皆由用户自愿选择使用，未经许可，任何团体和个人，请不要擅自修改样式或者盗用，这是对于用户选择权的尊重。--><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:fs="http://www.feedsky.com/namespace/feed" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link href="http://rss.ningoo.net" type="application/rss+xml" rel="self"></atom:link><fs:self_link href="http://feed.feedsky.com/NinGoo" type="application/rss+xml"></fs:self_link><lastBuildDate>Fri, 05 Feb 2010 03:43:21 GMT</lastBuildDate><title>NinGoo.net</title><description>Just a simple oracle and MySQL DBA</description><image><url>http://www.feedsky.com/feed/NinGoo/sc/gif</url><title>NinGoo.net</title><link>http://www.ningoo.net</link></image><link>http://www.ningoo.net</link><sy:updatePeriod>hourly</sy:updatePeriod><sy:updateFrequency>1</sy:updateFrequency><language>en</language><pubDate>Fri, 05 Feb 2010 03:46:13 GMT</pubDate><item><title>dstat:一款简单直观的os实时监控工具</title><link>http://item.feedsky.com/~feedsky/NinGoo/~1461473/329708616/1237504/1/item.html</link><content:encoded>&lt;p&gt;Author:&lt;a href='http://www.ningoo.net'&gt;NinGoo&lt;/a&gt; posted on &lt;a href='http://www.ningoo.net/html/2010/dstat_os_monitor_tool.html'&gt;NinGoo.net&lt;/a&gt; &lt;a href='http://rss.ningoo.net'&gt;&lt;img style='border: 0pt none;' align='middle' src='http://www.feedsky.com/feed/NinGoo/sc/gif'&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;在&lt;a href=&quot;http://www.oschina.net/&quot;&gt;oschina&lt;/a&gt;上闲逛，发现一款不错的os实时监控工具&lt;a href=&quot;http://dag.wieers.com/home-made/dstat/&quot;&gt;dstat&lt;/a&gt;，整合了vmstat, iostat, ifstat, netstat等常见os监控工具的优点，输出的结果简单直观，并且结果可以保存到csv文件，这样再写一个简单的perl脚本，就能将os的主要监控信息一次性全部抓取出来，保存到监控数据库中用于分析展示。试用了一下觉得非常不错，因此在这里分享一下这个用python写的工具。&lt;/p&gt;
&lt;pre&gt;
$dstat
----total-cpu-usage---- -dsk/total- -net/total- ---paging-- ---system--
usr sys idl wai hiq siq| read  writ| recv  send|  in   out | int   csw
  2   0  98   0   0   0|  80k   54k|   0     0 | 335B  381B|1297  1301
 22   2  74   0   0   2|   0   416k| 621k  219k|   0     0 |1158    26k
 23   3  72   0   0   2|  64k  484k|  11k   11k|   0     0 |1109    30k
 21   3  75   0   0   2|4096B  416k|  77k   77k|   0     0 |2104    25k
 29   4  66   0   0   2|   0  1240k| 996k  425k|   0     0 |1350    28k
&lt;/pre&gt;
&lt;pre&gt;
$dstat -ta --output osstat.csv
-----time----- ----total-cpu-usage---- -dsk/total- -net/total- ---paging-- ---system--
  date/time   |usr sys idl wai hiq siq| read  writ| recv  send|  in   out | int   csw
05-02 11:37:08|  2   0  98   0   0   0|  80k   54k|   0     0 | 335B  381B|1297  1301
05-02 11:37:09| 16   4  78   0   0   3|   0  1404k|1478k  939k|   0     0 |4316    33k
05-02 11:37:10| 20   2  76   0   0   2|   0  1144k|1109k  828k|   0     0 |5653    28k
05-02 11:37:11| 13   2  83   0   0   2|   0   588k|2590k 1684k|   0     0 |4256    23k
&lt;/pre&gt;
&lt;pre&gt;
$dstat -h
Usage: dstat [-afv] [options..] [delay [count]]
Versatile tool for generating system resource statistics

Dstat options:
  -c, --cpu              enable cpu stats
     -C 0,3,total           include cpu0, cpu3 and total
  -d, --disk             enable disk stats
     -D total,hda           include hda and total
  -g, --page             enable page stats
  -i, --int              enable interrupt stats
     -I 5,eth2              include int5 and interrupt used by eth2
  -l, --load             enable load stats
  -m, --mem              enable memory stats
  -n, --net              enable network stats
     -N eth1,total          include eth1 and total
  -p, --proc             enable process stats
  -s, --swap             enable swap stats
     -S swap1,total         include swap1 and total
  -t, --time             enable time/date output
  -T, --epoch            enable time counter (seconds since epoch)
  -y, --sys              enable system stats
  --ipc                  enable ipc stats
  --lock                 enable lock stats
  --raw                  enable raw stats
  --tcp                  enable tcp stats
  --udp                  enable udp stats
  --unix                 enable unix stats

  -M stat1,stat2         enable external stats
     --mods stat1,stat2

  -a, --all              equals -cdngy (default)
  -f, --full             expand -C, -D, -I, -N and -S discovery lists
  -v, --vmstat           equals -pmgdsc -D total

  --integer              show integer values
  --nocolor              disable colors (implies --noupdate)
  --noheaders            disable repetitive headers
  --noupdate             disable intermediate updates
  --output file          write CSV output to file

  delay is the delay in seconds between each update
  count is the number of updates to display before exiting
  The default delay is 1 and count is unspecified (unlimited)
&lt;/pre&gt;
&lt;br/&gt;&lt;b&gt;Related Articles&lt;/b&gt;&lt;p&gt;&lt;ul class=&quot;related_post&quot;&gt;&lt;li&gt;&lt;a href=&quot;http://www.ningoo.net/html/2010/tbstat_a_tool_for_oracle_sysstat_realtime_monitor.html&quot; title=&quot;tbstat:实时监控数据库统计状态的小工具&quot;&gt;tbstat:实时监控数据库统计状态的小工具&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.ningoo.net/html/2009/use_jpgraph_for_database_monitor.html&quot; title=&quot;使用jpgraph绘制数据库监控图形&quot;&gt;使用jpgraph绘制数据库监控图形&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.ningoo.net/html/2009/use_oracle_regexp_monitor_database_session.html&quot; title=&quot;使用Oracle正则表达式监控应用到数据库的连接情况&quot;&gt;使用Oracle正则表达式监控应用到数据库的连接情况&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.ningoo.net/html/2009/how_to_monitor_stats_of_memcached.html&quot; title=&quot;如何监控MemCached的状态&quot;&gt;如何监控MemCached的状态&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.ningoo.net/html/2009/use_jquery_and_tablesorter_for_data_sort_and_pager.html&quot; title=&quot;用jQuery+Tablesorter实现客户端分页与排序&quot;&gt;用jQuery+Tablesorter实现客户端分页与排序&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.ningoo.net/html/2008/using_perl_monitor_database.html&quot; title=&quot;用Perl的hash数组实现个性化监控&quot;&gt;用Perl的hash数组实现个性化监控&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;PermLink:&lt;/b&gt; &lt;a href='http://www.ningoo.net/html/2010/dstat_os_monitor_tool.html'&gt;http://www.ningoo.net/html/2010/dstat_os_monitor_tool.html&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;a href='http://www.ningoo.net/html/2010/dstat_os_monitor_tool.html#comment'&gt;Add Comments(0)&lt;/a&gt;&lt;/b&gt; | &lt;b&gt;&lt;a href='http://twitter.com/NinGoo'&gt;Follow NinGoo@Twitter&lt;/a&gt;&lt;/b&gt; | &lt;b&gt;&lt;a href='http://www.google.com/ig/add?feedurl=http://rss.ningoo.net'&gt;Google Reader&lt;/a&gt;&lt;/b&gt;&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/329708616/NinGoo/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/NinGoo/~1461473/329708616/1237504/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/NinGoo/329708616/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/NinGoo/329708616/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</content:encoded><wfw:commentRss>http://www.ningoo.net/html/2010/dstat_os_monitor_tool.html/feed</wfw:commentRss><slash:comments>0</slash:comments><description>Author:NinGoo posted on NinGoo.net 在oschina上闲逛，发现一款不错的os实时监控工具dstat，整合了vmstat, iostat, ifstat, netstat等常见os监控工具的优点，输出的结果简单直观，并且结果可以保存到csv文件，这...&lt;img src=&quot;http://www1.feedsky.com/t1/329708616/NinGoo/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/NinGoo/~1461473/329708616/1237504/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/NinGoo/329708616/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/NinGoo/329708616/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><category>dstat</category><category>工具</category><category>python</category><category>监控</category><pubDate>Fri, 05 Feb 2010 11:43:21 +0800</pubDate><author>NinGoo</author><comments>http://www.ningoo.net/html/2010/dstat_os_monitor_tool.html#comments</comments><guid isPermaLink="false">http://www.ningoo.net/?p=1255</guid><dc:creator>NinGoo</dc:creator><fs:srclink>http://www.ningoo.net/html/2010/dstat_os_monitor_tool.html</fs:srclink><fs:srcfeed>http://www.ningoo.net/feed/</fs:srcfeed><fs:itemid>feedsky/NinGoo/~1461473/329708616/1237504</fs:itemid></item><item><title>PostgreSQL备份</title><link>http://item.feedsky.com/~feedsky/NinGoo/~1461473/329054237/1237504/1/item.html</link><content:encoded>&lt;p&gt;Author:&lt;a href='http://www.ningoo.net'&gt;NinGoo&lt;/a&gt; posted on &lt;a href='http://www.ningoo.net/html/2010/postgresql_backup.html'&gt;NinGoo.net&lt;/a&gt; &lt;a href='http://rss.ningoo.net'&gt;&lt;img style='border: 0pt none;' align='middle' src='http://www.feedsky.com/feed/NinGoo/sc/gif'&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;PostgreSQL也支持逻辑备库和物理备份两种方式。物理备份可以和Oracle一样实现联机热备份，并且同样也需要将数据库设置为归档模式。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;逻辑备份&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;PostgreSQL提供了pg_dump/pg_dumpall两个程序可以用来将数据dump成文本文件，实现数据的逻辑备份。使用不同的参数，可以将数据dump成PostgreSQL专用的数据格式(生成copy语句)或者标准SQL语句(生成insert语句)格式。恢复只需要简单的使用psql将文件执行一遍即可。另外也可以使用pg_restore工具来恢复数据。&lt;/p&gt;
&lt;p&gt;利用pg_dump备份test数据库(只有一张test表)，包括重建表的DDL语句，授权语句等所有信息，生成copy格式的文件：&lt;/p&gt;
&lt;pre&gt;
$ ./pg_dump test
--
-- PostgreSQL database dump
--
SET statement_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = off;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET escape_string_warning = off;
SET search_path = public, pg_catalog;
SET default_tablespace = '';
SET default_with_oids = false;
--
-- Name: test; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE test (
    i integer
);
ALTER TABLE public.test OWNER TO postgres;
--
-- Data for Name: test; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY test (i) FROM stdin;
1
2
\.
--
-- Name: public; Type: ACL; Schema: -; Owner: postgres
--
REVOKE ALL ON SCHEMA public FROM PUBLIC;
REVOKE ALL ON SCHEMA public FROM postgres;
GRANT ALL ON SCHEMA public TO postgres;
GRANT ALL ON SCHEMA public TO PUBLIC;
--
-- PostgreSQL database dump complete
--
&lt;/pre&gt;
&lt;p&gt;利用pg_dump备份test库，只保存数据，insert语句格式：&lt;/p&gt;
&lt;pre&gt;
[postgres@dbconsole bin]$ ./pg_dump --inserts -a test
--
-- PostgreSQL database dump
--
SET statement_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = off;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET escape_string_warning = off;
SET search_path = public, pg_catalog;
--
-- Data for Name: test; Type: TABLE DATA; Schema: public; Owner: postgres
--
INSERT INTO test VALUES (1);
INSERT INTO test VALUES (2);
--
-- PostgreSQL database dump complete
--
&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;物理备份&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;和Oracle一样，物理备份可以分为冷备份和热备份。冷备份就是将数据库实例关闭，然后直接复制data目录的所有文件，恢复时只需要将文件copy到data目录，无须利用日志(WAL&amp;#8211;Write-Ahead Logging）进行恢复。而热备份，则需要利用日志将数据库恢复到一致状态，因此需要先将数据库置于归档模式。&lt;/p&gt;
&lt;p&gt;PostgreSQL归档模式使用参数archive_mode控制，这是一个静态参数，修改postgresql.conf文件，加入如下参数，然后重启生效：&lt;/p&gt;
&lt;pre&gt;
archive_mode = on
archive_command = 'cp &quot;%p&quot; /u01/postgresql/arch/&quot;%f&quot;'
archive_timeout = 600
&lt;/pre&gt;
&lt;pre&gt;
postgres=# show archive_mode;
 archive_mode
--------------
 on
(1 row)
&lt;/pre&gt;
&lt;p&gt;由于postgresql没有归档进程，因此归档是通过外部命令(OS)完成的，archive_command用于指定该外部命令，具体格式请参考文档。如果是linux归档到本地，使用cp即可，如果是到远程，则可以使用scp或者rsync。archive_timeout强制N秒以后进行一次归档，这个和Oracle的archive_lag_target参数的作用一样。当然也可以手工进行日志切换：&lt;/p&gt;
&lt;pre&gt;
postgres=# select pg_switch_xlog();
 pg_switch_xlog
----------------
 0/7000000
(1 row)
&lt;/pre&gt;
&lt;p&gt;热备份前，需要先将数据库置于备份状态，这一点和Oracle的手工也备份也是一样的。该命令会导致一次checkpoint，可能在业务高峰期会带来一些压力和风险，因此备份还是需要安排在业务低谷期间执行比较稳妥。&lt;/p&gt;
&lt;pre&gt;
postgres=# select pg_start_backup('test_backup');
 pg_start_backup
-----------------
 0/8000020
(1 row)
&lt;/pre&gt;
&lt;p&gt;然后在os层面将data目录进行复制备份。完成后，再取消备份状态，该命令同时会执行一次日志切换，并进行归档，以保证热备份期间的日志都已经归档，保证恢复数据库到一致状态的所有日志都能从归档中找到：&lt;/p&gt;
&lt;pre&gt;
postgres=# select pg_stop_backup();
 pg_stop_backup
----------------
 0/8000088
(1 row)
&lt;/pre&gt;
&lt;p&gt;备份完成后，可以在归档目录找到一个记录了本次备份信息的文件：&lt;/p&gt;
&lt;pre&gt;
$ more 000000010000000000000008.00000020.backup
START WAL LOCATION: 0/8000020 (file 000000010000000000000008)
STOP WAL LOCATION: 0/8000088 (file 000000010000000000000008)
CHECKPOINT LOCATION: 0/8000020
START TIME: 2010-02-03 12:24:57 CST
LABEL: test_backup
STOP TIME: 2010-02-03 12:24:59 CST
&lt;/pre&gt;
&lt;p&gt;PostgreSQL官方并没有提供和Oracle的rman一样的备份工具，不过因为PostgreSQL是开源的数据库，因此也有一个开源的工具&lt;a href=&quot;http://code.google.com/p/pg-rman/wiki/readme&quot;&gt;pg_rman&lt;/a&gt;可以使用，从命令行来看功能已经非常强大，暂时还没有测试，有兴趣的可以研究一下。&lt;/p&gt;
&lt;pre&gt;
pg_rman [ OPTIONS ] { init | backup | restore | show [ DATE | timeline ] |
 validate [ DATE ] | delete DATE }
&lt;/pre&gt;
&lt;br/&gt;&lt;b&gt;Related Articles&lt;/b&gt;&lt;p&gt;&lt;ul class=&quot;related_post&quot;&gt;&lt;li&gt;&lt;a href=&quot;http://www.ningoo.net/html/2010/installpostgresql.html&quot; title=&quot;PostgreSQL安装&quot;&gt;PostgreSQL安装&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.ningoo.net/html/2010/introduce_to_postgresql.html&quot; title=&quot;PostgreSQL简介&quot;&gt;PostgreSQL简介&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.ningoo.net/html/2008/lvm2_powerpath_and_found_duplicate_pv.html&quot; title=&quot;lvm2与powerpath的Found duplicate PV问题&quot;&gt;lvm2与powerpath的Found duplicate PV问题&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.ningoo.net/html/2008/buy_canon_450d.html&quot; title=&quot;入手Canon 450D&quot;&gt;入手Canon 450D&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.ningoo.net/html/2008/wow_movie_tales_of_the_past.html&quot; title=&quot;震撼推荐：魔兽史诗巨作《远古传说3》&quot;&gt;震撼推荐：魔兽史诗巨作《远古传说3》&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.ningoo.net/html/2009/xtradb_storage_engine.html&quot; title=&quot;XtraDB存储引擎&quot;&gt;XtraDB存储引擎&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;PermLink:&lt;/b&gt; &lt;a href='http://www.ningoo.net/html/2010/postgresql_backup.html'&gt;http://www.ningoo.net/html/2010/postgresql_backup.html&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;a href='http://www.ningoo.net/html/2010/postgresql_backup.html#comment'&gt;Add Comments(0)&lt;/a&gt;&lt;/b&gt; | &lt;b&gt;&lt;a href='http://twitter.com/NinGoo'&gt;Follow NinGoo@Twitter&lt;/a&gt;&lt;/b&gt; | &lt;b&gt;&lt;a href='http://www.google.com/ig/add?feedurl=http://rss.ningoo.net'&gt;Google Reader&lt;/a&gt;&lt;/b&gt;&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/329054237/NinGoo/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/NinGoo/~1461473/329054237/1237504/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/NinGoo/329054237/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/NinGoo/329054237/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</content:encoded><wfw:commentRss>http://www.ningoo.net/html/2010/postgresql_backup.html/feed</wfw:commentRss><slash:comments>0</slash:comments><description>Author:NinGoo posted on NinGoo.net PostgreSQL也支持逻辑备库和物理备份两种方式。物理备份可以和Oracle一样实现联机热备份，并且同样也需要将数据库设置为归档模式。
逻辑备份
PostgreSQL提供了pg_dump/pg_...&lt;img src=&quot;http://www1.feedsky.com/t1/329054237/NinGoo/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/NinGoo/~1461473/329054237/1237504/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/NinGoo/329054237/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/NinGoo/329054237/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><category>pg_rman</category><category>备份</category><category>数据库</category><category>postgresql</category><category>pg_dump</category><pubDate>Wed, 03 Feb 2010 12:31:55 +0800</pubDate><author>NinGoo</author><comments>http://www.ningoo.net/html/2010/postgresql_backup.html#comments</comments><guid isPermaLink="false">http://www.ningoo.net/?p=1240</guid><dc:creator>NinGoo</dc:creator><fs:srclink>http://www.ningoo.net/html/2010/postgresql_backup.html</fs:srclink><fs:srcfeed>http://www.ningoo.net/feed/</fs:srcfeed><fs:itemid>feedsky/NinGoo/~1461473/329054237/1237504</fs:itemid></item><item><title>PostgreSQL安装</title><link>http://item.feedsky.com/~feedsky/NinGoo/~1461473/329054238/1237504/1/item.html</link><content:encoded>&lt;p&gt;Author:&lt;a href='http://www.ningoo.net'&gt;NinGoo&lt;/a&gt; posted on &lt;a href='http://www.ningoo.net/html/2010/installpostgresql.html'&gt;NinGoo.net&lt;/a&gt; &lt;a href='http://rss.ningoo.net'&gt;&lt;img style='border: 0pt none;' align='middle' src='http://www.feedsky.com/feed/NinGoo/sc/gif'&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;PostgreSQL8.x版本的安装已经非常的简单了。EnterpriseDB制作了一键安装的版本，包括FreeBSD/Linux/Mac OS X/Solaris/Windows平台都有。不过即使使用源码编译，也非常的简单。各个版本的源码可以点&lt;a href=&quot;http://www.postgresql.org/ftp/source/&quot;&gt;这里下载&lt;/a&gt;。&lt;/p&gt;
&lt;p&gt;创建os用户&lt;/p&gt;
&lt;pre&gt;
#useradd -g dba postgres
#su - postgres
&lt;/pre&gt;
&lt;p&gt;编译&lt;/p&gt;
&lt;pre&gt;
$tar -zxvf postgresql-8.4.2.tar.gz
$cd postgresql-8.4.2
$./configure --prefix=/OPT/postgresql --enable-profiling --with-blocksize=8 --with-wal-blocksize=8
$make &amp;#038;&amp;#038; make install
&lt;/pre&gt;
&lt;p&gt;其中with-blocksize指定数据块大小，默认8k，with-wal-blocksize指定日志块大小，默认也是8k。更多编译配置选项，可以通过./configure &amp;#8211;help查看。&lt;/p&gt;
&lt;p&gt;初始化database，注意PostgreSQL在服务端不支持GBK编码。&lt;/p&gt;
&lt;pre&gt;
$cd /opt/postgresql/bin
$ ./initdb --encoding=utf8 -D /opt/postgresql/data
The files belonging to this database system will be owned by user &quot;postgres&quot;.
This user must also own the server process.

The database cluster will be initialized with locale en_US.UTF-8.
The default text search configuration will be set to &quot;english&quot;.

creating directory /opt/postgresql/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 32MB
creating configuration files ... ok
creating template1 database in /opt/postgresql/data/base/1 ... ok
initializing pg_authid ... ok
initializing dependencies ... ok
creating system views ... ok
loading system objects' descriptions ... ok
creating conversions ... ok
creating dictionaries ... ok
setting privileges on built-in objects ... ok
creating information schema ... ok
vacuuming database template1 ... ok
copying template1 to template0 ... ok
copying template1 to postgres ... ok

WARNING: enabling &quot;trust&quot; authentication for local connections
You can change this by editing pg_hba.conf or using the -A option the
next time you run initdb.

Success. You can now start the database server using:

    ./postgres -D /opt/postgresql/data
or
    ./pg_ctl -D /opt/postgresql/data -l logfile start
&lt;/pre&gt;
&lt;p&gt;初始化完成后，会在 /opt/postgresql/data目录生成数据库的文件，至此，软件安装完毕，数据库创建完毕。&lt;/p&gt;
&lt;p&gt;启动数据库&lt;/p&gt;
&lt;pre&gt;
./pg_ctl -D /opt/postgresql/data/ -l /opt/postgresql/log/alert.log start
&lt;/pre&gt;
&lt;p&gt;启动后，可以发现PostgreSQL实例一共运行了5个进程&lt;/p&gt;
&lt;pre&gt;
$ ps -ef | grep postgres
postgres 17572     1  0 16:41 pts/2    00:00:00 /opt/postgresql/bin/postgres
-D /opt/postgresql/data
postgres 17574 17572  0 16:41 ?        00:00:00 postgres: writer process
postgres 17575 17572  0 16:41 ?        00:00:00 postgres: wal writer process
postgres 17576 17572  0 16:41 ?        00:00:00 postgres: autovacuum launcher process
postgres 17577 17572  0 16:41 ?        00:00:00 postgres: stats collector process
postgres 18679 20791  0 16:47 pts/2    00:00:00 grep postgres
&lt;/pre&gt;
&lt;p&gt;其中wal writer process是日志写进程。&lt;/p&gt;
&lt;br/&gt;&lt;b&gt;Related Articles&lt;/b&gt;&lt;p&gt;&lt;ul class=&quot;related_post&quot;&gt;&lt;li&gt;&lt;a href=&quot;http://www.ningoo.net/html/2010/postgresql_backup.html&quot; title=&quot;PostgreSQL备份&quot;&gt;PostgreSQL备份&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.ningoo.net/html/2010/introduce_to_postgresql.html&quot; title=&quot;PostgreSQL简介&quot;&gt;PostgreSQL简介&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.ningoo.net/html/2010/anchang_and_qiaobo_ice_snow_world.html&quot; title=&quot;安昌古镇与乔波冰雪世界&quot;&gt;安昌古镇与乔波冰雪世界&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.ningoo.net/html/2008/memcached_and_mysql_use_cache.html&quot; title=&quot;缓存为王：Memcached和MySQL的结合应用&quot;&gt;缓存为王：Memcached和MySQL的结合应用&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.ningoo.net/html/2009/config_oracle11gr2_data_guard.html&quot; title=&quot;搭建Oracle11gR2 DataGuard&quot;&gt;搭建Oracle11gR2 DataGuard&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.ningoo.net/html/2007/ju_zhu_zheng.html&quot; title=&quot;暂住证？居住证？身份证？&quot;&gt;暂住证？居住证？身份证？&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;PermLink:&lt;/b&gt; &lt;a href='http://www.ningoo.net/html/2010/installpostgresql.html'&gt;http://www.ningoo.net/html/2010/installpostgresql.html&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;a href='http://www.ningoo.net/html/2010/installpostgresql.html#comment'&gt;Add Comments(4)&lt;/a&gt;&lt;/b&gt; | &lt;b&gt;&lt;a href='http://twitter.com/NinGoo'&gt;Follow NinGoo@Twitter&lt;/a&gt;&lt;/b&gt; | &lt;b&gt;&lt;a href='http://www.google.com/ig/add?feedurl=http://rss.ningoo.net'&gt;Google Reader&lt;/a&gt;&lt;/b&gt;&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/329054238/NinGoo/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/NinGoo/~1461473/329054238/1237504/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/NinGoo/329054238/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/NinGoo/329054238/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</content:encoded><wfw:commentRss>http://www.ningoo.net/html/2010/installpostgresql.html/feed</wfw:commentRss><slash:comments>4</slash:comments><description>Author:NinGoo posted on NinGoo.net PostgreSQL8.x版本的安装已经非常的简单了。EnterpriseDB制作了一键安装的版本，包括FreeBSD/Linux/Mac OS X/Solaris/Windows平台都有。不过即使使用源码编译，也非常的简单。各个...&lt;img src=&quot;http://www1.feedsky.com/t1/329054238/NinGoo/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/NinGoo/~1461473/329054238/1237504/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/NinGoo/329054238/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/NinGoo/329054238/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><category>数据库</category><category>postgresql</category><pubDate>Sat, 23 Jan 2010 22:35:10 +0800</pubDate><author>NinGoo</author><comments>http://www.ningoo.net/html/2010/installpostgresql.html#comments</comments><guid isPermaLink="false">http://www.ningoo.net/?p=1230</guid><dc:creator>NinGoo</dc:creator><fs:srclink>http://www.ningoo.net/html/2010/installpostgresql.html</fs:srclink><fs:srcfeed>http://www.ningoo.net/feed/</fs:srcfeed><fs:itemid>feedsky/NinGoo/~1461473/329054238/1237504</fs:itemid></item><item><title>PostgreSQL简介</title><link>http://item.feedsky.com/~feedsky/NinGoo/~1461473/329054239/1237504/1/item.html</link><content:encoded>&lt;p&gt;Author:&lt;a href='http://www.ningoo.net'&gt;NinGoo&lt;/a&gt; posted on &lt;a href='http://www.ningoo.net/html/2010/introduce_to_postgresql.html'&gt;NinGoo.net&lt;/a&gt; &lt;a href='http://rss.ningoo.net'&gt;&lt;img style='border: 0pt none;' align='middle' src='http://www.feedsky.com/feed/NinGoo/sc/gif'&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;上个周末，无聊的时候关注了一下PostgreSQL。第一次尝试去安装PostgreSQL，还是好几年前的事了，那是8.0版本刚出来，终于开始原生的支持windows了，所以在自己电脑上折腾了一个。不过那时候也仅限于安装了一次而已，甚至psql的命令行都不知道怎么用。&lt;/p&gt;
&lt;p&gt;同样作为开源关系型数据库，MySQL在这几年获得了更多的关注。大量的互联网公司都基于MySQL来构架系统，也导致MySQL DBA开始火热，一大堆年轻有为的同学投入到其中，渐成燎原之势。MySQL数据库火热了，MySQL AB公司却被&lt;a href=&quot;http://www.ningoo.net/html/2008/sun_acquires_mysql.html&quot;&gt;sun收购&lt;/a&gt;，现在又随着sun要投入Oracle的怀抱，而且欧盟已经无条件批准这个收购，只剩下中国和俄罗斯，大局已定。作为商业数据库的绝对老大，Oracle的这次收购，让MySQL的支持者感到了威胁，其创始人甚至发起了一场&lt;a href=&quot;http://monty-says.blogspot.com/2009/12/help-saving-mysql.html&quot;&gt;保护MySQL&lt;/a&gt;（有墙），阻击Oracle收购的运动。&lt;/p&gt;
&lt;p&gt;这也是PostgreSQL的机会，最近PostgreSQL的开发节奏很快，8.5已经连续出到了alpha3版，在这个版本中，最吸引我的是&lt;strong&gt;hot standby&lt;/strong&gt;，类似于Oracle11g的active data guard，hot standby也可以在恢复的同时提供读服务，而以往版本，PostgreSQL的物理备库&lt;strong&gt;warm standby&lt;/strong&gt;，则只能处于恢复状态，一旦open，则需要重做，比较痛苦。PostgreSQL的很多特性，都和Oracle相当的类似，甚至有一家商业化的公司&lt;strong&gt;EnterpriseDB&lt;/strong&gt;，在致力于将PostgreSQL打包，使得应用程序从Oracle迁移到PostgreSQL更方便，据说80%的Oracle应用代码甚至不需要做修改就能在PostgreSQL运行。因此，我在&lt;a href=&quot;http://twitter.com/NinGoo&quot;&gt;twitter&lt;/a&gt;上说，如果PostgreSQL在人机交互的工具和配置部分，能够更加友好一点，完全是一个影子版本的Oracle。&lt;/p&gt;
&lt;p&gt;PostgreSQL也支持mvcc多版本一致性控制。不过其实现的机制，和innodb的方式比较像，而和Oracle的不一样。Oracle是将变化的前映像记录到单独的undo段中，而PostgreSQL则只是将前映像(Tuples)上做个标记，如果是delete，则相当于是逻辑删除，实际的数据还是在原来的段中，如果是insert，相当于先delete，再insert，而且会在原来的记录上加一条指向新记录的指针，形成一个链表，查询的时候需要沿着这个链表找到一致的数据。这样会造成一个问题，一段时间以后，dml操作使得数据段和索引段中都有大量的前映像信息存在，会严重影响数据查询的效率。PostgreSQL的mvcc的这种实现方式，带来的一个好处是回滚非常快，只需要修改前映像上的几个标志位即可，而不像oracle需要从undo段将前映像再复制回来。但是，这种方便回滚，却会损失查询性能的设计思路，真的比较诡异。PostgreSQL中有一个专门用来清理这些旧版本数据的程序，叫做vacuum。在以前的版本中，需要定期执行vacuum来优化数据存储结构。这对于DBA来说，无疑是一件痛苦的事情。直到8.1版本，引入了&lt;a href=&quot;http://www.pgsqldb.org/pgsqldoc-cvs/maintenance.html#AUTOVACUUM&quot;&gt;autovacuum&lt;/a&gt;，系统可以自动来进行这些清理工作，终于人性化了一点点。&lt;/p&gt;
&lt;p&gt;在8.3版本，引入了一个新的特性HOT(Heap Only Tuples)，主要的目的是努力避免update造成的性能低下的问题。其实这个HOT，说白了很简单，对于update，要实现mvcc，其机制还是一样的，区别在于select，在沿着链表找一致性数据的过程中，如果发现这个检查过的版本已经没有任何事物在引用了，就会顺便把清理工作做掉，而不是像以前要等vacuum来做。因此这会加大一点select的压力，但前人栽树，后人乘凉，接下来需要访问这些数据的其他select就会快很多了，这和Oracle的延迟块清除其实有些类似的，当然两者的设计目的并不一样。&lt;/p&gt;
&lt;br/&gt;&lt;b&gt;Related Articles&lt;/b&gt;&lt;p&gt;&lt;ul class=&quot;related_post&quot;&gt;&lt;li&gt;&lt;a href=&quot;http://www.ningoo.net/html/2010/postgresql_backup.html&quot; title=&quot;PostgreSQL备份&quot;&gt;PostgreSQL备份&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.ningoo.net/html/2010/installpostgresql.html&quot; title=&quot;PostgreSQL安装&quot;&gt;PostgreSQL安装&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.ningoo.net/html/2009/mysql_replication_fatal_error_1236.html&quot; title=&quot;遭遇MySQL Replication Fatal Error 1236&quot;&gt;遭遇MySQL Replication Fatal Error 1236&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.ningoo.net/html/2009/gearman-for-mysql.html&quot; title=&quot;Gearman for MySQL&quot;&gt;Gearman for MySQL&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.ningoo.net/html/2009/about_innodb_thread_concurrency.html&quot; title=&quot;InnoDB线程并发检查机制&quot;&gt;InnoDB线程并发检查机制&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.ningoo.net/html/2009/xtradb_enhancements_in_show-innodb-status.html&quot; title=&quot;从show innodb status看XtraDB的增强特性&quot;&gt;从show innodb status看XtraDB的增强特性&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;PermLink:&lt;/b&gt; &lt;a href='http://www.ningoo.net/html/2010/introduce_to_postgresql.html'&gt;http://www.ningoo.net/html/2010/introduce_to_postgresql.html&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;a href='http://www.ningoo.net/html/2010/introduce_to_postgresql.html#comment'&gt;Add Comments(4)&lt;/a&gt;&lt;/b&gt; | &lt;b&gt;&lt;a href='http://twitter.com/NinGoo'&gt;Follow NinGoo@Twitter&lt;/a&gt;&lt;/b&gt; | &lt;b&gt;&lt;a href='http://www.google.com/ig/add?feedurl=http://rss.ningoo.net'&gt;Google Reader&lt;/a&gt;&lt;/b&gt;&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/329054239/NinGoo/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/NinGoo/~1461473/329054239/1237504/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/NinGoo/329054239/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/NinGoo/329054239/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</content:encoded><wfw:commentRss>http://www.ningoo.net/html/2010/introduce_to_postgresql.html/feed</wfw:commentRss><slash:comments>4</slash:comments><description>Author:NinGoo posted on NinGoo.net 上个周末，无聊的时候关注了一下PostgreSQL。第一次尝试去安装PostgreSQL，还是好几年前的事了，那是8.0版本刚出来，终于开始原生的支持windows了，所以在自己电脑上折...&lt;img src=&quot;http://www1.feedsky.com/t1/329054239/NinGoo/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/NinGoo/~1461473/329054239/1237504/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/NinGoo/329054239/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/NinGoo/329054239/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><category>MySQL</category><category>EnterpriseDB</category><category>数据库</category><category>postgresql</category><pubDate>Sat, 23 Jan 2010 11:18:46 +0800</pubDate><author>NinGoo</author><comments>http://www.ningoo.net/html/2010/introduce_to_postgresql.html#comments</comments><guid isPermaLink="false">http://www.ningoo.net/?p=1221</guid><dc:creator>NinGoo</dc:creator><fs:srclink>http://www.ningoo.net/html/2010/introduce_to_postgresql.html</fs:srclink><fs:srcfeed>http://www.ningoo.net/feed/</fs:srcfeed><fs:itemid>feedsky/NinGoo/~1461473/329054239/1237504</fs:itemid></item><item><title>tbstat:实时监控数据库统计状态的小工具</title><link>http://item.feedsky.com/~feedsky/NinGoo/~1461473/329054240/1237504/1/item.html</link><content:encoded>&lt;p&gt;Author:&lt;a href='http://www.ningoo.net'&gt;NinGoo&lt;/a&gt; posted on &lt;a href='http://www.ningoo.net/html/2010/tbstat_a_tool_for_oracle_sysstat_realtime_monitor.html'&gt;NinGoo.net&lt;/a&gt; &lt;a href='http://rss.ningoo.net'&gt;&lt;img style='border: 0pt none;' align='middle' src='http://www.feedsky.com/feed/NinGoo/sc/gif'&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;用perl写了一个简单的工具，用于实时查看数据库的统计状态信息，展现信息主要来源于Oracle数据字典中v$systat和v$system_event。写这个工具的初衷，是因为目前我们对于数据库的监控，更多的是分钟级别抽样的数据来绘制的图形，粒度相对还比较粗，有一些比较深的问题，需要更加细粒度的数据。而如果把监控的粒度做到秒级，则收集的数据量就会非常大，因此需要一个平衡，平时采用分钟级别的抽样数据已经足够用于预警，而秒级的则用于某个具体问题的分析。&lt;/p&gt;
&lt;p&gt;当前tbstat功能还比较简单，类似于iostat/vmstat等os工具，tbstat可以通过指定抽样间隔和抽样次数，来循环抓取Oracle的统计状态信息。tbstat支持三个参数 -i 表示间隔时间 -c 表示循环次数 -n 表示需要查看的统计信息的名字(使用前后%的like来查询) &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;tbstat -i 2 -c 10 表示间隔时间2s，循环次数10次，展示经过人工筛选的36项统计信息&lt;/li&gt;
&lt;li&gt;tbstat -i 2 -c 10 -n parse 表示间隔时间2s，循环次数10次，展示所有名字包含parse的统计信息&lt;/li&gt;
&lt;li&gt;tbstat -i 2 -c 10 -n all 表示间隔时间2s，循环次数10次，展示所有不为零的统计信息&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;也可以使用简化的参数输入方法，第一位表示间隔时间，第二位表示循环次数，第三位表示统计信息名。直接敲入tbstat，则默认的参数为间隔时间10s，次数无限，经过挑选过滤的一些常用的v$sysstat中的统计信息。如果name参数传入的值是event，则展示v$system_event中的等待事件的信息。&lt;/p&gt;
&lt;pre&gt;
$tbstat 1 0
--------------------------------------------------------------------------
-- tbstat v0.3.3 --- a tool for oracle system statistics and event.
-- Powered by NinGoo.net
--------------------------------------------------------------------------                      

               CPU used by this session:     40                       CR blocks created:       5
        DBWR checkpoint buffers written:    569                  DBWR undo block writes:      64
 bytes received via SQL*Net from client: 314297        bytes sent via SQL*Net to client: 2761660
  cleanouts only - consistent read gets:      4                         consistent gets:   48855
                       db block changes:   2122                           db block gets:    3714
                       enqueue requests:    900                           enqueue waits:       7
                          execute count:   3145                   free buffer requested:    1402
         index crx upgrade (positioned):      3            index fast full scans (full):       0
                 leaf node 90-10 splits:      0                        leaf node splits:       0
                      logons cumulative:      1                  parse count (failures):       0
                     parse count (hard):      0                          physical reads:    1546
          physical reads cache prefetch:      0                         physical writes:     603
                              redo size: 618436                         redo synch time:      16
                      redo synch writes:    181                         redo write time:      15
                            redo writes:    174   rollbacks only - consistent read gets:       0
                           sorts (disk):      0                          sorts (memory):     259
              table scans (long tables):      0              table scans (short tables):       9
                  transaction rollbacks:      0                            user commits:     182
&lt;/pre&gt;
&lt;pre&gt;
$tbstat 1 0 event
-------------------------------------------------------------------------------
-- tbstat v0.3.3 --- a tool for oracle system statistics and event.
-- Powered by NinGoo.net
-------------------------------------------------------------------------------              

                   Event Name:   waits   time                       Event Name: waits   time
--------------------------------------------------------------------------------------------
      LGWR wait for redo copy:       1   0.01    SQL*Net more data from client:   151  19.95
  SQL*Net more data to client:    1218   0.01                buffer busy waits:     2   0.01
  control file parallel write:       1   0.51     control file sequential read:     1   0.26
                cursor: pin S:       0   0.00          cursor: pin S wait on X:     0   0.00
        db file parallel read:       0   0.00           db file parallel write:     0   0.00
       db file scattered read:       0   0.00          db file sequential read:  2040   3.43
             direct path read:     269   0.71            direct path read temp:     0   0.00
            direct path write:      23   0.26           direct path write temp:     0   0.00
         enq: CF - contention:       0   0.00             enq: HW - contention:     7   9.00
         enq: SQ - contention:       0   0.00     enq: TX - allocate ITL entry:     0   0.00
   enq: TX - index contention:       0   0.00    enq: TX - row lock contention:     0   0.00
                   latch free:       0   0.00      latch: cache buffers chains:     0   0.00
         latch: library cache:       0   0.00              latch: redo writing:     0   0.00
    latch: session allocation:       0   0.00               library cache lock:     0   0.00
             log buffer space:       0   0.00          log file parallel write:   145   0.60
     log file sequential read:     145   0.53       log file switch completion:     0   0.00
                log file sync:     147   0.78                os thread startup:     0   0.00
        read by other session:       0   0.00                   row cache lock:     0   0.00
       undo segment extension:       0   0.00
&lt;/pre&gt;
&lt;p&gt;如果输入的name是精确匹配到只有一条统计信息的，会在后面打印出间隔时间内排名前10的sid的值。利用此功能，可以很方便的抓到造成某些统计信息异常的会话和SQL语句，会话和SQL信息是通过关联v$session来获取的。因此需要注意，如果统计信息对应的事件持续时间很短，从v$session里抓取到的sql可能并不是造成统计信息升高的罪魁祸首，但是sid一般来说还是准确的，因为应用采用的大多是连接池来连接数据库的，因此还是可以更具sid和machine信息来看看造成异常的是哪个具体的应用。&lt;/p&gt;
&lt;p&gt;例如，全表扫描一般会导致physical reads cache prefetch等待事件，因此可以通过查看该事件对应的top sid来获得具体的语句，当然，不是所有的physical reads cache prefetch都是全表扫描导致的，因此对于获得的结果，还需要DBA根据具体情况做进一步分析：&lt;/p&gt;
&lt;pre&gt;
$tbstat 1 0 'physical reads cache prefetch'
-------------------------------------------------------------------------------
-- tbstat v0.3.3 --- a tool for oracle system statistics and event.
-- Powered by NinGoo.net
-------------------------------------------------------------------------------
 physical reads cache prefetch:         526                             

              sid        value     %              machine         sql_id
       ----------  ----------- -----  ------------------- --------------
             2928          302  69.7               test11  79db58a3dg921
             4902           67  15.5               test71  79db58a3dg921
             4821           64  14.8               test33  3afdq50xt03ch
             4544            0   0.0               test54  3afdq50xt03ch
             1801            0   0.0               test06  79db58a3dg921
             2830            0   0.0               test12  79db58a3dg921
              898            0   0.0               test09  4n7675hwwcndc
             1031            0   0.0               test16  79db58a3dg921
              463            0   0.0               test04  3afdq50xt03ch
             1364            0   0.0               test08 cq749u66x06uj
             1408            0   0.0               test27  39rbqj3ck76w3
              722            0   0.0               test37  26hdkf07336uf
&lt;/pre&gt;
&lt;p&gt;当然，tbstat只是一个用于抽取统计状态的小工具而已，如果要用于故障诊断，则还是要求DBA对于v$systat和v$system_event中各种统计和事件非常的熟悉。tbstat使用了DBD::Oracle以sysdba身份来连接数据库，因此需要为Perl安装DBI和DBD::Oracle模块，并且在数据库服务器本机上执行。如果你对于这个工具有兴趣，可以&lt;a href=&quot;http://www.ningoo.net/software/tbstat&quot;&gt;在这里下载源代码&lt;/a&gt;，使用过程中，如果有什么建议和需求，欢迎告诉我。&lt;/p&gt;
&lt;br/&gt;&lt;b&gt;Related Articles&lt;/b&gt;&lt;p&gt;&lt;ul class=&quot;related_post&quot;&gt;&lt;li&gt;&lt;a href=&quot;http://www.ningoo.net/html/2009/use_oracle_regexp_monitor_database_session.html&quot; title=&quot;使用Oracle正则表达式监控应用到数据库的连接情况&quot;&gt;使用Oracle正则表达式监控应用到数据库的连接情况&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.ningoo.net/html/2010/dstat_os_monitor_tool.html&quot; title=&quot;dstat:一款简单直观的os实时监控工具&quot;&gt;dstat:一款简单直观的os实时监控工具&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.ningoo.net/html/2009/use_jpgraph_for_database_monitor.html&quot; title=&quot;使用jpgraph绘制数据库监控图形&quot;&gt;使用jpgraph绘制数据库监控图形&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.ningoo.net/html/2009/bbed_and_oracle_data_block_structure.html&quot; title=&quot;使用BBED帮助理解Oracle数据块结构&quot;&gt;使用BBED帮助理解Oracle数据块结构&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.ningoo.net/html/2009/how_to_link_oracle_bbed_tools.html&quot; title=&quot;安装使用BBED&quot;&gt;安装使用BBED&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.ningoo.net/html/2009/ora-600_4000_affter_redo_corruption.html&quot; title=&quot;记一次redo损坏导致ora-600[4000]的恢复&quot;&gt;记一次redo损坏导致ora-600[4000]的恢复&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;PermLink:&lt;/b&gt; &lt;a href='http://www.ningoo.net/html/2010/tbstat_a_tool_for_oracle_sysstat_realtime_monitor.html'&gt;http://www.ningoo.net/html/2010/tbstat_a_tool_for_oracle_sysstat_realtime_monitor.html&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;a href='http://www.ningoo.net/html/2010/tbstat_a_tool_for_oracle_sysstat_realtime_monitor.html#comment'&gt;Add Comments(9)&lt;/a&gt;&lt;/b&gt; | &lt;b&gt;&lt;a href='http://twitter.com/NinGoo'&gt;Follow NinGoo@Twitter&lt;/a&gt;&lt;/b&gt; | &lt;b&gt;&lt;a href='http://www.google.com/ig/add?feedurl=http://rss.ningoo.net'&gt;Google Reader&lt;/a&gt;&lt;/b&gt;&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/329054240/NinGoo/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/NinGoo/~1461473/329054240/1237504/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/NinGoo/329054240/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/NinGoo/329054240/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</content:encoded><wfw:commentRss>http://www.ningoo.net/html/2010/tbstat_a_tool_for_oracle_sysstat_realtime_monitor.html/feed</wfw:commentRss><slash:comments>9</slash:comments><description>Author:NinGoo posted on NinGoo.net 用perl写了一个简单的工具，用于实时查看数据库的统计状态信息，展现信息主要来源于Oracle数据字典中v$systat和v$system_event。写这个工具的初衷，是因为目前我们对于...&lt;img src=&quot;http://www1.feedsky.com/t1/329054240/NinGoo/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/NinGoo/~1461473/329054240/1237504/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/NinGoo/329054240/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/NinGoo/329054240/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><category>工具</category><category>oracle</category><category>统计信息</category><category>监控</category><category>tbstat</category><pubDate>Mon, 11 Jan 2010 14:11:22 +0800</pubDate><author>NinGoo</author><comments>http://www.ningoo.net/html/2010/tbstat_a_tool_for_oracle_sysstat_realtime_monitor.html#comments</comments><guid isPermaLink="false">http://www.ningoo.net/?p=1202</guid><dc:creator>NinGoo</dc:creator><fs:srclink>http://www.ningoo.net/html/2010/tbstat_a_tool_for_oracle_sysstat_realtime_monitor.html</fs:srclink><fs:srcfeed>http://www.ningoo.net/feed/</fs:srcfeed><fs:itemid>feedsky/NinGoo/~1461473/329054240/1237504</fs:itemid></item><item><title>安昌古镇与乔波冰雪世界</title><link>http://item.feedsky.com/~feedsky/NinGoo/~1461473/329054241/1237504/1/item.html</link><content:encoded>&lt;p&gt;Author:&lt;a href='http://www.ningoo.net'&gt;NinGoo&lt;/a&gt; posted on &lt;a href='http://www.ningoo.net/html/2010/anchang_and_qiaobo_ice_snow_world.html'&gt;NinGoo.net&lt;/a&gt; &lt;a href='http://rss.ningoo.net'&gt;&lt;img style='border: 0pt none;' align='middle' src='http://www.feedsky.com/feed/NinGoo/sc/gif'&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;元旦小假，第一天窝在家里，睡到自然醒，醒到自然睡，好好的放纵了一整天。2号一大早就赶到东站，出发去绍兴柯桥，计划去乔波冰雪世界滑雪，晚上则夜宿安昌古镇。&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;“乔波冰雪世界”是由前速滑世界冠军叶乔波女士倡导，清华科技园（启迪控股）投资建设，为我国唯一一家以室内滑雪为主、酒店（住宿、会议、餐饮、娱乐）为辅的综合性高档运动休闲场所。公司目标是成为我国运动与休闲产业的行业巨人。“绍兴乔波冰雪世界”是“乔波冰雪世界”在全国范围内的连锁企业之一，于 2009年10月初隆重开业。&lt;/p&gt;
&lt;p&gt;公司坐落于国家AAAA级风景名胜“浙江省绍兴县鉴湖-柯岩风景区”内，南傍山北依水。项目总投资超过4亿元，建筑面积逾6万㎡。以大型室内滑雪馆、真冰溜冰场为主，并配套四星级会议休闲酒店，是一家集四季滑雪、溜冰、旅游、会议、餐饮、度假、娱乐为一体的综合性运动休闲场所。&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;结果11点多到的时候，人满为患，滑雪服等用具已经被先到的人一扫而空，无奈之下，只能临时改变计划，先去安昌，第二天再赶个大早过来，反正买的是全天票，正好可以多玩点时间。3号早上9点赶到，刚开门没几个人，玩的更high。&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;http://pic.yupoo.com/ningoo/345178a5704a/medium.jpg&quot; alt=&quot;乔波冰雪世界&quot; /&gt;&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;位于浙江省绍兴县安昌镇，始建于北宋时期，后因战乱，多次焚毁，又于明清时期重建，其建筑风格传承了典型的江南水乡特色，一依带水，古朴典雅，为浙江省重点历史保护地，其特产安昌腊肠、扯白糖远近闻名，具有水乡风情的水上婚礼也是别具特色。&lt;/p&gt;
&lt;p&gt;安昌镇南靠柯桥，北邻杭甬高速公路，是一个具有千年历史的典型江南水乡古镇。境内现存白洋新石器时代越族先民遗址。相传大禹曾在镇东涂山娶妻成家。公元896年，钱镠奉唐王朝之命屯兵该地平董昌之乱，因命其乡为安昌。现存老街始建于明成化、弘治年间，数百年来，棉、布、米集散旺盛，蔚为越北大市重镇。抗战前夕尚有商号933家，是城区外市集之最。&lt;/p&gt;
&lt;p&gt;安昌明清老街依河而建，全长1747米，至今保存完好。粼粼河水，石板街路，错落有致的翻轩骑楼，传统特色的店铺作坊，姿态各异的拱桥石梁，古老凝重的台门，幽深僻静的弄堂，风貌古朴典雅，无不体现出浓浓的水乡特色。&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;安昌也可以算是典型的江南水乡古镇，可惜河水已经是惨不忍睹，不知何年能重见清清河水沿街流，小小乌篷河上游的写意画卷了。到达的时候沿街人声鼎沸，熙熙攘攘，可以说无趣。唯一可让人怀念的，则是满街满门口挂的腊肠，确实名不虚传。&lt;br /&gt;
&lt;img src=&quot;http://pic.yupoo.com/ningoo/117768a56827/xdhbebbi.jpg&quot; alt=&quot;安昌古镇&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;http://pic.yupoo.com/ningoo/281778a56c05/qipo22zn.jpg&quot; alt=&quot;安昌古镇&quot; /&gt;&lt;/p&gt;
&lt;p&gt;第二天从乔波冰雪世界出来已经是下午2点，精疲力尽的赶到轻纺城汽车站，不幸的是回杭州的班车最早的也要到5点多了。最后四个人一咬牙，决定倒公交车回去，先从柯桥坐到萧山，再在萧山转301到武林小广场，一路辗转，到家已是晚上6点。&lt;/p&gt;
&lt;br/&gt;&lt;b&gt;Related Articles&lt;/b&gt;&lt;p&gt;&lt;ul class=&quot;related_post&quot;&gt;&lt;li&gt;&lt;a href=&quot;http://www.ningoo.net/html/2010/my_2010_plan.html&quot; title=&quot;2010，风生水起&quot;&gt;2010，风生水起&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.ningoo.net/html/2009/my_2009_never_gone_with_wind.html&quot; title=&quot;往事不会随风-记我的2009&quot;&gt;往事不会随风-记我的2009&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.ningoo.net/html/2009/get_usa_vis.html&quot; title=&quot;签证是个体力活&quot;&gt;签证是个体力活&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.ningoo.net/html/2009/welcome_to_change.html&quot; title=&quot;拥抱变化&quot;&gt;拥抱变化&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.ningoo.net/html/2009/2009_07_22_total_solar_eclipse.html&quot; title=&quot;日全食&quot;&gt;日全食&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.ningoo.net/html/2009/zong_guan_xian_hangzhou.html&quot; title=&quot;纵贯线，老男人的春天&quot;&gt;纵贯线，老男人的春天&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;PermLink:&lt;/b&gt; &lt;a href='http://www.ningoo.net/html/2010/anchang_and_qiaobo_ice_snow_world.html'&gt;http://www.ningoo.net/html/2010/anchang_and_qiaobo_ice_snow_world.html&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;a href='http://www.ningoo.net/html/2010/anchang_and_qiaobo_ice_snow_world.html#comment'&gt;Add Comments(3)&lt;/a&gt;&lt;/b&gt; | &lt;b&gt;&lt;a href='http://twitter.com/NinGoo'&gt;Follow NinGoo@Twitter&lt;/a&gt;&lt;/b&gt; | &lt;b&gt;&lt;a href='http://www.google.com/ig/add?feedurl=http://rss.ningoo.net'&gt;Google Reader&lt;/a&gt;&lt;/b&gt;&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/329054241/NinGoo/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/NinGoo/~1461473/329054241/1237504/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/NinGoo/329054241/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/NinGoo/329054241/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</content:encoded><wfw:commentRss>http://www.ningoo.net/html/2010/anchang_and_qiaobo_ice_snow_world.html/feed</wfw:commentRss><slash:comments>3</slash:comments><description>Author:NinGoo posted on NinGoo.net 元旦小假，第一天窝在家里，睡到自然醒，醒到自然睡，好好的放纵了一整天。2号一大早就赶到东站，出发去绍兴柯桥，计划去乔波冰雪世界滑雪，晚上则夜宿安昌...&lt;img src=&quot;http://www1.feedsky.com/t1/329054241/NinGoo/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/NinGoo/~1461473/329054241/1237504/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/NinGoo/329054241/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/NinGoo/329054241/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><category>安昌</category><category>乔波冰雪世界</category><category>滑雪</category><category>life</category><category>杂记</category><pubDate>Mon, 04 Jan 2010 22:32:58 +0800</pubDate><author>NinGoo</author><comments>http://www.ningoo.net/html/2010/anchang_and_qiaobo_ice_snow_world.html#comments</comments><guid isPermaLink="false">http://www.ningoo.net/?p=1196</guid><dc:creator>NinGoo</dc:creator><fs:srclink>http://www.ningoo.net/html/2010/anchang_and_qiaobo_ice_snow_world.html</fs:srclink><fs:srcfeed>http://www.ningoo.net/feed/</fs:srcfeed><fs:itemid>feedsky/NinGoo/~1461473/329054241/1237504</fs:itemid></item><item><title>2010，风生水起</title><link>http://item.feedsky.com/~feedsky/NinGoo/~1461473/329054242/1237504/1/item.html</link><content:encoded>&lt;p&gt;Author:&lt;a href='http://www.ningoo.net'&gt;NinGoo&lt;/a&gt; posted on &lt;a href='http://www.ningoo.net/html/2010/my_2010_plan.html'&gt;NinGoo.net&lt;/a&gt; &lt;a href='http://rss.ningoo.net'&gt;&lt;img style='border: 0pt none;' align='middle' src='http://www.feedsky.com/feed/NinGoo/sc/gif'&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;无可奈何的，到了2010，无可奈何的，三十而立。无可奈何花落去，似曾相识燕归来，当年背得烂熟的诗，年少轻狂未解其意，而今嚼来一声叹息。&lt;/p&gt;
&lt;p&gt;酸气倒完，生活继续。2009年，总体来说，虽有诸多不如意处，也做了不少事，有了不少改变。与己，逐步完成转变，从技术一线开始尝试学习团队管理；与事，数据库整体还算稳定，无奈Q4因为各种原因有点晚节不保，由此也可以看出任重道远，还有很多事情需要去做。一个人做好，一个团队做好，一个部门做好，一个公司做好，挑战各有不同，诚如古人言，修身，治家，齐国，平天下，境界不同，或许可以类比。2009年，挣扎彷徨在个人技术能力与团队之间，结果技术能力没有多大增长，团队管理也不尽如人意，这是硬伤，2010年，这两个方面需要平衡好，最大的挑战。&lt;/p&gt;
&lt;p&gt;2010，我的wishlist，实际上主要三点昨天也在&lt;a href=&quot;http://twitter.com/NinGoo&quot;&gt;twitter&lt;/a&gt;上唠叨过了：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;技术上远离一线操作，更需要精研深入，Oracle和MySQL方面至少各看一到两本好书&lt;/li&gt;
&lt;li&gt;英语，年年念叨，年年没进步，2010，希望能达到初步口语沟通&lt;/li&gt;
&lt;li&gt;技术之外，看十本书，小说，历史，经管，皆可&lt;/li&gt;
&lt;li&gt;拿到驾照，2009年4月份就报考，却一直没有去练车，拖到2010，必须完成&lt;/li&gt;
&lt;li&gt;拿到房子，准备装修。房子交付在2010年底，估计也只能是先做准备&lt;/li&gt;
&lt;li&gt;写一本书，总结这两年Oracle的经验。如果2010年再不写，估计就再也写不出来了&lt;/li&gt;
&lt;li&gt;买一辆车，不需要太好，代步足矣&lt;/li&gt;
&lt;li&gt;至少出国旅游一次，已经定了4月去东南亚的行程，应该靠谱。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;希望我的2010，搅他个风生水起。待明年今日，再细数往事前程。&lt;/p&gt;
&lt;br/&gt;&lt;b&gt;Related Articles&lt;/b&gt;&lt;p&gt;&lt;ul class=&quot;related_post&quot;&gt;&lt;li&gt;&lt;a href=&quot;http://www.ningoo.net/html/2010/anchang_and_qiaobo_ice_snow_world.html&quot; title=&quot;安昌古镇与乔波冰雪世界&quot;&gt;安昌古镇与乔波冰雪世界&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.ningoo.net/html/2009/my_2009_never_gone_with_wind.html&quot; title=&quot;往事不会随风-记我的2009&quot;&gt;往事不会随风-记我的2009&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.ningoo.net/html/2009/get_usa_vis.html&quot; title=&quot;签证是个体力活&quot;&gt;签证是个体力活&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.ningoo.net/html/2009/welcome_to_change.html&quot; title=&quot;拥抱变化&quot;&gt;拥抱变化&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.ningoo.net/html/2009/2009_07_22_total_solar_eclipse.html&quot; title=&quot;日全食&quot;&gt;日全食&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.ningoo.net/html/2009/zong_guan_xian_hangzhou.html&quot; title=&quot;纵贯线，老男人的春天&quot;&gt;纵贯线，老男人的春天&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;PermLink:&lt;/b&gt; &lt;a href='http://www.ningoo.net/html/2010/my_2010_plan.html'&gt;http://www.ningoo.net/html/2010/my_2010_plan.html&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;a href='http://www.ningoo.net/html/2010/my_2010_plan.html#comment'&gt;Add Comments(7)&lt;/a&gt;&lt;/b&gt; | &lt;b&gt;&lt;a href='http://twitter.com/NinGoo'&gt;Follow NinGoo@Twitter&lt;/a&gt;&lt;/b&gt; | &lt;b&gt;&lt;a href='http://www.google.com/ig/add?feedurl=http://rss.ningoo.net'&gt;Google Reader&lt;/a&gt;&lt;/b&gt;&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/329054242/NinGoo/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/NinGoo/~1461473/329054242/1237504/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/NinGoo/329054242/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/NinGoo/329054242/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</content:encoded><wfw:commentRss>http://www.ningoo.net/html/2010/my_2010_plan.html/feed</wfw:commentRss><slash:comments>7</slash:comments><description>Author:NinGoo posted on NinGoo.net 无可奈何的，到了2010，无可奈何的，三十而立。无可奈何花落去，似曾相识燕归来，当年背得烂熟的诗，年少轻狂未解其意，而今嚼来一声叹息。
酸气倒完，生活继...&lt;img src=&quot;http://www1.feedsky.com/t1/329054242/NinGoo/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/NinGoo/~1461473/329054242/1237504/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/NinGoo/329054242/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/NinGoo/329054242/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><category>2010</category><category>life</category><category>杂记</category><pubDate>Fri, 01 Jan 2010 11:58:59 +0800</pubDate><author>NinGoo</author><comments>http://www.ningoo.net/html/2010/my_2010_plan.html#comments</comments><guid isPermaLink="false">http://www.ningoo.net/?p=1188</guid><dc:creator>NinGoo</dc:creator><fs:srclink>http://www.ningoo.net/html/2010/my_2010_plan.html</fs:srclink><fs:srcfeed>http://www.ningoo.net/feed/</fs:srcfeed><fs:itemid>feedsky/NinGoo/~1461473/329054242/1237504</fs:itemid></item><item><title>往事不会随风-记我的2009</title><link>http://item.feedsky.com/~feedsky/NinGoo/~1461473/329054243/1237504/1/item.html</link><content:encoded>&lt;p&gt;Author:&lt;a href='http://www.ningoo.net'&gt;NinGoo&lt;/a&gt; posted on &lt;a href='http://www.ningoo.net/html/2009/my_2009_never_gone_with_wind.html'&gt;NinGoo.net&lt;/a&gt; &lt;a href='http://rss.ningoo.net'&gt;&lt;img style='border: 0pt none;' align='middle' src='http://www.feedsky.com/feed/NinGoo/sc/gif'&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;这一年，二零零九，二十九年的记忆朦胧&lt;br /&gt;
这一年，不再孤独，惦记回家是一种幸福&lt;br /&gt;
这一年，成为房奴，空中楼阁没有交付&lt;br /&gt;
这一年，远渡重洋，第一次亲游异国大陆&lt;br /&gt;
这一年，调整变化，来如朝露去无踪&lt;br /&gt;
这一年，风起云涌，墙内墙外变幻不同&lt;br /&gt;
这一年，爬山喝茶，遍走杭城青峰&lt;br /&gt;
这一年，二零零九，往事不会飘散随风&lt;/p&gt;
&lt;br/&gt;&lt;b&gt;Related Articles&lt;/b&gt;&lt;p&gt;&lt;ul class=&quot;related_post&quot;&gt;&lt;li&gt;&lt;a href=&quot;http://www.ningoo.net/html/2009/first_of_2009.html&quot; title=&quot;2009，先声夺人&quot;&gt;2009，先声夺人&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.ningoo.net/html/2010/anchang_and_qiaobo_ice_snow_world.html&quot; title=&quot;安昌古镇与乔波冰雪世界&quot;&gt;安昌古镇与乔波冰雪世界&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.ningoo.net/html/2010/my_2010_plan.html&quot; title=&quot;2010，风生水起&quot;&gt;2010，风生水起&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.ningoo.net/html/2009/get_usa_vis.html&quot; title=&quot;签证是个体力活&quot;&gt;签证是个体力活&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.ningoo.net/html/2009/welcome_to_change.html&quot; title=&quot;拥抱变化&quot;&gt;拥抱变化&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.ningoo.net/html/2009/2009_07_22_total_solar_eclipse.html&quot; title=&quot;日全食&quot;&gt;日全食&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;PermLink:&lt;/b&gt; &lt;a href='http://www.ningoo.net/html/2009/my_2009_never_gone_with_wind.html'&gt;http://www.ningoo.net/html/2009/my_2009_never_gone_with_wind.html&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;a href='http://www.ningoo.net/html/2009/my_2009_never_gone_with_wind.html#comment'&gt;Add Comments(5)&lt;/a&gt;&lt;/b&gt; | &lt;b&gt;&lt;a href='http://twitter.com/NinGoo'&gt;Follow NinGoo@Twitter&lt;/a&gt;&lt;/b&gt; | &lt;b&gt;&lt;a href='http://www.google.com/ig/add?feedurl=http://rss.ningoo.net'&gt;Google Reader&lt;/a&gt;&lt;/b&gt;&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/329054243/NinGoo/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/NinGoo/~1461473/329054243/1237504/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/NinGoo/329054243/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/NinGoo/329054243/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</content:encoded><wfw:commentRss>http://www.ningoo.net/html/2009/my_2009_never_gone_with_wind.html/feed</wfw:commentRss><slash:comments>5</slash:comments><description>Author:NinGoo posted on NinGoo.net 这一年，二零零九，二十九年的记忆朦胧
这一年，不再孤独，惦记回家是一种幸福
这一年，成为房奴，空中楼阁没有交付
这一年，远渡重洋，第一次亲游异国大陆
...&lt;img src=&quot;http://www1.feedsky.com/t1/329054243/NinGoo/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/NinGoo/~1461473/329054243/1237504/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/NinGoo/329054243/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/NinGoo/329054243/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><category>2009</category><category>life</category><category>杂记</category><pubDate>Wed, 30 Dec 2009 22:54:49 +0800</pubDate><author>NinGoo</author><comments>http://www.ningoo.net/html/2009/my_2009_never_gone_with_wind.html#comments</comments><guid isPermaLink="false">http://www.ningoo.net/?p=1184</guid><dc:creator>NinGoo</dc:creator><fs:srclink>http://www.ningoo.net/html/2009/my_2009_never_gone_with_wind.html</fs:srclink><fs:srcfeed>http://www.ningoo.net/feed/</fs:srcfeed><fs:itemid>feedsky/NinGoo/~1461473/329054243/1237504</fs:itemid></item><item><title>使用jpgraph绘制数据库监控图形</title><link>http://item.feedsky.com/~feedsky/NinGoo/~1461473/329054244/1237504/1/item.html</link><content:encoded>&lt;p&gt;Author:&lt;a href='http://www.ningoo.net'&gt;NinGoo&lt;/a&gt; posted on &lt;a href='http://www.ningoo.net/html/2009/use_jpgraph_for_database_monitor.html'&gt;NinGoo.net&lt;/a&gt; &lt;a href='http://rss.ningoo.net'&gt;&lt;img style='border: 0pt none;' align='middle' src='http://www.feedsky.com/feed/NinGoo/sc/gif'&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;对于数据库的监控，可以分成两种类型，一种是实时的错误告警，需要尽快将一些错误信息发送给相关责任人，这更多的属于救火的性质。另外一种就是关键指标历史趋势的展示和分析，可以帮助DBA更加直观的发现数据库的指标的异常波动，提前发现问题。&lt;/p&gt;
&lt;p&gt;市面上有不少商品的数据库监控产品，数据库厂商们也在不遗余力的推广自己的解决方案，其中不乏优秀的东西，不过能做到多产品兼容、可扩展伸缩和高度可定制的产品就凤毛麟角了。所以很多公司会自己开发一些数据库监控产品，不求大而全，只要能满足自己的业务需求就足矣。&lt;/p&gt;
&lt;p&gt;对于自己开发的轻量级监控产品，使用LAMP等开源产品是比较合适的。数据的抽取和告警的发送，可以使用shell或者perl，几个简单的脚本就可以实现，放在crontab里定期跑跑就行，监控数据库使用MySQL存放，如果需要实现高可用的监控，考虑一下冗余，MySQL可以使用Master-Master Replication。而展示可以使用php等搭建一个简单的web网站，成本不高，效率很高。&lt;/p&gt;
&lt;p&gt;对于历史趋势的展示，图形绘制是必须的，一图胜千言。如果使用的是PHP，&lt;a href=&quot;http://www.aditus.nu/jpgraph/&quot;&gt;jpgraph&lt;/a&gt;或者是&lt;a href=&quot;http://pchart.sourceforge.net/&quot;&gt;pChart&lt;/a&gt;都是不错的选择。相对而言，jpgraph的文档和开发都还在不断的丰富，最新版本3.0.6发布于2009-10-10，而pChart的最新版本则是2008-10-06发布的1.27d，因此建议使用jpgraph。如果使用java来架构监控网站，则&lt;a href=&quot;http://www.anysql.net&quot;&gt;anysql&lt;/a&gt;的&lt;a href=&quot;http://www.dbatools.net/mytools/webchart-feature-overview.html&quot;&gt;DataReport&lt;/a&gt;是值得推荐的一款产品，简单易上手，功能很强大很邪恶。&lt;/p&gt;
&lt;p&gt;扯的有点远了，回到这篇文章的标题。jpgraph只是一个图形绘制的库，如果需要比较方便的用于数据库监控中，最好在上面再封装一层，以实现根据SQL语句查询的结果集自动绘制图形，这样可以更方便的做到批量化的增加关键指标的图形展示。另外，jpgraph对于中文的支持，因为使用了truetype字体的关系，有一点点复杂，需要从windows复制c:\windows\fonts\simsun.ttc和c:\windows\fonts\simhei.ttc到linux的/usr/share/fonts/truetype目录。jpgraph默认会将所有的中文转化成UTF8字符，如果数据库和web使用的是gb2312，则这个转化会导致乱码，解决办法是修改&lt;strong&gt;jpgraph_ttf.inc.php&lt;/strong&gt;，注释掉转化部分的代码：&lt;/p&gt;
&lt;pre&gt;
     /*   elseif( $aFF === FF_SIMSUN ) {
            // Do Chinese conversion
            if( $this-&gt;g2312 == null ) {
                include_once 'jpgraph_gb2312.php' ;
                $this-&gt;g2312 = new GB2312toUTF8();
            }
            return $this-&gt;g2312-&gt;gb2utf8($aTxt);
        }*/
&lt;/pre&gt;
&lt;p&gt;绘制图形时，在需要使用中文的地方，显式的调用字体设置函数，将字体设置为simsun，即可正确的显示中文：&lt;/p&gt;
&lt;pre&gt;
$graph-&gt;title-&gt;SetFont(FF_SIMSUN,FS_BOLD);
$graph-&gt;title-&gt;Set(&quot;中文测试&quot;);
&lt;/pre&gt;
&lt;p&gt;最后，贴两张用jpgraph绘制的Oracle数据库监控效果图：&lt;br /&gt;
&lt;img src=&quot;http://pic.yupoo.com/ningoo/3703988d4951/f5qv3ypm.jpg&quot; alt=&quot;sql_executions&quot; width=&quot;480&quot; height=&quot;200&quot; border=&quot;0&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;http://pic.yupoo.com/ningoo/4557588d4951/ndnpb506.jpg&quot; alt=&quot;sequential_reads&quot; width=&quot;480&quot; height=&quot;200&quot; border=&quot;0&quot; /&gt;&lt;/p&gt;
&lt;br/&gt;&lt;b&gt;Related Articles&lt;/b&gt;&lt;p&gt;&lt;ul class=&quot;related_post&quot;&gt;&lt;li&gt;&lt;a href=&quot;http://www.ningoo.net/html/2009/use_jquery_and_tablesorter_for_data_sort_and_pager.html&quot; title=&quot;用jQuery+Tablesorter实现客户端分页与排序&quot;&gt;用jQuery+Tablesorter实现客户端分页与排序&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.ningoo.net/html/2010/dstat_os_monitor_tool.html&quot; title=&quot;dstat:一款简单直观的os实时监控工具&quot;&gt;dstat:一款简单直观的os实时监控工具&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.ningoo.net/html/2010/tbstat_a_tool_for_oracle_sysstat_realtime_monitor.html&quot; title=&quot;tbstat:实时监控数据库统计状态的小工具&quot;&gt;tbstat:实时监控数据库统计状态的小工具&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.ningoo.net/html/2009/use_oracle_regexp_monitor_database_session.html&quot; title=&quot;使用Oracle正则表达式监控应用到数据库的连接情况&quot;&gt;使用Oracle正则表达式监控应用到数据库的连接情况&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.ningoo.net/html/2009/how_to_monitor_stats_of_memcached.html&quot; title=&quot;如何监控MemCached的状态&quot;&gt;如何监控MemCached的状态&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.ningoo.net/html/2009/use_memcached_in_php.html&quot; title=&quot;在PHP使用MemCached&quot;&gt;在PHP使用MemCached&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;PermLink:&lt;/b&gt; &lt;a href='http://www.ningoo.net/html/2009/use_jpgraph_for_database_monitor.html'&gt;http://www.ningoo.net/html/2009/use_jpgraph_for_database_monitor.html&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;a href='http://www.ningoo.net/html/2009/use_jpgraph_for_database_monitor.html#comment'&gt;Add Comments(5)&lt;/a&gt;&lt;/b&gt; | &lt;b&gt;&lt;a href='http://twitter.com/NinGoo'&gt;Follow NinGoo@Twitter&lt;/a&gt;&lt;/b&gt; | &lt;b&gt;&lt;a href='http://www.google.com/ig/add?feedurl=http://rss.ningoo.net'&gt;Google Reader&lt;/a&gt;&lt;/b&gt;&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/329054244/NinGoo/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/NinGoo/~1461473/329054244/1237504/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/NinGoo/329054244/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/NinGoo/329054244/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</content:encoded><wfw:commentRss>http://www.ningoo.net/html/2009/use_jpgraph_for_database_monitor.html/feed</wfw:commentRss><slash:comments>5</slash:comments><description>Author:NinGoo posted on NinGoo.net 对于数据库的监控，可以分成两种类型，一种是实时的错误告警，需要尽快将一些错误信息发送给相关责任人，这更多的属于救火的性质。另外一种就是关键指标历史...&lt;img src=&quot;http://www1.feedsky.com/t1/329054244/NinGoo/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/NinGoo/~1461473/329054244/1237504/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/NinGoo/329054244/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/NinGoo/329054244/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><category>工具</category><category>php</category><category>jpgraph</category><category>监控</category><pubDate>Thu, 17 Dec 2009 14:40:45 +0800</pubDate><author>NinGoo</author><comments>http://www.ningoo.net/html/2009/use_jpgraph_for_database_monitor.html#comments</comments><guid isPermaLink="false">http://www.ningoo.net/?p=1170</guid><dc:creator>NinGoo</dc:creator><fs:srclink>http://www.ningoo.net/html/2009/use_jpgraph_for_database_monitor.html</fs:srclink><fs:srcfeed>http://www.ningoo.net/feed/</fs:srcfeed><fs:itemid>feedsky/NinGoo/~1461473/329054244/1237504</fs:itemid></item><item><title>NoSQL，关系数据库终结者？</title><link>http://item.feedsky.com/~feedsky/NinGoo/~1461473/329054245/1237504/1/item.html</link><content:encoded>&lt;p&gt;Author:&lt;a href='http://www.ningoo.net'&gt;NinGoo&lt;/a&gt; posted on &lt;a href='http://www.ningoo.net/html/2009/nosql_teminator_of_rdbms.html'&gt;NinGoo.net&lt;/a&gt; &lt;a href='http://rss.ningoo.net'&gt;&lt;img style='border: 0pt none;' align='middle' src='http://www.feedsky.com/feed/NinGoo/sc/gif'&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;作为一个DBA，几年走过来，工作中历经MS SQL Server 2000/2005，Oracle9i/10g/11g，MySQL5.0/5.1等不同的数据库产品和版本，对于关系型数据库系统(RDBMS)应该说有了一定的了解。从一个数据库切换到另外一个数据库，虽然有些许艰难，却谈不上抗拒，甚至乐意主动去深入了解其他的数据库产品。关系理论的成熟，造就了这三十年来关系数据库在数据领域的绝对地位。&lt;/p&gt;
&lt;p&gt;这两年在互联网行业，时间虽然不长，却深切的感受到了一个大型网站真实的压力。随着业务滚雪球式的增长，关系数据库由于对数据一致性的强硬要求(ACID)，在扩展性方面天生不足，可以预见的天花板犹如达摩克利斯之剑，随时可能落下。SQL优化，应用重构，硬件升级，垂直拆分，能用的武器轮番上场，也不过救急于一时。要能做到系统随着网站压力几乎无限制的扩展需求，水平拆分横向扩展是不可避免的终极魔法。过去一年，我们也在一些应用上逐步尝试水平拆分，遇到过各种各样的问题，当然也有很大的收获，积累了很多的经验。MySQL作为开源的关系数据库，也开始得到大规模的应用，毕竟水平拆分后数据库的规模将是指数级的增长，商业数据库如Oracle的成本，是不得不考虑的一个问题。&lt;/p&gt;
&lt;p&gt;我们所遇到的问题，相信所有大型的互联网站都会碰到。关系数据库有其不可替代的特性，但是，我们真的所有的数据都需要使用关系数据库么？或许一个简单但是更加容易扩展的key-value存储更能够满足很多互联网应用的数据存储需求，Google和Amazon相继推出&lt;a href=&quot;http://en.wikipedia.org/wiki/BigTable&quot;&gt;BigTable&lt;/a&gt;和&lt;a href=&quot;http://en.wikipedia.org/wiki/Dynamo_%28storage_system%29&quot;&gt;Dynamo&lt;/a&gt;，可以说是在分布式数据库方面一个开荒式的尝试。2009年初，一个叫做&lt;a href=&quot;http://en.wikipedia.org/wiki/NoSQL&quot;&gt;NoSQL&lt;/a&gt;的组织开始出现并运作，纠集了一支优秀的开源部队想要革了关系型数据库的命，至少是想革了关系型数据库在互联网行业的命。不管NoSQL是不是关系型数据库的终结者，却确确实实在推广一些优秀的开源分布式数据库产品，作为DBA，或许我们是时候花点时间去了解一下这个对手了，不然饭碗丢了可能还不明白是谁抢去了，呵呵。&lt;/p&gt;
&lt;p&gt;下面是wikipedia上列出了NoSQL的一些开源项目，有时间应该去了解一下。实际上，&lt;a href=&quot;http://www.taobao.com&quot;&gt;淘宝&lt;/a&gt;也有在开发并使用自己的一套分布式cache和持久化系统，不知道什么时候也能看到开源版本的出现，呵呵。&lt;br /&gt;
    * &lt;a href=&quot;http://en.wikipedia.org/wiki/Cassandra_(database)&quot;&gt;Cassandra&lt;/a&gt;&lt;br /&gt;
    * &lt;a href=&quot;http://en.wikipedia.org/wiki/Chordless&quot;&gt;Chordless&lt;/a&gt;&lt;br /&gt;
    * &lt;a href=&quot;http://en.wikipedia.org/wiki/CouchDB&quot;&gt;CouchDB&lt;/a&gt;&lt;br /&gt;
    * &lt;a href=&quot;http://en.wikipedia.org/wiki/Db4o&quot;&gt;Db4o&lt;/a&gt;&lt;br /&gt;
    * &lt;a href=&quot;http://en.wikipedia.org/wiki/GT.M&quot;&gt;GT.M&lt;/a&gt;&lt;br /&gt;
    * &lt;a href=&quot;http://en.wikipedia.org/wiki/Hbase&quot;&gt;Hbase&lt;/a&gt;&lt;br /&gt;
    * &lt;a href=&quot;http://en.wikipedia.org/wiki/Hypertable&quot;&gt;Hypertable&lt;/a&gt;&lt;br /&gt;
    * &lt;a href=&quot;http://en.wikipedia.org/wiki/Memcachedb&quot;&gt;Memcachedb&lt;/a&gt;&lt;br /&gt;
    * &lt;a href=&quot;http://en.wikipedia.org/wiki/Mnesia&quot;&gt;Mnesia&lt;/a&gt;&lt;br /&gt;
    * &lt;a href=&quot;http://en.wikipedia.org/wiki/MongoDB&quot;&gt;MongoDB&lt;/a&gt;&lt;br /&gt;
    * &lt;a href=&quot;http://en.wikipedia.org/wiki/Neo4j&quot;&gt;Neo4j&lt;/a&gt;&lt;br /&gt;
    * &lt;a href=&quot;http://en.wikipedia.org/wiki/Project_Voldemort&quot;&gt;Project Voldemort&lt;/a&gt;&lt;br /&gt;
    * &lt;a href=&quot;http://en.wikipedia.org/wiki/Redis_(dbms)&quot;&gt;Redis&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;发现有半个月没写blog了，这篇比较水，充一下数。&lt;/p&gt;
&lt;br/&gt;&lt;b&gt;Related Articles&lt;/b&gt;&lt;p&gt;&lt;ul class=&quot;related_post&quot;&gt;&lt;li&gt;&lt;a href=&quot;http://www.ningoo.net/html/2008/open_source_and_sun_mysql.html&quot; title=&quot;开源，是一种精神&quot;&gt;开源，是一种精神&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.ningoo.net/html/2008/mysql_benchmark_function.html&quot; title=&quot;MySQL的benchmark函数&quot;&gt;MySQL的benchmark函数&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.ningoo.net/html/2008/mysql_new_branch_drizzle.html&quot; title=&quot;Drizzle:MySQL的瘦身运动&quot;&gt;Drizzle:MySQL的瘦身运动&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.ningoo.net/html/2007/process_limit_error.html&quot; title=&quot;Processes参数设置过小导致错误&quot;&gt;Processes参数设置过小导致错误&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.ningoo.net/html/2009/chat_about_mysqldba_on_msn.html&quot; title=&quot;MSN上的闲聊&quot;&gt;MSN上的闲聊&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.ningoo.net/html/2009/oracle_open_world_2009_golden_gate_and_obama.html&quot; title=&quot;OOW2009美国行:金门大桥与奥巴马&quot;&gt;OOW2009美国行:金门大桥与奥巴马&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;PermLink:&lt;/b&gt; &lt;a href='http://www.ningoo.net/html/2009/nosql_teminator_of_rdbms.html'&gt;http://www.ningoo.net/html/2009/nosql_teminator_of_rdbms.html&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;a href='http://www.ningoo.net/html/2009/nosql_teminator_of_rdbms.html#comment'&gt;Add Comments(2)&lt;/a&gt;&lt;/b&gt; | &lt;b&gt;&lt;a href='http://twitter.com/NinGoo'&gt;Follow NinGoo@Twitter&lt;/a&gt;&lt;/b&gt; | &lt;b&gt;&lt;a href='http://www.google.com/ig/add?feedurl=http://rss.ningoo.net'&gt;Google Reader&lt;/a&gt;&lt;/b&gt;&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/329054245/NinGoo/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/NinGoo/~1461473/329054245/1237504/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/NinGoo/329054245/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/NinGoo/329054245/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</content:encoded><wfw:commentRss>http://www.ningoo.net/html/2009/nosql_teminator_of_rdbms.html/feed</wfw:commentRss><slash:comments>2</slash:comments><description>Author:NinGoo posted on NinGoo.net 作为一个DBA，几年走过来，工作中历经MS SQL Server 2000/2005，Oracle9i/10g/11g，MySQL5.0/5.1等不同的数据库产品和版本，对于关系型数据库系统(RDBMS)应该说有了一定的了解。...&lt;img src=&quot;http://www1.feedsky.com/t1/329054245/NinGoo/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/NinGoo/~1461473/329054245/1237504/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/NinGoo/329054245/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/NinGoo/329054245/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><category>互联网</category><category>NoSQL</category><category>rdbms</category><category>Open Source</category><pubDate>Wed, 16 Dec 2009 20:56:27 +0800</pubDate><author>NinGoo</author><comments>http://www.ningoo.net/html/2009/nosql_teminator_of_rdbms.html#comments</comments><guid isPermaLink="false">http://www.ningoo.net/?p=1160</guid><dc:creator>NinGoo</dc:creator><fs:srclink>http://www.ningoo.net/html/2009/nosql_teminator_of_rdbms.html</fs:srclink><fs:srcfeed>http://www.ningoo.net/feed/</fs:srcfeed><fs:itemid>feedsky/NinGoo/~1461473/329054245/1237504</fs:itemid></item></channel></rss>