<?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>WorkingScripts &#187; DB2</title>
	<atom:link href="http://workingscripts.com/tag/db2-sql-scripts/feed/" rel="self" type="application/rss+xml" />
	<link>http://workingscripts.com</link>
	<description>The Stuff that Just Works</description>
	<lastBuildDate>Mon, 07 Jun 2010 20:06:34 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Task Manager, System Monitor &#8211; best thing for DB2</title>
		<link>http://workingscripts.com/2009/05/task-manager-system-monitor-best-thing-for-db2/</link>
		<comments>http://workingscripts.com/2009/05/task-manager-system-monitor-best-thing-for-db2/#comments</comments>
		<pubDate>Fri, 22 May 2009 11:51:24 +0000</pubDate>
		<dc:creator>Iouri Chadour</dc:creator>
				<category><![CDATA[DB2]]></category>
		<category><![CDATA[utility]]></category>

		<guid isPermaLink="false">http://workingscripts.com/?p=9</guid>
		<description><![CDATA[One of my colleagues have introduced me to this utility and we had our DBAs install it on the system, and voila – you can see DB2 in works: it’s running snapshots online, you can see bufferpools usage, your top processes and much much more. Here is a link to a IBM page that has [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>One of my colleagues have introduced me to this utility and we had our DBAs install it on the system, and voila – you can see DB2 in works: it’s running snapshots online, you can see bufferpools usage, your top processes and much much more. Here is a link to a IBM page that has a detailed description, screenshots:</p>
<p><a title="http://www.ibm.com/developerworks/data/library/techarticle/dm-0812wang/" href="http://www.ibm.com/developerworks/data/library/techarticle/dm-0812wang/">http://www.ibm.com/developerworks/data/library/techarticle/dm-0812wang/</a></p>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://workingscripts.com/2009/05/task-manager-system-monitor-best-thing-for-db2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DB2 Escape characters in queries</title>
		<link>http://workingscripts.com/2009/02/db2-escape-characters/</link>
		<comments>http://workingscripts.com/2009/02/db2-escape-characters/#comments</comments>
		<pubDate>Wed, 18 Feb 2009 05:05:00 +0000</pubDate>
		<dc:creator>Iouri Chadour</dc:creator>
				<category><![CDATA[DB2]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://workingscripts.com/?p=41</guid>
		<description><![CDATA[Recently I had to use escape characters in DB2 queries and after looking through documentation here is a simple way to do this. You can define you escape character using 
{escape '\'}
&#160;
right after the statement your are trying to use it, here is a sample statement:

select oprid, oprdefndesc
from psoprdefn
where oprid like '%\_%' {escape '\'} 


.csharpcode, [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I had to use escape characters in DB2 queries and after looking through documentation here is a simple way to do this. You can define you escape character using </p>
<pre class="csharpcode">{<span class="kwrd">escape</span> <span class="str">'\'</span>}</pre>
<p>&#160;</p>
<p>right after the statement your are trying to use it, here is a sample statement:</p>
<div class="csharpcode">
<pre class="alt"><span class="kwrd">select</span> oprid, oprdefndesc</pre>
<pre><span class="kwrd">from</span> psoprdefn</pre>
<pre class="alt"><span class="kwrd">where</span> oprid <span class="kwrd">like</span> <span class="str">'%\_%'</span> {<span class="kwrd">escape</span> <span class="str">'\'</span>} </pre>
</div>
<style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
]]></content:encoded>
			<wfw:commentRss>http://workingscripts.com/2009/02/db2-escape-characters/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Deleting a lot of rows fast</title>
		<link>http://workingscripts.com/2008/03/deleting-rows-fast/</link>
		<comments>http://workingscripts.com/2008/03/deleting-rows-fast/#comments</comments>
		<pubDate>Wed, 19 Mar 2008 21:36:00 +0000</pubDate>
		<dc:creator>Iouri Chadour</dc:creator>
				<category><![CDATA[DB2]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://workingscripts.com/?p=36</guid>
		<description><![CDATA[Need to delete millions of rows from a table fast? Here is how you can do this:


   1: ALTER TABLE table_name ACTIVATE NOT LOGGED INITIALLY; --disable logging

   2: DELETE FROM table_name WHERE ....;

   3: COMMIT; --Commits and enable logging


]]></description>
			<content:encoded><![CDATA[<p>Need to delete millions of rows from a table fast? Here is how you can do this:</p>
<div id="codeSnippetWrapper" style="border-right: silver 1px solid; padding-right: 4px; border-top: silver 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: silver 1px solid; width: 133.32%; cursor: text; direction: ltr; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: silver 1px solid; font-family: &#39;Courier New&#39;, courier, monospace; height: 102px; background-color: #f4f4f4; text-align: left">
<div id="codeSnippet" style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"><span id="lnum1" style="color: #606060">   1:</span> <span style="color: #0000ff">ALTER</span> <span style="color: #0000ff">TABLE</span> table_name ACTIVATE <span style="color: #0000ff">NOT</span> LOGGED <span style="color: #0000ff">INITIALLY</span>; --disable logging</pre>
<p><!--CRLF--></p>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"><span id="lnum2" style="color: #606060">   2:</span> <span style="color: #0000ff">DELETE</span> <span style="color: #0000ff">FROM</span> table_name <span style="color: #0000ff">WHERE</span> ....;</pre>
<p><!--CRLF--></p>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"><span id="lnum3" style="color: #606060">   3:</span> <span style="color: #0000ff">COMMIT</span>; --Commits <span style="color: #0000ff">and</span> enable logging</pre>
<p><!--CRLF--></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://workingscripts.com/2008/03/deleting-rows-fast/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DB2 Space Management</title>
		<link>http://workingscripts.com/2008/03/db2-space-management/</link>
		<comments>http://workingscripts.com/2008/03/db2-space-management/#comments</comments>
		<pubDate>Wed, 12 Mar 2008 21:52:00 +0000</pubDate>
		<dc:creator>Iouri Chadour</dc:creator>
				<category><![CDATA[DB2]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://workingscripts.com/?p=39</guid>
		<description><![CDATA[Here are some very useful utility SQLs that will allow you to understand your space usage, system and other useful stuff:
DB2 Space Usage &#38; Status


   1: -- to find tablespace status, type , usage run following SQL

   2: select substr(tablespace_name,1,20) Tablespace_name, 

   3:     case t.TBSPACETYPE [...]]]></description>
			<content:encoded><![CDATA[<p>Here are some very useful utility SQLs that will allow you to understand your space usage, system and other useful stuff:</p>
<p><strong>DB2 Space Usage &amp; Status</strong></p>
<div id="codeSnippetWrapper" style="border-right: silver 1px solid; padding-right: 4px; border-top: silver 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: silver 1px solid; width: 118.93%; cursor: text; direction: ltr; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: silver 1px solid; font-family: &#39;Courier New&#39;, courier, monospace; height: 210px; background-color: #f4f4f4; text-align: left">
<div id="codeSnippet" style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"><span id="lnum1" style="color: #606060">   1:</span> -- <span style="color: #0000ff">to</span> find tablespace status, type , <span style="color: #0000ff">usage</span> run following <span style="color: #0000ff">SQL</span></pre>
<p><!--CRLF--></p>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"><span id="lnum2" style="color: #606060">   2:</span> <span style="color: #0000ff">select</span> substr(tablespace_name,1,20) Tablespace_name, </pre>
<p><!--CRLF--></p>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"><span id="lnum3" style="color: #606060">   3:</span>     <span style="color: #0000ff">case</span> t.TBSPACETYPE </pre>
<p><!--CRLF--></p>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"><span id="lnum4" style="color: #606060">   4:</span>         <span style="color: #0000ff">when</span> <span style="color: #006080">'S'</span> <span style="color: #0000ff">then</span> <span style="color: #006080">'System Managed'</span></pre>
<p><!--CRLF--></p>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"><span id="lnum5" style="color: #606060">   5:</span>         <span style="color: #0000ff">when</span> <span style="color: #006080">'D'</span> <span style="color: #0000ff">then</span> <span style="color: #006080">'Database managed'</span></pre>
<p><!--CRLF--></p>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"><span id="lnum6" style="color: #606060">   6:</span>     <span style="color: #0000ff">end</span> <span style="color: #0000ff">as</span> TBSManaged, </pre>
<p><!--CRLF--></p>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"><span id="lnum7" style="color: #606060">   7:</span>     (used_pages/total_pages ) * 100 usedPCT, </pre>
<p><!--CRLF--></p>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"><span id="lnum8" style="color: #606060">   8:</span>     s.total_pages Total_pages, </pre>
<p><!--CRLF--></p>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"><span id="lnum9" style="color: #606060">   9:</span>     s.used_pages Used_pages, </pre>
<p><!--CRLF--></p>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"><span id="lnum10" style="color: #606060">  10:</span>     (s.total_pages - s.USABLE_PAGES ) Overhead_pgs, </pre>
<p><!--CRLF--></p>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"><span id="lnum11" style="color: #606060">  11:</span>     s.NUM_CONTAINERS No_of_containers,</pre>
<p><!--CRLF--></p>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"><span id="lnum12" style="color: #606060">  12:</span>     s.free_pages Free_pages,</pre>
<p><!--CRLF--></p>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"><span id="lnum13" style="color: #606060">  13:</span>     <span style="color: #0000ff">case</span> t.DATATYPE </pre>
<p><!--CRLF--></p>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"><span id="lnum14" style="color: #606060">  14:</span>         <span style="color: #0000ff">when</span> <span style="color: #006080">'A'</span> <span style="color: #0000ff">then</span> <span style="color: #006080">' ALL typ perm '</span></pre>
<p><!--CRLF--></p>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"><span id="lnum15" style="color: #606060">  15:</span>         <span style="color: #0000ff">when</span> <span style="color: #006080">'L'</span>  <span style="color: #0000ff">then</span> <span style="color: #006080">' Large '</span></pre>
<p><!--CRLF--></p>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"><span id="lnum16" style="color: #606060">  16:</span>         <span style="color: #0000ff">when</span> <span style="color: #006080">'T'</span>  <span style="color: #0000ff">then</span> <span style="color: #006080">' System Temp'</span></pre>
<p><!--CRLF--></p>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"><span id="lnum17" style="color: #606060">  17:</span>         <span style="color: #0000ff">when</span> <span style="color: #006080">'U'</span>  <span style="color: #0000ff">then</span> <span style="color: #006080">' User Temp '</span></pre>
<p><!--CRLF--></p>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"><span id="lnum18" style="color: #606060">  18:</span>     <span style="color: #0000ff">end</span> <span style="color: #0000ff">as</span> TBStype, </pre>
<p><!--CRLF--></p>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"><span id="lnum19" style="color: #606060">  19:</span>     <span style="color: #0000ff">case</span> s.TABLESPACE_STATE </pre>
<p><!--CRLF--></p>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"><span id="lnum20" style="color: #606060">  20:</span>         <span style="color: #0000ff">when</span> 0 <span style="color: #0000ff">then</span> <span style="color: #006080">' Normal '</span> </pre>
<p><!--CRLF--></p>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"><span id="lnum21" style="color: #606060">  21:</span>         <span style="color: #0000ff">when</span> 1 <span style="color: #0000ff">then</span> <span style="color: #006080">' Quiesced: SHARE '</span> </pre>
<p><!--CRLF--></p>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"><span id="lnum22" style="color: #606060">  22:</span>         <span style="color: #0000ff">when</span> 2 <span style="color: #0000ff">then</span> <span style="color: #006080">' Quiesced: UPDATE '</span> </pre>
<p><!--CRLF--></p>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"><span id="lnum23" style="color: #606060">  23:</span>         <span style="color: #0000ff">when</span> 4 <span style="color: #0000ff">then</span> <span style="color: #006080">' Quiesced: EXCLUSIVE '</span> </pre>
<p><!--CRLF--></p>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"><span id="lnum24" style="color: #606060">  24:</span>         <span style="color: #0000ff">when</span> 8 <span style="color: #0000ff">then</span> <span style="color: #006080">' Load pending '</span> </pre>
<p><!--CRLF--></p>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"><span id="lnum25" style="color: #606060">  25:</span>         <span style="color: #0000ff">when</span> 16 <span style="color: #0000ff">then</span> <span style="color: #006080">' Delete pending '</span> </pre>
<p><!--CRLF--></p>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"><span id="lnum26" style="color: #606060">  26:</span>         <span style="color: #0000ff">when</span> 32 <span style="color: #0000ff">then</span> <span style="color: #006080">' Backup pending '</span> </pre>
<p><!--CRLF--></p>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"><span id="lnum27" style="color: #606060">  27:</span>         <span style="color: #0000ff">when</span> 64 <span style="color: #0000ff">then</span> <span style="color: #006080">' Roll forward in progress '</span> </pre>
<p><!--CRLF--></p>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"><span id="lnum28" style="color: #606060">  28:</span>         <span style="color: #0000ff">when</span> 128 <span style="color: #0000ff">then</span> <span style="color: #006080">' Roll forward pending '</span> </pre>
<p><!--CRLF--></p>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"><span id="lnum29" style="color: #606060">  29:</span>         <span style="color: #0000ff">when</span> 256 <span style="color: #0000ff">then</span> <span style="color: #006080">' Restore pending '</span> </pre>
<p><!--CRLF--></p>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"><span id="lnum30" style="color: #606060">  30:</span>         <span style="color: #0000ff">when</span> 512 <span style="color: #0000ff">then</span> <span style="color: #006080">' Disable pending '</span> </pre>
<p><!--CRLF--></p>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"><span id="lnum31" style="color: #606060">  31:</span>         <span style="color: #0000ff">when</span> 1024 <span style="color: #0000ff">then</span> <span style="color: #006080">' Reorg in progress '</span> </pre>
<p><!--CRLF--></p>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"><span id="lnum32" style="color: #606060">  32:</span>         <span style="color: #0000ff">when</span> 2048 <span style="color: #0000ff">then</span> <span style="color: #006080">' Backup in progress '</span> </pre>
<p><!--CRLF--></p>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"><span id="lnum33" style="color: #606060">  33:</span>         <span style="color: #0000ff">when</span> 4096 <span style="color: #0000ff">then</span> <span style="color: #006080">' Storage must be defined '</span> </pre>
<p><!--CRLF--></p>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"><span id="lnum34" style="color: #606060">  34:</span>         <span style="color: #0000ff">when</span> 8192 <span style="color: #0000ff">then</span> <span style="color: #006080">' Restore in progress '</span> </pre>
<p><!--CRLF--></p>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"><span id="lnum35" style="color: #606060">  35:</span>         <span style="color: #0000ff">when</span> 16384 <span style="color: #0000ff">then</span> <span style="color: #006080">' Offline and not accessible '</span> </pre>
<p><!--CRLF--></p>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"><span id="lnum36" style="color: #606060">  36:</span>         <span style="color: #0000ff">when</span> 32768 <span style="color: #0000ff">then</span> <span style="color: #006080">' Drop pending '</span> </pre>
<p><!--CRLF--></p>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"><span id="lnum37" style="color: #606060">  37:</span>         <span style="color: #0000ff">when</span> 33554432 <span style="color: #0000ff">then</span> <span style="color: #006080">' Storage may be defined '</span> </pre>
<p><!--CRLF--></p>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"><span id="lnum38" style="color: #606060">  38:</span>         <span style="color: #0000ff">when</span> 67108864 <span style="color: #0000ff">then</span> <span style="color: #006080">' Storage Definition is in (final) state '</span> </pre>
<p><!--CRLF--></p>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"><span id="lnum39" style="color: #606060">  39:</span>         <span style="color: #0000ff">when</span> 134217728 <span style="color: #0000ff">then</span> <span style="color: #006080">' Storage Definition was changed prior to rollforward '</span> </pre>
<p><!--CRLF--></p>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"><span id="lnum40" style="color: #606060">  40:</span>         <span style="color: #0000ff">when</span> 268435456 <span style="color: #0000ff">then</span> <span style="color: #006080">' DMS rebalancer is active '</span> </pre>
<p><!--CRLF--></p>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"><span id="lnum41" style="color: #606060">  41:</span>         <span style="color: #0000ff">when</span> 536870912 <span style="color: #0000ff">then</span> <span style="color: #006080">' TBS deletion in progress '</span> </pre>
<p><!--CRLF--></p>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"><span id="lnum42" style="color: #606060">  42:</span>         <span style="color: #0000ff">when</span> 1073741824 <span style="color: #0000ff">then</span> <span style="color: #006080">' TBS creation in progress '</span> <span style="color: #0000ff">end</span> TABLESPACE_STATE </pre>
<p><!--CRLF--></p>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"><span id="lnum43" style="color: #606060">  43:</span> <span style="color: #0000ff">from</span> <span style="color: #0000ff">table</span>(snapshot_tbs_cfg(<span style="color: #006080">' '</span>,-1)) <span style="color: #0000ff">as</span> s, sysibm.systablespaces t <span style="color: #0000ff">where</span> s.tablespace_name = t.tbspace ;</pre>
<p><!--CRLF--></div>
</div>
<p><strong></strong></p>
<p><strong>DB2 Unused Space</strong></p>
<div id="codeSnippetWrapper" style="border-right: silver 1px solid; padding-right: 4px; border-top: silver 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: silver 1px solid; width: 128.25%; cursor: text; direction: ltr; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: silver 1px solid; font-family: &#39;Courier New&#39;, courier, monospace; height: 210px; background-color: #f4f4f4; text-align: left">
<div id="codeSnippet" style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"><span id="lnum1" style="color: #606060">   1:</span> -- GETTING WASTED <span style="color: #0000ff">SPACE</span></pre>
<p><!--CRLF--></p>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"><span id="lnum2" style="color: #606060">   2:</span> <span style="color: #0000ff">select</span> TBSPACE, ((80 - usedPCT) *  total_pages/100)*4/1000 SPACE_WASTED</pre>
<p><!--CRLF--></p>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"><span id="lnum3" style="color: #606060">   3:</span> <span style="color: #0000ff">FROM</span></pre>
<p><!--CRLF--></p>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"><span id="lnum4" style="color: #606060">   4:</span>     ( <span style="color: #0000ff">select</span> substr(tablespace_name,1,20) TBSPACE,</pre>
<p><!--CRLF--></p>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"><span id="lnum5" style="color: #606060">   5:</span>         total_pages,</pre>
<p><!--CRLF--></p>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"><span id="lnum6" style="color: #606060">   6:</span>         used_pages,</pre>
<p><!--CRLF--></p>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"><span id="lnum7" style="color: #606060">   7:</span>         free_pages, </pre>
<p><!--CRLF--></p>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"><span id="lnum8" style="color: #606060">   8:</span>         (used_pages*100/total_pages )  usedPCT</pre>
<p><!--CRLF--></p>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"><span id="lnum9" style="color: #606060">   9:</span>     <span style="color: #0000ff">from</span> <span style="color: #0000ff">table</span>(snapshot_tbs_cfg(<span style="color: #006080">' '</span>,-1)) <span style="color: #0000ff">as</span> tbs ) </pre>
<p><!--CRLF--></p>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"><span id="lnum10" style="color: #606060">  10:</span> <span style="color: #0000ff">AS</span> TABLE_SPACE</pre>
<p><!--CRLF--></p>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"><span id="lnum11" style="color: #606060">  11:</span> <span style="color: #0000ff">WHERE</span> usedPCT &lt; 60</pre>
<p><!--CRLF--></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://workingscripts.com/2008/03/db2-space-management/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DB2 Scripts &#8211; Table Management</title>
		<link>http://workingscripts.com/2008/03/db2-table-management/</link>
		<comments>http://workingscripts.com/2008/03/db2-table-management/#comments</comments>
		<pubDate>Wed, 05 Mar 2008 01:39:00 +0000</pubDate>
		<dc:creator>Iouri Chadour</dc:creator>
				<category><![CDATA[DB2]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://workingscripts.com/?p=45</guid>
		<description><![CDATA[Here are a few more nice DB2 scripts that would save you time:
Get all tables in Table Space

-- Get all tables in particular tablespaceselect SUBSTR(TABNAME,1,25) &#34;TABNAME&#34;, SUBSTR(TABSCHEMA,1,15) &#34;SCHEMA&#34;, NPAGES, CARD from syscat.tables where tbspace = '?'

Generate Grants for all tables in Table Space

-- Genereating GRANTS SELECT 'grant select on ' &#124;&#124; tabname &#124;&#124; ' to [...]]]></description>
			<content:encoded><![CDATA[<p>Here are a few more nice DB2 scripts that would save you time:</p>
<p><strong>Get all tables in Table Space</strong></p>
<div id="codeSnippetWrapper" style="border-right: silver 1px solid; padding-right: 4px; border-top: silver 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: silver 1px solid; width: 97.5%; cursor: text; direction: ltr; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: silver 1px solid; font-family: &#39;Courier New&#39;, courier, monospace; background-color: #f4f4f4; text-align: left">
<pre id="codeSnippet" style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"><span style="color: #008000">-- Get all tables in particular tablespace</span><span style="color: #0000ff">select</span> SUBSTR(TABNAME,1,25) &quot;TABNAME&quot;, SUBSTR(TABSCHEMA,1,15) &quot;<span style="color: #0000ff">SCHEMA</span>&quot;, NPAGES, CARD <span style="color: #0000ff">from</span> syscat.tables <span style="color: #0000ff">where</span> tbspace = <span style="color: #006080">'?'</span></pre>
<p></div>
<p><strong>Generate Grants for all tables in Table Space</strong></p>
<div id="codeSnippetWrapper" style="border-right: silver 1px solid; padding-right: 4px; border-top: silver 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: silver 1px solid; width: 97.5%; cursor: text; direction: ltr; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: silver 1px solid; font-family: &#39;Courier New&#39;, courier, monospace; background-color: #f4f4f4; text-align: left">
<pre id="codeSnippet" style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"><span style="color: #008000">-- Genereating GRANTS </span><span style="color: #0000ff">SELECT</span> <span style="color: #006080">'grant select on '</span> || tabname || <span style="color: #006080">' to PSFDEV'</span> || <span style="color: #006080">';'</span>  <span style="color: #0000ff">FROM</span> syscat.tables <span style="color: #0000ff">WHERE</span> tabname <span style="color: #0000ff">NOT</span> <span style="color: #0000ff">IN</span> (<span style="color: #0000ff">SELECT</span> tabname                         <span style="color: #0000ff">FROM</span> syscat.tabauth                        <span style="color: #0000ff">WHERE</span> grantee = <span style="color: #006080">'PSFDEV'</span>)   <span style="color: #0000ff">AND</span> tabschema = <span style="color: #006080">'PSFSSYS'</span>   <span style="color: #0000ff">AND</span> (type = <span style="color: #006080">'T'</span> <span style="color: #0000ff">OR</span> type = <span style="color: #006080">'V'</span>)</pre>
<p></div>
]]></content:encoded>
			<wfw:commentRss>http://workingscripts.com/2008/03/db2-table-management/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
