<?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>UKoom &#187; Oracle</title>
	<atom:link href="http://www.ukoom.com/category/database/oracle/feed" rel="self" type="application/rss+xml" />
	<link>http://www.ukoom.com</link>
	<description>Documentum, SharePoint, Alfresco, ECM...</description>
	<lastBuildDate>Tue, 25 Oct 2011 15:11:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Register table issue caused by using wrong column type in SQL</title>
		<link>http://www.ukoom.com/register-table-issue-caused-by-using-wrong-column-type-in-sql.htm</link>
		<comments>http://www.ukoom.com/register-table-issue-caused-by-using-wrong-column-type-in-sql.htm#comments</comments>
		<pubDate>Tue, 07 Dec 2010 03:54:26 +0000</pubDate>
		<dc:creator>ukoom</dc:creator>
				<category><![CDATA[Documentum]]></category>
		<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://www.ukoom.com/?p=1127</guid>
		<description><![CDATA[Wow, how long the title is! I came across one strange issue today (actually I found this last Friday, but you know weekend coming, hehehe). When using the update DQL to fill up one new column in the registered table, there are always lots of blanks appended. The root cause after doing some investigation, what [...]]]></description>
			<content:encoded><![CDATA[<p>Wow, how long the title is! <img src='http://www.ukoom.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I came across one strange issue today (actually I found this last Friday, but you know weekend coming, hehehe).</p>
<p>When using the update DQL to fill up one new column in the registered table, there are always lots of blanks appended.</p>
<p>The root cause after doing some investigation, what I found:</p>
<p>We are adding the column in type &#8211; char rather than varchar2 which is the normal one.</p>
<p>CHAR should be used for storing <span style="font-weight: bold;">fix length character strings</span>. String values will be <span style="font-weight: bold;">space/blank padded</span> before stored on disk.</p>
<p>Baiqing, one of my colleges , wrote the DQL to add the new column. I believe that:</p>
<p>1. He should be more careful <img src='http://www.ukoom.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>2. The DQL used to register table in Documentum are defining the type as &#8216;char&#8217;. Documentum is using &#8216;char&#8217; type to define <span style="font-weight: bold;">variable length character strings. </span>there is no type to define fix length strings. That make developer confused.</p>
<p>Anyway, the cause was found. Happy Monday!!!!</p>
<p>Reference:</p>
<p>http://www.orafaq.com/faq/what_is_the_difference_between_varchar_varchar2_and_char_data_types</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ukoom.com/register-table-issue-caused-by-using-wrong-column-type-in-sql.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get definition for view in Oracle</title>
		<link>http://www.ukoom.com/get-definition-for-view-in-oracle.htm</link>
		<comments>http://www.ukoom.com/get-definition-for-view-in-oracle.htm#comments</comments>
		<pubDate>Fri, 23 Apr 2010 01:19:36 +0000</pubDate>
		<dc:creator>ukoom</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Database]]></category>

		<guid isPermaLink="false">http://www.ukoom.com/?p=1059</guid>
		<description><![CDATA[set LONG 10000 select TEXT from ALL_VIEWS where view_name = &#8216;MY_VIEW&#8216;; Line one must be at least the size of the statement used to create the view. Either pick a really big number if you think the view is large or use the following to determine how long it is first. If it isn&#8217;t, the [...]]]></description>
			<content:encoded><![CDATA[<div><span><span style="font-family: Arial; font-size: 85%; color: #0000ff;">set  LONG 1000<span>0</span><br />
select TEXT from ALL_VIEWS  where  view_name<span> </span>=<span> </span>&#8216;<span>MY_VIEW</span>&#8216;;</span></span></div>
<div><span><span style="font-family: Arial; font-size: 85%;"> </span></span></div>
<div><span><span style="font-family: Arial; font-size: 85%;">Line one must be at  least the size of the statement used to  create the view. Either pick a really  big number if you think the view  is large or use the following to determine how  long it is first. If it  isn&#8217;t, the text will be truncated</span></span></div>
<div><span><span style="font-family: Arial; font-size: 85%;"> </span></span></div>
<div><span><span style="font-family: Arial; font-size: 85%; color: #0000ff;">select   text_length from all_views where view_name = &#8216;MY_VIEW&#8217;</span></span></div>
<div><span><span style="font-family: Arial; font-size: 85%;"> </span></span></div>
<div><span><span style="font-family: Arial; font-size: 85%;">NOTE: name of the  view is case sensitive as are most every thing  in Oracle.</span></span></div>
<div><span><span style="font-family: Arial; font-size: 85%;"> </span></span></div>
<div><span><span style="font-family: Arial; font-size: 85%;">If you want to  capture output to something other than a SQL Plus  window such as a file, be sure  to include do the following before you  execute the select  statement.</span></span></div>
<div><span><span style="font-family: Arial; font-size: 85%;"> </span></span></div>
<div><span><span style="font-family: Arial; font-size: 85%; color: #0000ff;">spool   c:\v_person.sql</span></span></div>
<div><span><span style="font-family: Arial; font-size: 85%;"> </span></span></div>
<div><span><span style="font-family: Arial; font-size: 85%;">To close the file  when you  are done writing output to it, call the following:</span></span></div>
<div><span><span style="font-family: Arial; font-size: 85%;"> </span></span></div>
<div><span><span style="font-family: Arial; font-size: 85%; color: #0000ff;">spool   off</span></span></div>
<div><span><span style="font-family: Arial; font-size: 85%;"> </span></span></div>
<div><span><span style="font-family: Arial; font-size: 85%;"><strong> </strong></span></span></div>
<div><span><span style="font-family: Arial; font-size: 85%;"><strong>To  summarize:</strong></span></span></div>
<div><span><span style="font-family: Arial; font-size: 85%;"> </span></span></div>
<div><span><span><span style="font-family: Arial; font-size: 85%; color: #0000ff;">select text_length from all_views where   view_name = &#8216;MY_VIEW&#8217;</span></span></span></div>
<div><span><span><span style="font-family: Arial; font-size: 85%; color: #0000ff;">10000</span></span></span></div>
<div><span><span style="font-family: Arial; font-size: 85%;"><span> </span></span></span></div>
<div><span><span style="font-family: Arial; font-size: 85%;"><span>&#8211; whatever value you  get back, use on the next  statement.</span></span></span></div>
<div><span><span style="font-family: Arial; font-size: 85%;"><span> </span></span></span></div>
<div><span><span><span><span style="font-family: Arial;"><span style="font-size: 85%;"><span style="color: #0000ff;">set  LONG  1000<span>0</span></span></span></span></span></span></span></div>
<div><span><span><span><span style="font-family: Arial; font-size: 85%; color: #0000ff;"><span> </span></span></span></span></span></div>
<div><span><span><span><span><span style="font-family: Arial; font-size: 85%; color: #0000ff;">spool  c:\v_person.sql</span></span></span></span></span></div>
<div><span><span><span><span><span style="font-family: Arial; font-size: 85%; color: #0000ff;"> </span></span></span></span></span></div>
<div><span><span><span><span style="font-family: Arial; font-size: 85%; color: #0000ff;"><span>select TEXT from ALL_VIEWS where view_name<span> </span>=<span> </span>&#8216;<span>MY_VIEW</span>&#8216;;</span></span></span></span></span></div>
<div><span><span><span><span style="font-family: Arial; font-size: 85%; color: #0000ff;"><span> </span></span></span></span></span></div>
<div><span><span><span><span><span style="font-family: Arial; font-size: 85%; color: #0000ff;">spool off</span></span></span></span></span></div>
]]></content:encoded>
			<wfw:commentRss>http://www.ukoom.com/get-definition-for-view-in-oracle.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle Tuning Documentum Server</title>
		<link>http://www.ukoom.com/oracle-tuning-documentum-server.htm</link>
		<comments>http://www.ukoom.com/oracle-tuning-documentum-server.htm#comments</comments>
		<pubDate>Mon, 07 Dec 2009 06:44:56 +0000</pubDate>
		<dc:creator>ukoom</dc:creator>
				<category><![CDATA[Documentum]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Database]]></category>

		<guid isPermaLink="false">http://www.ukoom.com/?p=942</guid>
		<description><![CDATA[Modifying the dmcl.ini File on the Oracle WebCenter Content Service for Documentum Host On all computers that host the Oracle WebCenter Content Service for Documentum, you can increase the max_session_count variable in the dmcl.ini file to allow for additional concurrent sessions. By default, the max_session_count is set to 10, meaning there can be 10 concurrent [...]]]></description>
			<content:encoded><![CDATA[<h2>Modifying the dmcl.ini File on the Oracle WebCenter Content Service for Documentum Host</h2>
<p><a name="wp1046181"> </a> On all computers that host the Oracle WebCenter Content Service for Documentum, you can increase the <span style="font-weight: bold;">max_session_count</span> variable in the<span style="font-weight: bold;"> dmcl.ini</span> file to allow for additional concurrent sessions. By default, the <span style="font-weight: bold;">max_session_count</span> is set to 10, meaning there can be 10 concurrent sessions to Documentum.</p>
<div>
<ul>
<li><a name="wp1046182"> </a>The number of Documentum sessions depends on the number of content crawlers you expect to run concurrently, as well as the number of users you expect to click through links concurrently. We recommend you set the <span style="font-weight: bold;">max_session_count </span>parameter accordingly. You can increase this setting later if you find that you run out of sessions or want to increase the number of content crawlers running simultaneously.</li>
<li><a name="wp1046183"> </a>A session is started for each user with a unique user name/password that tries to click through to a Documentum document in the portal. The <span style="font-weight: bold;">max_session_count</span> must accommodate the estimated number of click through users to be handled concurrently.</li>
</ul>
<h2>Modifying the server.ini File on the Documentum Server</h2>
<p><a name="wp1046185"> </a> On the Documentum Server computer, you can change the settings in the <span style="font-weight: bold;">server.ini</span> file to allow for additional concurrent sessions.</p>
<div>
<ul>
<li><a name="wp1046186"> </a>The <span style="font-weight: bold;">concurrent_sessions</span> variable controls the number of connections the Documentum server can handle concurrently. This parameter should accommodate for the sum of all the <span style="font-weight: bold;">max_session_count</span> values in your environment.</li>
</ul>
</div>
<p><a name="wp1046187"> </a> If you plan to use the Oracle WebCenter Content Service for Documentum with several different docbases, you must modify the <span style="font-weight: bold;">server.ini</span> for each docbase. When making these configuration changes, consider the following:</p>
<div>
<ul>
<li><a name="wp1046188"> </a>As with any configuration changes, take into account any hardware limitations.</li>
<li><a name="wp1046189"> </a>The configuration settings depend on both existing and projected Documentum usage.</li>
</ul>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.ukoom.com/oracle-tuning-documentum-server.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle Session Statistics</title>
		<link>http://www.ukoom.com/oracle-session-statistics.htm</link>
		<comments>http://www.ukoom.com/oracle-session-statistics.htm#comments</comments>
		<pubDate>Mon, 07 Dec 2009 05:55:32 +0000</pubDate>
		<dc:creator>ukoom</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Database]]></category>

		<guid isPermaLink="false">http://www.ukoom.com/?p=939</guid>
		<description><![CDATA[Here are some scripts related to Session Statistics . Session I/O By User SESSION I/O BY USER NOTES: Username &#8211; Name of the Oracle process user OS User &#8211; Name of the operating system user PID &#8211; Process ID of the session SID &#8211; Session ID of the session Serial# &#8211; Serial# of the session [...]]]></description>
			<content:encoded><![CDATA[<p>Here are some scripts related to Session Statistics .</p>
<h2>Session I/O By User</h2>
<p><strong>SESSION I/O BY USER NOTES:</strong></p>
<div>
<li><strong>Username</strong> &#8211; Name of the Oracle process user</li>
<li><strong>OS User</strong> &#8211; Name of the operating system user</li>
<li><strong>PID</strong> &#8211; Process ID of the session</li>
<li><strong>SID</strong> &#8211; Session ID of the session</li>
<li><strong>Serial#</strong> &#8211; Serial# of the session</li>
<li><strong>Physical Reads</strong> &#8211; Physical reads for the session</li>
<li><strong>Block Gets</strong> &#8211; Block gets for the session</li>
<li><strong>Consistent Gets</strong> &#8211; Consistent gets for the session</li>
<li><strong>Block Changes</strong> &#8211; Block changes for the session</li>
<li><strong>Consistent Changes</strong> &#8211; Consistent changes for the session<br />
<blockquote>
<pre>select	nvl(ses.USERNAME,'ORACLE PROC') username,
	OSUSER os_user,
	PROCESS pid,
	ses.SID sid,
	SERIAL#,
	PHYSICAL_READS,
	BLOCK_GETS,
	CONSISTENT_GETS,
	BLOCK_CHANGES,
	CONSISTENT_CHANGES
from	v$session ses,
	v$sess_io sio
where 	ses.SID = sio.SID
order 	by PHYSICAL_READS, ses.USERNAME</pre>
</blockquote>
<h2>CPU Usage By Session</h2>
<p><strong>CPU USAGE BY SESSION NOTES:</strong></li>
<li><strong>Username</strong> &#8211; Name of the user</li>
<li><strong>SID</strong> &#8211; Session id</li>
<li><strong>CPU Usage</strong> &#8211; CPU centiseconds used by this session (divide by 100 to get real CPU seconds)<br />
<blockquote>
<pre>select 	nvl(ss.USERNAME,'ORACLE PROC') username,
	se.SID,
	VALUE cpu_usage
from 	v$session ss,
	v$sesstat se,
	v$statname sn
where  	se.STATISTIC# = sn.STATISTIC#
and  	NAME like '%CPU used by this session%'
and  	se.SID = ss.SID
order  	by VALUE desc</pre>
</blockquote>
<h2>Resource Usage By User</h2>
<p><strong>RESOURCE USAGE BY USER NOTES:</strong></li>
<li><strong>SID</strong> &#8211; Session ID</li>
<li><strong>Username</strong> &#8211; Name of the user</li>
<li><strong>Statistic</strong> &#8211; Name of the statistic</li>
<li><strong>Value</strong> &#8211; Current value<br />
<blockquote>
<pre>select 	ses.SID,
	nvl(ses.USERNAME,'ORACLE PROC') username,
	sn.NAME statistic,
	sest.VALUE
from 	v$session ses,
	v$statname sn,
	v$sesstat sest
where 	ses.SID = sest.SID
and 	sn.STATISTIC# = sest.STATISTIC#
and 	sest.VALUE is not null
and 	sest.VALUE != 0
order 	by ses.USERNAME, ses.SID, sn.NAME</pre>
</blockquote>
<h2>Session Stats By Session</h2>
<p><strong>SESSION STAT NOTES:</strong></li>
<li><strong>Username</strong> &#8211; Name of the user</li>
<li><strong>SID</strong> &#8211; Session ID</li>
<li><strong>Statistic</strong> &#8211; Name of the statistic</li>
<li><strong>Usage</strong> &#8211; Usage according to Oracle<br />
<blockquote>
<pre>select  nvl(ss.USERNAME,'ORACLE PROC') username,
	se.SID,
	sn.NAME stastic,
	VALUE usage
from 	v$session ss,
	v$sesstat se,
	v$statname sn
where  	se.STATISTIC# = sn.STATISTIC#
and  	se.SID = ss.SID
and	se.VALUE &gt; 0
order  	by sn.NAME, se.SID, se.VALUE desc</pre>
</blockquote>
<h2>Cursor Usage By Session</h2>
<p><strong>CURSOR USAGE BY SESSION NOTES:</strong></li>
<li><strong>Username</strong> &#8211; Name of the user</li>
<li><strong>Recursive Calls</strong> &#8211; Total number of recursive calls</li>
<li><strong>Opened Cursors</strong> &#8211; Total number of opened cursors</li>
<li><strong>Current Cursors</strong> &#8211; Number of cursor currently in use<br />
<blockquote>
<pre>select 	user_process username,
	"Recursive Calls",
	"Opened Cursors",
	"Current Cursors"
from  (
	select 	nvl(ss.USERNAME,'ORACLE PROC')||'('||se.sid||') ' user_process,
			sum(decode(NAME,'recursive calls',value)) "Recursive Calls",
			sum(decode(NAME,'opened cursors cumulative',value)) "Opened Cursors",
			sum(decode(NAME,'opened cursors current',value)) "Current Cursors"
	from 	v$session ss,
		v$sesstat se,
		v$statname sn
	where 	se.STATISTIC# = sn.STATISTIC#
	and 	(NAME  like '%opened cursors current%'
	or 	 NAME  like '%recursive calls%'
	or 	 NAME  like '%opened cursors cumulative%')
	and 	se.SID = ss.SID
	and 	ss.USERNAME is not null
	group 	by nvl(ss.USERNAME,'ORACLE PROC')||'('||se.SID||') '
)
orasnap_user_cursors
order 	by USER_PROCESS,"Recursive Calls"</pre>
</blockquote>
<h2>User Hit Ratios</h2>
<p><strong>USER HIT RATIO NOTES:</strong></li>
<li><strong>Username</strong> &#8211; Name of the user</li>
<li><strong>Consistent Gets</strong> &#8211; The number of accesses made to the block buffer to retrieve data in a  consistent mode.</li>
<li><strong>DB Blk Gets</strong> &#8211; The number of blocks accessed via single block gets (i.e. not through the consistent get mechanism).</li>
<li><strong>Physical Reads</strong> &#8211; The cumulative number of blocks read from disk.</li>
<li>Logical reads are the sum of <strong>consistent gets</strong> and <strong>db block gets</strong>.</li>
<li>The <strong>db block gets</strong> statistic value is incremented when a block is read for update and when segment header blocks are accessed.</li>
<li>Hit ratio should be &gt; 90%<br />
<blockquote>
<pre>select	USERNAME,
	CONSISTENT_GETS,
        BLOCK_GETS,
        PHYSICAL_READS,
        ((CONSISTENT_GETS+BLOCK_GETS-PHYSICAL_READS) / (CONSISTENT_GETS+BLOCK_GETS)) Ratio
from 	v$session, v$sess_io
where 	v$session.SID = v$sess_io.SID
and 	(CONSISTENT_GETS+BLOCK_GETS) &gt; 0
and 	USERNAME is not null
order	by ((CONSISTENT_GETS+BLOCK_GETS-PHYSICAL_READS) / (CONSISTENT_GETS+BLOCK_GETS))</pre>
</blockquote>
</li>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.ukoom.com/oracle-session-statistics.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>spool命令和使用select语句批量动态生成sql语句</title>
		<link>http://www.ukoom.com/spool%e5%91%bd%e4%bb%a4%e5%92%8c%e4%bd%bf%e7%94%a8select%e8%af%ad%e5%8f%a5%e6%89%b9%e9%87%8f%e6%8b%bc%e8%a3%85sql%e8%af%ad%e5%8f%a5.htm</link>
		<comments>http://www.ukoom.com/spool%e5%91%bd%e4%bb%a4%e5%92%8c%e4%bd%bf%e7%94%a8select%e8%af%ad%e5%8f%a5%e6%89%b9%e9%87%8f%e6%8b%bc%e8%a3%85sql%e8%af%ad%e5%8f%a5.htm#comments</comments>
		<pubDate>Fri, 27 Nov 2009 07:16:45 +0000</pubDate>
		<dc:creator>ukoom</dc:creator>
				<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://www.ukoom.com/?p=858</guid>
		<description><![CDATA[今天一个任务是从两张表中用sql语句导出些数据，并且提交这些数据的插入语句。上网查询后找到个方法，例子如下： spool c:\data.sql; select &#8216;insert into table_name values(&#8221;&#8217;&#124;&#124;field_1&#124;&#124;&#8221;&#8217;,&#8221;&#8217;&#124;&#124;field_2&#124;&#124;&#8221;&#8217;);&#8217;from table_name where field_n=some_conditon; spool off; 从这个方案中引申学到两条：spool命令和使用select语句批量拼装sql语句 spool命令 1 Oracle的spool命令可以用来将数据export出来到文本文件。Oracle的Import/Export命令用于备份和恢复比较有效，但对于一些临时数据量的导出，Export不好用，甚至不可用。在这里，就是spool的发挥之地了。 2Spool一般使用格式为spool [filepath]filename;       其他sql语句；spool off; 要输出的内容都在spool语句中包含； 3 spool还有些其他控制命令： set pagesize 0               &#8211;设置页面大小， 0表示无限制，如果设置为10,则10行数据后出现一空行 set num 18                  &#8211;设置数字的长度，如果不够大，则用科学记数法显示 set heading off             &#8211;设置不要题头，则不出现select的field list set feedback off           &#8211;设置不需要返回信息， 比如&#8221; 100 rows selected“ set term off                 &#8211; set trimspool on           &#8211;trim 4 如果在sqlplus中直接使用sql语句，则导出的数据文件中会包含spool语句中使用的sql语句，如果不想让生成这些可把要使用的sql语句存在一个文件中再在sqlplus中执行此文件即可。 [...]]]></description>
			<content:encoded><![CDATA[<p>今天一个任务是从两张表中用sql语句导出些数据，并且提交这些数据的插入语句。上网查询后找到个方法，例子如下：<br />
spool c:\data.sql;<br />
select &#8216;insert into table_name values(&#8221;&#8217;||field_1||&#8221;&#8217;,&#8221;&#8217;||field_2||&#8221;&#8217;);&#8217;from table_name where field_n=some_conditon;<br />
spool off;<br />
从这个方案中引申学到两条：spool命令和使用select语句批量拼装sql语句</p>
<ol>
<li>spool命令</li>
</ol>
<p>1 Oracle的spool命令可以用来将数据export出来到文本文件。Oracle的Import/Export命令用于备份和恢复比较有效，但对于一些临时数据量的导出，Export不好用，甚至不可用。在这里，就是spool的发挥之地了。</p>
<p>2Spool一般使用格式为spool [filepath]filename;       其他sql语句；spool off;</p>
<p>要输出的内容都在spool语句中包含；</p>
<p>3 spool还有些其他控制命令：</p>
<p>set pagesize 0               &#8211;设置页面大小， 0表示无限制，如果设置为10,则10行数据后出现一空行<br />
set num 18                  &#8211;设置数字的长度，如果不够大，则用科学记数法显示<br />
set heading off             &#8211;设置不要题头，则不出现select的field list<br />
set feedback off           &#8211;设置不需要返回信息， 比如&#8221; 100 rows selected“<br />
set term off                 &#8211;<br />
set trimspool on           &#8211;trim</p>
<p>4 如果在sqlplus中直接使用sql语句，则导出的数据文件中会包含spool语句中使用的sql语句，如果不想让生成这些可把要使用的sql语句存在一个文件中再在sqlplus中执行此文件即可。</p>
<ol>
<li>使用select语句批量拼装sql语句</li>
</ol>
<p>仿照select &#8216;insert into table_name values(&#8221;&#8217;||field_1||&#8221;&#8217;,&#8221;&#8217;||field_2||&#8221;&#8217;);&#8217;from table_name where field_n=some_conditon;可联想批量生成其他sql语句，例如drop、update、delete语句。其中||为连接符号，三个单引号最后生成一个单引号。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ukoom.com/spool%e5%91%bd%e4%bb%a4%e5%92%8c%e4%bd%bf%e7%94%a8select%e8%af%ad%e5%8f%a5%e6%89%b9%e9%87%8f%e6%8b%bc%e8%a3%85sql%e8%af%ad%e5%8f%a5.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SSH 处理Oracle Clob</title>
		<link>http://www.ukoom.com/ssh-%e5%a4%84%e7%90%86oracle-clob.htm</link>
		<comments>http://www.ukoom.com/ssh-%e5%a4%84%e7%90%86oracle-clob.htm#comments</comments>
		<pubDate>Wed, 18 Nov 2009 05:03:38 +0000</pubDate>
		<dc:creator>ukoom</dc:creator>
				<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://www.ukoom.com/?p=776</guid>
		<description><![CDATA[SSH 处理Oracle Clob]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.ukoom.com/wp-content/uploads/2009/11/SSH-处理Oracle-Clob.rtf">SSH 处理Oracle Clob</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ukoom.com/ssh-%e5%a4%84%e7%90%86oracle-clob.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Uninstall Oracle</title>
		<link>http://www.ukoom.com/uninstall-oracle.htm</link>
		<comments>http://www.ukoom.com/uninstall-oracle.htm#comments</comments>
		<pubDate>Tue, 17 Nov 2009 15:24:17 +0000</pubDate>
		<dc:creator>ukoom</dc:creator>
				<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://www.ukoom.com/?p=772</guid>
		<description><![CDATA[It sure is easier to remove oracle products than to add them&#8230;. The method suggested, using Oracle Universal installer to remove the product, is the safest method, and the only reliable means if you have several different ORACLE-HOMEs on you server. However, if you want to remove all oracle software from your server, the following [...]]]></description>
			<content:encoded><![CDATA[<p>It sure is easier to remove oracle products than to add them&#8230;.</p>
<p>The method suggested, using Oracle Universal installer to remove the product, is the safest method, and the only reliable means if you have several different ORACLE-HOMEs on you server.</p>
<p>However, if you want to remove all oracle software from your server, the following method will work:</p>
<p>1. Stop all oracle processes (shutdown, kill or reboot &#8211; you are goeng to ditch the installation anyway)</p>
<p>2. Remove the $ORACLE_HOME(s) using rm -rf</p>
<p>3. Check the file /etc/oraInst.loc and remove the oraInventory directory structure.</p>
<p>3. Remove the files that remain scattered around your system:</p>
<p>/etc/oraInst.loc</p>
<p>/etc/oratab</p>
<p>/var/tmp/.oracle (directory)</p>
<p>/usr/local/bin/coraenv</p>
<p>/usr/local/bin/dbhome</p>
<p>/usr/local/bin/oraenv</p>
<p>If you remove these files, you will have a fresh system, in an Oracle point of view.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ukoom.com/uninstall-oracle.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle Flashback Deleted Table</title>
		<link>http://www.ukoom.com/oracle-flashback-deleted-table.htm</link>
		<comments>http://www.ukoom.com/oracle-flashback-deleted-table.htm#comments</comments>
		<pubDate>Tue, 17 Nov 2009 15:21:05 +0000</pubDate>
		<dc:creator>ukoom</dc:creator>
				<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://www.ukoom.com/?p=770</guid>
		<description><![CDATA[SQL&#62; create table tst (col varchar2(10), row_chng_dt date); Table created. SQL&#62; insert into tst values ('Version1', sysdate); 1 row created. SQL&#62; select * from tst ; COL ROW_CHNG ---------- -------- Version1 16:10:03 SQL&#62; drop table tst; Table dropped. SQL&#62; select object_name, original_name, type, can_undrop as "UND", can_purge as "PUR", droptime 2 from recyclebin SQL&#62; / [...]]]></description>
			<content:encoded><![CDATA[<pre>SQL&gt; create table tst (col varchar2(10), row_chng_dt date);

Table created.

SQL&gt; insert into tst values ('Version1', sysdate);

1 row created.

SQL&gt; select * from tst ;

COL        ROW_CHNG
---------- --------
Version1   16:10:03
<pre>SQL&gt; drop table tst;

Table dropped.

SQL&gt; select object_name, original_name, type, can_undrop as "UND", can_purge as "PUR", droptime
  2  from recyclebin
SQL&gt; /

OBJECT_NAME                    ORIGINAL_NAME TYPE  UND PUR DROPTIME
------------------------------ ------------- ----- --- -------------------
BIN$HGnc55/7rRPgQPeM/qQoRw==$0 TST           TABLE YES YES 2006-09-01:16:10:12
<pre>SQL&gt; flashback table tst to before drop;

Flashback complete.

SQL&gt; select * from tst ;

COL        ROW_CHNG
---------- --------
Version1   16:10:03

SQL&gt; select * from recyclebin ;

no rows selected

Reference:

http://www.orafaq.com/node/968</pre>
</pre>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.ukoom.com/oracle-flashback-deleted-table.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle EXP/IMP FAQs</title>
		<link>http://www.ukoom.com/oracle-expimp-faqs.htm</link>
		<comments>http://www.ukoom.com/oracle-expimp-faqs.htm#comments</comments>
		<pubDate>Tue, 17 Nov 2009 15:17:30 +0000</pubDate>
		<dc:creator>ukoom</dc:creator>
				<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://www.ukoom.com/?p=767</guid>
		<description><![CDATA[Can one import tables to a different tablespace?ITPUB个人空间g!] g4`6k;W)a Oracle offers no parameter to specify a different tablespace to import data into. Objects will be re-created in the tablespace they were originally exported from. One can alter this behaviour by following one of these procedures: Pre-create the table(s) in the correct tablespace: Import the dump [...]]]></description>
			<content:encoded><![CDATA[<p><span style="color: #000066;"><strong>Can one import tables to a different tablespace?</strong><span style="display: none;">ITPUB个人空间g!] g4`6k;W)a</span><br />
<a onclick="javascript:tagshow(event, 'Oracle');" href="javascript:;" target="_self"><span style="text-decoration: underline;"><strong>Oracle</strong></span></a> offers no parameter to specify a different tablespace to import <a onclick="javascript:tagshow(event, 'data');" href="javascript:;" target="_self"><span style="text-decoration: underline;"><strong>data</strong></span></a> into. Objects will be re-created in the tablespace they were originally exported from. One can alter this behaviour by following one of these procedures:</span></p>
<p><span style="color: #000066;">Pre-create the table(s) in the correct tablespace:</span></p>
<p><span style="color: #000066;">Import the dump file using the INDEXFILE= option<span style="display: none;">ITPUB个人空间 qW4{�B)hq5I</span><br />
Edit the indexfile. Remove remarks and specify the correct tablespaces.<br />
<span style="display: none;">;W1~%xL0f,H0G0</span>Run this indexfile against your database, this will create the required tables in the appropriate tablespaces<br />
<span style="display: none;">^O/w N!A$V0</span>Import the table(s) with the IGNORE=Y option.<br />
<span style="display: none;">8^8eYcT0</span>Change the default tablespace for the user:</span></p>
<p><span style="color: #000066;">Revoke the &#8220;UNLIMITED TABLESPACE&#8221; privilege from the user<span style="display: none;">ITPUB个人空间	oG�J,fM8bou;fV</span><br />
Revoke the user&#8217;s quota from the tablespace from where the object was exported. This forces the import utility to create tables in the user&#8217;s default tablespace.<span style="display: none;">ITPUB个人空间&#8217;K,CJ	u`&#8217;G</span><br />
Make the tablespace to which you want to import the default tablespace for the user<br />
<span style="display: none;"> E3Y6TReVd[0</span>Import the table</span></p>
<p><span style="color: #000066;"><strong>Does one need to drop/ truncate objects before importing?</strong><span style="display: none;">ITPUB个人空间'CH7j	]4O~%t</span><br />
Before one import rows into already populated tables, one needs to truncate or drop these tables to get rid of the old data. If not, the new data will be appended to the existing tables. One must always DROP existing Sequences before re-importing. If the sequences are not dropped, they will generate numbers inconsistent with the rest of the database.</span></p>
<p><span style="color: #000066;">Note: It is also advisable to drop indexes before importing to speed up the import process. Indexes can easily be recreated after the data was successfully imported.</span></p>
<p><span style="color: #000066;"><strong>Can one import/export between different versions of Oracle?</strong><br />
<span style="display: none;">h2i#ElR*t;R0</span>Different versions of the import utility is upwards compatible. This means that one can take an export file created from an old export version, and import it using a later version of the import utility. This is quite an effective way of upgrading a database from one release of Oracle to the next.</span></p>
<p><span style="color: #000066;">Oracle also ships some previous catexpX.sql scripts that can be executed as user SYS enabling older imp/exp versions to work (for backwards compatibility). For example, one can run $ORACLE_HOME/rdbms/admin/catexp7.sql on an Oracle 8 database to allow the Oracle 7.3 exp/imp utilities to run against an Oracle 8 database.</span></p>
<p><span style="color: #000066;"><strong>Can one export to multiple files?/ Can one beat the Unix 2 Gig limit?</strong><span style="display: none;">ITPUB个人空间/F9M1h@0^ h`</span><br />
From Oracle8i, the export utility supports multiple output files. This feature enables large exports to be divided into files whose sizes will not exceed any operating system limits (FILESIZE= parameter). When importing from multi-file export you must provide the same filenames in the same sequence in the FILE= parameter. Look at this example:</span></p>
<p><span style="color: #000066;"><a onclick="javascript:tagshow(event, 'exp');" href="javascript:;" target="_self"><span style="text-decoration: underline;"><strong>exp</strong></span></a> SCOTT/TIGER FILE=D:F1.dmp,E:F2.dmp FILESIZE=10m LOG=scott.log<span style="display: none;">ITPUB个人空间e-iR$|-v3@*?~9n</span><br />
Use the following technique if you use an Oracle version prior to 8i:</span></p>
<p><span style="color: #000066;">Create a compressed export on the fly. Depending on the type of data, you probably can export up to 10 gigabytes to a single file. This example uses gzip. It offers the best compression I know of, but you can also substitute it with zip, compress or whatever.</span></p>
<p><span style="color: #000066;"># create a named pipe<br />
<span style="display: none;">SnY[*{.L&amp;h&amp;{'n0</span>mknod exp.pipe p<span style="display: none;">ITPUB个人空间6B7NZv/A b)X"C*u</span><br />
# read the pipe - output to zip file in the background<br />
<span style="display: none;">U^M[M`-{$h0</span>gzip &lt; exp.pipe &gt; scott.exp.gz &amp;<br />
<span style="display: none;">U;vDa3f-b8f|\	i0</span># feed the pipe<span style="display: none;">ITPUB个人空间![vC:R1cD#E!_</span><br />
exp userid=scott/tiger file=exp.pipe ...[/code]<br />
<span style="display: none;">Au�ji�?/g1Km0</span>Contributed by Jared Still</span></p>
<p><span style="color: #000066;">Import directly from a compressed export:</span></p>
<p><span style="color: #000066;"># create a  name pipe<br />
<span style="display: none;">9D4DpnKr(mD0</span>mknod imp_pipe p<span style="display: none;">ITPUB个人空间sP`sa$Ny&amp;|</span><br />
# read the zip file and output to pipe<span style="display: none;">ITPUB个人空间xe7{&amp;Dk!j�i2C</span><br />
gunzip &lt; exp_file.dmp.gz &gt; imp_pipe &amp;<span style="display: none;">ITPUB个人空间/ppJ%bn%s4J</span><br />
# feed the pipe<span style="display: none;">ITPUB个人空间I*FB%FXF7J2[)V</span><br />
<a onclick="javascript:tagshow(event, 'imp');" href="javascript:;" target="_self"><span style="text-decoration: underline;"><strong>imp</strong></span></a></span><a href="mailto:system/pwd@sid"><span style="color: #000066;">system/pwd@sid</span></a><span style="color: #000066;">file=imp_pipe log=imp_pipe.log ...<span style="display: none;">ITPUB个人空间3S3N-{R~x</span><br />
Contributed by Blaise BIBOUE.</span></p>
<p><span style="color: #000066;"><strong> How can one improve Import/ Export performance?</strong><br />
<span style="display: none;">Q N/h3rBH!F`J)v|0</span>EXPORT:</span></p>
<p><span style="color: #000066;">Set the BUFFER parameter to a high value (e.g. 2Mb -- entered as an integer "2000000")<span style="display: none;">ITPUB个人空间!n B9zNV</span><br />
Set the RECORDLENGTH parameter to a high value (e.g. 64Kb -- entered as an integer "64000")<span style="display: none;">ITPUB个人空间,M�OM!vxh_0v</span><br />
Use DIRECT=yes (direct mode export)<br />
<span style="display: none;">:\;\;GtX&amp;|h {0</span>Stop unnecessary applications to free-up resources for your job.<br />
<span style="display: none;">(_w-Q$]$O$Dl9CL0</span>If you run multiple export sessions, ensure they write to different physical disks.<span style="display: none;">ITPUB个人空间+S5i4C;`_J</span><br />
DO NOT export to an NFS mounted filesystem. It will take forever.<br />
<span style="display: none;">m6K[5_TB\0</span>IMPORT:</span></p>
<p><span style="color: #000066;">Create an indexfile so that you can create indexes AFTER you have imported data. Do this by setting INDEXFILE to a filename and then import. No data will be imported but a file containing index definitions will be created. You must edit this file afterwards and supply the passwords for the schemas on all CONNECT statements.<span style="display: none;">ITPUB个人空间v6k8o5^YQxS{*p</span><br />
Place the file to be imported on a separate physical disk from the oracle data files<span style="display: none;">ITPUB个人空间?v(W"ps0ok|</span><br />
Increase DB_CACHE_SIZE (DB_BLOCK_BUFFERS prior to 9i) considerably in the init$SID.ora file<br />
<span style="display: none;">/t]3K;_a`TF&amp;m0</span>Set the LOG_BUFFER to a big value and restart oracle.<br />
<span style="display: none;">U&amp;t!ev(a2D&amp;PD0</span>Stop redo log archiving if it is running (ALTER DATABASE NOARCHIVELOG;)<span style="display: none;">ITPUB个人空间0` SP&#8217;C	u(CJ</span><br />
Create a BIG tablespace with a BIG rollback segment inside. Set all other rollback segments offline (except the SYSTEM rollback segment of course). The rollback segment must be as big as your biggest table (I think?)<br />
<span style="display: none;">e;t#G�P2G!F`w0</span>Use COMMIT=N in the import parameter file if you can afford it<span style="display: none;">ITPUB个人空间K,Pw:lVPP`</span><br />
Use ANALYZE=N in the import parameter file to avoid time consuming ANALYZE statements<span style="display: none;">ITPUB个人空间v^�_0cY^4Y</span><br />
Remember to run the indexfile previously created<br />
<span style="display: none;">(J*z[o(g\z0</span>Contributed by Petter Henrik Hansen.</span></p>
<p><span style="color: #000066;"><strong> What are the common Import/ Export problems?</strong><br />
<span style="display: none;">TB9t7{&#8220;G:PY!cF0</span>ORA-00001: Unique constraint (&#8230;) violated<span style="display: none;">ITPUB个人空间nj-{@X k m</span><br />
You are importing duplicate rows. Use IGNORE=NO to skip tables that already exist (imp will give an error if the object is re-created).<span style="display: none;">ITPUB个人空间3kE.R.Ri-}6r</span><br />
ORA-01555: Snapshot too old<br />
<span style="display: none;">be&#8221;~?-Q Z1a-pa-Sm0</span>Ask your users to STOP working while you are exporting or use parameter CONSISTENT=YES<br />
<span style="display: none;">/_6Q }3Qo0</span>ORA-01562: Failed to extend rollback segment<span style="display: none;">ITPUB个人空间yX&#8217;d?4{`</span><br />
Create bigger rollback segments or set parameter COMMIT=Y while importing<br />
<span style="display: none;">5y&#8221;u${/@eBgY!E.bZ0</span>IMP-00015: Statement failed &#8230; object already exists&#8230;<br />
<span style="display: none;">l!n#s	N0Gc0</span>Use the IGNORE=Y import parameter to ignore these errors, but be careful as you might end up with duplicate rows.</span></p>
<p><span style="color: #000066;">Reference:</span></p>
<p>http://www.orafaq.com/wiki/Import_Export_FAQ</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ukoom.com/oracle-expimp-faqs.htm/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Oracle Recompile Invalid Objects</title>
		<link>http://www.ukoom.com/oracle-recompile-invalid-objects.htm</link>
		<comments>http://www.ukoom.com/oracle-recompile-invalid-objects.htm#comments</comments>
		<pubDate>Tue, 17 Nov 2009 15:15:39 +0000</pubDate>
		<dc:creator>ukoom</dc:creator>
				<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://www.ukoom.com/?p=765</guid>
		<description><![CDATA[Recompile the invalid objects: SET NEWPAGE 0 SET SPACE 0 SET LINESIZE 80 SET PAGESIZE 0 SET ECHO OFF SET FEEDBACK OFF SET HEADING OFF SET MARKUP HTML OFF SET ESCAPE \ SPOOL RECOMPILE.SQL select &#8216;ALTER VIEW &#8216;, object_name, &#8216;compile \;&#8217; from user_objects where status = &#8216;INVALID&#8217; and object_type=&#8217;VIEW&#8217;; SPOOL OFF Reference: http://www.oracle-base.com/articles/misc/RecompilingInvalidSchemaObjects.php]]></description>
			<content:encoded><![CDATA[<p><strong>Recompile the invalid objects:</strong></p>
<p>SET NEWPAGE 0</p>
<p>SET SPACE 0</p>
<p>SET LINESIZE 80</p>
<p>SET PAGESIZE 0</p>
<p>SET ECHO OFF</p>
<p>SET FEEDBACK OFF</p>
<p>SET HEADING OFF</p>
<p>SET MARKUP HTML OFF</p>
<p>SET ESCAPE \</p>
<p>SPOOL RECOMPILE.SQL</p>
<p>select &#8216;ALTER VIEW &#8216;, object_name, &#8216;compile \;&#8217; from user_objects where status = &#8216;INVALID&#8217; and object_type=&#8217;VIEW&#8217;;</p>
<p>SPOOL OFF</p>
<p>Reference:</p>
<p>http://www.oracle-base.com/articles/misc/RecompilingInvalidSchemaObjects.php</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ukoom.com/oracle-recompile-invalid-objects.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

