<?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>Rich Technologies</title>
	<atom:link href="http://www.richtechnologies.com/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.richtechnologies.com</link>
	<description>The Technical Weblog of Shad Rich</description>
	<lastBuildDate>Sat, 21 Aug 2010 21:13:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>AD Patch Worker Hangs on XDOLoader Process</title>
		<link>http://www.richtechnologies.com/?p=178</link>
		<comments>http://www.richtechnologies.com/?p=178#comments</comments>
		<pubDate>Sat, 21 Aug 2010 18:53:34 +0000</pubDate>
		<dc:creator>Shad</dc:creator>
				<category><![CDATA[Applications]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[ad patch]]></category>
		<category><![CDATA[adpatch]]></category>
		<category><![CDATA[e-business suite]]></category>
		<category><![CDATA[hang]]></category>
		<category><![CDATA[oracle applications]]></category>
		<category><![CDATA[oracle apps]]></category>
		<category><![CDATA[xdoloader]]></category>
		<category><![CDATA[xdoloader.class]]></category>

		<guid isPermaLink="false">http://www.richtechnologies.com/?p=178</guid>
		<description><![CDATA[Have you run an e-Business Suite R12 patch that slowed down or hung at the Java Loader steps for no apparent reason? I first encountered this issue in January, and finding a workable solution took several hours of research. No Oracle Support notes pointed directly to the issue at the time, although several more recent [...]]]></description>
			<content:encoded><![CDATA[<p>Have you run an e-Business Suite R12 patch that slowed down or hung at the Java Loader steps for no apparent reason? I first encountered this issue in January, and finding a workable solution took several hours of research. No Oracle Support notes pointed directly to the issue at the time, although several more recent notes make the issue easier to identify and solve. Hopefully this post will be useful to someone else.</p>
<p><strong>Platform:</strong>  Red Hat Enterprise Linux Server<br />
<strong>Application Version:</strong>  e-Business Suite 12.1+</p>
<p><strong>Symptoms:</strong></p>
<p>Patch runs fine until it begins to slow down and hang partway through the java loader (e.g., XDOLoader) steps for no apparent reason. There are no indications that the hang is being caused by a database performance or locking issue.</p>
<p><strong>Troubleshooting:</strong></p>
<p>AD patch worker log error:</p>
<p><code>Error: Error connecting to database "jdbc:oracle:thin:APPS/xxxxxx@(DESCRIPTION=(LOAD_BALANCE=YES)(FAILOVER=YES)(ADDRESS_LIST=(ADDRESS=(PROTOCOL=tcp)(HOST=YOUR_HOST)(PORT=1521)))(CONNECT_DATA=(SID=YOUR_SID)))"<br />
Io exception: Connection reset</code></p>
<p>Run jstack on the hanging java process:</p>
<p><code>"main" prio=10 tid=0x08937000 nid=0x22ea runnable [0xf73e1000]<br />
   java.lang.Thread.State: RUNNABLE<br />
    at java.io.FileInputStream.readBytes(Native Method)<br />
    at java.io.FileInputStream.read(FileInputStream.java:199)<br />
    at java.io.BufferedInputStream.read1(BufferedInputStream.java:256)<br />
    at java.io.BufferedInputStream.read(BufferedInputStream.java:317)<br />
    - locked <0xf29b25a0> (a java.io.BufferedInputStream)<br />
    at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)<br />
    at java.io.BufferedInputStream.read1(BufferedInputStream.java:258)<br />
    at java.io.BufferedInputStream.read(BufferedInputStream.java:317)<br />
    - locked <0xf29b2370> (a java.io.BufferedInputStream)<br />
    at sun.security.provider.SeedGenerator$URLSeedGenerator.getSeedByte(SeedGenerator.java:453)<br />
    at sun.security.provider.SeedGenerator.getSeedBytes(SeedGenerator.java:123)<br />
    at sun.security.provider.SeedGenerator.generateSeed(SeedGenerator.java:118)<br />
    at sun.security.provider.SecureRandom.engineGenerateSeed(SecureRandom.java:114)<br />
    at sun.security.provider.SecureRandom.engineNextBytes(SecureRandom.java:171)<br />
    - locked <0xf29b1fd0> (a sun.security.provider.SecureRandom)<br />
    at java.security.SecureRandom.nextBytes(SecureRandom.java:433)<br />
    - locked <0xf29b2250> (a java.security.SecureRandom)<br />
    at oracle.security.o5logon.O5LoginClientHelper.generateOAuthResponse(Unknown Source)<br />
    at oracle.jdbc.driver.T4CTTIoauthenticate.marshalOauth(T4CTTIoauthenticate.java:457)<br />
    at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:367)<br />
    at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:510)<br />
    at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:203)<br />
    at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:33)<br />
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:510)<br />
    at java.sql.DriverManager.getConnection(DriverManager.java:582)<br />
    at java.sql.DriverManager.getConnection(DriverManager.java:185)<br />
    at oracle.apps.xdo.oa.util.XDOLoader.initAppsContext(XDOLoader.java:558)<br />
    at oracle.apps.xdo.oa.util.XDOLoader.init(XDOLoader.java:455)<br />
    at oracle.apps.xdo.oa.util.XDOLoader.<init>(XDOLoader.java:413)<br />
    at oracle.apps.xdo.oa.util.XDOLoader.main(XDOLoader.java:2250)<br />
</code><br />
Check /dev/random entropy:</p>
<p><code>cat /proc/sys/kernel/random/entropy_avail</code><br />
NOTE:  Higher numbers are better. The patch will begin to slow down or hang whenever entropy is ~50 or less.</p>
<p><strong>Explanation:</strong></p>
<p>The java process depends on the /dev/random device to provide random numbers to the SecureRandom Java class. If /dev/random runs out of random numbers, the patch workers calling SecureRandom hang until enough random numbers are available.</p>
<p><strong>Solutions:</strong><br />
NOTE: Pick one of the solutions below. Solution number 1 is my preferred solution, since it is specific to the e-Business Suite and should not affect other processes on the server.</p>
<ol>
<li>Search for all jre/lib/security/java.security files and replace:
<p><code>securerandom.source=file:/dev/random</code><br />
with<br />
<code>securerandom.source=file:/dev/urandom</code>
</li>
<li>Run the rngd daemon to seed /dev/random with random numbers:<br />
Install the rngd-utils package in RedHat 5 or kernel-utils in RedHat 4.<br />
<code>rngd -r /dev/urandom -o /dev/random -f -t 1</code>
</li>
<li>Replace the /dev/random device with /dev/urandom. (Not recommended for security reasons.)
<p><code>sudo mv /dev/random /dev/random.bak<br />
sudo ln -s /dev/urandom /dev/random</code>
</li>
</ol>
<p><strong>References:</strong></p>
<ul>
<li><a href="http://bugs.sun.com/view_bug.do?bug_id=4705093">http://bugs.sun.com/view_bug.do?bug_id=4705093</a></li>
<li><a href="https://support.oracle.com/CSP/main/article?cmd=show&#038;type=NOT&#038;doctype=PROBLEM&#038;id=555036.1">Java SecureRandom Issue Causing Hangs [ID 555036.1]</a><br />
NOTE: This is the original note that led me in the right direction, but it is no longer available.</li>
<li><a href="https://support.oracle.com/CSP/main/article?cmd=show&#038;type=NOT&#038;doctype=PROBLEM&#038;id=1065393.1">12.1.1 UPGRADE FROM 11.5.10.2 VERY SLOW XDOLOADER TASK HANGS [ID 1065393.1]</a></li>
<li><a href="https://support.oracle.com/CSP/main/article?cmd=show&#038;type=NOT&#038;doctype=PROBLEM&#038;id=1158024.1">Wfxload.Class is Running Very Slow When Upgrading to 12.1.1 [ID 1158024.1]</a></li>
<li><a href="http://www.vglug.info/how-increase-entropy-pool-2-6-kernel-rhel-fedora-system-without-keyboard-mouse">How to increase entropy pool on a 2.6 kernel RHEL/Fedora system without keyboard/mouse.</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.richtechnologies.com/?feed=rss2&amp;p=178</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>EC2 persistent boots with pivot root</title>
		<link>http://www.richtechnologies.com/?p=102</link>
		<comments>http://www.richtechnologies.com/?p=102#comments</comments>
		<pubDate>Tue, 02 Mar 2010 22:51:48 +0000</pubDate>
		<dc:creator>Shad</dc:creator>
				<category><![CDATA[Amazon Web Services]]></category>
		<category><![CDATA[EC2]]></category>

		<guid isPermaLink="false">http://www.bluegecko.net/?p=801</guid>
		<description><![CDATA[Amazon recently allowed Elastic Block Store to boot persistent images. However, there are two concerns I have with the method.
* The EBS boot volumes must be EBS Snapshots, which cost more than regular EBS volumes.  (http://aws.amazon.com/ec2/#pricing)
* The EBS boot volumes currently do not work within the Virtual Private Cloud (VPC) infrastructure.  (http://aws.amazon.com/vpc/faqs/#45)
To work [...]


Related posts:<ol><li><a href='http://www.bluegecko.net/amazon-web-services/s3fox-does-not-create-valid-export-manifest-files/' rel='bookmark' title='Permanent Link: s3fox does not create valid export manifest files'>s3fox does not create valid export manifest files</a></li>
<li><a href='http://www.bluegecko.net/oracle/metalink-wget-download-script/' rel='bookmark' title='Permanent Link: Metalink wget download script'>Metalink wget download script</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Amazon recently allowed Elastic Block Store to boot persistent images. However, there are two concerns I have with the method.</p>
<p>* The EBS boot volumes must be EBS Snapshots, which cost more than regular EBS volumes.  (http://aws.amazon.com/ec2/#pricing)<br />
* The EBS boot volumes currently do not work within the Virtual Private Cloud (VPC) infrastructure.  (http://aws.amazon.com/vpc/faqs/#45)<span id="more-801"></span></p>
<p>To work around these two issues, it is possible to &#8220;pivot&#8221; from a normal AMI&#8217;s local root volume (/dev/sda1) to an arbitrary EBS volume that contains a full OS installation. An additional benefit is that a very small AMI may be used to launch the EBS backed instance, so that the instance launches much faster than a large AMI.</p>
<p>The goal of this post is to provide instructions on how to build a small AMI that is capable of launching a full-blown persistent Linux installation that is backed on EBS storage. BusyBox, &#8220;The Swiss Army Knife of Embedded Systems&#8221;, provides a solid foundation for our small AMI. To build a BusyBox AMI and an instance backed by EBS, simply follow these directions:</p>
<p>1. Start an instance from an AMI that is running the desired kernel and software configuration. (You can use an existing public AMI or a custom AMI that you created. Personally, I prefer to create my own AMI&#8217;s, so I know what is in them.)</p>
<p>2. Log into the instance.</p>
<p>3. Download the latest version of BusyBox.</p>
<p>wget &#8220;http://busybox.net/downloads/busybox-1.15.3.tar.bz2&#8243;</p>
<p>4. Create a busyroot directory.</p>
<p>mkdir busyroot</p>
<p>5. Extract BusyBox.</p>
<p>bunzip2 busybox-1.15.3.tar.bz2<br />
tar xvf busybox-1.15.3.tar</p>
<p>6. Configure BusyBox. (You can experiment here to reduce the image size, but the configuration listed below works.)</p>
<p>cd busybox-1.15.3<br />
make config<br />
Select &#8220;y&#8221; for the STATIC option and the default values for everything else.<br />
Build BusyBox as a static binary (no shared libs) (STATIC) [N/y/?] y</p>
<p>7. Make and install BusyBox.</p>
<p>make CONFIG_PREFIX=$HOME/busyroot install<br />
chmod 4755 $HOME/busyroot/bin/busybox</p>
<p>8. Create required directories.</p>
<p>cd $HOME/busyroot<br />
mkdir dev sys etc proc mnt mnt/new-root</p>
<p>9. Create the necessary devices. (We will use /dev/sdj for the EBS volume, but this could be any block device not used by the normal AMI.)</p>
<p>MAKEDEV -d $HOME/busyroot/dev -x sdj<br />
MAKEDEV -d $HOME/busyroot/dev -x console<br />
MAKEDEV -d $HOME/busyroot/dev -x null<br />
MAKEDEV -d $HOME/busyroot/dev -x zero</p>
<p>10. Create the init file.</p>
<p>mv $HOME/busyroot/sbin/init $HOME/busyroot/sbin/init.orig<br />
cat &lt;&lt;&#8217;EOL&#8217; &gt;  $HOME/busyroot/sbin/init<br />
#!/bin/busybox sh<br />
PATH=/bin:/usr/bin:/sbin:/usr/sbin<br />
NEWDEV=&#8221;/dev/sdj&#8221;<br />
NEWTYP=&#8221;ext3&#8243;<br />
NEWMNT=&#8221;/mnt/new-root&#8221;<br />
OLDMNT=&#8221;/mnt/old-root&#8221;<br />
OPTIONS=&#8221;noatime,ro&#8221;<br />
SLEEP=10</p>
<p>echo &#8220;Remounting writable.&#8221;<br />
mount -o remount,rw /<br />
[ ! -d $NEWMNT ] &amp;&amp; echo &#8220;Creating directory $NEWMNT.&#8221; &amp;&amp; mkdir -p $NEWMNT</p>
<p>while true ; do<br />
echo &#8220;sleeping&#8230;&#8221;<br />
sleep $SLEEP<br />
echo &#8220;Trying to mount $NEWDEV writable.&#8221;<br />
mount -t $NEWTYP -o rw $NEWDEV $NEWMNT || continue<br />
echo &#8220;Mounted.&#8221;<br />
break;<br />
done</p>
<p>[ ! -d $NEWMNT/$OLDMNT ] &amp;&amp; echo &#8220;Creating directory $NEWMNT/$OLDMNT.&#8221; &amp;&amp; mkdir -p $NEWMNT/$OLDMNT</p>
<p>echo &#8220;Remounting $NEWMNT $OPTIONS.&#8221;<br />
mount -o remount,$OPTIONS $NEWMNT</p>
<p>echo &#8220;Trying to pivot.&#8221;<br />
cd $NEWMNT<br />
pivot_root . ./$OLDMNT</p>
<p>for dir in /dev /proc /sys; do<br />
echo &#8220;Moving mounted file system ${OLDMNT}${dir} to $dir.&#8221;<br />
mount &#8211;move ./${OLDMNT}${dir} ${dir}<br />
done</p>
<p>echo &#8220;Trying to chroot.&#8221;<br />
exec chroot . /bin/sh -c &#8220;umount ./$OLDMNT; exec /sbin/init $*&#8221; &lt; /dev/console &gt; /dev/console 2&gt;&amp;1<br />
EOL</p>
<p>chmod 755 $HOME/busyroot/sbin/init</p>
<p>11. Create the fstab file.</p>
<p>cat &lt;&lt;&#8217;EOL&#8217; &gt;  $HOME/busyroot/etc/fstab<br />
/dev/sda1 /     ext3    defaults 1 1<br />
none      /dev/pts devpts  gid=5,mode=620 0 0<br />
none      /proc proc    defaults 0 0<br />
none      /sys  sysfs   defaults 0 0<br />
EOL</p>
<p>12. Create a 4MB loopback file.</p>
<p>cd<br />
dd if=/dev/zero of=busybox.fs bs=1M count=4<br />
mkfs.ext3 busybox.fs</p>
<p>13. Mount the loopback file.</p>
<p>mkdir $HOME/busyimg<br />
mount -o loop $HOME/busybox.fs $HOME/busyimg</p>
<p>14. Copy the staged files and directories to the image. (Technically, the BusyBox image could have been built directly in $HOME/busyimg, but we were not sure how big the image was going to be.)</p>
<p>cp -rp $HOME/busyroot/* $HOME/busyimg</p>
<p>15. Un-mount the image.</p>
<p>sync<br />
umount -d $HOME/busyimg</p>
<p>16. Set environment variables.</p>
<p>export EC2_HOME=/opt/ec2-api-tools<br />
export EC2_CERT=/path/to/your/cert.pem<br />
export EC2_PRIVATE_KEY=/path/to/your/pk.pem<br />
export AWS_ACCOUNT_NUMBER=&#8221;NNNN-NNNN-NNNN&#8221;<br />
export AWS_ACCESS_KEY_ID=your_key<br />
export AWS_SECRET_ACCESS_KEY=your_secret_key<br />
export EC2_BUCKET=&#8221;your_bucket&#8221;<br />
export JAVA_HOME=/usr/java/default<br />
export ARCH=`uname -i`<br />
export AKI=`curl -s http://169.254.169.254/latest/meta-data/kernel-id`<br />
export ARI=`curl -s http://169.254.169.254/latest/meta-data/ramdisk-id`<br />
export INSTANCE_ID=`curl -s http://169.254.169.254/latest/meta-data/instance-id`<br />
export AVAIL_ZONE=`curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone`<br />
export SEC_GROUP=`curl -s http://169.254.169.254/latest/meta-data/security-groups`<br />
export PUB_KEY=`wget -q -O &#8211; &#8220;http://169.254.169.254/latest/meta-data/public-keys&#8221; | awk -F= &#8216;{print $2}&#8217;`</p>
<p>17. Bundle the image.</p>
<p>ec2-bundle-image -i $HOME/busybox.fs -d /tmp -k $EC2_PRIVATE_KEY -c $EC2_CERT -u $AWS_ACCOUNT_NUMBER -r $ARCH &#8211;kernel $AKI &#8211;ramdisk $ARI</p>
<p>18. Upload the image.</p>
<p>ec2-upload-bundle -b $EC2_BUCKET -m /tmp/busybox.fs.manifest.xml -a $AWS_ACCESS_KEY_ID -s $AWS_SECRET_ACCESS_KEY</p>
<p>19. Register the AMI.</p>
<p>BUSYBOX_AMI=`ec2-register &#8220;$EC2_BUCKET/busybox.fs.manifest.xml&#8221; | awk &#8216;{print $2}&#8217;`<br />
echo &#8220;BUSYBOX_AMI: $BUSYBOX_AMI&#8221;</p>
<p>20. Create an EBS volume of the desired size (10G or more) in the desired availability zone.</p>
<p>VOLUME_ID=`ec2-create-volume -s 10 -z $AVAIL_ZONE | awk &#8216;{print $2}&#8217;`<br />
echo &#8220;VOLUME_ID: $VOLUME_ID&#8221;</p>
<p>21. Attach the volume to the current instance as /dev/sdj.</p>
<p>ec2-attach-volume $VOLUME_ID -i $INSTANCE_ID -d /dev/sdj</p>
<p>22. Create an EXT3 file system on /dev/sdj.</p>
<p>mkfs.ext3 /dev/sdj</p>
<p>22. Mount the EBS volume.</p>
<p>mkdir /mnt/ebs_boot<br />
mount /dev/sdj /mnt/ebs_boot</p>
<p>23. Copy the current AMI to the EBS volume.</p>
<p>rsync -avHx / /mnt/ebs_boot</p>
<p>24. Fix the /etc/fstab file.</p>
<p>vi /mnt/ebs_boot/etc/fstab<br />
Remove the local file systems.<br />
/dev/sda1  /         ext3    defaults        1 1<br />
/dev/sdb  /mnt      ext3    defaults        1 2<br />
/dev/sda3  swap      swap    defaults        0 0<br />
Add the /dev/sdj file system.<br />
/dev/sdj  /         ext3    defaults        1 1</p>
<p>25. Fix the /etc/inittab file. The cloud AMI&#8217;s are normally configured for runlevel 4.</p>
<p>vi /mnt/ebs_boot/etc/inittab<br />
Edit the following line if necessary:<br />
id:4:initdefault:</p>
<p>26. Un-mount the EBS volume.</p>
<p>sync<br />
umount /mnt/ebs_boot</p>
<p>27. Detach the volume.</p>
<p>ec2-detach-volume $VOLUME_ID -i $INSTANCE_ID -d /dev/sdj</p>
<p>28. Create a new instance running the BusyBox AMI.</p>
<p>BUSYBOX_ID=`ec2-run-instances $BUSYBOX_AMI -z $AVAIL_ZONE -k $PUB_KEY -g $SEC_GROUP | awk &#8216;{print $6}&#8217;`</p>
<p>29. Wait until the instance is running&#8230;</p>
<p>ec2-describe-instances $BUSYBOX_ID</p>
<p>30. Attach the EBS volume to the BusyBox instance as /dev/sdj.</p>
<p>ec2-attach-volume $VOLUME_ID -i $BUSYBOX_ID -d /dev/sdj</p>
<p>31. Reboot the BusyBox instance to make sure it picks up the new device.</p>
<p>ec2-reboot-instances $BUSYBOX_ID</p>
<p>32. Check the BusyBox instance&#8217;s console output to make sure it came up as expected.</p>
<p>ec2-get-console-output $BUSYBOX_ID</p>
<p>33. Log into the new EBS backed instance.</p>
<p>That should be it. You now have a persistent instance that is backed by EBS storage!</p>


<p>Related posts:<ol><li><a href='http://www.bluegecko.net/amazon-web-services/s3fox-does-not-create-valid-export-manifest-files/' rel='bookmark' title='Permanent Link: s3fox does not create valid export manifest files'>s3fox does not create valid export manifest files</a></li>
<li><a href='http://www.bluegecko.net/oracle/metalink-wget-download-script/' rel='bookmark' title='Permanent Link: Metalink wget download script'>Metalink wget download script</a></li>
</ol></p><img src="http://feeds.feedburner.com/~r/BlueGecko/~4/ecAHIyprSog" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.richtechnologies.com/?feed=rss2&amp;p=102</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle Log and Trace File Cleanup</title>
		<link>http://www.richtechnologies.com/?p=28</link>
		<comments>http://www.richtechnologies.com/?p=28#comments</comments>
		<pubDate>Fri, 02 Jan 2009 02:23:38 +0000</pubDate>
		<dc:creator>Shad</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[alert log]]></category>
		<category><![CDATA[clean]]></category>
		<category><![CDATA[dump]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[listener]]></category>
		<category><![CDATA[listener log]]></category>
		<category><![CDATA[log]]></category>
		<category><![CDATA[rotate]]></category>
		<category><![CDATA[trace]]></category>

		<guid isPermaLink="false">http://www.richtechnologies.com/?p=28</guid>
		<description><![CDATA[UPDATE: Several script bugs brought to my attention by a comment posted below have been fixed. The script should now be compatible with Linux and Solaris. Please let me know if any additional bugs are identified. Every running Oracle installation has several directories and files that need to be rotated and/or purged. Surprisingly, or not, [...]]]></description>
			<content:encoded><![CDATA[<p>UPDATE: Several script bugs brought to my attention by a comment posted below have been fixed. The script should now be compatible with Linux and Solaris. Please let me know if any additional bugs are identified.</p>
<p>Every running Oracle installation has several directories and files that need to be rotated and/or purged. Surprisingly, or not, Oracle has not included this basic maintenance in their software. I have come across the <a href="http://home.planet.nl/~erwindon/oraclean.html">oraclean</a> utility in the past, but the script does not do everything I need.</p>
<p>To achieve what I required, I recently hacked together a single script that does the following things:</p>
<ul>
<li>Cleans audit_dump_dest.</li>
<li>Cleans background_dump_dest.</li>
<li>Cleans core_dump_dest.</li>
<li>Cleans user_dump_dest.</li>
<li>Cleans Oracle Clusterware log files.</li>
<li>Rotates and purges alert log files.</li>
<li>Rotates and purges listener log files.</li>
</ul>
<p>The script has been tested on Solaris 9 and 10 with Oracle database versions 9i and 10g. It has also been tested with Oracle Clusterware and ASM 11g. The script can be scheduled on each server having one or more Oracle homes installed, and it will clean all of them up using the retention policy specified. The limitation is that log file retention is specified per server, not per instance. However, I find that placing a single crontab entry on each database server is easier than setting up separate log purge processes for each one.</p>
<p>The script finds all unique Oracle Homes listed in the oratab file and retrieves the list of running Oracle instances and listeners. Once the script knows that information, it rotates and cleans the trace, dump, and log files.</p>
<p>Download:  <a href='http://www.richtechnologies.com/wp-content/uploads/2008/09/cleanhouse.txt'>cleanhouse.sh</a></p>
<p><code>Usage: cleanhouse.sh -d DAYS [-a DAYS] [-b DAYS] [-c DAYS] [-n DAYS] [-r DAYS] [-u DAYS] [-t] [-h]<br />
 &nbsp;&nbsp;       -d = Mandatory default number of days to keep log files that are not explicitly passed as parameters.<br />
 &nbsp;&nbsp;       -a = Optional number of days to keep audit logs.<br />
 &nbsp;&nbsp;       -b = Optional number of days to keep background dumps.<br />
  &nbsp;&nbsp;      -c = Optional number of days to keep core dumps.<br />
 &nbsp;&nbsp;       -n = Optional number of days to keep network log files.<br />
 &nbsp;&nbsp;       -r = Optional number of days to keep clusterware log files.<br />
 &nbsp;&nbsp;       -u = Optional number of days to keep user dumps.<br />
 &nbsp;&nbsp;       -h = Optional help mode.<br />
 &nbsp;&nbsp;       -t = Optional test mode. Does not delete any files.</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.richtechnologies.com/?feed=rss2&amp;p=28</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Copy Tables From DB2 to Oracle &#8211; The Free Way</title>
		<link>http://www.richtechnologies.com/?p=37</link>
		<comments>http://www.richtechnologies.com/?p=37#comments</comments>
		<pubDate>Fri, 07 Nov 2008 03:32:05 +0000</pubDate>
		<dc:creator>Shad</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[db2]]></category>
		<category><![CDATA[generic connectivity]]></category>
		<category><![CDATA[migrate]]></category>
		<category><![CDATA[table]]></category>
		<category><![CDATA[workbench]]></category>

		<guid isPermaLink="false">http://www.richtechnologies.com/?p=37</guid>
		<description><![CDATA[Part of a recent project I was working on involved the decommissioning of an old DB2 database on an IBM z/OS mainframe. As part of the decommissioning process, the business wanted to keep the data available for potential audit reporting. The Oracle Migration Workbench for DB2 sounded like the best option, but it turned out [...]]]></description>
			<content:encoded><![CDATA[<p>Part of a recent project I was working on involved the decommissioning of an old DB2 database on an IBM z/OS mainframe. As part of the decommissioning process, the business wanted to keep the data available for potential audit reporting. The Oracle Migration Workbench for DB2 sounded like the best option, but it turned out to not be supported on z/OS.</p>
<p>After several attempts at using SQL*Loader to move the 350 tables, a colleague suggested Oracle&#8217;s Generic Connectivity. After coordinating with several other groups, this is the process that finally worked:</p>
<ol>
<li>Have a DB2 account created, so that the data can be queried.</li>
<li>Install the DB2 Connect client on the UNIX server on which the Oracle database resides.</li>
<li>Configure the DB2 Connect client.<br />
   &#8211; The DB2 administrator and UNIX administrator coordinated on this, so<br />
     I do not have the specifics.</li>
<li>Test the DB2 connection<br />
   <code>. /export/home/db2inst1/sqllib/cfg/db2profile<br />
   db2 connect to MYDB2DATABASE user &lt;username&gt;<br />
   db2 =&gt; select current time as DB2_TIME from sysibm.sysdummy1<br />
   db2 =&gt; terminate</code></li>
<li>Install the <a href="http://www.unixodbc.org/">unixODBC</a> package on the Oracle database server.</li>
<li>Configure the odbc.ini file (usually located in /usr/local/etc/odbc.ini).<br />
   Example:<br />
   <code>[DB2DATABASE]<br />
   Description = DB2 Driver<br />
   Driver      = /export/home/db2inst1/sqllib/lib/libdb2.so</code></li>
<li>Test the unixODBC connection.<br />
   <code>isql -v MYDB2DATABASE username password<br />
   SQL&gt; select current time as DB2_TIME from sysibm.sysdummy1<br />
   SQL&gt; quit</code></li>
<li>Create an initialization file for Oracle Generic Connectivity.<br />
   Example:<br />
   <code>cd $ORACLE_HOME/hs/admin<br />
   vi initMYDB2DATABASE.ora<br />
   #<br />
   # HS init parameters<br />
   #<br />
   #<br />
   # HS init parameters<br />
   #<br />
   HS_FDS_CONNECT_INFO = MYDB2DATABASE<br />
   HS_FDS_TRACE_LEVEL = debug<br />
   HS_FDS_SHAREABLE_NAME = /usr/local/lib/libodbc.so<br />
   &nbsp;<br />
   #<br />
   # ODBC specific environment variables<br />
   #<br />
   set ODBCINI=/usr/local/etc/odbc.ini<br />
   &nbsp;<br />
   #<br />
   # Environment variables required for the non-Oracle system<br />
   #<br />
   set DB2INSTANCE=db2inst1</code></li>
<li>Create a listener entry in the Oracle listener.ora.<br />
   Example:<br />
    <code>(SID_DESC =<br />
      (ORACLE_HOME = /path/to/your/oracle/home)<br />
      (SID_NAME = MYDB2DATABASE)<br />
      (PROGRAM = hsodbc)<br />
      (ENVS=LD_LIBRARY_PATH=/path/to/your/oracle/home/lib:/export/home/db2inst1/sqllib/lib:/u<br />
sr/lib)<br />
    )</code></li>
<li>Ensure the listener connection timeout is unlimited in the listener.ora.<br />
   Example:<br />
   <code>INBOUND_CONNECT_TIMEOUT_YOUR_LISTENER=0</code></li>
<li>Ensure the connection timeout is unlimited in the sqlnet.ora.<br />
   Example:<br />
  <code>SQLNET.INBOUND_CONNECT_TIMEOUT = 0</code></li>
<li>Restart the database listener.<br />
   <code>lsnrctl stop listener_name; lsnrctl start listener_name</code></li>
<li>Add a tnsnames.ora entry for the HS listener.<br />
    Example:<br />
   <code>MYDB2DATABASE =<br />
    (DESCRIPTION =<br />
     (ADDRESS_LIST =<br />
      (ADDRESS = (PROTOCOL = TCP)(HOST = hostname)(PORT = 1521>))<br />
     )<br />
     (CONNECT_DATA =<br />
      (SERVICE_NAME = MYDB2DATABASE)<br />
     )<br />
     (HS = OK)<br />
    )</code></li>
<li>Log into the Oracle database as a user that has the CREATE DATABASE LINK privilege.</li>
<li>Create a database link to the DB2 database.<br />
    <code>CREATE DATABASE LINK "MYDB2DATABASE" CONNECT TO "DB2_USERNAME" IDENTIFIED by "DB2_PASSWORD" USING 'MYDB2DATABASE';</code></li>
<li>Test the database link.<br />
    <code>select current time as DB2_TIME from sysibm.sysdummy1@MYDB2DATABASE;</code></li>
<li>Move as many tables as possible using:<br />
    <code>create table table_name as select * from db2_schema.db2_table_name@MYDB2DATABASE;</code></li>
<li>Some tables will fall out due to &#8220;ORA-00997: illegal use of LONG datatype&#8221;.<br />
    Workaround:<br />
    <code>SET ARRAYSIZE 1000<br />
    SET COPYCOMMIT 1<br />
    COPY FROM username/password@ORACLE_SID TO username/password@ORACLE_SID -<br />
    CREATE table_name USING SELECT * from db2_schema.db2_table_name@MYDB2DATABASE;</code></li>
</ol>
<p>Known Issues:</p>
<ol>
<li>ORA-28511: lost RPC connection to heterogeneous remote agent using<br />
     Solution: Set the connections to not timeout.<br />
               listener.ora: <code>INBOUND_CONNECT_TIMEOUT_YOUR_LISTENER=0</code><br />
               sqlnet.ora:   <code>SQLNET.INBOUND_CONNECT_TIMEOUT=0</code></li>
<li>ORA-00997: illegal use of LONG datatype<br />
     Solution: Use the SQL*Plus COPY command.</li>
<li>Error when running SQL*Plus COPY command.<br />
     ORA-28500: connection from ORACLE to a non-Oracle system returned this message:<br />
     [Generic Connectivity Using ODBC]DRV_BlobRead: DB_ODBC_ENGINE (1489): ;<br />
     [unixODBC][IBM][CLI Driver][DB2] SQL0805N  Package<br />
     &#8220;MYDB2DATABASE.NULLID.SYSLH203.5359534C564C3031&#8243; was not found.  SQLSTATE=51002<br />
     (SQL State: 51002; SQL Code: -805)<br />
     Solution:  This error is due to packages missing on the DB2 side. I had the DB2 database admin create the missing package.</p>
<li>ORA-01400: cannot insert NULL into (&#8220;oracle_schema&#8221;.&#8221;table_name&#8221;.&#8221;column_name&#8221;)<br />
     Solution: Create an empty table and alter the column to accept NULL.<br />
              <code>COPY FROM username/password@ORACLE_SID TO username/password@ORACLE_SID -<br />
    CREATE table_name USING SELECT * from db2_schema.db2_table_name@MYDB2DATABASE WHERE 1=2;<br />
                          ALTER TABLE table_name MODIFY column_name NULL;<br />
                          COPY FROM username/password@ORACLE_SID TO username/password@ORACLE_SID -<br />
                          APPEND table_name USING SELECT * from db2_schema.db2_table_name@MYDB2DATABASE;<br />
             </code>
</li>
<li>Enable DB2 ODBC driver tracing.<br />
     Solution: Edit the db2cli.ini file.<br />
               <code>[COMMON]<br />
               Trace=1<br />
               TraceFileName=/tmp/db2cli_trace.log</code></li>
</ol>
<p>References:<br />
<a href="http://metalink.oracle.com/metalink/plsql/showdoc?db=NOT&#038;id=375624.1">Metalink Note:375624.1 &#8211; How to Configure Generic Connectivity (HSODBC) on Linux 32 bit using DB2Connect</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.richtechnologies.com/?feed=rss2&amp;p=37</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Web Hosting Provider</title>
		<link>http://www.richtechnologies.com/?p=29</link>
		<comments>http://www.richtechnologies.com/?p=29#comments</comments>
		<pubDate>Sun, 02 Nov 2008 20:26:22 +0000</pubDate>
		<dc:creator>Shad</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[provider]]></category>
		<category><![CDATA[vps]]></category>

		<guid isPermaLink="false">http://www.richtechnologies.com/?p=29</guid>
		<description><![CDATA[I recently switched from a web hosting plan with IX Web Hosting to a Virtual Private Server (VPS) plan with Rose Hosting. I had the &#8220;Business Plus&#8221; plan with IX Web Hosting for 2 years. The service stability was always a little spotty, but the price-benefit ratio was acceptable for most of my time with [...]]]></description>
			<content:encoded><![CDATA[<p>I recently switched from a web hosting plan with <a href="http://www.ixwebhosting.com">IX Web Hosting</a> to a Virtual Private Server (VPS) plan with <a href="http://www.rosehosting.com">Rose Hosting</a>.<br />
<br />
I had the &#8220;Business Plus&#8221; plan with IX Web Hosting for 2 years. The service stability was always a little spotty, but the price-benefit ratio was acceptable for most of my time with them. My plan was set to expire, and the site&#8217;s performance and stability were becoming noticeably worse, so I decided to check out other options.<br />
<br />
Beyond the degradation of stability and performance on IX Web Hosting, I found that I had trouble accessing files whenever they were generated by the web server processes. My user owned the directory structure, but backups and file uploads were owned by the web server user. Due to this, I had issues with deleting files and/or changing file permissions. To work around the issue, I had to write a PHP script that would execute as the web server owner to delete files.<br />
<br />
Considering the limitations of a web hosting provider, I decided I would rather have full control over the services by having a dedicated or virtual private server. Because this site is not exactly &#8220;critical&#8221; to anyone, I concentrated my search based on price rather than uptime. I ruled out a dedicated server based on the higher cost, leaving me with Linux virtual private servers.<br />
<br />
The main open source virtual environments offered on Linux at this time are <a href="http://www.openvz.org/">OpenVZ</a> and <a href="http://www.xen.org/">Xen</a>. OpenVZ and Xen are different but not different enough for me to pick one over the other. I continued my search primarily on provider reviews and price points. The <a href="http://wiki.debian.org/DebianHosting">Debian Wiki</a> site offered a list of Linux VPS hosting providers, and I started looking at the plans that several of the providers offered. I was leaning toward using <a href="http://vpslink.com/">VPSLink</a> when I came across the Rose Hosting <a href="http://www.rosehosting.com/virtserv-spec.html">virtual server specials</a>. The prices seemed too good to be true, but after searching for reviews, the provider seemed legitimate. They may not be as big or as stable as some of the other providers, but the price is right for a blog like mine.<br />
<br />
I ordered the Rose Hosting service late night on a weekend, and I did not receive an email reply providing my connection information. I contacted the provider&#8217;s support personnel via email and a chat window. It turned out that their email had been marked as spam by Gmail. After pulling it out of my spam folder, things have been going well.<br />
<br />
I moved my MySQL database and website over to the Rose Hosting server and reconfigured my DNS entry. The best thing is that I can now monitor the server&#8217;s performance and uptime using all the basic Linux utilities. As of this time, the site has gone down once for 30 minutes as a result of a server outage. I did not inquire with support as to the cause, but the site has been stable otherwise.<br />
<br />
If anyone is interested in having a cheap virtual private server for development or fun, I recommend Rose Hosting. I have only been with them for a month, so if my recommendation changes, I will post an update.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.richtechnologies.com/?feed=rss2&amp;p=29</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
