<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>TQ 试用 WP &#187; MY 默认分类</title>
	<atom:link href="http://tq.freehostia.com.freehostia.com/category/default/feed" rel="self" type="application/rss+xml" />
	<link>http://tq.freehostia.com.freehostia.com</link>
	<description>TQ 试用中... ...</description>
	<lastBuildDate>Fri, 19 Mar 2010 06:07:08 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Orange Crush 20LDX</title>
		<link>http://tq.freehostia.com.freehostia.com/2010/03/orange-crush-20ldx.html</link>
		<comments>http://tq.freehostia.com.freehostia.com/2010/03/orange-crush-20ldx.html#comments</comments>
		<pubDate>Fri, 19 Mar 2010 06:07:08 +0000</pubDate>
		<dc:creator>TQ</dc:creator>
				<category><![CDATA[MY 默认分类]]></category>

		<guid isPermaLink="false">http://tq.freehostia.com.freehostia.com/?p=244</guid>
		<description><![CDATA[YOUKU视频
Orange Crush 20LDX
http://player.youku.com/player.php/sid/XMTU4NjQ4OTgw/v.swf
——

YOUKU视频... ]]></description>
			<content:encoded><![CDATA[<p>YOUKU视频<br />
Orange Crush 20LDX<br />
http://player.youku.com/player.php/sid/XMTU4NjQ4OTgw/v.swf<br />
——<br />
<embed src="http://player.youku.com/player.php/sid/XMTU4NjQ4OTgw/v.swf" quality="high" width="480" height="400" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash"></embed></p>
<p>YOUKU视频</p>
]]></content:encoded>
			<wfw:commentRss>http://tq.freehostia.com.freehostia.com/2010/03/orange-crush-20ldx.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>test 视频</title>
		<link>http://tq.freehostia.com.freehostia.com/2010/03/test-%e8%a7%86%e9%a2%91.html</link>
		<comments>http://tq.freehostia.com.freehostia.com/2010/03/test-%e8%a7%86%e9%a2%91.html#comments</comments>
		<pubDate>Fri, 19 Mar 2010 05:55:55 +0000</pubDate>
		<dc:creator>TQ</dc:creator>
				<category><![CDATA[MY 默认分类]]></category>

		<guid isPermaLink="false">http://tq.freehostia.com.freehostia.com/?p=238</guid>
		<description><![CDATA[test 视频

test 视频... ]]></description>
			<content:encoded><![CDATA[<p>test 视频<br />
<object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/ftXfLkDsxAI&#038;hl=zh_CN&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/ftXfLkDsxAI&#038;hl=zh_CN&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object><br />
test 视频</p>
]]></content:encoded>
			<wfw:commentRss>http://tq.freehostia.com.freehostia.com/2010/03/test-%e8%a7%86%e9%a2%91.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>日志项目集成</title>
		<link>http://tq.freehostia.com.freehostia.com/2009/10/%e6%97%a5%e5%bf%97%e9%a1%b9%e7%9b%ae%e9%9b%86%e6%88%90-2.html</link>
		<comments>http://tq.freehostia.com.freehostia.com/2009/10/%e6%97%a5%e5%bf%97%e9%a1%b9%e7%9b%ae%e9%9b%86%e6%88%90-2.html#comments</comments>
		<pubDate>Sun, 11 Oct 2009 04:09:51 +0000</pubDate>
		<dc:creator>TQ</dc:creator>
				<category><![CDATA[MY 默认分类]]></category>

		<guid isPermaLink="false">http://tq.freehostia.com.freehostia.com/2009/10/%e6%97%a5%e5%bf%97%e9%a1%b9%e7%9b%ae%e9%9b%86%e6%88%90-2.html</guid>
		<description><![CDATA[日志项目集成：
项目说明：多台Web服务用用LVS进行负载均衡，并且多台Web服务器的apache日志由独立一台日志服务器来记录到syslog日志中。（这里主要介绍如何使用syslog日志服务远程管理apache日... ]]></description>
			<content:encoded><![CDATA[<blockquote><p><b>日志项目集成：</b>
<p>项目说明：多台Web服务用用LVS进行负载均衡，并且多台Web服务器的apache日志由独立一台日志服务器来记录到syslog日志中。（这里主要介绍如何使用syslog日志服务远程管理apache日志）
<p><a href="http://tq.freehostia.com.freehostia.com/wp-content/uploads/2009/10/clip_image001.gif"><img title="clip_image001" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="112" alt="clip_image001" src="http://tq.freehostia.com.freehostia.com/wp-content/uploads/2009/10/clip_image001_thumb.gif" width="240" border="0"></a>
<p>∵apache本身有一套日志系统，记录在/var/log/httpd/中。现在想用独立的一台syslog日志服务器记录apache日志信息。
<p>∴用“管道”：| logger
<p><b>在各台Web服务器设置：</b>
<p><b>⑴</b><b> </b><b>上加</b><b>-r</b><b>参数，开启远程日志管理。</b><b></b>
<p>[root@vm5: ~]#vim /etc/sysconfig/syslog
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;前略&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;
<p>SYSLOGD_OPTIONS=&#8221;<b>-m 0 -r -x</b>&#8221; <b>注：</b><b>-m</b><b>：</b><b>MAC -r</b><b>：开启远程日志</b><b> -x</b><b>：不</b><b>DNS</b>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;后略&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;
<p><b>⑵</b><b> </b><b>在</b><b>apache</b><b>的配置文件</b><b>/etc/httpd/conf/httpd.conf</b><b>中，增加</b><b>| logger </b><b>。</b><b></b>
<p>[root@vm5: ~]#vim /etc/httpd/conf/httpd.conf
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;前略&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;
<p># For a single logfile with access, agent, and referer information
<p># (Combined Logfile Format), use the following directive:
<p>#
<p>CustomLog logs/access_log combined
<p>CustomLog &#8220;| logger -p info&#8221; combined
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;后略&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;
<p>此时，就可以在独立的syslog日志服务器上，查看到各台Web服务器的日志了！！！</p>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://tq.freehostia.com.freehostia.com/2009/10/%e6%97%a5%e5%bf%97%e9%a1%b9%e7%9b%ae%e9%9b%86%e6%88%90-2.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>日志项目集成</title>
		<link>http://tq.freehostia.com.freehostia.com/2009/10/%e6%97%a5%e5%bf%97%e9%a1%b9%e7%9b%ae%e9%9b%86%e6%88%90.html</link>
		<comments>http://tq.freehostia.com.freehostia.com/2009/10/%e6%97%a5%e5%bf%97%e9%a1%b9%e7%9b%ae%e9%9b%86%e6%88%90.html#comments</comments>
		<pubDate>Sun, 11 Oct 2009 04:06:21 +0000</pubDate>
		<dc:creator>TQ</dc:creator>
				<category><![CDATA[MY 默认分类]]></category>

		<guid isPermaLink="false">http://tq.freehostia.com.freehostia.com/?p=213</guid>
		<description><![CDATA[日志项目集成：
项目说明：多台Web服务用用LVS进行负载均衡，并且多台Web服务器的apache日志由独立一台日志服务器来记录到syslog日志中。（这里主要介绍如何使用syslog日志服务远程管理apache日... ]]></description>
			<content:encoded><![CDATA[<p><strong>日志项目集成：</strong></p>
<p>项目说明：多台Web服务用用LVS进行负载均衡，并且多台Web服务器的apache日志由独立一台日志服务器来记录到syslog日志中。（这里主要介绍如何使用syslog日志服务远程管理apache日志）</p>
<p> </p>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td>LVS：Linux Virtual Server Linux虚拟服务器</p>
<p> </td>
</tr>
</tbody>
</table>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td>Web服务器</p>
<p> </td>
</tr>
</tbody>
</table>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td>Web服务器</p>
<p> </td>
</tr>
</tbody>
</table>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td>Web服务器</p>
<p> </td>
</tr>
</tbody>
</table>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td>Web服务器</p>
<p> </td>
</tr>
</tbody>
</table>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td>syslog日志服务器</p>
<p> </td>
</tr>
</tbody>
</table>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td>用户访问网页</p>
<p> </td>
</tr>
</tbody>
</table>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td>Web服务器 负载均衡</p>
<p> </td>
</tr>
</tbody>
</table>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td>日志都存到syslog日志服务器</p>
<p> </td>
</tr>
</tbody>
</table>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td><strong>| logger</strong></td>
</tr>
</tbody>
</table>
<p>∵apache本身有一套日志系统，记录在/var/log/httpd/中。现在想用独立的一台syslog日志服务器记录apache日志信息。</p>
<p>∴用“管道”：| logger</p>
<p> </p>
<p> </p>
<p><strong>在各台Web服务器设置：</strong></p>
<p><strong>⑴</strong><strong> </strong><strong>上加</strong><strong>-r</strong><strong>参数，开启远程日志管理。</strong><strong></strong></p>
<p>[root@vm5: ~]#vim /etc/sysconfig/syslog</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;前略&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>SYSLOGD_OPTIONS=&#8221;<strong>-m 0 -r -x</strong>&#8220;    <strong>注：</strong><strong>-m</strong><strong>：</strong><strong>MAC -r</strong><strong>：开启远程日志</strong><strong>      -x</strong><strong>：不</strong><strong>DNS</strong></p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;后略&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p> </p>
<p><strong>⑵</strong><strong> </strong><strong>在</strong><strong>apache</strong><strong>的配置文件</strong><strong>/etc/httpd/conf/httpd.conf</strong><strong>中，增加</strong><strong>| logger </strong><strong>。</strong><strong></strong></p>
<p>[root@vm5: ~]#vim /etc/httpd/conf/httpd.conf</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;前略&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p># For a single logfile with access, agent, and referer information</p>
<p># (Combined Logfile Format), use the following directive:</p>
<p>#</p>
<p>CustomLog logs/access_log combined</p>
<p>CustomLog &#8220;| logger -p info&#8221; combined</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;后略&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>此时，就可以在独立的syslog日志服务器上，查看到各台Web服务器的日志了！！！</p>
]]></content:encoded>
			<wfw:commentRss>http://tq.freehostia.com.freehostia.com/2009/10/%e6%97%a5%e5%bf%97%e9%a1%b9%e7%9b%ae%e9%9b%86%e6%88%90.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>插图</title>
		<link>http://tq.freehostia.com.freehostia.com/2009/09/%e6%8f%92%e5%9b%be.html</link>
		<comments>http://tq.freehostia.com.freehostia.com/2009/09/%e6%8f%92%e5%9b%be.html#comments</comments>
		<pubDate>Tue, 22 Sep 2009 03:47:00 +0000</pubDate>
		<dc:creator>TQ</dc:creator>
				<category><![CDATA[MY 默认分类]]></category>
		<category><![CDATA[test photo]]></category>

		<guid isPermaLink="false">http://tq.freehostia.com.freehostia.com/2009/09/%e6%8f%92%e5%9b%be.html</guid>
		<description><![CDATA[

查看整个相册
... ]]></description>
			<content:encoded><![CDATA[<p><a href="http://tq.freehostia.com.freehostia.com/wp-content/uploads/2009/09/GNR.jpg"><img title="GNR" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin-left: auto; margin-right: auto; border-right-width: 0px" height="484" alt="GNR" src="http://tq.freehostia.com.freehostia.com/wp-content/uploads/2009/09/GNR_thumb.jpg" width="644" border="0"></a>
<div class="wlWriterEditableSmartContent" id="scid:66721397-FF69-4ca6-AEC4-17E6B3208830:d7742df4-1de0-4ab3-9a12-2ec0b9c6b058" style="padding-right: 0px; display: inline; padding-left: 0px; float: left; padding-bottom: 0px; margin: 0px; padding-top: 0px"><a style="border:0px" href="http://cid-1f90ab1d119fe9fc.skydrive.live.com/redir.aspx?page=browse&amp;resid=1F90AB1D119FE9FC!558&amp;ct=photos"><img style="border:0px" alt="查看 新建相册" src="http://tq.freehostia.com.freehostia.com/wp-content/uploads/2009/09/InlineRepresentation455e356b5b8041bf82e17b507010f0b0.jpg" /></a>
<div style="width:340px;text-align:right;" ><a href="http://cid-1f90ab1d119fe9fc.skydrive.live.com/redir.aspx?page=browse&amp;resid=1F90AB1D119FE9FC!558&amp;ct=photos">查看整个相册</a></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://tq.freehostia.com.freehostia.com/2009/09/%e6%8f%92%e5%9b%be.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>compare</title>
		<link>http://tq.freehostia.com.freehostia.com/2009/08/compare.html</link>
		<comments>http://tq.freehostia.com.freehostia.com/2009/08/compare.html#comments</comments>
		<pubDate>Sun, 23 Aug 2009 08:46:00 +0000</pubDate>
		<dc:creator>TQ</dc:creator>
				<category><![CDATA[MY 默认分类]]></category>
		<category><![CDATA[compare]]></category>

		<guid isPermaLink="false">http://tq.freehostia.com.freehostia.com/2009/08/compare.html</guid>
		<description><![CDATA[
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
CREATE OR REP... ]]></description>
			<content:encoded><![CDATA[
<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
</pre></td><td class="code"><pre class="plsql" style="font-family:monospace;"><span style="color: #00F;">CREATE</span> <span style="color: #00F;">OR</span> <span style="color: #000;">REPLACE</span> <span style="color: #00F;">PROCEDURE</span> del_UserContent<span style="color: #00F;">&#40;</span>phoneNum <span style="color: #00F;">VARCHAR2</span><span style="color: #00F;">,</span>
                                            oresultcode   <span style="color: #00F;">OUT</span> INT<span style="color: #00F;">&#41;</span> <span style="color: #00F;">IS</span>
&nbsp;
  memberId <span style="color: #00F;">NUMBER</span><span style="color: #00F;">;</span> <span style="color: #080; font-style: italic;">--用户id</span>
  cnt <span style="color: #00F;">INTEGER</span><span style="color: #00F;">;</span>
&nbsp;
<span style="color: #00F;">BEGIN</span>
  oresultcode <span style="color: #00F;">:=</span> <span style="color: #800;">0</span><span style="color: #00F;">;</span>
&nbsp;
  <span style="color: #080; font-style: italic;">--删除临时注册表中的信息</span>
  <span style="color: #00F;">SELECT</span> <span style="color: #000;">COUNT</span><span style="color: #00F;">&#40;</span><span style="color: #00F;">*</span><span style="color: #00F;">&#41;</span> <span style="color: #00F;">INTO</span> cnt <span style="color: #00F;">FROM</span> member_reg t <span style="color: #00F;">WHERE</span> t<span style="color: #00F;">.</span>phone<span style="color: #00F;">=</span>phoneNum<span style="color: #00F;">;</span>
  <span style="color: #00F;">IF</span> cnt<span style="color: #00F;">&gt;</span><span style="color: #800;">0</span> <span style="color: #00F;">THEN</span>
    <span style="color: #00F;">BEGIN</span>
      <span style="color: #00F;">DELETE</span> <span style="color: #00F;">FROM</span> member_reg t <span style="color: #00F;">WHERE</span> t<span style="color: #00F;">.</span>phone<span style="color: #00F;">=</span>phoneNum<span style="color: #00F;">;</span>
   <span style="color: #00F;">END</span><span style="color: #00F;">;</span>
  <span style="color: #00F;">END</span> <span style="color: #00F;">IF</span><span style="color: #00F;">;</span>
&nbsp;
  <span style="color: #00F;">SELECT</span> member_id
    <span style="color: #00F;">INTO</span> memberId
    <span style="color: #00F;">FROM</span> member
   <span style="color: #00F;">WHERE</span> phone <span style="color: #00F;">=</span> phoneNum<span style="color: #00F;">;</span>
&nbsp;
  <span style="color: #080; font-style: italic;">--删除所有好友和群组的映射关系</span>
  <span style="color: #00F;">DELETE</span> <span style="color: #00F;">FROM</span> grp_friend_rel t <span style="color: #00F;">WHERE</span> t<span style="color: #00F;">.</span>MEMBER_ID<span style="color: #00F;">=</span>memberId<span style="color: #00F;">;</span>
  <span style="color: #080; font-style: italic;">--删除所有群组信息</span>
  <span style="color: #00F;">DELETE</span> <span style="color: #00F;">FROM</span> friend_grp t <span style="color: #00F;">WHERE</span> t<span style="color: #00F;">.</span>member_id<span style="color: #00F;">=</span>memberId<span style="color: #00F;">;</span>
  <span style="color: #080; font-style: italic;">--删除所有好友信息</span>
  <span style="color: #00F;">DELETE</span> <span style="color: #00F;">FROM</span> friend t <span style="color: #00F;">WHERE</span> t<span style="color: #00F;">.</span>member_id <span style="color: #00F;">=</span> memberId<span style="color: #00F;">;</span>
&nbsp;
  <span style="color: #080; font-style: italic;">--删除定制信息中包含的彩像信息</span>
  <span style="color: #00F;">DELETE</span> <span style="color: #00F;">FROM</span> winks_pkg t <span style="color: #00F;">WHERE</span> t<span style="color: #00F;">.</span>member_id <span style="color: #00F;">=</span> memberId<span style="color: #00F;">;</span>
  <span style="color: #080; font-style: italic;">--删除定制信息</span>
  <span style="color: #00F;">DELETE</span> <span style="color: #00F;">FROM</span> winks_script t <span style="color: #00F;">WHERE</span> t<span style="color: #00F;">.</span>member_id <span style="color: #00F;">=</span> memberId<span style="color: #00F;">;</span>
&nbsp;
  <span style="color: #080; font-style: italic;">--删除我的彩像库中的信息</span>
  <span style="color: #00F;">DELETE</span> <span style="color: #00F;">FROM</span> member_winks t <span style="color: #00F;">WHERE</span> t<span style="color: #00F;">.</span>member_id<span style="color: #00F;">=</span>memberId<span style="color: #00F;">;</span>
&nbsp;
  <span style="color: #080; font-style: italic;">--删除彩像库中本用户diy上传的彩像文件</span>
  <span style="color: #080; font-style: italic;">--delete from winks_file t where t.winks_id in (select w.winks_id from winks w where w.owner_id=memberId);</span>
  <span style="color: #080; font-style: italic;">--删除彩像库中本用户diy上传的彩像信息</span>
  <span style="color: #080; font-style: italic;">--delete from winks t where t.owner_id=memberId;</span>
  <span style="color: #00F;">UPDATE</span> winks t <span style="color: #00F;">SET</span> t<span style="color: #00F;">.</span>owner_type<span style="color: #00F;">=</span><span style="color: #800;">2</span> <span style="color: #00F;">,</span> t<span style="color: #00F;">.</span>owner_id<span style="color: #00F;">=</span><span style="color: #800;">10001</span> <span style="color: #00F;">WHERE</span> t<span style="color: #00F;">.</span>owner_id<span style="color: #00F;">=</span>memberId<span style="color: #00F;">;</span>
  <span style="color: #080; font-style: italic;">--删除订单明细信息</span>
  <span style="color: #00F;">DELETE</span> <span style="color: #00F;">FROM</span> line_item t <span style="color: #00F;">WHERE</span> t<span style="color: #00F;">.</span>contract_id <span style="color: #00F;">IN</span> <span style="color: #00F;">&#40;</span><span style="color: #00F;">SELECT</span> a<span style="color: #00F;">.</span>contract_id <span style="color: #00F;">FROM</span> contract a <span style="color: #00F;">WHERE</span> a<span style="color: #00F;">.</span>buy_account_id<span style="color: #00F;">=</span>memberId<span style="color: #00F;">&#41;</span><span style="color: #00F;">;</span>
  <span style="color: #00F;">DELETE</span> <span style="color: #00F;">FROM</span> line_item t <span style="color: #00F;">WHERE</span> t<span style="color: #00F;">.</span>contract_id <span style="color: #00F;">IN</span> <span style="color: #00F;">&#40;</span><span style="color: #00F;">SELECT</span> a<span style="color: #00F;">.</span>contract_id <span style="color: #00F;">FROM</span> contract a <span style="color: #00F;">WHERE</span> a<span style="color: #00F;">.</span>sell_account_id<span style="color: #00F;">=</span>memberId<span style="color: #00F;">&#41;</span><span style="color: #00F;">;</span>
  <span style="color: #080; font-style: italic;">--删除订单信息</span>
  <span style="color: #00F;">DELETE</span> <span style="color: #00F;">FROM</span> contract t <span style="color: #00F;">WHERE</span> t<span style="color: #00F;">.</span>buy_account_id<span style="color: #00F;">=</span>memberId<span style="color: #00F;">;</span>
  <span style="color: #00F;">DELETE</span> <span style="color: #00F;">FROM</span> contract t <span style="color: #00F;">WHERE</span> t<span style="color: #00F;">.</span>sell_account_id<span style="color: #00F;">=</span>memberId<span style="color: #00F;">;</span>
  <span style="color: #080; font-style: italic;">--删除注册激活日志信息</span>
  <span style="color: #00F;">DELETE</span> <span style="color: #00F;">FROM</span> member_scr_log t <span style="color: #00F;">WHERE</span> t<span style="color: #00F;">.</span>member_id<span style="color: #00F;">=</span>memberId<span style="color: #00F;">;</span>
  <span style="color: #080; font-style: italic;">--删除用户客户端配置信息</span>
  <span style="color: #00F;">DELETE</span> <span style="color: #00F;">FROM</span> member_client t <span style="color: #00F;">WHERE</span> t<span style="color: #00F;">.</span>member_id<span style="color: #00F;">=</span>memberId<span style="color: #00F;">;</span>
  <span style="color: #080; font-style: italic;">--删除推荐用户信息</span>
  <span style="color: #00F;">DELETE</span> <span style="color: #00F;">FROM</span> member_invited t <span style="color: #00F;">WHERE</span> t<span style="color: #00F;">.</span>member_id<span style="color: #00F;">=</span>memberId<span style="color: #00F;">;</span>
  <span style="color: #080; font-style: italic;">--删除社区元素明细信息</span>
  <span style="color: #00F;">DELETE</span> <span style="color: #00F;">FROM</span> member_action t <span style="color: #00F;">WHERE</span> t<span style="color: #00F;">.</span>invited_member_action_id <span style="color: #00F;">IN</span> <span style="color: #00F;">&#40;</span><span style="color: #00F;">SELECT</span> a<span style="color: #00F;">.</span>member_action_id <span style="color: #00F;">FROM</span> member_action a <span style="color: #00F;">WHERE</span> a<span style="color: #00F;">.</span>member_id<span style="color: #00F;">=</span>memberId<span style="color: #00F;">&#41;</span><span style="color: #00F;">;</span>
  <span style="color: #00F;">DELETE</span> <span style="color: #00F;">FROM</span> member_action t <span style="color: #00F;">WHERE</span> t<span style="color: #00F;">.</span>member_id<span style="color: #00F;">=</span>memberId<span style="color: #00F;">;</span>
  <span style="color: #080; font-style: italic;">--更新member表中推荐人信息</span>
  <span style="color: #00F;">UPDATE</span> member t <span style="color: #00F;">SET</span> t<span style="color: #00F;">.</span>invited_by <span style="color: #00F;">=</span> <span style="color: #00F;">NULL</span>
                  <span style="color: #00F;">WHERE</span> t<span style="color: #00F;">.</span>invited_by <span style="color: #00F;">=</span> memberId<span style="color: #00F;">;</span>
  <span style="color: #00F;">COMMIT</span><span style="color: #00F;">;</span>
  <span style="color: #080; font-style: italic;">--删除修改密码的信息</span>
  <span style="color: #00F;">DELETE</span> <span style="color: #00F;">FROM</span> member_at_site t <span style="color: #00F;">WHERE</span> t<span style="color: #00F;">.</span>member_id<span style="color: #00F;">=</span>memberId<span style="color: #00F;">;</span>
  <span style="color: #080; font-style: italic;">--删除用户信息</span>
  <span style="color: #00F;">DELETE</span> <span style="color: #00F;">FROM</span> member t <span style="color: #00F;">WHERE</span> t<span style="color: #00F;">.</span>member_id<span style="color: #00F;">=</span>memberId<span style="color: #00F;">;</span>
  <span style="color: #080; font-style: italic;">--删除此用户相关消息</span>
  <span style="color: #00F;">DELETE</span> <span style="color: #00F;">FROM</span> message t <span style="color: #00F;">WHERE</span> t<span style="color: #00F;">.</span>party_id<span style="color: #00F;">=</span>memberId <span style="color: #00F;">OR</span> t<span style="color: #00F;">.</span>send_from<span style="color: #00F;">=</span>memberId<span style="color: #00F;">;</span>
  <span style="color: #080; font-style: italic;">--删除参与者信息</span>
   <span style="color: #00F;">DELETE</span> <span style="color: #00F;">FROM</span> party t <span style="color: #00F;">WHERE</span> t<span style="color: #00F;">.</span>party_id<span style="color: #00F;">=</span>memberId<span style="color: #00F;">;</span>
&nbsp;
  <span style="color: #00F;">IF</span> SQL<span style="color: #00F;">%</span>NOTFOUND <span style="color: #00F;">THEN</span>
    <span style="color: #00F;">ROLLBACK</span><span style="color: #00F;">;</span>
    <span style="color: #00F;">DBMS_OUTPUT</span><span style="color: #00F;">.</span>put_line<span style="color: #00F;">&#40;</span><span style="color: #F00;">'NO SUCH USER'</span><span style="color: #00F;">&#41;</span><span style="color: #00F;">;</span>
    oresultcode <span style="color: #00F;">:=</span> <span style="color: #00F;">-</span><span style="color: #800;">21000</span><span style="color: #00F;">;</span>
    <span style="color: #00F;">RETURN</span><span style="color: #00F;">;</span>
  <span style="color: #00F;">END</span> <span style="color: #00F;">IF</span><span style="color: #00F;">;</span>
  <span style="color: #00F;">COMMIT</span><span style="color: #00F;">;</span>
<span style="color: #00F;">EXCEPTION</span>
  <span style="color: #00F;">WHEN</span> <span style="color: #00F;">OTHERS</span> <span style="color: #00F;">THEN</span>
    <span style="color: #00F;">ROLLBACK</span><span style="color: #00F;">;</span>
    oresultcode <span style="color: #00F;">:=</span> <span style="color: #00F;">SQLCODE</span><span style="color: #00F;">;</span>
<span style="color: #00F;">END</span><span style="color: #00F;">;</span>
<span style="color: #00F;">/</span></pre></td></tr></table></div>

<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<pre class="sql" name="code">
CREATE OR REPLACE PROCEDURE del_UserContent(phoneNum VARCHAR2,
                                            oresultcode   OUT INT) IS

  memberId NUMBER; --用户id
  cnt INTEGER;

BEGIN
  oresultcode := 0;

  --删除临时注册表中的信息
  select count(*) into cnt from member_reg t where t.phone=phoneNum;
  IF cnt>0 THEN
    BEGIN
      delete from member_reg t where t.phone=phoneNum;
   END;
  END IF;

  select member_id
    into memberId
    from member
   WHERE phone = phoneNum;

  --删除所有好友和群组的映射关系
  delete from grp_friend_rel t where t.MEMBER_ID=memberId;
  --删除所有群组信息
  delete from friend_grp t where t.member_id=memberId;
  --删除所有好友信息
  delete from friend t where t.member_id = memberId;

  --删除定制信息中包含的彩像信息
  delete from winks_pkg t where t.member_id = memberId;
  --删除定制信息
  delete from winks_script t where t.member_id = memberId;

  --删除我的彩像库中的信息
  delete from member_winks t where t.member_id=memberId;

  --删除彩像库中本用户diy上传的彩像文件
  --delete from winks_file t where t.winks_id in (select w.winks_id from winks w where w.owner_id=memberId);
  --删除彩像库中本用户diy上传的彩像信息
  --delete from winks t where t.owner_id=memberId;
  update winks t set t.owner_type=2 , t.owner_id=10001 where t.owner_id=memberId;
  --删除订单明细信息
  delete from line_item t where t.contract_id in (select a.contract_id from contract a where a.buy_account_id=memberId);
  delete from line_item t where t.contract_id in (select a.contract_id from contract a where a.sell_account_id=memberId);
  --删除订单信息
  delete from contract t where t.buy_account_id=memberId;
  delete from contract t where t.sell_account_id=memberId;
  --删除注册激活日志信息
  delete from member_scr_log t where t.member_id=memberId;
  --删除用户客户端配置信息
  delete from member_client t where t.member_id=memberId;
  --删除推荐用户信息
  delete from member_invited t where t.member_id=memberId;
  --删除社区元素明细信息
  delete from member_action t where t.invited_member_action_id in (select a.member_action_id from member_action a where a.member_id=memberId);
  delete from member_action t where t.member_id=memberId;
  --更新member表中推荐人信息
  update member t set t.invited_by = null
                  where t.invited_by = memberId;
  commit;
  --删除修改密码的信息
  delete from member_at_site t where t.member_id=memberId;
  --删除用户信息
  delete from member t where t.member_id=memberId;
  --删除此用户相关消息
  delete from message t where t.party_id=memberId or t.send_from=memberId;
  --删除参与者信息
   delete from party t where t.party_id=memberId;

  IF SQL%NOTFOUND THEN
    ROLLBACK;
    dbms_output.put_line('NO SUCH USER');
    oresultcode := -21000;
    RETURN;
  END IF;
  COMMIT;
EXCEPTION
  WHEN OTHERS THEN
    ROLLBACK;
    oresultcode := sqlcode;
END;
/
</pre>
]]></content:encoded>
			<wfw:commentRss>http://tq.freehostia.com.freehostia.com/2009/08/compare.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Syntax Highlighter for WordPress</title>
		<link>http://tq.freehostia.com.freehostia.com/2009/08/google-syntax-highlighter-for-wordpress.html</link>
		<comments>http://tq.freehostia.com.freehostia.com/2009/08/google-syntax-highlighter-for-wordpress.html#comments</comments>
		<pubDate>Sun, 23 Aug 2009 08:30:00 +0000</pubDate>
		<dc:creator>TQ</dc:creator>
				<category><![CDATA[MY 默认分类]]></category>
		<category><![CDATA[Google Syntax Highlighter for WordPress]]></category>

		<guid isPermaLink="false">http://tq.freehostia.com.freehostia.com/2009/08/google-syntax-highlighter-for-wordpress.html</guid>
		<description><![CDATA[


&#160;

winks@CCDB&#62; select name,ceil(bytes/1024/1024) MB,status from v$datafile;

NAME                                                  [...... ]]></description>
			<content:encoded><![CDATA[<pre class="sql" name="code">
</pre>

<div class="wp_syntax"><div class="code"><pre class="oracle11" style="font-family:monospace;">&nbsp;</pre></div></div>

<pre class="sql" name="code">winks@CCDB&gt; select name,ceil(bytes/1024/1024) MB,status from v$datafile;

NAME                                                                           MB STATUS
---------------------------------------------------------------------- ---------- --------------
/home/oracle/app/oracle/oradata/ccdb/system01.dbf                             730 SYSTEM
/home/oracle/app/oracle/oradata/ccdb/sysaux01.dbf                            1037 ONLINE
/home/oracle/app/oracle/oradata/ccdb/undotbs01.dbf                            440 ONLINE
/home/oracle/app/oracle/oradata/ccdb/users01.dbf                                5 ONLINE
/home/oracle/app/oracle/oradata/ccdb/example01.dbf                            100 ONLINE
/home/oracle/app/oracle/product/11.1.0/db_1/dbs/USER_DATA_01.DBF                5 ONLINE
/home/oracle/app/oracle/product/11.1.0/db_1/dbs/WINKS_DATA_01.DBF              62 ONLINE
/home/oracle/app/oracle/oradata/ccdb/WINKS_DATA_EN_01.DBF                      37 ONLINE

已选择8行。</pre>
<p>escaped=&quot;true&quot; </p>
<pre class="sql" name="code">
winks@CCDB&gt; set autotrace traceonly explain
winks@CCDB&gt; select * from member;

执行计划
----------------------------------------------------------
Plan hash value: 3441279308

----------------------------------------------------------------------------
| Id  | Operation         | Name   | Rows  | Bytes | Cost (%CPU)| Time     |
----------------------------------------------------------------------------
|   0 | SELECT STATEMENT  |        |  1358 |   224K|    13   (0)| 00:00:01 |
|   1 |  TABLE ACCESS FULL| MEMBER |  1358 |   224K|    13   (0)| 00:00:01 |
----------------------------------------------------------------------------
</pre>
<pre class="sql" name="code">
winks@CCDB&gt; set autotrace traceonly statistics
winks@CCDB&gt; select * from member_client;

已选择1363行。

统计信息
----------------------------------------------------------
          1  recursive calls
          0  db block gets
        149  consistent gets
          0  physical reads
          0  redo size
     380811  bytes sent via SQL*Net to client
       1354  bytes received via SQL*Net from client
         92  SQL*Net roundtrips to/from client
          0  sorts (memory)
          0  sorts (disk)
       1363  rows processed
</pre>
]]></content:encoded>
			<wfw:commentRss>http://tq.freehostia.com.freehostia.com/2009/08/google-syntax-highlighter-for-wordpress.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>测试wp-syntax</title>
		<link>http://tq.freehostia.com.freehostia.com/2009/08/wp-syntax.html</link>
		<comments>http://tq.freehostia.com.freehostia.com/2009/08/wp-syntax.html#comments</comments>
		<pubDate>Sun, 23 Aug 2009 07:36:00 +0000</pubDate>
		<dc:creator>TQ</dc:creator>
				<category><![CDATA[MY 默认分类]]></category>
		<category><![CDATA[wp-syntax]]></category>

		<guid isPermaLink="false">http://tq.freehostia.com.freehostia.com/2009/08/wp-syntax.html</guid>
		<description><![CDATA[Example 1: PHP, no line numbers

&#60;div id=&#34;foo&#34;&#62;
&#60;?php
  function foo&#40;&#41; &#123;
    echo &#34;Hello World!\\n&#34;;
  &#125;
?&#62;
&#60;/div&#62;

Example 2: Java, with line numbers

1
2
3
4
5
public class Hello &#123;
  public... ]]></description>
			<content:encoded><![CDATA[<p>Example 1: PHP, no line numbers</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&lt;div id=&quot;foo&quot;&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span>
  <span style="color: #000000; font-weight: bold;">function</span> foo<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Hello World!<span style="color: #000099; font-weight: bold;">\\</span>n&quot;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;/div&gt;</pre></div></div>

<p>Example 2: Java, with line numbers</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Hello <span style="color: #009900;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> main<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> args<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Hello World!&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Example 3: Ruby, with line numbers starting at 18</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>18
19
20
21
22
</pre></td><td class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">class</span> Example
  <span style="color:#9966CC; font-weight:bold;">def</span> example<span style="color:#006600; font-weight:bold;">&#40;</span>arg1<span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#0000FF; font-weight:bold;">return</span> <span style="color:#996600;">&quot;Hello: &quot;</span> <span style="color:#006600; font-weight:bold;">+</span> arg1.<span style="color:#9900CC;">to_s</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></td></tr></table></div>

<p>Example 4: If your code already has html entities escaped, use escaped=&#8221;true&#8221; as an option</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xml<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Hello<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/xml<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="oracle11" style="font-family:monospace;">winks@CCDB<span style="color: #66cc66;">&gt;</span> <span style="color: #993333; font-weight: bold; text-transform: uppercase;">SELECT</span> name<span style="color: #66cc66;">,</span><span style="color: #993333; font-weight: bold; text-transform: uppercase;">CEIL</span><span style="color: #66cc66;">&#40;</span>bytes<span style="color: #66cc66;">/</span><span style="color: #cc66cc;">1024</span><span style="color: #66cc66;">/</span><span style="color: #cc66cc;">1024</span><span style="color: #66cc66;">&#41;</span> MB<span style="color: #66cc66;">,</span>status <span style="color: #993333; font-weight: bold; text-transform: uppercase;">FROM</span> v$datafile;
&nbsp;
NAME                                                                           MB STATUS
<span style="color: #808080; font-style: italic;">---------------------------------------------------------------------- ---------- --------------</span>
<span style="color: #66cc66;">/</span>home<span style="color: #66cc66;">/</span>oracle<span style="color: #66cc66;">/</span>app<span style="color: #66cc66;">/</span>oracle<span style="color: #66cc66;">/</span>oradata<span style="color: #66cc66;">/</span>ccdb<span style="color: #66cc66;">/</span>system01.dbf                             <span style="color: #cc66cc;">730</span> <span style="color: #993333; font-weight: bold; text-transform: uppercase;">SYSTEM</span>
<span style="color: #66cc66;">/</span>home<span style="color: #66cc66;">/</span>oracle<span style="color: #66cc66;">/</span>app<span style="color: #66cc66;">/</span>oracle<span style="color: #66cc66;">/</span>oradata<span style="color: #66cc66;">/</span>ccdb<span style="color: #66cc66;">/</span>sysaux01.dbf                            <span style="color: #cc66cc;">1037</span> <span style="color: #993333; font-weight: bold; text-transform: uppercase;">ONLINE</span>
<span style="color: #66cc66;">/</span>home<span style="color: #66cc66;">/</span>oracle<span style="color: #66cc66;">/</span>app<span style="color: #66cc66;">/</span>oracle<span style="color: #66cc66;">/</span>oradata<span style="color: #66cc66;">/</span>ccdb<span style="color: #66cc66;">/</span>undotbs01.dbf                            <span style="color: #cc66cc;">440</span> <span style="color: #993333; font-weight: bold; text-transform: uppercase;">ONLINE</span>
<span style="color: #66cc66;">/</span>home<span style="color: #66cc66;">/</span>oracle<span style="color: #66cc66;">/</span>app<span style="color: #66cc66;">/</span>oracle<span style="color: #66cc66;">/</span>oradata<span style="color: #66cc66;">/</span>ccdb<span style="color: #66cc66;">/</span>users01.dbf                                <span style="color: #cc66cc;">5</span> <span style="color: #993333; font-weight: bold; text-transform: uppercase;">ONLINE</span>
<span style="color: #66cc66;">/</span>home<span style="color: #66cc66;">/</span>oracle<span style="color: #66cc66;">/</span>app<span style="color: #66cc66;">/</span>oracle<span style="color: #66cc66;">/</span>oradata<span style="color: #66cc66;">/</span>ccdb<span style="color: #66cc66;">/</span>example01.dbf                            <span style="color: #cc66cc;">100</span> <span style="color: #993333; font-weight: bold; text-transform: uppercase;">ONLINE</span>
<span style="color: #66cc66;">/</span>home<span style="color: #66cc66;">/</span>oracle<span style="color: #66cc66;">/</span>app<span style="color: #66cc66;">/</span>oracle<span style="color: #66cc66;">/</span>product<span style="color: #66cc66;">/</span>11.1.0<span style="color: #66cc66;">/</span>db_1<span style="color: #66cc66;">/</span>dbs<span style="color: #66cc66;">/</span>USER_DATA_01.DBF                <span style="color: #cc66cc;">5</span> <span style="color: #993333; font-weight: bold; text-transform: uppercase;">ONLINE</span>
<span style="color: #66cc66;">/</span>home<span style="color: #66cc66;">/</span>oracle<span style="color: #66cc66;">/</span>app<span style="color: #66cc66;">/</span>oracle<span style="color: #66cc66;">/</span>product<span style="color: #66cc66;">/</span>11.1.0<span style="color: #66cc66;">/</span>db_1<span style="color: #66cc66;">/</span>dbs<span style="color: #66cc66;">/</span>WINKS_DATA_01.DBF              <span style="color: #cc66cc;">62</span> <span style="color: #993333; font-weight: bold; text-transform: uppercase;">ONLINE</span>
<span style="color: #66cc66;">/</span>home<span style="color: #66cc66;">/</span>oracle<span style="color: #66cc66;">/</span>app<span style="color: #66cc66;">/</span>oracle<span style="color: #66cc66;">/</span>oradata<span style="color: #66cc66;">/</span>ccdb<span style="color: #66cc66;">/</span>WINKS_DATA_EN_01.DBF                      <span style="color: #cc66cc;">37</span> <span style="color: #993333; font-weight: bold; text-transform: uppercase;">ONLINE</span>
&nbsp;
已选择<span style="color: #cc66cc;">8</span>行。</pre></div></div>

<p>escaped=&#8221;true&#8221;</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td class="code"><pre class="oracle11" style="font-family:monospace;">winks@CCDB<span style="color: #66cc66;">&gt;</span> <span style="color: #993333; font-weight: bold; text-transform: uppercase;">SET</span> autotrace traceonly <span style="color: #993333; font-weight: bold; text-transform: uppercase;">EXPLAIN</span>
winks@CCDB<span style="color: #66cc66;">&gt;</span> <span style="color: #993333; font-weight: bold; text-transform: uppercase;">SELECT</span> <span style="color: #66cc66;">*</span> <span style="color: #993333; font-weight: bold; text-transform: uppercase;">FROM</span> member;
&nbsp;
执行计划
<span style="color: #808080; font-style: italic;">----------------------------------------------------------</span>
<span style="color: #993333; font-weight: bold; text-transform: uppercase;">PLAN</span> hash <span style="color: #993333; font-weight: bold; text-transform: uppercase;">VALUE</span>: <span style="color: #cc66cc;">3441279308</span>
&nbsp;
<span style="color: #808080; font-style: italic;">----------------------------------------------------------------------------</span>
<span style="color: #66cc66;">|</span> Id  <span style="color: #66cc66;">|</span> Operation         <span style="color: #66cc66;">|</span> Name   <span style="color: #66cc66;">|</span> <span style="color: #993333; font-weight: bold; text-transform: uppercase;">ROWS</span>  <span style="color: #66cc66;">|</span> Bytes <span style="color: #66cc66;">|</span> <span style="color: #993333; font-weight: bold; text-transform: uppercase;">COST</span> <span style="color: #66cc66;">&#40;</span>%CPU<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">|</span> <span style="color: #993333; font-weight: bold; text-transform: uppercase;">TIME</span>     <span style="color: #66cc66;">|</span>
<span style="color: #808080; font-style: italic;">----------------------------------------------------------------------------</span>
<span style="color: #66cc66;">|</span>   <span style="color: #cc66cc;">0</span> <span style="color: #66cc66;">|</span> <span style="color: #993333; font-weight: bold; text-transform: uppercase;">SELECT</span> STATEMENT  <span style="color: #66cc66;">|</span>        <span style="color: #66cc66;">|</span>  <span style="color: #cc66cc;">1358</span> <span style="color: #66cc66;">|</span>   224K<span style="color: #66cc66;">|</span>    <span style="color: #cc66cc;">13</span>   <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">|</span> 00:00:01 <span style="color: #66cc66;">|</span>
<span style="color: #66cc66;">|</span>   <span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">|</span>  <span style="color: #993333; font-weight: bold; text-transform: uppercase;">TABLE</span> <span style="color: #993333; font-weight: bold; text-transform: uppercase;">ACCESS</span> FULL<span style="color: #66cc66;">|</span> MEMBER <span style="color: #66cc66;">|</span>  <span style="color: #cc66cc;">1358</span> <span style="color: #66cc66;">|</span>   224K<span style="color: #66cc66;">|</span>    <span style="color: #cc66cc;">13</span>   <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">|</span> 00:00:01 <span style="color: #66cc66;">|</span>
<span style="color: #808080; font-style: italic;">----------------------------------------------------------------------------</span></pre></td></tr></table></div>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
</pre></td><td class="code"><pre class="sql" style="font-family:monospace;">winks@CCDB<span style="color: #66cc66;">&gt;</span> <span style="color: #993333; font-weight: bold;">SET</span> autotrace traceonly statistics
winks@CCDB<span style="color: #66cc66;">&gt;</span> <span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #66cc66;">*</span> <span style="color: #993333; font-weight: bold;">FROM</span> member_client;
&nbsp;
已选择<span style="color: #cc66cc;">1363</span>行。
&nbsp;
&nbsp;
统计信息
<span style="color: #808080; font-style: italic;">----------------------------------------------------------</span>
          <span style="color: #cc66cc;">1</span>  recursive calls
          <span style="color: #cc66cc;">0</span>  db block gets
        <span style="color: #cc66cc;">149</span>  consistent gets
          <span style="color: #cc66cc;">0</span>  physical reads
          <span style="color: #cc66cc;">0</span>  redo size
     <span style="color: #cc66cc;">380811</span>  bytes sent via SQL<span style="color: #66cc66;">*</span>Net <span style="color: #993333; font-weight: bold;">TO</span> client
       <span style="color: #cc66cc;">1354</span>  bytes received via SQL<span style="color: #66cc66;">*</span>Net <span style="color: #993333; font-weight: bold;">FROM</span> client
         <span style="color: #cc66cc;">92</span>  SQL<span style="color: #66cc66;">*</span>Net roundtrips <span style="color: #993333; font-weight: bold;">TO</span><span style="color: #66cc66;">/</span><span style="color: #993333; font-weight: bold;">FROM</span> client
          <span style="color: #cc66cc;">0</span>  sorts <span style="color: #66cc66;">&#40;</span>memory<span style="color: #66cc66;">&#41;</span>
          <span style="color: #cc66cc;">0</span>  sorts <span style="color: #66cc66;">&#40;</span>disk<span style="color: #66cc66;">&#41;</span>
       <span style="color: #cc66cc;">1363</span>  rows processed</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://tq.freehostia.com.freehostia.com/2009/08/wp-syntax.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle关于时间/日期的操作</title>
		<link>http://tq.freehostia.com.freehostia.com/2009/08/oracle-time-or-timestamp.html</link>
		<comments>http://tq.freehostia.com.freehostia.com/2009/08/oracle-time-or-timestamp.html#comments</comments>
		<pubDate>Tue, 18 Aug 2009 08:01:50 +0000</pubDate>
		<dc:creator>TQ</dc:creator>
				<category><![CDATA[MY 默认分类]]></category>

		<guid isPermaLink="false">http://tq.freehostia.com.freehostia.com/2009/08/oracle-time-or-timestamp.html</guid>
		<description><![CDATA[1.日期时间间隔操作 
当前时间减去7分钟的时间
select&#160; sysdate,sysdate - interval '7' MINUTE&#160; from dual; 
当前时间减去7小时的时间 
select&#160; sysdate &#8211; interval &#8216;7&#8242; hour&#160; from dual ; 
当前... ]]></description>
			<content:encoded><![CDATA[<p>1.日期时间间隔操作 </p>
<p>当前时间减去7分钟的时间
<pre class="sql" name="code">select&#160; sysdate,sysdate - interval '7' MINUTE&#160; from dual; </pre>
<p>当前时间减去7小时的时间 </p>
<p><textarea name="code" class="sql" cols="60" rows="10">select&#160; sysdate &#8211; interval &#8216;7&#8242; hour&#160; from dual ; </textarea></p>
<p>当前时间减去7天的时间 </p>
<p></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span>  sysdate <span style="color: #66cc66;">-</span> interval <span style="color: #ff0000;">'7'</span> day  <span style="color: #993333; font-weight: bold;">FROM</span> dual ;</pre></td></tr></table></div>

<p>当前时间减去7月的时间 </p>
<p>
<pre>select&#160; sysdate,sysdate - interval '7' month from dual ; </pre>
<p>当前时间减去7年的时间 </p>
<p>
<pre class="sql">select&#160; sysdate,sysdate - interval '7' year&#160;&#160; from dual ; </pre>
<p>时间间隔乘以一个数字 </p>
<p>select&#160; sysdate,sysdate &#8211; 8 *interval &#8216;2&#8242; hour&#160;&#160; from dual; </p>
<p>2.日期到字符操作 </p>
<p>select&#160; sysdate,to_char(sysdate,&#8217;yyyy-mm-dd hh24:mi:ss&#8217;)&#160; from dual ;<br />
  
<pre class="sql" name="code">select&#160; sysdate,to_char(sysdate,'yyyy-mm-dd hh:mi:ss')&#160; from dual ; 

select&#160; sysdate,to_char(sysdate,'yyyy-ddd hh:mi:ss')&#160; from dual ; 

select&#160; sysdate,to_char(sysdate,'yyyy-mm iw-d hh:mi:ss')&#160; from dual ; </pre>
<p>&#160;&#160; 参考oracle的相关关文档(ORACLE901DOC/SERVER.901/A90125/SQL_ELEMENTS4.HTM#48515) </p>
<p>3. 字符到日期操作 </p>
<p>select&#160; to_date(&#8217;2003-10-17 21:15:37&#8242;,&#8217;yyyy-mm-dd hh24:mi:ss&#8217;) from dual<br />
  <br />具体用法和上面的to_char差不多。 </p>
<p>4. trunk/ ROUND函数的使用 </p>
<p>select&#160; trunc(sysdate ,&#8217;YEAR&#8217;)&#160; from dual<br />
  <br />select&#160; trunc(sysdate )&#160; from dual </p>
<p>select&#160; to_char(trunc(sysdate ,&#8217;YYYY&#8217;),&#8217;YYYY&#8217;)&#160; from&#160; dual </p>
<p>5.oracle有毫秒级的数据类型 </p>
<p>&#8211;返回当前时间 年月日小时分秒毫秒<br />
  <br />select to_char(current_timestamp(5),&#8217;DD-MON-YYYY HH24:MI:SSxFF&#8217;) from dual; </p>
<p>&#8211;返回当前 时间的秒毫秒，可以指定秒后面的精度(最大=9) </p>
<p>select to_char(current_timestamp(9),&#8217;MI:SSxFF&#8217;) from dual; </p>
<p>6.计算程序运行的时间(ms) </p>
<p>declare<br />
  <br />&#160;&#160;&#160; type rc is ref cursor; </p>
<p>&#160;&#160;&#160; l_rc rc; </p>
<p>&#160;&#160;&#160; l_dummy all_objects.object_name%type; </p>
<p>&#160;&#160;&#160; l_start number default dbms_utility.get_time; </p>
<p>begin </p>
<p>&#160;&#160;&#160; for&#160; I&#160; in 1 .. 1000 </p>
<p>&#160;&#160;&#160; loop </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; open l_rc for </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#8217;select object_name&#160; from all_objects &#8216;|| </p>
<p>&#8216;where object_id = &#8216; || i;<br />
  <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; fetch l_rc into l_dummy; </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; close l_rc; </p>
<p>&#160;&#160;&#160; end loop; </p>
<p>&#160;&#160;&#160; dbms_output.put_line </p>
<p>&#160;&#160;&#160; ( round( (dbms_utility.get_time-l_start)/100, 2 ) || </p>
<p>&#160;&#160;&#160;&#160;&#160; &#8216; seconds&#8230;&#8217; ); </p>
<p>end; </p>
]]></content:encoded>
			<wfw:commentRss>http://tq.freehostia.com.freehostia.com/2009/08/oracle-time-or-timestamp.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
