<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Petteway&#039;s Blog</title>
	<atom:link href="http://petteway.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://petteway.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Mon, 31 Oct 2011 03:45:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='petteway.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Petteway&#039;s Blog</title>
		<link>http://petteway.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://petteway.wordpress.com/osd.xml" title="Petteway&#039;s Blog" />
	<atom:link rel='hub' href='http://petteway.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Linux NAS / Media Server</title>
		<link>http://petteway.wordpress.com/2011/10/21/linux-nas-media-server/</link>
		<comments>http://petteway.wordpress.com/2011/10/21/linux-nas-media-server/#comments</comments>
		<pubDate>Fri, 21 Oct 2011 04:46:17 +0000</pubDate>
		<dc:creator>petteway</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://petteway.wordpress.com/?p=112</guid>
		<description><![CDATA[Install Fedora onto a single disk at least 100GB.  Other disks are for RAID.   Install samba. yum install samba /etc/init.d/smb start /etc/init.d/smb enable /etc/init.d/nmb start /etc/init.d/nmb enable /etc/init.d/autofs start Install gnome-commander. Better file manager. yum install gnome-commander SSH is installed but not started or set to auto start. systemctl start sshd.service systemctl enable sshd.service [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=petteway.wordpress.com&amp;blog=8703785&amp;post=112&amp;subd=petteway&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Install Fedora onto a single disk at least 100GB.  Other disks are for RAID.  </p>
<p>Install samba.</p>
<table width="100%" border="0" bgcolor="#E0E0E0">
<tbody>
<tr>
<td>
<pre>
yum install samba
/etc/init.d/smb start
/etc/init.d/smb enable
/etc/init.d/nmb start
/etc/init.d/nmb enable
/etc/init.d/autofs start
</pre>
</tr>
</tbody>
</table>
<p>Install gnome-commander.  Better file manager.</p>
<table width="100%" border="0" bgcolor="#E0E0E0">
<tbody>
<tr>
<td>
<pre>
yum install gnome-commander
</pre>
</tr>
</tbody>
</table>
<p>SSH is installed but not started or set to auto start.</p>
<table width="100%" border="0" bgcolor="#E0E0E0">
<tbody>
<tr>
<td>
<pre>
systemctl start sshd.service
systemctl enable sshd.service
</pre>
</tr>
</tbody>
</table>
<p>yum install smartmontools<br />
yum install autofs</p>
<p>Use udisks &#8211;enumerate or mdadm &#8211;detail &#8211;scan to identify device names (e.g. /dev/sdb) for the commands below.  First create raid.</p>
<table width="100%" border="0" bgcolor="#E0E0E0">
<tbody>
<tr>
<td>
<pre>
mdadm --create --verbose /dev/md0 --level=5 --raid-devices=3 /dev/sdb /dev/sdc /dev/sdd
</pre>
</tr>
</tbody>
</table>
<p>This step above took over a dozen hours for me.  To see status.</p>
<table width="100%" border="0" bgcolor="#E0E0E0">
<tbody>
<tr>
<td>
<pre>
<em>watch cat /proc/mdstat</em>
</pre>
</tr>
</tbody>
</table>
<p>Save your new configuration so that it can be loaded next time you reboot.</p>
<table width="100%" border="0" bgcolor="#E0E0E0">
<tbody>
<tr>
<td>
<pre>
mdadm --detail --scan &gt;&gt; /etc/mdadm.conf
</pre>
</tr>
</tbody>
</table>
<table width="100%" border="0" bgcolor="#E0E0E0">
<tbody>
<tr>
<td>
<pre>
mke2fs -t ext4 -j /dev/md0
</pre>
</tr>
</tbody>
</table>
<p>Add this to /etc/fstab so that it is mounted every time.  /data being the mount point.</p>
<table width="100%" border="0" bgcolor="#E0E0E0">
<tbody>
<tr>
<td>
<pre>
/dev/md0 /data auto defaults 0 3
</pre>
</tr>
</tbody>
</table>
<p>If you chose to use ext2/3/4 you should also be aware of reserved space. By default ext2/3/4 will reserve 5% of the drives space, which only root is able to write to. This is done so a user cannot fill the drive and prevent critical daemons writing to it, but 5% of a large RAID array which isn’t going to be written to by critical daemons anyway, is a lot of wasted space. I chose to set the reserved space to 0%, using tune2fs:</p>
<table width="100%" border="0" bgcolor="#E0E0E0">
<tbody>
<tr>
<td>
<pre>
tune2fs -m 0 /dev/md0
</pre>
</tr>
</tbody>
</table>
<p>vi /etc/auto.misc<br />
dmesg is a nice command as well. <br />
ls -Z</p>
<p>shows the SELinux security label</p>
<p>This sets the label for the /data directory.  Do it before you add anything to the directory.  Everything added will gain this attribute.  Without this, SAMBA will not work under SELinux.</p>
<table width="100%" border="0" bgcolor="#E0E0E0">
<tbody>
<tr>
<td>
<pre>
chcon -t samba_share_t /data
</pre>
</tr>
</tbody>
</table>
<p>Make sure samba and netbios are set to autostart</p>
<table width="100%" border="0" bgcolor="#E0E0E0">
<tbody>
<tr>
<td>
<pre>
chkconfig --levels 35 smb on
chkconfig --levels 35 nmb on
</pre>
</tr>
</tbody>
</table>
<p>To test mail config,</p>
<table width="100%" border="0" bgcolor="#E0E0E0">
<tbody>
<tr>
<td>
<pre>
chkconfig --levels 35 sendmail on
yum install mailx 
</pre>
</tr>
</tbody>
</table>
<p>vi /etc/smartmon.conf<br />
Wanna run x-windows programs remotely such as gome-commander, do the following.  Before establishing the ssh connection the xserver must be started and the environment variable <code>DISPLAY</code> must be set for ssh.</p>
<table width="100%" border="0" bgcolor="#E0E0E0">
<tbody>
<tr>
<td>
<pre>
$ DISPLAY=<tt><em>localhost:0.0</em></tt>
$ export DISPLAY
$ ssh -Y <tt><em>remotehost</em></tt>
</pre>
</td>
</tr>
</tbody>
</table>
<p>or</p>
<table width="100%" border="0" bgcolor="#E0E0E0">
<tbody>
<tr>
<td>
<pre>
$ DISPLAY=<tt><em>localhost:0.0</em></tt> ssh -Y <tt><em>remotehost</em></tt>
</pre>
</td>
</tr>
</tbody>
</table>
<p>The parameter <code>-Y</code> enables trusted X11Forwarding. This is available since OpenSSH 3.8. If you have an older version of ssh you will have to use <code>-X</code>.</p>
<p>Then you can do</p>
<p>gome-commander &amp;</p>
<pre>Growing a raid 5 array
<a href="http://scotgate.org/2006/07/03/growing-a-raid5-array-mdadm/">http://scotgate.org/2006/07/03/growing-a-raid5-array-mdadm/</a>
Replace Failed drive
<a href="http://www.kernelhardware.org/replacing-failed-raid-drive/">http://www.kernelhardware.org/replacing-failed-raid-drive/</a>

sources
<a href="http://bfish.xaedalus.net/2006/11/software-raid-5-in-ubuntu-with-mdadm/">http://bfish.xaedalus.net/2006/11/software-raid-5-in-ubuntu-with-mdadm/</a>

<a href="http://www.jamierf.co.uk/2009/11/04/software-raid-5-using-mdadm-in-ubuntu-9-10/">http://www.jamierf.co.uk/2009/11/04/software-raid-5-using-mdadm-in-ubuntu-9-10/</a>

http://www.linuxjournal.com/magazine/monitoring-hard-disks-smart?page=0,2

http://blog.shadypixel.com/monitoring-hard-drive-health-on-linux-with-smartmontools/

http://www.oracle.com/technetwork/articles/hunter-rac10gr2-iscsi-101317.html#4
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/petteway.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/petteway.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/petteway.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/petteway.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/petteway.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/petteway.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/petteway.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/petteway.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/petteway.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/petteway.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/petteway.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/petteway.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/petteway.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/petteway.wordpress.com/112/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=petteway.wordpress.com&amp;blog=8703785&amp;post=112&amp;subd=petteway&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://petteway.wordpress.com/2011/10/21/linux-nas-media-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/95d52e35f89a54b5137b5b87e25707a8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">petteway</media:title>
		</media:content>
	</item>
		<item>
		<title>schema copy</title>
		<link>http://petteway.wordpress.com/2011/08/25/schema-copy/</link>
		<comments>http://petteway.wordpress.com/2011/08/25/schema-copy/#comments</comments>
		<pubDate>Thu, 25 Aug 2011 18:50:03 +0000</pubDate>
		<dc:creator>petteway</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://petteway.wordpress.com/?p=109</guid>
		<description><![CDATA[http://www.oracle-home.ro/Oracle_Database/10g_New_Features/Schema_refresh_DP.html 1. Create a new user on the target database with DBA role granted connected as sys run the following commands: CREATE USER DBA_TOOLS identified by ; grant DBA to DBA_TOOLS; 2. Create a DBlink in the new schema to point to the source schema CREATE DATABASE LINK &#8220;db_LINK_NAME&#8221; connect to source_schema identified by password [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=petteway.wordpress.com&amp;blog=8703785&amp;post=109&amp;subd=petteway&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>http://www.oracle-home.ro/Oracle_Database/10g_New_Features/Schema_refresh_DP.html</p>
<p>1. Create a new user on the target database with DBA role granted</p>
<p>connected as sys run the following commands:</p>
<p>CREATE USER DBA_TOOLS identified by ;</p>
<p>grant DBA to DBA_TOOLS; </p>
<p>2. Create a DBlink in the new schema to point to the source schema</p>
<p>CREATE DATABASE LINK &#8220;db_LINK_NAME&#8221; </p>
<p>connect to source_schema</p>
<p>identified by password</p>
<p>using &#8216;DB_alias&#8217;;</p>
<p>3. Create the procedure which will refresh the data</p>
<p>        CREATE OR REPLACE PROCEDURE DBA_TOOLS.copy_schema</p>
<p>                  ( source_schema in varchar2,</p>
<p>                   destination_schema in varchar2,</p>
<p>                   new_password in varchar2 default &#8216;newuser&#8217;,</p>
<p>                   network_link in varchar2 default &#8216;db_LINK_NAME&#8217;)</p>
<p>        as </p>
<p>          JobHandle   number; </p>
<p>          js  varchar2(9); &#8212; COMPLETED or STOPPED </p>
<p>          q   varchar2(1) := chr(39); </p>
<p>        BEGIN  /* open a new schema level import job using a default DB link */ </p>
<p>           JobHandle := dbms_datapump.open (&#8216;IMPORT&#8217;,</p>
<p>                                                                         &#8216;SCHEMA&#8217;,</p>
<p>                                                                          network_link); </p>
<p>          /* restrict to the schema we want to copy */ </p>
<p>          dbms_datapump.metadata_filter ( JobHandle,</p>
<p>                                                                      &#8216;SCHEMA_LIST&#8217;,</p>
<p>                                                                       q||source_schema||q);</p>
<p>          /* remap the importing schema name to the schema we want to create */</p>
<p>           dbms_datapump.metadata_remap ( JobHandle,</p>
<p>                                                                         &#8216;REMAP_SCHEMA&#8217;,</p>
<p>                                                                          source_schema,</p>
<p>                                                                          destination_schema);</p>
<p>           /* Set datapump parameters*/                            </p>
<p>           dbms_datapump.set_parameter ( JobHandle,</p>
<p>                                                                     &#8216;TABLE_EXISTS_ACTION&#8217;,</p>
<p>                                                                      &#8216;REPLACE&#8217; );</p>
<p>          /* start the job */ </p>
<p>          dbms_datapump.start_job( JobHandle);   </p>
<p>          /* wait for the job to finish */ </p>
<p>          dbms_datapump.wait_for_job( JobHandle, js);   </p>
<p>        end;</p>
<p>        /</p>
<p>4. Run the schema refresh </p>
<p>                 begin        </p>
<p>                     DBA_TOOLS.copy_schema(‘SOURCE_SCHEMA’,&#8217;DESTINATION_SCHEMA&#8217;);</p>
<p>                 end;</p>
<p>                  /</p>
<p>More information about  this subject ( Speed up the schema refresh over a DBlink with Data Pump (10g) ) you can get from  www.in-oracle.com</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/petteway.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/petteway.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/petteway.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/petteway.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/petteway.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/petteway.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/petteway.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/petteway.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/petteway.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/petteway.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/petteway.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/petteway.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/petteway.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/petteway.wordpress.com/109/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=petteway.wordpress.com&amp;blog=8703785&amp;post=109&amp;subd=petteway&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://petteway.wordpress.com/2011/08/25/schema-copy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/95d52e35f89a54b5137b5b87e25707a8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">petteway</media:title>
		</media:content>
	</item>
		<item>
		<title>who am i</title>
		<link>http://petteway.wordpress.com/2011/06/17/who-am-i/</link>
		<comments>http://petteway.wordpress.com/2011/06/17/who-am-i/#comments</comments>
		<pubDate>Fri, 17 Jun 2011 21:09:39 +0000</pubDate>
		<dc:creator>petteway</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://petteway.wordpress.com/?p=102</guid>
		<description><![CDATA[http://knol.google.com/k/frank-young/retrieve-current-executing-point-of-pl/3b2hx94o2q1wg/63# http://plsql.wikidot.com/forum:recent-posts http://www.oracle-developer.net/content/utilities/stk.sql<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=petteway.wordpress.com&amp;blog=8703785&amp;post=102&amp;subd=petteway&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>http://knol.google.com/k/frank-young/retrieve-current-executing-point-of-pl/3b2hx94o2q1wg/63#</p>
<p>http://plsql.wikidot.com/forum:recent-posts</p>
<p>http://www.oracle-developer.net/content/utilities/stk.sql</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/petteway.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/petteway.wordpress.com/102/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/petteway.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/petteway.wordpress.com/102/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/petteway.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/petteway.wordpress.com/102/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/petteway.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/petteway.wordpress.com/102/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/petteway.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/petteway.wordpress.com/102/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/petteway.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/petteway.wordpress.com/102/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/petteway.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/petteway.wordpress.com/102/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=petteway.wordpress.com&amp;blog=8703785&amp;post=102&amp;subd=petteway&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://petteway.wordpress.com/2011/06/17/who-am-i/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/95d52e35f89a54b5137b5b87e25707a8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">petteway</media:title>
		</media:content>
	</item>
		<item>
		<title>comma separated list to rows</title>
		<link>http://petteway.wordpress.com/2011/06/02/comma-separated-list-to-rows/</link>
		<comments>http://petteway.wordpress.com/2011/06/02/comma-separated-list-to-rows/#comments</comments>
		<pubDate>Thu, 02 Jun 2011 21:41:39 +0000</pubDate>
		<dc:creator>petteway</dc:creator>
				<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://petteway.wordpress.com/?p=96</guid>
		<description><![CDATA[If you have data in a field or a parameter passed in that is a comma separated list, this will give a resultset that can be joined to or used in an &#8220;in&#8221; clause. variable s := '1,2,3'; in 10g, this works in pl/sql SELECT TO_NUMBER(xt.column_value) lock_id FROM XMLTABLE(s) xt; in all version, this works [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=petteway.wordpress.com&amp;blog=8703785&amp;post=96&amp;subd=petteway&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you have data in a field or a parameter passed in that is a comma separated list, this will give a resultset that can be joined to or used in an &#8220;in&#8221; clause.</p>
<pre>
<code>
variable s := '1,2,3';

in 10g, this works in pl/sql
SELECT TO_NUMBER(xt.column_value) lock_id
FROM XMLTABLE(s) xt;

in all version, this works in pl/sql
select
    substr(txt,
    instr (txt, ',', 1, level ) + 1,
    instr (txt, ',', 1, level+1) - instr (txt, ',', 1, level) -1 )
as token
from (select ','||s||',' txt from dual)
connect by level
</code>
</pre>
<p>&nbsp;<br />
One caveat though, in less than 11.2 sometimes this causes ora-600 error after a while.  Known bug not fixed until 11.2.<br />
<a href="http://tkyte.blogspot.com/2006/01/how-can-i.html">Tom Kyte</a><br />
<a href="http://fdegrelle.over-blog.com/article-1694534.html" title="Another way">Another way</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/petteway.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/petteway.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/petteway.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/petteway.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/petteway.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/petteway.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/petteway.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/petteway.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/petteway.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/petteway.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/petteway.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/petteway.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/petteway.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/petteway.wordpress.com/96/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=petteway.wordpress.com&amp;blog=8703785&amp;post=96&amp;subd=petteway&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://petteway.wordpress.com/2011/06/02/comma-separated-list-to-rows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/95d52e35f89a54b5137b5b87e25707a8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">petteway</media:title>
		</media:content>
	</item>
		<item>
		<title>Scripting Tidbits</title>
		<link>http://petteway.wordpress.com/2011/02/11/scripting-tidbits/</link>
		<comments>http://petteway.wordpress.com/2011/02/11/scripting-tidbits/#comments</comments>
		<pubDate>Fri, 11 Feb 2011 17:15:06 +0000</pubDate>
		<dc:creator>petteway</dc:creator>
				<category><![CDATA[Scripting]]></category>

		<guid isPermaLink="false">http://petteway.wordpress.com/?p=79</guid>
		<description><![CDATA[rename a bunch of files in directory using bash $ for i in *.mkv; do mv $i &#8220;${i/HOGAN_S_HEROES_S2_DISC_/Hogans Heroes S2D}&#8221;; done n=1 for i in H*.mkv; do mv &#8220;$i&#8221; &#8220;${i/.mkv/-$n.mkv}&#8221;;let &#8220;n += 1&#8243;;done n=1 for i in HO*.mkv; do echo &#8220;$i&#8221; &#8220;${i/HOGAN_S_HEROES_S3_D?-?/Hogans Heroes S3E$n}&#8221;;let &#8220;n += 1&#8243;; done then point filebot at it and the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=petteway.wordpress.com&amp;blog=8703785&amp;post=79&amp;subd=petteway&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>rename a bunch of files in directory using bash<br />
$ for i in *.mkv; do mv $i &#8220;${i/HOGAN_S_HEROES_S2_DISC_/Hogans Heroes S2D}&#8221;; done</p>
<p>n=1<br />
for i in H*.mkv; do mv &#8220;$i&#8221; &#8220;${i/.mkv/-$n.mkv}&#8221;;let &#8220;n += 1&#8243;;done<br />
n=1<br />
for i in HO*.mkv; do echo &#8220;$i&#8221; &#8220;${i/HOGAN_S_HEROES_S3_D?-?/Hogans Heroes S3E$n}&#8221;;let &#8220;n += 1&#8243;; done<br />
then point filebot at it and the episode titles are added instantly.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/petteway.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/petteway.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/petteway.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/petteway.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/petteway.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/petteway.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/petteway.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/petteway.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/petteway.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/petteway.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/petteway.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/petteway.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/petteway.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/petteway.wordpress.com/79/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=petteway.wordpress.com&amp;blog=8703785&amp;post=79&amp;subd=petteway&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://petteway.wordpress.com/2011/02/11/scripting-tidbits/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/95d52e35f89a54b5137b5b87e25707a8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">petteway</media:title>
		</media:content>
	</item>
		<item>
		<title>Peppers Saving Seeds</title>
		<link>http://petteway.wordpress.com/2011/02/01/peppers-saving-seeds/</link>
		<comments>http://petteway.wordpress.com/2011/02/01/peppers-saving-seeds/#comments</comments>
		<pubDate>Tue, 01 Feb 2011 18:09:19 +0000</pubDate>
		<dc:creator>petteway</dc:creator>
				<category><![CDATA[Flamenco/Spanish]]></category>
		<category><![CDATA[Peppers]]></category>

		<guid isPermaLink="false">http://petteway.wordpress.com/?p=69</guid>
		<description><![CDATA[My research on getting free pepper plants for next year ripped from link below. For personal use only. Tomatoes, peppers, beans and peas are good choices for seed saving. These plants have flowers that are self-pollinating, and seeds that require little or no special treatment before storage. Saving pepper seeds is even easier. Allow some [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=petteway.wordpress.com&amp;blog=8703785&amp;post=69&amp;subd=petteway&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>My research on getting free pepper plants for next year ripped from link below.  For personal use only.</p>
<p>Tomatoes, peppers, beans and peas are good choices for seed saving. These plants have flowers that are self-pollinating, and seeds that require little or no special treatment before storage.</p>
<p>Saving pepper seeds is even easier. Allow some fruits to stay on the plants until they become fully ripe and start to wrinkle. Remove the seeds from the peppers and spread them out to dry. </p>
<p>Store seeds in tightly-sealed glass containers. You can store different kinds of seeds, each in individual paper packets, together in a large container. Keep seeds dry and cool. A temperature between 32° and 41°F is ideal, so your refrigerator can be a good place to store seeds.</p>
<p>A small amount of silica-gel desiccant added to each container will absorb moisture from the air and help keep the seeds dry. Silica gel is sold in bulk for drying flowers at craft supply stores. Powdered milk can also be used as a desiccant. Use one to two tablespoons of milk powder from a freshly opened package. Wrap the powder in a piece of cheesecloth or a facial tissue and place it in the container with the seeds. Powdered milk will absorb excess moisture from the air for about six months.</p>
<p>Be sure to label your saved seeds with their name, variety, and the date you collected them. It’s too easy to forget the details by the following spring. </p>
<p><a href="http://www.extension.umn.edu/distribution/horticulture/M1226.html"> Saving Vegetables Seeds: Tomatoes, Peppers, Peas and Beans by Jill MacKensie, Former Extension Specialist, Horticulture,<br />
University of Minnesota Extension</a></p>
<p>Pepper seeds can be purchased from <a href="http://www.thehippyseedcompany.com/">here</a> and <a href="http://www.yellow7pod.com/">here</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/petteway.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/petteway.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/petteway.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/petteway.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/petteway.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/petteway.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/petteway.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/petteway.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/petteway.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/petteway.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/petteway.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/petteway.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/petteway.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/petteway.wordpress.com/69/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=petteway.wordpress.com&amp;blog=8703785&amp;post=69&amp;subd=petteway&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://petteway.wordpress.com/2011/02/01/peppers-saving-seeds/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/95d52e35f89a54b5137b5b87e25707a8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">petteway</media:title>
		</media:content>
	</item>
		<item>
		<title>Remote Tnsnames File</title>
		<link>http://petteway.wordpress.com/2011/02/01/remote-tnsnames-file/</link>
		<comments>http://petteway.wordpress.com/2011/02/01/remote-tnsnames-file/#comments</comments>
		<pubDate>Tue, 01 Feb 2011 17:47:15 +0000</pubDate>
		<dc:creator>petteway</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://petteway.wordpress.com/?p=63</guid>
		<description><![CDATA[Problem: How to have a central location for tnsnames.ora file so that copying the file everywhere is not necessary. Answer: Three ways to do it. 1. in tnsnames.ora file put the following which can be a network location. This may or may not be supported. ifile=c:\temp\tnsnames.ora 2. set up a TNS_ADMIN environment variable that points [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=petteway.wordpress.com&amp;blog=8703785&amp;post=63&amp;subd=petteway&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Problem:  How to have a central location for tnsnames.ora file so that copying the file everywhere is not necessary.</p>
<p>Answer:  Three ways to do it.</p>
<p>1. in tnsnames.ora file put the following which can be a network location.  This may or may not be supported.<br />
ifile=c:\temp\tnsnames.ora</p>
<p>2. set up a TNS_ADMIN environment variable that points to the directory where this file<br />
is.</p>
<p>3. The best place to put the tns_admin variable on Windows is in the registry under each oracle home.<br />
For example: HKLM\software\oracle\home0\tns_admin and set the value to the location of your tnsnames.ora file.  Supposedly, this is documented in the Administrators Guide&#8230; </p>
<p>All this ripped from <a href="http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:2354114929479">http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:2354114929479</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/petteway.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/petteway.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/petteway.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/petteway.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/petteway.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/petteway.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/petteway.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/petteway.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/petteway.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/petteway.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/petteway.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/petteway.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/petteway.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/petteway.wordpress.com/63/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=petteway.wordpress.com&amp;blog=8703785&amp;post=63&amp;subd=petteway&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://petteway.wordpress.com/2011/02/01/remote-tnsnames-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/95d52e35f89a54b5137b5b87e25707a8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">petteway</media:title>
		</media:content>
	</item>
		<item>
		<title>blocking sessions</title>
		<link>http://petteway.wordpress.com/2009/11/19/blocking-sessions/</link>
		<comments>http://petteway.wordpress.com/2009/11/19/blocking-sessions/#comments</comments>
		<pubDate>Thu, 19 Nov 2009 21:49:18 +0000</pubDate>
		<dc:creator>petteway</dc:creator>
				<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://petteway.wordpress.com/?p=58</guid>
		<description><![CDATA[sql to determine blocking sessions. rac-safe. select inst_id, blocking_session, sid, serial#, wait_class, seconds_in_wait from gv$session where blocking_session is not NULL order by blocking_session;<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=petteway.wordpress.com&amp;blog=8703785&amp;post=58&amp;subd=petteway&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>sql to determine blocking sessions.  rac-safe.</p>
<pre>
<code>
select
   inst_id,
   blocking_session,
   sid,
   serial#,
   wait_class,
   seconds_in_wait
from
   gv$session
where
   blocking_session is not NULL
order by
   blocking_session;

</code>
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/petteway.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/petteway.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/petteway.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/petteway.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/petteway.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/petteway.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/petteway.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/petteway.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/petteway.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/petteway.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/petteway.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/petteway.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/petteway.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/petteway.wordpress.com/58/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=petteway.wordpress.com&amp;blog=8703785&amp;post=58&amp;subd=petteway&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://petteway.wordpress.com/2009/11/19/blocking-sessions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/95d52e35f89a54b5137b5b87e25707a8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">petteway</media:title>
		</media:content>
	</item>
		<item>
		<title>VM links</title>
		<link>http://petteway.wordpress.com/2009/08/12/vm-links/</link>
		<comments>http://petteway.wordpress.com/2009/08/12/vm-links/#comments</comments>
		<pubDate>Wed, 12 Aug 2009 18:28:05 +0000</pubDate>
		<dc:creator>petteway</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://petteway.wordpress.com/?p=48</guid>
		<description><![CDATA[article with info on how to create blanks for vmware player. http://blogbuildingu.com/articles/using-vmware-player-to-create-images-for-new-virtual-machines Online webpage to create and download properly configured blank image files. http://www.easyvmx.com/new-easyvmx.shtml Oracle Linux http://www.oracle.com/technology/tech/linux/index.html Unbuntu with Oracle http://www.pythian.com/news/968/installing-oracle-11g-on-ubuntu-804-lts-hardy-heron http://www.microsoft.com/windowsserver2008/en/us/hyperv-supported-guest-os.aspx<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=petteway.wordpress.com&amp;blog=8703785&amp;post=48&amp;subd=petteway&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>article with info on how to create blanks for vmware player.</p>
<p><a href="http://blogbuildingu.com/articles/using-vmware-player-to-create-images-for-new-virtual-machines">http://blogbuildingu.com/articles/using-vmware-player-to-create-images-for-new-virtual-machines</a></p>
<p>Online webpage to create and download properly configured blank image files.</p>
<p><a href="http://www.easyvmx.com/new-easyvmx.shtml">http://www.easyvmx.com/new-easyvmx.shtml</a></p>
<p>Oracle Linux</p>
<p>http://www.oracle.com/technology/tech/linux/index.html</p>
<p>Unbuntu with Oracle</p>
<p>http://www.pythian.com/news/968/installing-oracle-11g-on-ubuntu-804-lts-hardy-heron</p>
<p>http://www.microsoft.com/windowsserver2008/en/us/hyperv-supported-guest-os.aspx</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/petteway.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/petteway.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/petteway.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/petteway.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/petteway.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/petteway.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/petteway.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/petteway.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/petteway.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/petteway.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/petteway.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/petteway.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/petteway.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/petteway.wordpress.com/48/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=petteway.wordpress.com&amp;blog=8703785&amp;post=48&amp;subd=petteway&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://petteway.wordpress.com/2009/08/12/vm-links/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/95d52e35f89a54b5137b5b87e25707a8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">petteway</media:title>
		</media:content>
	</item>
		<item>
		<title>record count in a paging query</title>
		<link>http://petteway.wordpress.com/2009/08/07/record-count-in-a-paging-query/</link>
		<comments>http://petteway.wordpress.com/2009/08/07/record-count-in-a-paging-query/#comments</comments>
		<pubDate>Fri, 07 Aug 2009 19:17:51 +0000</pubDate>
		<dc:creator>petteway</dc:creator>
				<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://petteway.wordpress.com/?p=43</guid>
		<description><![CDATA[Quite often, you need to know the total number of records returned a query and page through the resultset. One common implementation is to run the query twice. Once to get the recordcount and once to get a page of data. This is expensive and unnecessary. Alias rownum in the subquery. count(*) over () as [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=petteway.wordpress.com&amp;blog=8703785&amp;post=43&amp;subd=petteway&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Quite often, you need to know the total number of records returned a query and page through the resultset.  One common implementation is to run the query twice.  Once to get the recordcount and once to get a page of data.  This is expensive and unnecessary.</p>
<ol>
<li>Alias rownum in the subquery.</li>
<li>count(*) over () as an extra column.</li>
<li>add to the where clause to filter result to a single page.</li>
</ol>
<p>Example.<br />
<code>
<pre>
select *
from (select empno, rownum rn, count(*) over () cnt
      from employees
      ) xx
where rn &gt;= 11 and rn &lt; 15
</pre>
<p></code><br />
&#8220;count(*) over ()&#8221; gives you the total number of records in the resultset which in this case is the subquery.  Therefore, you do not need to execute the query twice.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/petteway.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/petteway.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/petteway.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/petteway.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/petteway.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/petteway.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/petteway.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/petteway.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/petteway.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/petteway.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/petteway.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/petteway.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/petteway.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/petteway.wordpress.com/43/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=petteway.wordpress.com&amp;blog=8703785&amp;post=43&amp;subd=petteway&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://petteway.wordpress.com/2009/08/07/record-count-in-a-paging-query/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/95d52e35f89a54b5137b5b87e25707a8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">petteway</media:title>
		</media:content>
	</item>
	</channel>
</rss>
