<?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; Oracle</title>
	<atom:link href="http://tq.freehostia.com.freehostia.com/category/oracle/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>使用sqlloader导入数据</title>
		<link>http://tq.freehostia.com.freehostia.com/2009/09/sqlloader.html</link>
		<comments>http://tq.freehostia.com.freehostia.com/2009/09/sqlloader.html#comments</comments>
		<pubDate>Sat, 26 Sep 2009 07:57:00 +0000</pubDate>
		<dc:creator>TQ</dc:creator>
				<category><![CDATA[Oracle数据库管理]]></category>
		<category><![CDATA[sqlloader]]></category>

		<guid isPermaLink="false">http://tq.freehostia.com.freehostia.com/2009/09/sqlloader.html</guid>
		<description><![CDATA[

今天为开发数据库导入数据，使用sqlloader。记录一下遇到的问题及笔记。  1、表结构如下：
 oss@WINKSDB&#62; desc member_actions; Name              Null?    Type ----------------- -------- ------------ PHONE             NO... ]]></description>
			<content:encoded><![CDATA[<div id="Published By Juziyue-[4]1_124F523B08F540F6AD4293E61293381E_0862E224B1A14E30B1F5C72BD1E6A719_1"></div>
<p><span id="more-192"></span>
<div id="Published By Juziyue-[4]1_124F523B08F540F6AD4293E61293381E_0862E224B1A14E30B1F5C72BD1E6A719">今天为开发数据库导入数据，使用sqlloader。记录一下遇到的问题及笔记。<br/> <br/> <strong>1、表结构如下：</strong>
<pre class="sql"> oss@WINKSDB&gt; desc member_actions; Name              Null?    Type ----------------- -------- ------------ PHONE             NOT NULL VARCHAR2(50) ACTION_TIME       NOT NULL DATE URL                        VARCHAR2(80) APP                        VARCHAR2(20) ACTIVE_LEVEL               VARCHAR2(10) </pre>
<p> <strong>2、要导入的文件（infile），是由log分析得来：</strong><br />
<blockquote>[oracle@devdb: ~]$ll -th deactive_actionlist.2009-09-23-rw-r&#8211;r&#8211; 1 oracle oinstall 49M Sep 24 03:11 deactive_actionlist.2009-09-23[oracle@devdb: ~]$head !$head deactive_actionlist.2009-09-23<font face="宋体" color="#FF00FF" size="2">2009-09-23 00:00:04<strong>,314</strong></font> 13560338333 user/registeruser comm deactive2009-09-23 00:00:17,053 13563963585 user/registeruser comm deactive2009-09-23 00:02:05,704 13810843712 user/registeruser comm deactive2009-09-23 00:02:41,097 13609331107 user/registeruser comm deactive2009-09-23 00:02:43,330 13520106592 user/registeruser comm deactive2009-09-23 00:04:18,818 18702967004 user/registeruser comm deactive2009-09-23 00:05:52,878 15106936277 user/registeruser comm deactive2009-09-23 00:09:14,438 13483699551 user/registeruser comm deactive2009-09-23 00:09:37,988 15910669392 user/registeruser comm deactive2009-09-23 00:09:46,555 15819008127 user/registeruser comm deactive</p></blockquote>
<p> <strong>3、sqlloader的controlfile如下：</strong><br />
<blockquote>
<pre class="sql"> load data                                            --控制文件标识 infile 'deactive_actionlist.2009-09-23'        --要导入数据的文件名 truncate into table MEMBER_ACTIONS                  --truncate table MEMBER_ACTIONS_IMP后，再导入数据 fields terminated by &quot; &quot; optionally enclosed by '&quot;'        --字符终止于“空格”，并附上&quot;双引号(ACTION_TIME POSITION(1:19) date &quot;YYYY-MM-DD HH24:MI:SS&quot;,     --infile中的日期／时间精确到千分秒，而ACTION_TIME列 为DATE型field2 FILLER,                                               --所以多了一段3位的千分秒，要把它漏过去phone, url,app,active_level)                                                       --定义列对应顺序 </pre>
</blockquote>
<blockquote><p><strong>说明：</strong>INSERT：为缺省方式，在数据装载开始时要求表为空。APPEND：在表中追加新记录。REPLACE：使用一种传统DELETE语句；因此，如果要加载的表中已经包含许多记录，这个操作可能执行得很慢。TRUNCATE：则不同，它使用TRUNCATE SQL命令，通常会更快地执行，因为它不必物理地删除每一行。</p></blockquote>
<p> <strong>4、现在来导入并看一下产生的log：</strong><br />
<blockquote>[oracle@devdb: ~]$sqlldr oss/oss control=deactive.ctl <font face="宋体" color="#FF0000" size="2">direct=true</font> &#8212;导入性能果然很快！<font face="宋体" color="#FF0000" size="2">只用了5.75秒</font>。[oracle@devdb: ~]$cat deactive.logSQL*Loader: Release 11.1.0.7.0 &#8211; Production on Fri Sep 25 11:02:59 2009Copyright (c) 1982, 2007, Oracle. All rights reserved.Control File: deactive.ctlData File: deactive_actionlist.2009-09-23 Bad File: deactive_actionlist.bad Discard File: none specified (Allow all discards)Number to load: ALLNumber to skip: 0Errors allowed: 50Continuation: none specifiedPath used: DirectTable MEMBER_ACTIONS, loaded from every logical record.Insert option in effect for this table: TRUNCATE Column Name Position Len Term Encl Datatype&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; &#8212;&#8212;&#8212;- &#8212;&#8211; &#8212;- &#8212;- &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;ACTION_TIME 1:19 19 WHT O(&quot;) DATE YYYY-MM-DD HH24:MI:SSFIELD2 NEXT * WHT O(&quot;) CHARACTER (FILLER FIELD)PHONE NEXT * WHT O(&quot;) CHARACTER URL NEXT * WHT O(&quot;) CHARACTER APP NEXT * WHT O(&quot;) CHARACTER ACTIVE_LEVEL NEXT * WHT O(&quot;) CHARACTER Table MEMBER_ACTIONS: <font face="宋体" color="#FF0000" size="2">821263 Rows successfully loaded.</font> 0 Rows not loaded due to data errors. 0 Rows not loaded because all WHEN clauses were failed. 0 Rows not loaded because all fields were null. Date conversion cache disabled due to overflow (default size: 1000)Bind array size not used in direct path.Column array rows : 5000Stream buffer bytes: 256000Read buffer bytes: 1048576Total logical records skipped: 0Total logical records read: 821263Total logical records rejected: 0Total logical records discarded: 0Total stream buffers loaded by SQL*Loader main thread: 195Total stream buffers loaded by SQL*Loader load thread: 0Run began on Fri Sep 25 11:02:59 2009Run ended on Fri Sep 25 11:03:05 2009Elapsed time was: <font face="宋体" color="#FF0000" size="2">00:00:05.75</font>CPU time was: 00:00:03.26</p></blockquote>
<p> <strong>5、最后，看看导入的数据有没有问题：</strong>
<pre class="sql"> oss@WINKSDB&gt; select count(*) from member_actions;  COUNT(*)----------    821263oss@WINKSDB&gt; alter session set nls_date_format='yyyy-dd-mm hh24:mi:ss';Session altered.oss@WINKSDB&gt; col phone for a15oss@WINKSDB&gt; col url for a30oss@WINKSDB&gt; col app for a15oss@WINKSDB&gt; select * from member_actions where rownum &lt;= 10;PHONE           ACTION_TIME         URL                            APP             ACTIVE_LEVEL--------------- ------------------- ------------------------------ --------------- ---------------15850680739     2009-23-09 23:21:16 specialwinks                   comm            deactive15819468114     2009-23-09 23:21:16 winks/show                     comm            deactive15817936605     2009-23-09 23:21:16 winks/show                     comm            deactive13471875440     2009-23-09 23:21:16 message                        comm            deactive13262699996     2009-23-09 23:21:16 winks/show                     comm            deactive15129159347     2009-23-09 23:21:16 specialwinks                   comm            deactive13960018854     2009-23-09 23:21:16 specialwinks                   comm            deactive15860758584     2009-23-09 23:21:16 winks/show                     comm            deactive13880176827     2009-23-09 23:21:16 specialwinks                   comm            deactive15120901746     2009-23-09 23:21:16 config                         comm            deactive10 rows selected. </pre>
<p> 导入的数据没有问题！<br/> 该服务器的CPU为1颗4核的Intel(R) Xeon(R) CPU E5410 @ 2.33GHz &nbsp;&nbsp;&nbsp;&nbsp;内存：4G<br/> <br/> &#8211; The End -</div>
]]></content:encoded>
			<wfw:commentRss>http://tq.freehostia.com.freehostia.com/2009/09/sqlloader.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle 创建只读用户</title>
		<link>http://tq.freehostia.com.freehostia.com/2009/08/oracle_user_readonly.html</link>
		<comments>http://tq.freehostia.com.freehostia.com/2009/08/oracle_user_readonly.html#comments</comments>
		<pubDate>Thu, 20 Aug 2009 08:17:00 +0000</pubDate>
		<dc:creator>TQ</dc:creator>
				<category><![CDATA[Oracle数据库管理]]></category>
		<category><![CDATA[read only oracle user]]></category>

		<guid isPermaLink="false">http://tq.freehostia.com.freehostia.com/2009/08/oracle_user_readonly.html</guid>
		<description><![CDATA[
set pages 999;
set heading off;
spool d:\run_grant.sql
select 'grant select on '&#124;&#124;owner&#124;&#124;'.'&#124;&#124;object_name&#124;&#124; ' to user1;'
from dba_objects
 where object_type='TABLE'  and owner='SCOTT';
spool off;
... ]]></description>
			<content:encoded><![CDATA[<pre class="sql" name="code">
set pages 999;
set heading off;
spool d:\run_grant.sql
select 'grant select on '||owner||'.'||object_name|| ' to user1;'
from dba_objects
 where object_type='TABLE'  and owner='SCOTT';
spool off;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://tq.freehostia.com.freehostia.com/2009/08/oracle_user_readonly.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>在WINDOWS 下改变sqlplusw字体大小</title>
		<link>http://tq.freehostia.com.freehostia.com/2009/08/sqlplusw-font.html</link>
		<comments>http://tq.freehostia.com.freehostia.com/2009/08/sqlplusw-font.html#comments</comments>
		<pubDate>Tue, 18 Aug 2009 02:17:00 +0000</pubDate>
		<dc:creator>TQ</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[sqlplusw font]]></category>

		<guid isPermaLink="false">http://tq.freehostia.com.freehostia.com/2009/08/sqlplusw-font.html</guid>
		<description><![CDATA[有时在做演示时希望修改SQLPLUSW字体大小，可通过修改注册表完成。位置：\HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\KEY_OraDb10g_home1
增加String Valuesqlplus_font&#160; 其值为terminalsqlplus_font_size&#160; 其值可为 数值，... ]]></description>
			<content:encoded><![CDATA[<p>有时在做演示时希望修改SQLPLUSW字体大小，可通过修改注册表完成。<br />位置：<br />\HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\KEY_OraDb10g_home1</p>
<p>增加String Value<br />sqlplus_font&nbsp; 其值为terminal<br />sqlplus_font_size&nbsp; 其值可为 数值，如16，18，20 &#8230;</p>
<p>重启SQLPLUSW后可观察到效果
<p>- The End -<br />转自：<a title="http://space.itpub.net/13940/viewspace-611702" href="http://space.itpub.net/13940/viewspace-611702">http://space.itpub.net/13940/viewspace-611702</a></p>
]]></content:encoded>
			<wfw:commentRss>http://tq.freehostia.com.freehostia.com/2009/08/sqlplusw-font.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>备份策略的选择</title>
		<link>http://tq.freehostia.com.freehostia.com/2009/08/backup-policy.html</link>
		<comments>http://tq.freehostia.com.freehostia.com/2009/08/backup-policy.html#comments</comments>
		<pubDate>Fri, 14 Aug 2009 10:21:00 +0000</pubDate>
		<dc:creator>TQ</dc:creator>
				<category><![CDATA[Oracle备份与恢复]]></category>
		<category><![CDATA[backup policy]]></category>

		<guid isPermaLink="false">http://tq.freehostia.com.freehostia.com/2009/08/backup-policy.html</guid>
		<description><![CDATA[数据量归档否是否是容易加载，而比恢复更快是否有存储软件是否为裸设备
数据量：如果数据量小，每天全备份如果数据量大，要有rman的备份策略
归档否：非归档数据库：只有冷备份归档：... ]]></description>
			<content:encoded><![CDATA[<blockquote><p>数据量<br />归档否<br />是否是容易加载，而比恢复更快<br />是否有存储软件<br />是否为裸设备
<p>数据量：<br />如果数据量小，每天全备份<br />如果数据量大，要有rman的备份策略
<p>归档否：<br />非归档数据库：只有冷备份<br />归档：既可以冷备份，也可以热备份
<p>是否是容易加载，而比恢复更快：<br />如果数据是每天统一灌入，以后就是查询<br />可以每天冷备份，失败后先将数据库恢复到备份点，再重新灌入
<p>是否有存储软件：<br />如果有其它存储软件<br />最好归档，rman，增量
<p>是否为裸设备：<br />如果是裸设备<br />rman或逻辑备份<br />还有ocopy<br />ocopy from_file [to_file [a | size_1 [size_n]]]<br />ocopy -b from_file to_drive<br />ocopy -r from_drive to_dir </p>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://tq.freehostia.com.freehostia.com/2009/08/backup-policy.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle备份</title>
		<link>http://tq.freehostia.com.freehostia.com/2009/08/oracle-backup.html</link>
		<comments>http://tq.freehostia.com.freehostia.com/2009/08/oracle-backup.html#comments</comments>
		<pubDate>Fri, 14 Aug 2009 09:50:00 +0000</pubDate>
		<dc:creator>TQ</dc:creator>
				<category><![CDATA[Oracle备份与恢复]]></category>

		<guid isPermaLink="false">http://tq.freehostia.com.freehostia.com/2009/08/oracle-backup.html</guid>
		<description><![CDATA[备份：&#160;&#160;&#160; DBWR：&#160;&#160;&#160; LGWR：（oradata中）三个日志redo01.log、redo02.log、redo02.log。&#160;&#160;&#160; ARCH：归档日志：备份redo日志。&#160;&#160;&#160; 要完整恢复archivelog归档。&#160;&#160;&... ]]></description>
			<content:encoded><![CDATA[<p>备份：<br />&nbsp;&nbsp;&nbsp; DBWR：<br />&nbsp;&nbsp;&nbsp; LGWR：（oradata中）三个日志redo01.log、redo02.log、redo02.log。<br />&nbsp;&nbsp;&nbsp; ARCH：归档日志：备份redo日志。&nbsp;&nbsp;&nbsp; 要完整恢复archivelog归档。<br />&nbsp;&nbsp;&nbsp; CKPT：通知DBWR、LGWR、ARCH什么时候写；通知控制文件写。
<p>至少备份（2个）：数据文件、redo log。<br />&nbsp;&nbsp;&nbsp; 物理备份：v$datafile、v$logfile、v$controlfile、v$recovery_log、密码文件、参数文件。<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; （前三个最重要！）<br />&nbsp;&nbsp;&nbsp; 逻辑备份：二进制文件、文本文件——用DML、DDL、DCL。<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 导入／导出：IMP、EXP
<p>冗余机制：备份要放到其它物理位置。
<p>物理备份、逻辑备份 都是“垃圾数据”。
<p>当恢复时，<br />非归档：如不要最新的数据时，OK！&nbsp;&nbsp; noarchivelog<br />归档：日志（LGWR、ARCH），可部分或完整恢复。
<p>设置为归档：<br />① ＞startup mount;<br />② ＞alter database archivelog;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8211;&gt;10G<br />&nbsp;&nbsp; ＞alter system archive log start;&nbsp;&nbsp;&nbsp; &#8211;&gt;9i<br />③ ＞alter database open;<br />④ ＞archive log list;<br />归档文件存放在：/u01/app/flash_recovery_area/&nbsp;&nbsp;&nbsp; (10g)<br />单机＞alter system switch logfile;&nbsp;&nbsp;&nbsp; 切换日志，会在归档目录下有日志产生。<br />集群＞alter system archive log current;
<p>＞archive log all;&nbsp;&nbsp;&nbsp; 看哪些日志要归档
<p>冷备份：<br />停止数据库后做的备份；<br />所有的数据库都可以冷备份；<br />冷备份不能备局部，必须备份整体；<br />没有增量备份策略；<br />需要的空间较大；<br />概念简单，执行简单。
<p>冷备份的执行步骤：<br />⑴ 一致性停止数据库（shutdown immediate;）<br />⑵ 备份：数据文件、控制文件、日志文件、<br />&nbsp;&nbsp;&nbsp;&nbsp; 密码文件、参数文件、临时文件（可选）<br />⑶ 启动数据库。
<p>书写冷备份脚本：<br />select &#8216;copy &#8216;||name||&#8217; d:\bk&#8217; from v$datafile<br />union all<br />select &#8216;copy &#8216;||name||&#8217; d:\bk&#8217; from v$controlfile<br />union all<br />select &#8216;copy &#8216;||name||&#8217; d:\bk&#8217; from v$tempfile<br />union all <br />select &#8216;copy &#8216;||member||&#8217; d:\dk&#8217; from v$logfile;<br />这是是脚本的局部，前面得加停止数据库，后面加启动数据库，另外加上参数文件和密码文件的备份命令。<br />运行脚本<br />查看日志<br />1。数据库停止了<br />2。复制成功<br />3。数据库启动了
<p>优点：<br />&nbsp;&nbsp;&nbsp; 冷备份是最可靠的备份；<br />&nbsp;&nbsp;&nbsp; 在不完全恢复前和后都最好做冷备份。<br />缺点：<br />&nbsp;&nbsp;&nbsp; 必须停止数据库；<br />&nbsp;&nbsp;&nbsp; 空间占用大，冷备份是一个整体，不能备份局部，所以使用的时候有一定的局限性，当然如果是归档数据库可以备份局部，但一般我们不这么做，因为归档数据库可以热备份，不必停止数据库。
<p>冷备份的恢复：<br />停止数据库，将备份复制回原来的目录就可以。<br />将数据库带回到备份的时间点。如果想恢复全部的交易，要应用归档的日志。
<p>热备份：<br />数据库open下的备份；<br />数据库必须处于归档状态；<br />可以备份局部；<br />没有增量备份策略。
<p>备份内容：<br />&nbsp;&nbsp;&nbsp; 数据文件、控制文件、归档日志文件、密码文件、参数文件；<br />&nbsp;&nbsp;&nbsp; 不能备份在线的日志文件redo log。
<p>数据文件的备份：<br />alter tablespace users begin backup;<br />host copy ####&nbsp; *****<br />alter tablespace users end backup;<br />除了临时表空间外，所有表空间都要做一遍。<br />&gt; select *&nbsp; from v$backup;
<p>alter tablespace users begin backup;<br />1。将该表空间的文件单独存盘。<br />2。将该表空间的文件头冷冻。<br />3。日志的产生加入了变化块的原来拷贝。<br />4。数据文件体不影响，因为文件头中没有我们的数据，所以交易可以继续。<br />5。恢复的时候需要归档文件的支持。
<p>alter tablespace users end backup;<br />将文件头解冻<br />将控制文件中最新的存盘时间SCN写入文件头<br />一句话，热备份的文件是一个〖无效的垃圾文件〗，需要〖日志的配合〗才能恢复，所以归档数据库是热备份的前提条件。热备份的文件中〖只有一个数据块〗是保真的，就是被冷冻的数据文件头的〖第一个块〗，文件头有8个块，数据库只冷冻一个，因为数据库只是需要一个SCN坐标而已。其余7个数据块含有范围的信息，是会改变的，不能冷冻。我们备份的垃圾文件的数据块有两类：一是SCN小于头的块，另一类是SCN大于头的块，凡是大于文件头的块都有一个该块的原形存在于日志文件中。 </p>
]]></content:encoded>
			<wfw:commentRss>http://tq.freehostia.com.freehostia.com/2009/08/oracle-backup.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle truncate table 与 delete tabel的区别</title>
		<link>http://tq.freehostia.com.freehostia.com/2009/08/truncate-table-or-delete-table.html</link>
		<comments>http://tq.freehostia.com.freehostia.com/2009/08/truncate-table-or-delete-table.html#comments</comments>
		<pubDate>Tue, 11 Aug 2009 10:25:00 +0000</pubDate>
		<dc:creator>TQ</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[delete table]]></category>
		<category><![CDATA[truncate table]]></category>

		<guid isPermaLink="false">http://tq.freehostia.com.freehostia.com/2009/08/truncate-table-or-delete-table.html</guid>
		<description><![CDATA[一、
1.delete产生rollback，如果删除大数据量的表速度会很慢，同时会占用很多的rollback segments .truncate 是DDL操作，不产生rollback，速度快一些.　　Truncate table does not generate rollback information and redo re... ]]></description>
			<content:encoded><![CDATA[<p>一、
<p>1.delete产生rollback，如果删除大数据量的表速度会很慢，同时会占用很多的rollback segments .truncate 是DDL操作，不产生rollback，速度快一些.<br />　　Truncate table does not generate rollback information and redo records so it is much faster than delete.<br />　　In default, it deallocates all space except the space allocated by MINEXTENTS unless you specify REUSE STORAGE clause.<br />2.不从tablespace中腾出空间,需要<br />　　ALTER TABLESPACE AAA COALESCE; 才有空间<br />3.truncate 调整high water mark 而delete不.truncate之后，TABLE的HWM退回到 INITIAL和NEXT的位置（默认）<br />　　delete 则不可以。<br />4.truncate 只能对TABLE<br />　　delete 可以是table,view,synonym<br />5.TRUNCATE TABLE 的对象必须是本模式下的，或者有drop any table的权限 而 DELETE 则是对象必须是本模式下的，或被授予 DELETE ON SCHEMA.TABLE 或DELETE ANY TABLE的权限
<p>二、 truncate是DDL語言.<br />delete是DML語言<br />DDL語言是自動提交的.<br />命令完成就不可回滾.<br />truncate的速度也比delete要快得多. 所以，delete 后要commit work，而truncate就不需要啦。
<p>三、 truncate 会把 highwatermark 回归至 0 &#8230; 当下一次再插入新资料时就会快一些啦。<br />所以一般都是在 temp table 上使用的，不过要注意就是 truncate 不能在 pl/sql 上使用，要用 dynamic SQL 才可以。
<p>四、
<p>当你不再需要该表时， 用 drop;<br />当你仍要保留该表，但要删除所有记录时， 用 truncate;<br />当你要删除部分记录时（always with a WHERE clause), 用 delete.
<p>五、
<p>1.TRUNCATE TABLE
<p>Index也會刪掉不是指drop index<br />sys@DEMO&gt; create index </p>
]]></content:encoded>
			<wfw:commentRss>http://tq.freehostia.com.freehostia.com/2009/08/truncate-table-or-delete-table.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Oracle基本信息检查</title>
		<link>http://tq.freehostia.com.freehostia.com/2009/08/oracle-base-info.html</link>
		<comments>http://tq.freehostia.com.freehostia.com/2009/08/oracle-base-info.html#comments</comments>
		<pubDate>Mon, 10 Aug 2009 07:27:00 +0000</pubDate>
		<dc:creator>TQ</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Oracle数据库管理]]></category>
		<category><![CDATA[Oracle基础信息检查]]></category>

		<guid isPermaLink="false">http://tq.freehostia.com.freehostia.com/2009/08/oracle%e5%9f%ba%e6%9c%ac%e4%bf%a1%e6%81%af%e6%a3%80%e6%9f%a5.html</guid>
		<description><![CDATA[1.	检查Windows下的Oracle相关服务的状态
 主要服务包括： OracleServiceORA10：Oracle实例服务 OracleOraDb10g_home1TNSListenerFslmyoracle：	Oracle监听服务（OFS管理） OracleMSCSServices：Oracle Fail Safe for MSCS服务   在当... ]]></description>
			<content:encoded><![CDATA[<p>1.	检查Windows下的Oracle相关服务的状态<br />
<blockquote> 主要服务包括： OracleServiceORA10：Oracle实例服务<br /> OracleOraDb10g_home1TNSListenerFslmyoracle：	Oracle监听服务（OFS管理）<br /> OracleMSCSServices：Oracle Fail Safe for MSCS服务 <br />  在当前活动节点上，服务状态应该是正常“已启动”状态。 </p></blockquote>
<p>  2.	检查Oracle初始化参数<br />
<blockquote>
<pre class="sql" name="code">
select * from v$parameter
</pre>
</blockquote>
<p>3.	检查Oracle的实例状态</p>
<blockquote>
<pre class="sql" name="code">
select instance_name,version,status,database_status
from v$instance;
</pre>
<p>其中&#8221;STATUS&#8221;表示Oracle当前的实例状态，必须为&#8221;OPEN&#8221;；&#8221;DATABASE_STATUS&#8221;表示Oracle当前数据库的状态，必须为&#8221;ACTIVE&#8221;。
</p></blockquote>
<p>4.	检查后台线程的状态</p>
<blockquote>
<pre class="sql" name="code">
Select name,Description
From V$BGPROCESS
Where Paddr<>'00';
</pre>
</blockquote>
<p>5.	检查系统全局区SGA信息</p>
<blockquote>
<pre class="sql" name="code">
select * from v$sga;
</pre>
<p>检查SGA各部份的分配情况，与实际内存比较是否合理。
</p></blockquote>
<p>6.	检查SGA各部分占用内存状况</p>
<blockquote>
<pre class="sql" name="code">
select * from v$sgastat;
</pre>
<p>检查有无占用大量Shared pool的对象，及是否有内存浪费情况。
</p></blockquote>
<p>7.	检查系统SCN号</p>
<blockquote>
<pre class="sql" name="code">
select max(ktuxescnw * power(2, 32) + ktuxescnb) scn from x$ktuxe;
select dbms_flashback.get_system_change_number from dual;
select current_scn from v$database;
</pre>
</blockquote>
<p>8.	检查数据库状态</p>
<blockquote>
<pre class="sql" name="code">
select name,log_mode,open_mode from v$database;
</pre>
</blockquote>
<p>9.	检查当前数据库的操作系统平台</p>
<blockquote>
<pre class="sql" name="code">
select platform_name from v$database;
</pre>
</blockquote>
<p>10.	检查数据库的大小，和空间使用情况</p>
<blockquote>
<pre class="sql" name="code">
col tablespace format a20
select b.file_id　　文件ID,
　　b.tablespace_name　　表空间,
　　b.file_name　　　　　物理文件名,
　　b.bytes　　　　　　　总字节数,
　　(b.bytes-sum(nvl(a.bytes,0)))　　　已使用,
　　sum(nvl(a.bytes,0))　　　　　　　　剩余,
　　sum(nvl(a.bytes,0))/(b.bytes)*100　剩余百分比
　　from dba_free_space a,dba_data_files b
　　where a.file_id=b.file_id
　　group by b.tablespace_name,b.file_name,b.file_id,b.bytes
　　order by b.tablespace_name
/
</pre>
<p>　　dba_free_space &#8211;表空间剩余空间状况<br />
　　dba_data_files &#8211;数据文件空间占用情况
</p></blockquote>
<p>11.	检查数据库的创建日期和归档方式</p>
<blockquote>
<pre class="sql" name="code">
Select Created, Log_Mode, Log_Mode From V$Database;
</pre>
</blockquote>
<p>12.	检查数据库是否处于归档模式，并启动了自动归档进程</p>
<blockquote>
<pre class="sql" name="code">
archive log list;
</pre>
</blockquote>
<p>13.	检查NLS信息（包括字符集）</p>
<blockquote>
<pre class="sql" name="code">
select * from nls_database_parameters
</pre>
<p>&#8216;NLS_LANGUAGE&#8217; || &#8216;NLS_TERRITORY&#8217; || &#8216;NLS_CHARACTERSET&#8217; 即字符集。
</p></blockquote>
<p>14.	检查表空间的名称、状态及大小</p>
<blockquote>
<pre class="sql" name="code">
select t.tablespace_name, t.status, round(sum(bytes/(1024*1024)),0) ts_size
    from dba_tablespaces t, dba_data_files d
    where t.tablespace_name = d.tablespace_name
group by t.tablespace_name, t.status;
</pre>
</blockquote>
<p>15.	检查每个表空间占用空间的大小</p>
<blockquote>
<pre class="sql" name="code">
Select Tablespace_Name,Sum(bytes)/1024/1024
From Dba_Segments Group By Tablespace_Name;
</pre>
</blockquote>
<p>16.	检查表空间物理文件的名称及大小</p>
<blockquote>
<pre class="sql" name="code">
select tablespace_name, file_id, file_name,
round(bytes/(1024*1024),0) total_space
from dba_data_files
order by tablespace_name;
</pre>
</blockquote>
<p>17.	查询表空间的剩余大小</p>
<blockquote>
<pre class="sql" name="code">
select tablespace_name,sum(bytes)/(1024*1024) as free_space
from dba_free_space
group by tablespace_name;
</pre>
</blockquote>
<p>18.	检查表空间的使用情况</p>
<blockquote>
<pre class="sql" name="code">
SELECT A.TABLESPACE_NAME,A.BYTES TOTAL,B.BYTES USED, C.BYTES FREE,
(B.BYTES*100)/A.BYTES "% USED",(C.BYTES*100)/A.BYTES "% FREE"
FROM SYS.SM$TS_AVAIL A,SYS.SM$TS_USED B,SYS.SM$TS_FREE C
WHERE A.TABLESPACE_NAME=B.TABLESPACE_NAME
AND A.TABLESPACE_NAME=C.TABLESPACE_NAME;
</pre>
</blockquote>
<p>19.	检查表空间碎块状况</p>
<blockquote>
<pre class="sql" name="code">
col tablespace_name form a25
select tablespace_name, count(*) chunks,
max(bytes)/1024/1024 max_chunk,
sum(bytes)/1024/1024 total_space
from dba_free_space group by tablespace_name;
</pre>
<p>如果最大可用块(max_chunk)与总大小(total_space)相比太小，要考虑接合表空间碎片或重建某些数据库对象。 碎片接合的方法: alter tablespace 表空间名 coalesce;
</p></blockquote>
<p>20.	检查回滚段名称、状态及大小</p>
<blockquote>
<pre class="sql" name="code">
select segment_name, tablespace_name, r.status,
(initial_extent/1024) InitialExtent,(next_extent/1024) NextExtent,
max_extents, v.curext CurExtent
From dba_rollback_segs r, v$rollstat v
Where r.segment_id = v.usn(+)
order by segment_name ;
</pre>
</blockquote>
<p>21.	检查控制文件状态</p>
<blockquote>
<pre class="sql" name="code">
select * from v$controlfile;
</pre>
</blockquote>
<p>22.	检查日志文件状态</p>
<blockquote>
<pre class="sql" name="code">
select * from v$logfile;
</pre>
</blockquote>
<p>23.	检查日志组信息</p>
<blockquote>
<pre class="sql" name="code">
select * from v$log;
</pre>
</blockquote>
<p>24.	检查数据文件状态</p>
<blockquote>
<pre class="sql" name="code">
select file_name,status
from dba_data_files;
</pre>
</blockquote>
<p>25.	检查数据文件存放路径</p>
<blockquote>
<pre class="sql" name="code">
col file_name format a50
select tablespace_name,file_id,bytes/1024/1024,file_name
from dba_data_files order by file_id;
</pre>
</blockquote>
<p>26.	检查数据文件的自动增长控制</p>
<blockquote>
<pre class="sql" name="code">
select file_name,autoextensible from dba_data_files;
</pre>
</blockquote>
<p>27.	检查临时数据文件路径</p>
<blockquote>
<pre class="sql" name="code">
select file_name
from Dba_temp_files;
</pre>
</blockquote>
<p>28.	检查闪回恢复区的路径</p>
<blockquote>
<pre class="sql" name="code">
select name from v$recovery_file_dest;
</pre>
</blockquote>
<p>29.	检查数据库库对象</p>
<blockquote>
<pre class="sql" name="code">
select owner, object_type, status, count(*) count#
from all_objects group by owner, object_type, status;
</pre>
</blockquote>
<p>30.	检查数据库的版本　</p>
<blockquote>
<pre class="sql" name="code">
Select version FROM Product_component_version
Where SUBSTR(PRODUCT,1,6)='Oracle';

VERSION
---------------
11.1.0.6.0
</pre>
<p>依次为：版本号11、新特性版本号1、维护版本号0、普通的补丁设置号码6、特殊的平台补丁设置号码0
</p></blockquote>
<p>31.	检查数据库的创建日期和归档方式</p>
<blockquote>
<pre class="sql" name="code">
Select Created, Log_Mode, Log_Mode From V$Database;
</pre>
</blockquote>
<p>32.	检查当前所有对象</p>
<blockquote>
<pre class="sql" name="code">
select * from tab;
</pre>
</blockquote>
<p>33.	检查当前连接用户</p>
<blockquote>
<pre class="sql" name="code">
show user;
</pre>
</blockquote>
<p>34.	检查已有用户： </p>
<blockquote>
<pre class="sql" name="code">
select username from dba_users;
</pre>
</blockquote>
<p>35.	检查所有表、索引、存储过程、触发器、包等对象的状态</p>
<blockquote>
<pre class="sql" name="code">
select owner,object_name,object_type
from dba_objects where status!='VALID'
and owner!='SYS' and owner!='SYSTEM';
</pre>
</blockquote>
<p>36.	检查当前用户的缺省表空间、临时表空间</p>
<blockquote>
<pre class="sql" name="code">
select username,default_tablespace, temporary_tablespace from user_users;
</pre>
</blockquote>
<p>37.	检查当前用户的角色</p>
<blockquote>
<pre class="sql" name="code">
select * from user_role_privs;
</pre>
</blockquote>
<p>38.	检查当前用户的系统权限和表级权限</p>
<blockquote>
<pre class="sql" name="code">
select * from user_sys_privs;
select * from user_tab_privs;
</pre>
</blockquote>
<p>39.	检查用户下所有的表</p>
<blockquote>
<pre class="sql" name="code">
select * from user_tables;
</pre>
</blockquote>
<p>40.	检查各个表的大小</p>
<blockquote><p>
检查当前用户每个表占用空间的大小：</p>
<pre class="sql" name="code">
Select Segment_Name,Sum(bytes)/1024/1024
From User_Extents Group By Segment_Name
</pre>
<p>注：段名即表名</p>
<p>按数据对象大小排序</p>
<pre class="sql" name="code">
Select Segment_Name,segment_type, Sum(bytes)/1024/1024 as MB
From User_Extents
Group By Segment_Name, segment_type
Order by MB
</pre>
</blockquote>
<p>41.	检查某表的创建时间</p>
<blockquote>
<pre class="sql" name="code">
select object_name,created from user_objects where object_name=upper('&#038;table_name');
</pre>
</blockquote>
<p>42.	检查名称包含log字符的表</p>
<blockquote>
<pre class="sql" name="code">
select object_name,object_id from user_objects
     where instr(object_name,'LOG')>0;
</pre>
</blockquote>
<p>43.	检查某表的大小</p>
<blockquote>
<pre class="sql" name="code">
select sum(bytes)/(1024*1024) as "size(M)" from user_segments
     where segment_name=upper('&#038;table_name');
</pre>
</blockquote>
<p>44.	检查放在内存区里的表</p>
<blockquote>
<pre class="sql" name="code">
select table_name,cache from user_tables where instr(cache,'Y')>0;
</pre>
</blockquote>
<p>45.	检查索引个数和类别</p>
<blockquote>
<pre class="sql" name="code">
select index_name,index_type,table_name from user_indexes order by table_name;
</pre>
</blockquote>
<p>46.	检查索引中被索引的字段</p>
<blockquote>
<pre class="sql" name="code">
select * from user_ind_columns where index_name=upper('&#038;index_name');
</pre>
</blockquote>
<p>47.	检查索引的大小</p>
<blockquote>
<pre class="sql" name="code">
select sum(bytes)/(1024*1024) as "size(M)" from user_segments
     where segment_name=upper('&#038;index_name');
</pre>
</blockquote>
<p>48.	检查是否有失效的索引</p>
<blockquote>
<pre class="sql" name="code">
select index_name, owner, table_name, tablespace_name
from dba_indexes
where owner not in ('SYS','SYSTEM') and status != 'VALID';
</pre>
<p>如果有记录返回，考虑重建这些索引。
</p></blockquote>
<p>49.	检查是否有无效的对象</p>
<blockquote>
<pre class="sql" name="code">
select object_name,      object_type,      owner,      status
from dba_objects
where status !='VALID'
and owner not in ('SYS','SYSTEM')
and object_type in  ('TRIGGER','VIEW','PROCEDURE','FUNCTION');
</pre>
<p>如果存在无效的对象，手工重新编译一下。
</p></blockquote>
<p>50.	检查序列号</p>
<blockquote>
<pre class="sql" name="code">
select * from user_sequences;
</pre>
<p>last_number是当前值
</p></blockquote>
<p>51.	检查序列号的使用	</p>
<blockquote>
<pre class="sql" name="code">
select sequence_owner, sequence_name, min_value,
max_value, increment_by, last_number,
cache_size, cycle_flag from dba_sequences;
</pre>
<p>检查是否存在即将达到max_value的sequence	。
</p></blockquote>
<p>52.	检查视图的名称</p>
<blockquote>
<pre class="sql" name="code">
select view_name from user_views;
</pre>
</blockquote>
<p>53.	检查创建视图的select语句</p>
<blockquote>
<pre class="sql" name="code">
set view_name,text_length from user_views;
set long 2000;                --说明：可以根据视图的text_length值设定set long 的大小
select text from user_views where view_name=upper('&#038;view_name');
</pre>
</blockquote>
<p>54.	检查同义词的名称</p>
<blockquote>
<pre class="sql" name="code">
select * from user_synonyms;
</pre>
</blockquote>
<p>55.	检查某表的约束条件</p>
<blockquote>
<pre class="sql" name="code">
select constraint_name, constraint_type,search_condition, r_constraint_name
     from user_constraints where table_name = upper('&#038;table_name');

select c.constraint_name,c.constraint_type,cc.column_name
 from user_constraints c,user_cons_columns cc
 where c.owner = upper('&#038;table_owner') and c.table_name = upper('&#038;table_name')
 and c.owner = cc.owner and c.constraint_name = cc.constraint_name
 order by cc.position;
</pre>
</blockquote>
<p>56.	检查函数和过程的状态</p>
<blockquote>
<pre class="sql" name="code">
select object_name,status from user_objects where object_type='FUNCTION';
select object_name,status from user_objects where object_type='PROCEDURE';
</pre>
</blockquote>
<p>57.	检查函数和过程的源代码</p>
<blockquote>
<pre class="sql" name="code">
select text from all_source where owner=user and name=upper('&#038;plsql_name');
</pre>
</blockquote>
<p>58.	检查当前数据库有几个用户连接</p>
<blockquote><p>
用系统管理员权限执行，</p>
<pre class="sql" name="code">
select username,sid,serial#, machine, status from v$session;
</pre>
<p>USERNAME：建立该会话的用户名；<br />
SID：会话(session)的ID号；<br />
SERIAL#：会话的序列号，和SID一起用来唯一标识一个会话；<br />
PROGRAM：	这个会话是用什么工具连接到数据库的；<br />
MACHINE：这个会话是从哪台电脑连过来的<br />
STATUS	当前这个会话的状态，ACTIVE表示会话正在执行某些任务，INACTIVE表示当前会话没有执行任何操作；</p>
<p>如果要停某个连接用</p>
<pre class="sql" name="code">
SQL> alter system kill session 'sid,serial#';
</pre>
<p>如果这命令不行,找它UNIX的进程数</p>
<pre class="sql" name="code">
SQL> select pro.spid
	from v$session ses,v$process pro
	where ses.sid=21 and ses.paddr=pro.addr;
</pre>
<p>说明：21是某个连接的sid数</p>
<p>然后用 kill 命令杀此进程号。
</p></blockquote>
<p>59.	检查定时作业的完成情况</p>
<blockquote>
<pre class="sql" name="code">
select job,log_user,last_date,failures
from dba_jobs;

select  job, this_date, this_sec, next_date, next_sec, failures, what
from dba_jobs where failures !=0 or failures is not null;
</pre>
<p>如果FAILURES列是一个大于0的数的话，说明JOB运行失败，要进一步的检查。
</p></blockquote>
<p>&#8211; The End &#8211;<br />
转自：itpub<br />
部分经过修改。</p>
]]></content:encoded>
			<wfw:commentRss>http://tq.freehostia.com.freehostia.com/2009/08/oracle-base-info.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>第6篇 文章</title>
		<link>http://tq.freehostia.com.freehostia.com/2009/08/no-6-flie.html</link>
		<comments>http://tq.freehostia.com.freehostia.com/2009/08/no-6-flie.html#comments</comments>
		<pubDate>Sun, 09 Aug 2009 13:51:00 +0000</pubDate>
		<dc:creator>TQ</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://tq.freehostia.com.freehostia.com/?p=64</guid>
		<description><![CDATA[sys@TQGZS> select FILE# ,NAME,BYTES from v$datafile where FILE#=1... ]]></description>
			<content:encoded><![CDATA[<p>输入一些文字 </p>
<pre class="sql" name="code">
15:50:08 sys@TQGZS> select FILE# ,NAME,BYTES from v$datafile where FILE#=1;

     FILE# NAME                                                    BYTES
---------- -------------------------------------------------- ----------
         1 /u01/oracle/oradata/tqgzs/system01.dbf              734003200
</pre>
<blockquote><p>引用一下 </p>
</blockquote>
<p><u><em><strong>我我我</strong></em></u></p>
<blockquote><p></p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span>    d<span style="color: #66cc66;">.</span>VALUE
       <span style="color: #66cc66;">||</span> <span style="color: #ff0000;">'/'</span>
       <span style="color: #66cc66;">||</span> LOWER <span style="color: #66cc66;">&#40;</span>RTRIM <span style="color: #66cc66;">&#40;</span>i<span style="color: #66cc66;">.</span>INSTANCE<span style="color: #66cc66;">,</span> CHR <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
       <span style="color: #66cc66;">||</span> <span style="color: #ff0000;">'_ora_'</span>
       <span style="color: #66cc66;">||</span> p<span style="color: #66cc66;">.</span>spid
       <span style="color: #66cc66;">||</span> <span style="color: #ff0000;">'.trc'</span> trace_file_name
  <span style="color: #993333; font-weight: bold;">FROM</span> <span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">SELECT</span> p<span style="color: #66cc66;">.</span>spid
          <span style="color: #993333; font-weight: bold;">FROM</span> v$mystat m<span style="color: #66cc66;">,</span> v$session s<span style="color: #66cc66;">,</span> v$process p
         <span style="color: #993333; font-weight: bold;">WHERE</span> m<span style="color: #66cc66;">.</span>statistic<span style="color: #808080; font-style: italic;"># = 1 AND s.SID = m.SID AND p.addr = s.paddr) p,</span>
       <span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">SELECT</span> t<span style="color: #66cc66;">.</span>INSTANCE
          <span style="color: #993333; font-weight: bold;">FROM</span> v$thread t<span style="color: #66cc66;">,</span> v$parameter v
         <span style="color: #993333; font-weight: bold;">WHERE</span> v<span style="color: #66cc66;">.</span>NAME <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'thread'</span>
           <span style="color: #993333; font-weight: bold;">AND</span> <span style="color: #66cc66;">&#40;</span>v<span style="color: #66cc66;">.</span>VALUE <span style="color: #66cc66;">=</span> <span style="color: #cc66cc;">0</span> <span style="color: #993333; font-weight: bold;">OR</span> t<span style="color: #66cc66;">.</span>thread<span style="color: #808080; font-style: italic;"># = TO_NUMBER (v.VALUE))) i,</span>
       <span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">SELECT</span> VALUE
          <span style="color: #993333; font-weight: bold;">FROM</span> v$parameter
         <span style="color: #993333; font-weight: bold;">WHERE</span> NAME <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'user_dump_dest'</span><span style="color: #66cc66;">&#41;</span> d
<span style="color: #66cc66;">/</span></pre></div></div>

<p>
</p>
</blockquote>
<table cellspacing="0" cellpadding="2" width="400" border="1">
<tbody>
<tr>
<td valign="top" width="200">a1</td>
<td valign="top" width="200">b1</td>
</tr>
<tr>
<td valign="top" width="200">100</td>
<td valign="top" width="200">200</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://tq.freehostia.com.freehostia.com/2009/08/no-6-flie.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>第9篇 文章</title>
		<link>http://tq.freehostia.com.freehostia.com/2009/08/no-9-file.html</link>
		<comments>http://tq.freehostia.com.freehostia.com/2009/08/no-9-file.html#comments</comments>
		<pubDate>Fri, 07 Aug 2009 05:23:00 +0000</pubDate>
		<dc:creator>TQ</dc:creator>
				<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://tq.freehostia.com.freehostia.com/2009/08/no-9-file.html</guid>
		<description><![CDATA[
winkstest@CCDB&#62; SELECT name,ceil&#40;bytes/1024/1024&#41; MB,STATUS FROM v$datafile;
&#160;
NAME                                                  [...... ]]></description>
			<content:encoded><![CDATA[
<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;">winkstest@CCDB<span style="color: #66cc66;">&gt;</span> <span style="color: #993333; font-weight: bold;">SELECT</span> name<span style="color: #66cc66;">,</span>ceil<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><span style="color: #993333; font-weight: bold;">STATUS</span> <span style="color: #993333; font-weight: bold;">FROM</span> v$datafile;
&nbsp;
NAME                                                                 MB <span style="color: #993333; font-weight: bold;">STATUS</span>
<span style="color: #808080; font-style: italic;">------------------------------------------------------------ ---------- --------------</span>
<span style="color: #66cc66;">/</span>oracle<span style="color: #66cc66;">/</span>oradata<span style="color: #66cc66;">/</span>ccdb<span style="color: #66cc66;">/</span>ccdb<span style="color: #66cc66;">/</span>system01<span style="color: #66cc66;">.</span>dbf                             <span style="color: #cc66cc;">1500</span> SYSTEM
<span style="color: #66cc66;">/</span>oracle<span style="color: #66cc66;">/</span>oradata<span style="color: #66cc66;">/</span>ccdb<span style="color: #66cc66;">/</span>ccdb<span style="color: #66cc66;">/</span>sysaux01<span style="color: #66cc66;">.</span>dbf                             <span style="color: #cc66cc;">1500</span> ONLINE
<span style="color: #66cc66;">/</span>oracle<span style="color: #66cc66;">/</span>oradata<span style="color: #66cc66;">/</span>ccdb<span style="color: #66cc66;">/</span>ccdb<span style="color: #66cc66;">/</span>undotbs01<span style="color: #66cc66;">.</span>dbf                            <span style="color: #cc66cc;">2985</span> ONLINE
<span style="color: #66cc66;">/</span>oracle<span style="color: #66cc66;">/</span>oradata<span style="color: #66cc66;">/</span>ccdb<span style="color: #66cc66;">/</span>ccdb<span style="color: #66cc66;">/</span>users01<span style="color: #66cc66;">.</span>dbf                               <span style="color: #cc66cc;">368</span> ONLINE
<span style="color: #66cc66;">/</span>oracle<span style="color: #66cc66;">/</span>oradata<span style="color: #66cc66;">/</span>ccdb<span style="color: #66cc66;">/</span>ccdb<span style="color: #66cc66;">/</span>example01<span style="color: #66cc66;">.</span>dbf                             <span style="color: #cc66cc;">100</span> ONLINE
<span style="color: #66cc66;">/</span>oracle<span style="color: #66cc66;">/</span>oradata<span style="color: #66cc66;">/</span>ccdb<span style="color: #66cc66;">/</span>ccdb<span style="color: #66cc66;">/</span>USER_DATA_01<span style="color: #66cc66;">.</span>DBF                            <span style="color: #cc66cc;">5</span> ONLINE
<span style="color: #66cc66;">/</span>oracle<span style="color: #66cc66;">/</span>oradata<span style="color: #66cc66;">/</span>ccdb<span style="color: #66cc66;">/</span>ccdb<span style="color: #66cc66;">/</span>WINKS_DATA_01<span style="color: #66cc66;">.</span>DBF                           <span style="color: #cc66cc;">5</span> ONLINE
<span style="color: #66cc66;">/</span>oracle<span style="color: #66cc66;">/</span>oradata<span style="color: #66cc66;">/</span>ccdb<span style="color: #66cc66;">/</span>ccdb<span style="color: #66cc66;">/</span>USER_DATA_01_WINKSTEST<span style="color: #66cc66;">.</span>DBF                  <span style="color: #cc66cc;">5</span> ONLINE
<span style="color: #66cc66;">/</span>oracle<span style="color: #66cc66;">/</span>oradata<span style="color: #66cc66;">/</span>ccdb<span style="color: #66cc66;">/</span>ccdb<span style="color: #66cc66;">/</span>WINKS_DATA_01_WINKSTEST<span style="color: #66cc66;">.</span>DBF                 <span style="color: #cc66cc;">5</span> ONLINE
<span style="color: #66cc66;">/</span>oracle<span style="color: #66cc66;">/</span>oradata<span style="color: #66cc66;">/</span>ccdb<span style="color: #66cc66;">/</span>ccdb<span style="color: #66cc66;">/</span>tq<span style="color: #66cc66;">.</span>dbf                                   <span style="color: #cc66cc;">4969</span> ONLINE
<span style="color: #66cc66;">/</span>oracle<span style="color: #66cc66;">/</span>oradata<span style="color: #66cc66;">/</span>ccdb<span style="color: #66cc66;">/</span>test<span style="color: #66cc66;">/</span>lmt_uniform<span style="color: #66cc66;">.</span>dbf                          <span style="color: #cc66cc;">8349</span> ONLINE
<span style="color: #66cc66;">/</span>oracle<span style="color: #66cc66;">/</span>oradata<span style="color: #66cc66;">/</span>ccdb<span style="color: #66cc66;">/</span>test<span style="color: #66cc66;">/</span>lmt_auto<span style="color: #66cc66;">.</span>dbf                             <span style="color: #cc66cc;">7138</span> ONLINE
&nbsp;
已选择<span style="color: #cc66cc;">12</span>行。</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://tq.freehostia.com.freehostia.com/2009/08/no-9-file.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>第10篇 文章</title>
		<link>http://tq.freehostia.com.freehostia.com/2009/08/no-10-file.html</link>
		<comments>http://tq.freehostia.com.freehostia.com/2009/08/no-10-file.html#comments</comments>
		<pubDate>Fri, 07 Aug 2009 04:00:19 +0000</pubDate>
		<dc:creator>TQ</dc:creator>
				<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://tq.freehostia.com.freehostia.com/2009/08/no-10-file.html</guid>
		<description><![CDATA[
winkstest@CCDB&#62; SELECT * FROM v$version;
&#160;
BANNER
--------------------------------------------------------------------------------
Oracle DATABASE 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production
PL/SQL Release 11.1.0.6.0 - Producti... ]]></description>
			<content:encoded><![CDATA[
<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;">winkstest@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> v$version;
&nbsp;
BANNER
<span style="color: #808080; font-style: italic;">--------------------------------------------------------------------------------</span>
Oracle <span style="color: #993333; font-weight: bold;">DATABASE</span> 11g Enterprise Edition Release 11<span style="color: #66cc66;">.</span>1<span style="color: #66cc66;">.</span>0<span style="color: #66cc66;">.</span>6<span style="color: #66cc66;">.</span>0 <span style="color: #66cc66;">-</span> 64bit Production
PL<span style="color: #66cc66;">/</span>SQL Release 11<span style="color: #66cc66;">.</span>1<span style="color: #66cc66;">.</span>0<span style="color: #66cc66;">.</span>6<span style="color: #66cc66;">.</span>0 <span style="color: #66cc66;">-</span> Production
CORE    11<span style="color: #66cc66;">.</span>1<span style="color: #66cc66;">.</span>0<span style="color: #66cc66;">.</span>6<span style="color: #66cc66;">.</span>0      Production
TNS <span style="color: #993333; font-weight: bold;">FOR</span> Linux: Version 11<span style="color: #66cc66;">.</span>1<span style="color: #66cc66;">.</span>0<span style="color: #66cc66;">.</span>6<span style="color: #66cc66;">.</span>0 <span style="color: #66cc66;">-</span> Production
NLSRTL Version 11<span style="color: #66cc66;">.</span>1<span style="color: #66cc66;">.</span>0<span style="color: #66cc66;">.</span>6<span style="color: #66cc66;">.</span>0 <span style="color: #66cc66;">-</span> Production</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://tq.freehostia.com.freehostia.com/2009/08/no-10-file.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
