<?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>making IT happen : an infrastructure blog</title>
	<atom:link href="http://www.lanigera.com/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.lanigera.com/wordpress</link>
	<description>views from the trenches</description>
	<lastBuildDate>Fri, 18 May 2012 17:13:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Find workflows not processed by mailer after ORA-29532</title>
		<link>http://www.lanigera.com/wordpress/2012/05/find-workflows-not-processed-by-mailer-after-ora-29532/</link>
		<comments>http://www.lanigera.com/wordpress/2012/05/find-workflows-not-processed-by-mailer-after-ora-29532/#comments</comments>
		<pubDate>Fri, 18 May 2012 17:12:13 +0000</pubDate>
		<dc:creator>tkyle</dc:creator>
				<category><![CDATA[11i]]></category>
		<category><![CDATA[Applications]]></category>
		<category><![CDATA[Databases]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Oracle E-Business Suite]]></category>
		<category><![CDATA[11gr2]]></category>
		<category><![CDATA[e-business suite]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[workflow]]></category>

		<guid isPermaLink="false">http://www.lanigera.com/wordpress/?p=562</guid>
		<description><![CDATA[I recently ran into a problem where inbound Workflow approvals were being &#8220;stuck&#8221; in processing. The notification messages were being delivered to the instance&#8217;s INBOX and transferred into the PROCESS folder, but were not being processed. The only error message was a notice sent to the sysadmin. In the error notification was an ORA-29532: Event [...]]]></description>
			<content:encoded><![CDATA[<p>I recently ran into a problem where inbound Workflow approvals were being &#8220;stuck&#8221; in processing. The notification messages were being delivered to the instance&#8217;s INBOX and transferred into the PROCESS folder, but were not being processed. The only error message was a notice sent to the sysadmin.</p>
<p>In the error notification was an ORA-29532:</p>
<pre style="padding-left: 30px;">Event Error Name: -29532
Event Error Message: ORA-29532: Java call terminated by uncaught Java exception: java.lang.ArrayIndexOutOfBoundsException
Event Error Stack:
WF_XML.getResponseDetails()
WF_XML.handleReceiveEvent(oracle.apps.wf.notification.receive.message, C0F79E8FE39B266EE0301490C8C41A0C)</pre>
<p>The underlying issue turned out to be a regressed XDK after a database upgrade, and a workaround was to bounce the Workflow Mailer Agent Listeners until the patch (5194357) could be reapplied. But that still left a certain number of workflows in limbo, with the respective users unaware that their actions had not &#8220;taken.&#8221; So, knowing the identification number of the first errored workflow (from the subject of the error notification email sent to the sysadmin), I wrote a small script to identify these workflows:</p>
<pre style="padding-left: 30px;">select
 recipient_role,
 status,
 mail_status,
 to_user,
 subject
from
 wf_notifications
where
 notification_id in (
 select
 substr(subject, -7) wf_notification_id
 from
 wf_notifications
 where
 subject like 'External Event ERROR%'
 and notification_id &gt; &amp;id_number)
order by
 to_user</pre>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><em>References</em></p>
<p><a href="https://support.oracle.com/CSP/main/article?cmd=show&amp;type=NOT&amp;doctype=HOWTO&amp;id=177411.1">How to Identify the Version of XDK Installed Inside the Database [ID 177411.1]</a></p>
<p><a href="https://support.oracle.com/CSP/main/article?cmd=show&amp;type=NOT&amp;doctype=HOWTO&amp;id=1288090.1">Response Workflow Emails Not Being Processed by the Mailer and Still Shows in Process Resulting in ORA-29532 [ID 1288090.1]</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.lanigera.com/wordpress/2012/05/find-workflows-not-processed-by-mailer-after-ora-29532/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Open GL periods in Oracle Apps 11i</title>
		<link>http://www.lanigera.com/wordpress/2012/01/open-gl-periods-in-oracle-apps-11i/</link>
		<comments>http://www.lanigera.com/wordpress/2012/01/open-gl-periods-in-oracle-apps-11i/#comments</comments>
		<pubDate>Mon, 23 Jan 2012 21:41:09 +0000</pubDate>
		<dc:creator>tkyle</dc:creator>
				<category><![CDATA[11i]]></category>
		<category><![CDATA[Applications]]></category>
		<category><![CDATA[Databases]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Oracle E-Business Suite]]></category>
		<category><![CDATA[gl periods]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://www.lanigera.com/wordpress/?p=541</guid>
		<description><![CDATA[Quick and overly simple script to determine status of GL periods. The example looks for period names ending in &#8217;11&#8242; (ie, from 2011). SELECT gps.period_num, gps.period_name, gps.set_of_books_id, gsob.period_set_name, DECODE (gps.closing_status, 'O', 'Open', 'C', 'Closed', 'F', 'Future', 'N', 'Never') status FROM gl_period_statuses gps, gl_sets_of_books gsob where gps.period_name like '%11' and gps.application_id = 101 and gsob.set_of_books_id = [...]]]></description>
			<content:encoded><![CDATA[<p>Quick and overly simple script to determine status of GL periods. The example looks for period names ending in &#8217;11&#8242; (ie, from 2011).</p>
<pre style="padding-left: 30px;" lang="&quot;sql">SELECT
  gps.period_num,
  gps.period_name,
  gps.set_of_books_id,
  gsob.period_set_name,
  DECODE (gps.closing_status,
    'O', 'Open',
    'C', 'Closed',
    'F', 'Future',
    'N', 'Never') status
FROM
  gl_period_statuses gps,
  gl_sets_of_books gsob
where
  gps.period_name like '%11' and
  gps.application_id = 101 and
  gsob.set_of_books_id = gps.set_of_books_id
order by
  gps.period_num</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.lanigera.com/wordpress/2012/01/open-gl-periods-in-oracle-apps-11i/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Easy thumbnails of PDFs on OS X</title>
		<link>http://www.lanigera.com/wordpress/2012/01/easy-thumbnails-of-pdfs-on-os-x/</link>
		<comments>http://www.lanigera.com/wordpress/2012/01/easy-thumbnails-of-pdfs-on-os-x/#comments</comments>
		<pubDate>Sat, 07 Jan 2012 04:42:43 +0000</pubDate>
		<dc:creator>tkyle</dc:creator>
				<category><![CDATA[OS X]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[os x]]></category>
		<category><![CDATA[pdf]]></category>
		<category><![CDATA[sips]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.lanigera.com/wordpress/?p=536</guid>
		<description><![CDATA[I recently needed to create some thumbnails, using the first page of a fairly large number of PDFs. I was pleasantly surprised to learn that OS X has a handy command-line utility that can be easily scripted to do this. Here&#8217;s the one-liner I used to accomplish the task: for file in `echo *.pdf`; do [...]]]></description>
			<content:encoded><![CDATA[<p>I recently needed to create some thumbnails, using the first page of a fairly large number of PDFs.  I was pleasantly surprised to learn that OS X has a handy command-line utility that can be easily scripted to do this.  Here&#8217;s the one-liner I used to accomplish the task:</p>

<div class="wp_syntax"><div class="code"><pre class="script" style="font-family:monospace;">for file in `echo *.pdf`; do sips -s format jpeg --resampleWidth 540 \
$file --out `basename $file .pdf`_thumb.jpg; done</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.lanigera.com/wordpress/2012/01/easy-thumbnails-of-pdfs-on-os-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Queries to verify Oracle configuration</title>
		<link>http://www.lanigera.com/wordpress/2012/01/queries-to-verify-oracle-configuration/</link>
		<comments>http://www.lanigera.com/wordpress/2012/01/queries-to-verify-oracle-configuration/#comments</comments>
		<pubDate>Thu, 05 Jan 2012 22:03:59 +0000</pubDate>
		<dc:creator>tkyle</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[dba]]></category>
		<category><![CDATA[oracle]]></category>

		<guid isPermaLink="false">http://www.lanigera.com/wordpress/?p=518</guid>
		<description><![CDATA[I wrote up this fairly basic cheat sheet for myself several years ago. At the time, I was not very familiar with the Oracle database, and was working with a DBA whom we suspected was not setting things up correctly or even consistently. So, I put together a set of queries to verify basic parameters [...]]]></description>
			<content:encoded><![CDATA[<p>I wrote up this fairly basic cheat sheet for myself several years ago. At the time, I was not very familiar with the Oracle database, and was working with a DBA whom we suspected was not setting things up correctly or even consistently. So, I put together a set of queries to verify basic parameters and compare them to our project documentation.  As a result, I learned a bit about database configuration, and we found a very good DBA.</p>
<p>I&#8217;m putting these queries on the blog in case someone else finds them useful.  The queries were originally for 10gR2.</p>
<h3>Data file locations:</h3>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span> 
  name 
<span style="color: #993333; font-weight: bold;">FROM</span> 
  v$datafile;</pre></div></div>

<h3>Temp file locations:</h3>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span>
  name 
<span style="color: #993333; font-weight: bold;">FROM</span>
  v$tempfile;</pre></div></div>

<p>Undo file locations:</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span>
  name
<span style="color: #993333; font-weight: bold;">FROM</span>
  v$datafile
<span style="color: #993333; font-weight: bold;">WHERE</span>
  ts# <span style="color: #66cc66;">=</span> <span style="color: #66cc66;">&#40;</span>
         <span style="color: #993333; font-weight: bold;">SELECT</span>
           ts#
         <span style="color: #993333; font-weight: bold;">FROM</span>
           v$tablespace 
         <span style="color: #993333; font-weight: bold;">WHERE</span>
           name <span style="color: #66cc66;">=</span> <span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">SELECT</span>
                     tablespace_name
                   <span style="color: #993333; font-weight: bold;">FROM</span> 
                     dba_tablespaces
                   <span style="color: #993333; font-weight: bold;">WHERE</span>
                     contents <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'UNDO'</span><span style="color: #66cc66;">&#41;</span>
        <span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<h3>Archive log destinations:</h3>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;">ARCHIVE LOG LIST;</pre></div></div>

<p>- or -</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span> destination <span style="color: #993333; font-weight: bold;">FROM</span> v$archive_dest;</pre></div></div>

<h3>Control file locations:</h3>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span> name <span style="color: #993333; font-weight: bold;">FROM</span> v$controlfile;</pre></div></div>

<h3>Redo log locations:</h3>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span> member <span style="color: #993333; font-weight: bold;">FROM</span> v$logfile;</pre></div></div>

<h3>Checking ARCHIVELOG mode:</h3>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span> log_mode <span style="color: #993333; font-weight: bold;">FROM</span> v$database;</pre></div></div>

<h3>Enabling ARCHIVELOG mode:</h3>
<pre>SQL&gt; startup mount
ORACLE instance started.

Total System Global Area 184549376 bytes
Fixed Size 1300928 bytes
Variable Size 157820480 bytes
Database Buffers 25165824 bytes
Redo Buffers 262144 bytes
Database mounted.

SQL&gt; alter database archivelog;
Database altered.

SQL&gt; alter database open;
Database altered.</pre>
<h3>Determine which datafiles have AUTOEXTEND enabled:</h3>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span> file_name <span style="color: #993333; font-weight: bold;">FROM</span> dba_data_files <span style="color: #993333; font-weight: bold;">WHERE</span> autoextensible <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'YES'</span>;</pre></div></div>

<h3>Disable AUTOEXTEND for a datafile:</h3>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">ALTER</span> <span style="color: #993333; font-weight: bold;">DATABASE</span> DATAFILE <span style="color: #ff0000;">'/path/to/datafile.dbf'</span> AUTOEXTEND OFF</pre></div></div>

<h3>Enable AUTOEXTEND for a datafile, but with a maximum size:</h3>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">ALTER</span> <span style="color: #993333; font-weight: bold;">DATABASE</span> DATAFILE <span style="color: #ff0000;">'/path/to/datafile.dbf'</span> AUTOEXTEND <span style="color: #993333; font-weight: bold;">ON</span> MAXSIZE 500M</pre></div></div>

<h3>Estimate size of SYSAUX tablespace (after system has been running for &gt;1 days):</h3>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;">@$ORACLE_HOME<span style="color: #66cc66;">/</span>rdbms<span style="color: #66cc66;">/</span>admin<span style="color: #66cc66;">/</span>utlsyxsz<span style="color: #66cc66;">.</span><span style="color: #993333; font-weight: bold;">SQL</span>;</pre></div></div>

<p>and answer the questions that the script asks</p>
<h3>Change archive log destination:</h3>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">ALTER</span> SYSTEM <span style="color: #993333; font-weight: bold;">SET</span> log_archive_dest_1<span style="color: #66cc66;">=</span><span style="color: #ff0000;">'LOCATION=/path/to/archivelogs'</span>;</pre></div></div>

<h3>Getting ORA-19815 errors</h3>
<p>&#8220;ORA-19815: WARNING: db_recovery_file_dest_size of 2147483648 bytes is 100.00% used, and has 0 remaining bytes available.&#8221;</p>
<p>What&#8217;s happening:</p>
<p>* Oracle is trying to write to the flashback area, but is bumping up against<br />
a hard limit defined by the db_recovery_file_dest_size parameter</p>
<p>Possible causes:</p>
<p>* In ARCHIVELOG mode, but no destination is set (defaults to flashback)</p>
<p>Possible fixes:</p>
<p>* Set one or more archive log destinations<br />
* Increase the db_recovery_file_dest_size (if not full)<br />
- BUT: You&#8217;ll probably end up having this error again in the future<br />
if you try to use this as a permanent fix</p>
<h3>Open Cursors:</h3>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span> 
  a<span style="color: #66cc66;">.</span><span style="color: #993333; font-weight: bold;">VALUE</span><span style="color: #66cc66;">,</span>
  b<span style="color: #66cc66;">.</span>name
<span style="color: #993333; font-weight: bold;">FROM</span>
  v$mystat a<span style="color: #66cc66;">,</span>
  v$statname b
<span style="color: #993333; font-weight: bold;">WHERE</span>
  a<span style="color: #66cc66;">.</span>statistic# <span style="color: #66cc66;">=</span> b<span style="color: #66cc66;">.</span>statistic# <span style="color: #993333; font-weight: bold;">AND</span>
  a<span style="color: #66cc66;">.</span>statistic# <span style="color: #66cc66;">=</span> <span style="color: #cc66cc;">3</span>;</pre></div></div>

<p>Who opened cursors:</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span> user_name<span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">STATUS</span><span style="color: #66cc66;">,</span> osuser<span style="color: #66cc66;">,</span> machine<span style="color: #66cc66;">,</span> a<span style="color: #66cc66;">.</span>sql_text
<span style="color: #993333; font-weight: bold;">FROM</span> v$session b<span style="color: #66cc66;">,</span> v$open_cursor a
<span style="color: #993333; font-weight: bold;">WHERE</span> a<span style="color: #66cc66;">.</span>sid <span style="color: #66cc66;">=</span> b<span style="color: #66cc66;">.</span>sid;</pre></div></div>

<p>Max number of cursors per user:</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #66cc66;">*</span>
<span style="color: #993333; font-weight: bold;">FROM</span> v$parameter
<span style="color: #993333; font-weight: bold;">WHERE</span> name <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'open_cursors'</span>;</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.lanigera.com/wordpress/2012/01/queries-to-verify-oracle-configuration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting under the hood with DB2 for TSM Admins</title>
		<link>http://www.lanigera.com/wordpress/2011/12/getting-under-the-hood-with-db2-for-tsm-admins/</link>
		<comments>http://www.lanigera.com/wordpress/2011/12/getting-under-the-hood-with-db2-for-tsm-admins/#comments</comments>
		<pubDate>Wed, 21 Dec 2011 21:26:49 +0000</pubDate>
		<dc:creator>tkyle</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[DB2]]></category>
		<category><![CDATA[Infrastructure]]></category>
		<category><![CDATA[Social]]></category>
		<category><![CDATA[Storage]]></category>
		<category><![CDATA[TSM]]></category>
		<category><![CDATA[backups]]></category>
		<category><![CDATA[databases]]></category>
		<category><![CDATA[db2]]></category>
		<category><![CDATA[db2look]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[tsm]]></category>
		<category><![CDATA[tuning]]></category>

		<guid isPermaLink="false">http://www.lanigera.com/wordpress/?p=503</guid>
		<description><![CDATA[Over at the TSMADmin blog, Chad Small recently posted &#8220;DB2 Doesn&#8217;t Make a Difference.&#8221;  Chad was concerned that he was not seeing a performance boost in his database queries after upgrading from TSM 5.5 to 6.x. As you know, one of the biggest changes in TSM 6.x is that it is now backed by DB2. [...]]]></description>
			<content:encoded><![CDATA[<p>Over at the <a href="http://www.tsmadmin.com">TSMADmin blog</a>, Chad Small recently posted &#8220;<a href="http://www.tsmadmin.com/2011/12/db2-doesnt-make-difference.html">DB2 Doesn&#8217;t Make a Difference</a>.&#8221;  Chad was concerned that he was not seeing a performance boost in his database queries after upgrading from TSM 5.5 to 6.x.</p>
<p>As you know, one of the biggest changes in TSM 6.x is that it is now backed by DB2.  Previous releases of TSM used a proprietary database that worked well, but had certain limitations, especially with scaling.</p>
<p>In any case, Chad was using the following query to find old Oracle database backups that had not been properly cleaned:</p>
<pre style="padding-left: 30px;">select \
 cast(sum(b.file_size/1073741824) as decimal(18,2)) AS GB_SIZE \
from \
 backups a, \
 contents b \
where \
 a.node_name in ('DEV01_ORA','DEV02_ORA','DEV03_ORA','PRD01_ORA','PROD02_ORA') and \
 a.backup_date &lt; '2011-11-01 00:00:00' and \
 a.object_id=b.object_id</pre>
<p>Chad&#8217;s problem was that the query was slow.  Really, really slow.  It sounded like an interesting problem (I know, I&#8217;m weird), and since one of my many hats is doing Oracle support, I have a seen a fair amount of poorly-performing database queries.  And usually, the culprit is the query itself, and not the database.  I&#8217;m not anyone&#8217;s idea of a SQL tuning expert, but it seemed like a good opportunity to learn.</p>
<p>I confirmed what Chad was seeing by issuing a select count(*) against <code>backups</code> and <code>contents</code>, and the <code>contents</code> query in particular took very long to execute.  Additionally, it returned tens of millions of rows, so there was a lot of data to process.</p>
<p>Since the CLI for DB2, <code>db2</code>,  is included with TSM, I used it to query the database directly.  Once connected, the first order of business was to find out what the query was hitting: what are <code>backups</code> and <code>contents</code>?</p>
<pre style="padding-left: 30px;">db2 =&gt; set schema tsmdb1
DB20000I  The SQL command completed successfully.
db2 =&gt; list tables for schema tsmdb1

Table/View                      Schema          Type  Creation time
------------------------------- --------------- ----- --------------------------
.
.
.
BACKUPS                         TSMDB1          V     2011-09-14-19.05.58.424225
.
.
.
CONTENTS                        TSMDB1          V     2011-09-14-19.06.04.636090
.
.
.</pre>
<p>Well.  We can see from the &#8216;V&#8217; in the Type column that the two objects are views.  A view is essentially a SQL code block that you can query and update just like you would a table.  This is great for abstracting a complicated database, but whenever you execute a statement against it, it gets executed itself.  So there may be a whole lot more processing involved than you expect or need.</p>
<p>In order to examine the SQL code for the views, DB2 provides the <code>db2look</code> command-line utility.  Here are the commands to dump the code for the two views.  Note that the output is being placed into a text file.</p>
<p style="padding-left: 30px;"><code>db2look -d TSMDB1 -e -v backups -o backups.sql</code></p>
<p style="padding-left: 30px;"> and</p>
<p style="padding-left: 30px;"><code>db2look -d TSMDB1 -e -v contents -o contents.sql</code></p>
<p>After looking at the source code, I found that most of what Chad was looking for seemed to be in the backup_objects table.  Here&#8217;s my rewrite of Chad&#8217;s query:</p>
<pre style="padding-left: 30px;">select \
  sum(cast(bk.bfsize/1024/1024 as decimal(14,4))) AS MB \
from \
  backup_objects bk \
where \
  bk.nodeid in (select nodeid from nodesview where node_name in ('DEV01_ORA','DEV02_ORA','DEV03_ORA','PRD01_ORA','PROD02_ORA')) and \
  bk.insdate&lt;'2011-11-01 00:00:00'</pre>
<p>Chad pointed out that you can&#8217;t query the <code>nodes</code> table from the <code>dsmadmc</code> client (why??), however you are able to query against the <code>nodesview</code> view.  You&#8217;ll need to change the column from <code>nodename</code> to <code>node_name</code> when you do.</p>
<p>With the new query, Chad is able to get results within 10 minutes.  Still not blazing fast, but it sounds like the query is usable now.</p>
<p><em>References:</em></p>
<p><a href="http://www.tsmadmin.com/2011/12/db2-doesnt-make-difference.html">DB2 Doesn&#8217;t Make A Difference</a></p>
<p><a href="http://publib.boulder.ibm.com/infocenter/db2luw/v9r7/index.jsp?topic=%2Fcom.ibm.db2.luw.admin.cmd.doc%2Fdoc%2Fr0002051.html">db2look &#8211; DB2 statistics and DDL extraction tool command</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.lanigera.com/wordpress/2011/12/getting-under-the-hood-with-db2-for-tsm-admins/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Disabling caching on a primary stgpool and deleting the volumes in TSM</title>
		<link>http://www.lanigera.com/wordpress/2011/09/disabling-caching-on-a-primary-stgpool-and-deleting-the-volumes-in-tsm/</link>
		<comments>http://www.lanigera.com/wordpress/2011/09/disabling-caching-on-a-primary-stgpool-and-deleting-the-volumes-in-tsm/#comments</comments>
		<pubDate>Tue, 13 Sep 2011 22:15:44 +0000</pubDate>
		<dc:creator>tkyle</dc:creator>
				<category><![CDATA[Infrastructure]]></category>
		<category><![CDATA[Storage]]></category>
		<category><![CDATA[TSM]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[stgpool]]></category>
		<category><![CDATA[tsm]]></category>

		<guid isPermaLink="false">http://www.lanigera.com/wordpress/?p=456</guid>
		<description><![CDATA[I recently needed to shrink a primary stgpool with devclass DISK on a TSM 5.5 server  in order to free up space.  Since the stgpool had a device class of DISK and caching was enabled, I wasn&#8217;t able to directly shrink the stgpool by moving the data within volumes and then deleting the empty volumes. [...]]]></description>
			<content:encoded><![CDATA[<p>I recently needed to shrink a primary stgpool with devclass DISK on a TSM 5.5 server  in order to free up space.  Since the stgpool had a device class of DISK and caching was enabled, I wasn&#8217;t able to directly shrink the stgpool by moving the data within volumes and then deleting the empty volumes.  Instead, I needed to first disable caching on the stgpool, and then I was able to purge the cached data from the storage pool.</p>
<p>Here&#8217;s a look at the volumes in the storage pool:</p>
<pre style="padding-left: 30px;">tsm: SERVER1&gt;q vol stg=mypool1

Volume Name                  Storage         Device         Estimated       Pct      Volume
                             Pool Name       Class Name      Capacity      Util      Status
------------------------     -----------     ----------     ---------     -----     --------
/path/to/mypoolvol01         MYPOOL1         DISK             500.0 G      55.2     On-Line
/path/to/mypoolvol02         MYPOOL1         DISK             500.0 G      90.0     On-Line</pre>
<p>The first step is to disable caching of migrated files on the storage pool.</p>
<pre style="padding-left: 30px;">tsm: SERVER1&gt;update stgpool mypool1 cache=no</pre>
<p>As you can see, this has no effect on the storage space used; the data remains in the storage pool.</p>
<pre style="padding-left: 30px;">tsm: SERVER1&gt;q vol stg=mypool1

Volume Name                  Storage         Device         Estimated       Pct      Volume
                             Pool Name       Class Name      Capacity      Util      Status
------------------------     -----------     ----------     ---------     -----     --------
/path/to/mypoolvol01         MYPOOL1         DISK             500.0 G      55.2     On-Line
/path/to/mypoolvol02         MYPOOL1         DISK             500.0 G      90.0     On-Line</pre>
<p>However, now that caching has been disabled, if we use the &#8220;move data&#8221; command, any cached data in the storage pool will be cleared:</p>
<pre style="padding-left: 30px;">tsm: SERVER1&gt;move data /path/to/mypoolvol01
ANR2232W This command will move all of the data stored on volume /path/to/mypoolvol01 to other volumes within the
same storage pool; the data will be inaccessible to users until the operation completes.

Do you wish to proceed? (Yes (Y)/No (N)) y
ANS8003I Process number 1094 started.</pre>
<pre style="padding-left: 30px;">tsm: SERVER1&gt;q vol stg=mypool1

Volume Name                  Storage         Device         Estimated       Pct      Volume
                             Pool Name       Class Name      Capacity      Util      Status
------------------------     -----------     ----------     ---------     -----     --------
/path/to/mypoolvol01         MYPOOL1         DISK             500.0 G       0.0     On-Line
/path/to/mypoolvol02         MYPOOL1         DISK             500.0 G      90.0     On-Line</pre>
</pre>
<p>With the volume now empty, we can remove the volume from the storage pool:</p>
<pre style="padding-left: 30px;">tsm: SERVER1&gt;del vol /path/to/mypoolvol01
ANR2220W This command will delete volume /path/to/V02737713.BFS from its storage pool after verifying that the volume
contains no data.

Do you wish to proceed? (Yes (Y)/No (N)) y</pre>
<p>The last step is to remove the file from the filesystem:</p>
<pre style="padding-left: 30px;"># rm /path/to/mypoolvol01</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.lanigera.com/wordpress/2011/09/disabling-caching-on-a-primary-stgpool-and-deleting-the-volumes-in-tsm/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Using SQL*Loader to get around ORA-01795</title>
		<link>http://www.lanigera.com/wordpress/2011/09/using-sqlloader-to-get-around-ora-01795/</link>
		<comments>http://www.lanigera.com/wordpress/2011/09/using-sqlloader-to-get-around-ora-01795/#comments</comments>
		<pubDate>Tue, 13 Sep 2011 21:00:15 +0000</pubDate>
		<dc:creator>tkyle</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[ORA-01795]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[sql*loader]]></category>
		<category><![CDATA[sqlldr]]></category>

		<guid isPermaLink="false">http://www.lanigera.com/wordpress/?p=441</guid>
		<description><![CDATA[So one of your higher-ups just sent you an Excel spreadsheet with tens of thousands of items, and he or she wants you to query Oracle and get the results right away to resolve the crisis of the day.  Unfortunately, trying to query against this huge list of values gets you this fun error: ORA-01795: [...]]]></description>
			<content:encoded><![CDATA[<p>So one of your higher-ups just sent you an Excel spreadsheet with tens of thousands of items, and he or she wants you to query Oracle and get the results right away to resolve the crisis of the day.  Unfortunately, trying to query against this huge list of values gets you this fun error:</p>
<pre style="padding-left: 30px;">ORA-01795: maximum number of expressions in a list is 1000</pre>
<p>Which, honestly, is one of the most honest and straightforward ORA codes. So what are you going to do about it?  You can either break your query into separate statements with 1,000 expressions each, or you can make life a lot easier and load what you need into a scratch table using the Oracle SQL*Loader utility (aka sqlldr).  This will let you query against data within the database.</p>
<p>SQL*Loader, unsurprisingly, loads data from a flat file into a table in an Oracle database.  Of course, one of the first things you&#8217;ll need to do is to create the table where you want this data to be loaded.  This table will of course be different, depending on what data you are working with:</p>
<pre style="padding-left: 30px;">-------------------------------------------------
-- BEGIN SCRATCH_t.sql

create table scratch_t
  (important_txt   varchar2(30) not null);

-- END SCRATCH_t.sql
-------------------------------------------------</pre>
<p>We&#8217;ll also need a control file.  This tells sqlldr how to load our data into the database.  Note that the table we just created is referenced here.</p>
<pre style="padding-left: 30px;">-------------------------------------------------
-- BEGIN scratch.ctl

LOAD DATA
INFILE '*'
--INFILE 'scratch_values.txt'
--BADFILE 'scratch.bad'
--DISCARDFILE 'scratch.dsc'
APPEND
INTO TABLE SCRATCH_t
FIELDS TERMINATED BY ' '
OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
(
IMPORTANT_TXT
)

-- END scratch.ctl
-------------------------------------------------</pre>
<pre style="padding-left: 30px;"></pre>
<p>Once the table and control file have been created, and the data is in a text file, you are ready to roll.  Invoke SQL*Loader from the command line with appropriate credentials, referencing your input and control files:</p>
<pre style="padding-left: 30px;">[oradood@bigserver ~]$ sqlldr user/pass data=scratch_values.txt,control=scratch.ctl</pre>
<p>While the program is running, it will output how many records have been processed.  Once it completes, don&#8217;t forget to check the logfile (try scratch.out) for any errors.</p>
<p>&nbsp;</p>
<p><em>Reference</em></p>
<p><a href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14215/ldr_params.htm">SQL*Loader Command-Line Reference</a></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lanigera.com/wordpress/2011/09/using-sqlloader-to-get-around-ora-01795/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WMS Health Check scripts for Oracle Apps 11i and R12</title>
		<link>http://www.lanigera.com/wordpress/2011/08/wms-health-check-scripts-for-oracle-apps-11i-and-r12/</link>
		<comments>http://www.lanigera.com/wordpress/2011/08/wms-health-check-scripts-for-oracle-apps-11i-and-r12/#comments</comments>
		<pubDate>Thu, 25 Aug 2011 01:49:22 +0000</pubDate>
		<dc:creator>tkyle</dc:creator>
				<category><![CDATA[11i]]></category>
		<category><![CDATA[Applications]]></category>
		<category><![CDATA[Databases]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Oracle E-Business Suite]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[r12]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[wms]]></category>

		<guid isPermaLink="false">http://www.lanigera.com/wordpress/?p=451</guid>
		<description><![CDATA[While poking around on the My Oracle Support site (formerly Metalink), I ran across a script called WMS_health_check.sql (document 1086783.1) that contains 30 queries to find certain kinds of data corruption in Oracle Apps.  Most of the checks are for WMS, but there are also several relating to Order Management, Shipping Execution, and Inventory/Purchasing/Receiving. Some of [...]]]></description>
			<content:encoded><![CDATA[<p>While poking around on the My Oracle Support site (formerly Metalink), I ran across a script called WMS_health_check.sql (document 1086783.1) that contains 30 queries to find certain kinds of data corruption in Oracle Apps.  Most of the checks are for WMS, but there are also several relating to Order Management, Shipping Execution, and Inventory/Purchasing/Receiving.</p>
<p>Some of the checks were things that I&#8217;ve looked for (LPNs that have been Shipped Out of Stores, but still have an onhand quantity), but most were ones that I hadn&#8217;t built queries for.  In my defense, I <em>am</em> a Unix guy who plays Oracle DBA from time to time&#8230; ;^)</p>
<p>If you&#8217;re running Oracle E-Business Suite and have WMS-enabled organization(s), it&#8217;s definitely useful to check out this script. I opened several SRs after running the script for the first time.  Hopefully this means fewer problems for our warehouse and shipping staff, and therefore fewer tickets for IT.</p>
<p>&nbsp;</p>
<p><em>Reference</em></p>
<p><a href="https://support.oracle.com/CSP/main/article?cmd=show&amp;type=NOT&amp;doctype=HOWTO&amp;id=1086783.1">WMS Health Check Scripts to Check for Data Corruption [ID 1086783.1]</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.lanigera.com/wordpress/2011/08/wms-health-check-scripts-for-oracle-apps-11i-and-r12/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Determine order number from delivery_detail_id in Oracle Apps 11i</title>
		<link>http://www.lanigera.com/wordpress/2011/08/determine-order-number-from-delivery_detail_id-in-oracle-apps-11i/</link>
		<comments>http://www.lanigera.com/wordpress/2011/08/determine-order-number-from-delivery_detail_id-in-oracle-apps-11i/#comments</comments>
		<pubDate>Wed, 24 Aug 2011 20:21:00 +0000</pubDate>
		<dc:creator>tkyle</dc:creator>
				<category><![CDATA[11i]]></category>
		<category><![CDATA[Applications]]></category>
		<category><![CDATA[Databases]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Oracle E-Business Suite]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[order management]]></category>
		<category><![CDATA[shipping execution]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://www.lanigera.com/wordpress/?p=445</guid>
		<description><![CDATA[I recently needed to look up the order number associated with a delivery_detail_id, so that I could run diagnostics on the sales order.  Here&#8217;s a quick script that I whipped up to find the info: select unique wdd.source_header_number order_number, wdd.source_header_id, wdd.source_header_type_name order_type, wdd.source_line_id line_id, msi.segment1 item from wsh_delivery_details wdd, mtl_system_items_b msi where wdd.delivery_detail_id in ( [...]]]></description>
			<content:encoded><![CDATA[<p>I recently needed to look up the order number associated with a delivery_detail_id, so that I could run diagnostics on the sales order.  Here&#8217;s a quick script that I whipped up to find the info:</p>
<pre style="padding-left: 30px;">select
  unique wdd.source_header_number order_number,
  wdd.source_header_id,
  wdd.source_header_type_name order_type,
  wdd.source_line_id line_id,
  msi.segment1 item
from
  wsh_delivery_details wdd,
  mtl_system_items_b msi
where
  wdd.delivery_detail_id in (
    123456,
    789012,
    345678,
    901234) and
  msi.inventory_item_id = wdd.inventory_item_id
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.lanigera.com/wordpress/2011/08/determine-order-number-from-delivery_detail_id-in-oracle-apps-11i/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What does &#8220;down&#8221; mean?</title>
		<link>http://www.lanigera.com/wordpress/2011/08/what-does-down-mean/</link>
		<comments>http://www.lanigera.com/wordpress/2011/08/what-does-down-mean/#comments</comments>
		<pubDate>Mon, 15 Aug 2011 21:06:40 +0000</pubDate>
		<dc:creator>tkyle</dc:creator>
				<category><![CDATA[Humor]]></category>
		<category><![CDATA[Musings]]></category>

		<guid isPermaLink="false">http://www.lanigera.com/wordpress/?p=432</guid>
		<description><![CDATA[Various meanings for &#8216;down&#8217; that I have seen over the years: An email to someone at another company bounced back. Someone forgot his or her password and/or password. A mobile user has poor wireless and/or mobile broadband connectivity.  &#8220;I&#8217;m at the airport&#8230;&#8221; A mobile user was sitting at home during a power outage.  Wish I [...]]]></description>
			<content:encoded><![CDATA[<p>Various meanings for &#8216;down&#8217; that I have seen over the years:</p>
<ul>
<li>An email to someone at another company bounced back.</li>
<li>Someone forgot his or her password and/or password.</li>
<li>A mobile user has poor wireless and/or mobile broadband connectivity.  <em>&#8220;I&#8217;m at the airport&#8230;&#8221;</em></li>
<li>A mobile user was sitting at home during a power outage.  <em>Wish I were making this up.</em></li>
<li>The application is down for scheduled maintenance, as requested and scheduled by the person complaining of the outage.  <em>&#8220;You never tell us anything!&#8221;</em></li>
<li>The person submitting the ticket was told by a coworker that someone on a previous shift had some sort of problem sometime between last night and last week.  <em>&#8220;He needs this to do his job.&#8221;</em></li>
<li>Users were sharing credentials, and then the account was closed when the account owner was terminated for whatever reason.  <em>&#8220;How else can I do it?&#8221;</em></li>
<li>User attempted to log into a system that was decommissioned five years ago.  <em>It *was* a good hostname.</em></li>
<li>All of the access points in a large warehouse were physically moved, creating large dead spots.  Of course, no one saw anything or knew how it happened.  <em>Gnomes!</em></li>
<li>The cnn.com website was down.  <em>Guess who had to send an outage notification to 16,000 users?</em></li>
<li>The application administrator tried something that broke the dev instance, and then proceeded to &#8216;try&#8217; it in all of the other instances, too.  <em>Because you never know!</em></li>
<li>A developer with production access ran a &#8220;harmless&#8221; SQL statement.  <em>It couldn&#8217;t be that &#8211; it&#8217;s only a SELECT statement!</em></li>
<li>The application administrator decided to &#8220;secure&#8221; the ERP by disabling system accounts.  <em>Since no one could log in, it was really secure</em>.</li>
</ul>
<p>How about you?  I&#8217;d love to hear some other good definitions of &#8220;down.&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lanigera.com/wordpress/2011/08/what-does-down-mean/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced

Served from: lanigera.com @ 2012-05-20 21:15:19 -->
