<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>I am SYS</title>
	<atom:link href="http://iamsys.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://iamsys.wordpress.com</link>
	<description>Oracle DBA Adventures</description>
	<lastBuildDate>Mon, 04 Jul 2011 17:23:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='iamsys.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>I am SYS</title>
		<link>http://iamsys.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://iamsys.wordpress.com/osd.xml" title="I am SYS" />
	<atom:link rel='hub' href='http://iamsys.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Oracle 11gR2 on Fedora 15</title>
		<link>http://iamsys.wordpress.com/2011/05/25/oracle-11gr2-on-fedora-15/</link>
		<comments>http://iamsys.wordpress.com/2011/05/25/oracle-11gr2-on-fedora-15/#comments</comments>
		<pubDate>Wed, 25 May 2011 18:05:39 +0000</pubDate>
		<dc:creator>sys</dc:creator>
				<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://iamsys.wordpress.com/?p=77</guid>
		<description><![CDATA[I have confirmed that the exact steps previously documented for Oracle 11g Release 2 (11.2.0.1.0) on Fedora 14 work for Fedora 15 release. You can find the steps HERE Filed under: Oracle<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iamsys.wordpress.com&amp;blog=9173765&amp;post=77&amp;subd=iamsys&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have confirmed that the exact steps previously documented for Oracle 11g Release 2 (11.2.0.1.0) on Fedora 14 work for Fedora 15 release. You can find the steps <a title="Oracle 11gR2 on Fedora 14" href="http://iamsys.wordpress.com/2010/11/08/oracle-11gr2-on-fedora-14/">HERE</a></p>
<br />Filed under: <a href='http://iamsys.wordpress.com/category/oracle/'>Oracle</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/iamsys.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/iamsys.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/iamsys.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/iamsys.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/iamsys.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/iamsys.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/iamsys.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/iamsys.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/iamsys.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/iamsys.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/iamsys.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/iamsys.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/iamsys.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/iamsys.wordpress.com/77/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iamsys.wordpress.com&amp;blog=9173765&amp;post=77&amp;subd=iamsys&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://iamsys.wordpress.com/2011/05/25/oracle-11gr2-on-fedora-15/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e1b73e40c9150a3070577dd50ca42845?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">sys</media:title>
		</media:content>
	</item>
		<item>
		<title>Oracle 11gR2 on Ubuntu 10.10</title>
		<link>http://iamsys.wordpress.com/2010/11/16/oracle-11gr2-on-ubuntu-10-10/</link>
		<comments>http://iamsys.wordpress.com/2010/11/16/oracle-11gr2-on-ubuntu-10-10/#comments</comments>
		<pubDate>Tue, 16 Nov 2010 16:25:58 +0000</pubDate>
		<dc:creator>sys</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://iamsys.wordpress.com/?p=74</guid>
		<description><![CDATA[I have confirmed that the exact steps for my previous posting for Ubuntu 10.04 work for 10.10. You can find the link here: Oracle 11gR2 on Ubuntu 10.04 Filed under: Uncategorized<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iamsys.wordpress.com&amp;blog=9173765&amp;post=74&amp;subd=iamsys&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have confirmed that the exact steps for my previous posting for Ubuntu 10.04 work for 10.10. You can find the link here: <a href="http://iamsys.wordpress.com/2010/06/08/oracle-11gr2-on-ubuntu-10-04/">Oracle 11gR2 on Ubuntu 10.04</a></p>
<br />Filed under: <a href='http://iamsys.wordpress.com/category/uncategorized/'>Uncategorized</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/iamsys.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/iamsys.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/iamsys.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/iamsys.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/iamsys.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/iamsys.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/iamsys.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/iamsys.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/iamsys.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/iamsys.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/iamsys.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/iamsys.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/iamsys.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/iamsys.wordpress.com/74/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iamsys.wordpress.com&amp;blog=9173765&amp;post=74&amp;subd=iamsys&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://iamsys.wordpress.com/2010/11/16/oracle-11gr2-on-ubuntu-10-10/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e1b73e40c9150a3070577dd50ca42845?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">sys</media:title>
		</media:content>
	</item>
		<item>
		<title>Oracle 11gR2 on Fedora 14</title>
		<link>http://iamsys.wordpress.com/2010/11/08/oracle-11gr2-on-fedora-14/</link>
		<comments>http://iamsys.wordpress.com/2010/11/08/oracle-11gr2-on-fedora-14/#comments</comments>
		<pubDate>Mon, 08 Nov 2010 20:28:21 +0000</pubDate>
		<dc:creator>sys</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://iamsys.wordpress.com/?p=66</guid>
		<description><![CDATA[The purpose of the complete install guide below is to have a fully functioning oracle 11gR2 client and software to run local database instances on Fedora 14. I based all of the instructions on the Oracle® Database Installation Guide 11g Release 2 (11.2) for Linux. Below is the list of required packages according to the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iamsys.wordpress.com&amp;blog=9173765&amp;post=66&amp;subd=iamsys&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The purpose of the complete install guide below is to have a fully functioning oracle 11gR2 client and software to run local database instances on Fedora 14. I based all of the instructions on the Oracle® Database Installation Guide 11g Release 2 (11.2) for Linux.</p>
<p>
Below is the list of required packages according to the 11gr2 install docs:</p>
<pre>binutils-2.17.50.0.6
compat-libstdc++-33-3.2.3
elfutils-libelf-0.125
elfutils-libelf-devel-0.125
elfutils-libelf-devel-static-0.125
gcc-4.1.2
gcc-c++-4.1.2
glibc-2.5-24
glibc-common-2.5
glibc-devel-2.5
glibc-headers-2.5
kernel-headers-2.6.18
ksh-20060214
libaio-0.3.106
libaio-devel-0.3.106
libgcc-4.1.2
libgomp-4.1.2
libstdc++-4.1.2
libstdc++-devel-4.1.2
make-3.81
numactl-devel-0.9.8.i386
sysstat-7.0.2</pre>
</p>
<p>
Here is the list of packages that I installed. Some required packages were already installed. I used the &#8220;yum info&#8221; command to verify if the package was installed or not.</p>
<p>
NOTE: all commands below are ran as root (su -) until “su – oracle”</p>
<pre>yum install compat-libstdc++-33
yum install elfutils-libelf-devel
yum install elfutils-libelf-devel-static
yum install gcc (this picked up other required packages (glibc-devel, glibc-headers))
yum install gcc-c++ (this picked up other required package (libstdc++-devel))
yum install ksh
yum install libaio-devel
yum install numactl-devel
yum install sysstat
yum install unixODBC ***for the unixODBC packages, they are not in the required list of packages, but they did come up as a warning in the installer as required. I doubt they are truly necessary, but I appeased the installer.
yum install unixODBC-devel</pre>
</p>
<p>
This will add the minimum installation group that will own the oracle software, create the oracle user, and allow the oracle user to run x sessions locally so you don’t have to login and logout for any of this installation. You may want to add your “normal” user to the oinstall group later.</p>
<pre>groupadd oinstall
useradd -s /bin/bash -m -g oinstall oracle
passwd oracle
xhost local:oracle</pre>
</p>
<p>
The next two pieces of work will change various kernel settings and limits to be able to run database instances locally if you desire.</p>
<pre>cat &gt;&gt; /etc/profile
#added for oracle
ulimit -S -c unlimited &gt; /dev/null 2&gt;&amp;1</pre>
<p><pre>cat &gt;&gt; /etc/sysctl.conf
#added for oracle
fs.suid_dumpable = 1</pre>
<p><pre>cat &gt;&gt; /etc/security/limits.conf
oracle              soft    nproc   2047
oracle              hard    nproc   16384
oracle              soft    nofile  1024
oracle              hard    nofile  65536</pre>
<p><pre>cat &gt;&gt; /etc/sysctl.conf
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586
net.ipv4.tcp_wmem = 262144 262144 262144
net.ipv4.tcp_rmem = 4194304 4194304 4194304</pre>
<p><pre>/sbin/sysctl -p</pre>
</p>
<p>
I disabled SELinux since its not required, and is more difficult to deal with than I care to at this time.</p>
<pre>setenforce 0
vi /etc/selinux/config
modify the line "SELINUX=enforcing" to "SELINUX=disabled"</pre>
</p>
<p>
The below directories are the Oracle recommended Optimal Flexible Architecture (besides all the separation of physical devices)</p>
<pre>mkdir -p /u01/app/oracle
chown -R oracle:oinstall /u01/app/oracle
chmod -R 775 /u01/app/oracle
mkdir -p /u01/app/oraInventory
chown -R oracle:oinstall /u01/app/oraInventory
chmod -R 775 /u01/app/oraInventory</pre>
</p>
<p>
At this point you should have downloaded the two huge zip files from Oracle’s download page:</p>
<pre>mv /home/michael/Downloads/linux_11gR2_database_* /home/oracle/
su - oracle (NOTE: all commands below are ran as oracle)
unzip linux_11gR2_database_1of2.zip
rm linux_11gR2_database_1of2.zip
unzip linux_11gR2_database_2of2.zip
rm linux_11gR2_database_2of2.zip</pre>
</p>
<p>
Here is the where the actual installation begins. You will get a nice GUI for this part.</p>
<pre>cd database
./runInstaller</pre>
</p>
<p>
On the successive list of screens, select the following to install the database software without creating a test database.</p>
<p>
&#8220;Install database software only&#8221;<br />
&#8220;Single instance database installation&#8221;<br />
&#8220;Enterprise Edition&#8221;<br />
Oracle Base: &#8220;/u01/app/oracle&#8221;<br />
Software Location: &#8220;/u01/app/oracle/product/11.2.0/dbhome_1&#8243;<br />
Inventory Directory &#8220;/u01/app/oraInventory&#8221;<br />
oraInventory Group Name &#8220;oinstall&#8221;<br />
Database Administrator Group &#8220;oinstall&#8221;<br />
Database Operator Group &#8220;oinstall&#8221;</p>
<p>
A list of prerequisites that are failed will be shown on the screen. The only failed prerequisite I faced was a missing pdksh package, but I already installed the original Korn Shell package &#8220;ksh&#8221;, so I clicked the &#8220;Ignore All&#8221; box.</p>
<p>
During the install there was one error that popped up about linking:</p>
<p>Error in invoking target &#8216;agent nmhs&#8217; of makefile &#8216;/u01/app/oracle/product/11.2.0/dbhome_1/sysman/lib/ins_emagent.mk&#8217;</p>
<p>Some information that I gleaned from &#8220;http://cn.forums.oracle.com/forums/thread.jspa?threadID=1091616&#8243; regarding this error: Apparently the enterprise manager agent will not run properly until this linking issue is resolved. The fix is below&#8230;</p>
<p>vi $ORACLE_HOME/sysman/lib/ins_emagent.mk<br />
Search for the line<br />
$(MK_EMAGENT_NMECTL)<br />
Change it to:<br />
$(MK_EMAGENT_NMECTL) -lnnz11</p>
<p>
If at this point, you still have the linking error popup on your screen, you should be able to hit Retry and it should go through. (Can someone confirm this works?) If you ignored the error and finished the installation like I did, you can still do the modification to ins_emagent.mk as above, then manually run &#8220;make -f ins_emagent.mk &#8220;agent&#8221;". Make sure to set the ORACLE_BASE and ORACLE_HOME environment variables before running the make command.</p>
<p>After the install I placed the following lines in the /etc/profile to ensure the ORACLE_* environment variables get set properly after login for any local users:</p>
<pre>export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export PATH=$PATH:$ORACLE_HOME/bin</pre>
</p>
<p>
At this point, I moved some known *.ora files into the $ORACLE_HOME/network/admin directory to skip the tns setup.</p>
<p>From here you should be able to use the oracle client tools to connect to existing databases on your network. Also, I was able to create an 11gR2 database instance locally without any more system changes, besides the normal instructions for creating an instance from the Oracle documentation.</p>
<br />Filed under: <a href='http://iamsys.wordpress.com/category/uncategorized/'>Uncategorized</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/iamsys.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/iamsys.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/iamsys.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/iamsys.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/iamsys.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/iamsys.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/iamsys.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/iamsys.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/iamsys.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/iamsys.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/iamsys.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/iamsys.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/iamsys.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/iamsys.wordpress.com/66/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iamsys.wordpress.com&amp;blog=9173765&amp;post=66&amp;subd=iamsys&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://iamsys.wordpress.com/2010/11/08/oracle-11gr2-on-fedora-14/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e1b73e40c9150a3070577dd50ca42845?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">sys</media:title>
		</media:content>
	</item>
		<item>
		<title>Test backup to tape without a tape library</title>
		<link>http://iamsys.wordpress.com/2010/06/08/test-backup-to-tape-without-a-tape-library/</link>
		<comments>http://iamsys.wordpress.com/2010/06/08/test-backup-to-tape-without-a-tape-library/#comments</comments>
		<pubDate>Tue, 08 Jun 2010 18:16:31 +0000</pubDate>
		<dc:creator>sys</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[rman]]></category>
		<category><![CDATA[sbt]]></category>
		<category><![CDATA[tape]]></category>

		<guid isPermaLink="false">http://iamsys.wordpress.com/?p=35</guid>
		<description><![CDATA[If you want to test some backup scripts, crash recovery scenarios, or anything of that sort on a test system, and you don&#8217;t have access to an sbt tape library, you can use an Oracle provided sbt &#8220;emulator&#8221; which puts backups onto a specified disk location, yet acts like an sbt channel. CONFIGURE CHANNEL DEVICE [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iamsys.wordpress.com&amp;blog=9173765&amp;post=35&amp;subd=iamsys&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you want to test some backup scripts, crash recovery scenarios, or anything of that sort on a test system, and you don&#8217;t have access to an sbt tape library, you can use an Oracle provided sbt &#8220;emulator&#8221; which puts backups onto a specified disk location, yet acts like an sbt channel.</p>
<p>CONFIGURE CHANNEL DEVICE TYPE &#8216;SBT_TAPE&#8217; PARMS  &#8216;SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/u01/app/oracle/sbt)&#8217;;</p>
<p>RMAN&gt; backup device type sbt current controlfile;</p>
<p>Starting backup at 08-JUN-10<br />
allocated channel: ORA_SBT_TAPE_1<br />
channel ORA_SBT_TAPE_1: SID=21 device type=SBT_TAPE<br />
channel ORA_SBT_TAPE_1: WARNING: Oracle Test Disk API<br />
channel ORA_SBT_TAPE_1: starting full datafile backup set<br />
channel ORA_SBT_TAPE_1: specifying datafile(s) in backup set<br />
including current control file in backup set<br />
channel ORA_SBT_TAPE_1: starting piece 1 at 08-JUN-10<br />
channel ORA_SBT_TAPE_1: finished piece 1 at 08-JUN-10<br />
piece handle=17lfnivf_1_1 tag=TAG20100608T140015 comment=API Version 2.0,MMS Version 8.1.3.0<br />
channel ORA_SBT_TAPE_1: backup set complete, elapsed time: 00:00:01<br />
Finished backup at 08-JUN-10</p>
<p>When the backup is done, you can see the backup files on disk, along with a binary file &#8220;Oracle_Disk_SBT_Catalog&#8221; which seems to be a simple index of sorts.</p>
<p>oracle@micweh1-lucid:/u01/app/oracle$ ls -ltr sbt/<br />
total 16396<br />
-rw-r&#8211;r&#8211; 1 oracle oinstall 8388616 2010-06-08 14:00 17lfnivf_1_1<br />
-rw-r&#8211;r&#8211; 1 oracle oinstall 8388616 2010-06-08 14:00 c-2019211406-20100608-00<br />
-rw-r&#8211;r&#8211; 1 oracle oinstall    3204 2010-06-08 14:00 Oracle_Disk_SBT_Catalog</p>
<br />Filed under: <a href='http://iamsys.wordpress.com/category/oracle/'>Oracle</a> Tagged: <a href='http://iamsys.wordpress.com/tag/backup/'>backup</a>, <a href='http://iamsys.wordpress.com/tag/rman/'>rman</a>, <a href='http://iamsys.wordpress.com/tag/sbt/'>sbt</a>, <a href='http://iamsys.wordpress.com/tag/tape/'>tape</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/iamsys.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/iamsys.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/iamsys.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/iamsys.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/iamsys.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/iamsys.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/iamsys.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/iamsys.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/iamsys.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/iamsys.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/iamsys.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/iamsys.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/iamsys.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/iamsys.wordpress.com/35/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iamsys.wordpress.com&amp;blog=9173765&amp;post=35&amp;subd=iamsys&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://iamsys.wordpress.com/2010/06/08/test-backup-to-tape-without-a-tape-library/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e1b73e40c9150a3070577dd50ca42845?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">sys</media:title>
		</media:content>
	</item>
		<item>
		<title>Oracle 11gR2 on Ubuntu 10.04</title>
		<link>http://iamsys.wordpress.com/2010/06/08/oracle-11gr2-on-ubuntu-10-04/</link>
		<comments>http://iamsys.wordpress.com/2010/06/08/oracle-11gr2-on-ubuntu-10-04/#comments</comments>
		<pubDate>Tue, 08 Jun 2010 14:12:14 +0000</pubDate>
		<dc:creator>sys</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[11g]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://iamsys.wordpress.com/?p=53</guid>
		<description><![CDATA[The purpose of the complete install guide below is to have a fully functioning oracle 11gR2 client and software to run local database instances on Ubuntu 10.04. (UPDATE: I have confirmed this install guide works exactly as below for Ubuntu 10.10) There are some details of the Oracle installation on Linux guide that I have [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iamsys.wordpress.com&amp;blog=9173765&amp;post=53&amp;subd=iamsys&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The purpose of the complete install guide below is to have a fully functioning oracle 11gR2 client and software to run local database instances on Ubuntu 10.04. (UPDATE: I have confirmed this install guide works exactly as below for Ubuntu 10.10) There are some details of the Oracle installation on Linux guide that I have not mentioned in this document, because I have verifed this version of Ubuntu to already meet certain qualifications that don&#8217;t need to be changed.<br />
Below is the list of required packages according to the 11gr2 install docs:</p>
<pre>binutils-2.15.92.0.2
compat-libstdc++-33-3.2.3
elfutils-libelf-0.97
elfutils-libelf-devel-0.97
gcc-3.4.6
gcc-c++-3.4.6
glibc-2.3.4-2.41
glibc-common-2.3.4
glibc-devel-2.3.4
glibc-headers-2.3.4
libaio-devel-0.3.105
libaio-0.3.105
libgcc-3.4.6
libstdc++-3.4.6
libstdc++-devel-3.4.6
make-3.80
numactl-0.6.4.i386
pdksh-5.2.14
sysstat-5.0.5
unixODBC-2.2.11
unixODBC-devel-2.2.11</pre>
<p>Here is the list of packages that I installed. Some packages from above were already installed, and some were not even available. The ones not available, I just ignored and after extensive testing, all seems to run fine.</p>
<p>NOTE: all commands below are ran as root (sudo su -) until &#8220;su &#8211; oracle&#8221;</p>
<pre>apt-get install elfutils
apt-get install libaio1
apt-get install libaio-dev
apt-get install libstdc++6-4.4-dev
apt-get install numactl
apt-get install pdksh
apt-get install sysstat
apt-get install unixODBC-dev
apt-get install unixODBC</pre>
<p>This will add the minimum installation group that will own the oracle software, create the oracle user, and allow the oracle user to run x sessions locally so you don&#8217;t have to login and logout for any of this installation. You may want to add your &#8220;normal&#8221; user to the oinstall group later.</p>
<pre>groupadd oinstall
useradd -s /bin/bash -m -g oinstall oracle
passwd oracle
xhost local:oracle</pre>
<p>The next two pieces of work will change various kernel settings and limits to be able to run database instances locally if you desire.</p>
<pre>cp /etc/security/limits.conf /etc/security/limits.conf.bak
cat &gt;&gt; /etc/security/limits.conf
oracle              soft    nproc   2047
oracle              hard    nproc   16384
oracle              soft    nofile  1024
oracle              hard    nofile  65536
&lt;Ctrl-C&gt;</pre>
<pre>cp /etc/sysctl.conf /etc/sysctl.conf.bak
cat &gt;&gt; /etc/sysctl.conf
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586
net.ipv4.tcp_wmem = 262144 262144 262144
net.ipv4.tcp_rmem = 4194304 4194304 4194304
&lt;Ctrl-C&gt;</pre>
<pre>/sbin/sysctl -p</pre>
<p>The below directories are the Oracle recommended Optimal Flexible Architecture (besides all the separation of physical devices)</p>
<pre>mkdir -p /u01/app/oracle
chown -R oracle:oinstall /u01/app/oracle
chmod -R 775 /u01/app/oracle
mkdir -p /u01/app/oraInventory
chown -R oracle:oinstall /u01/app/oraInventory
chmod -R 775 /u01/app/oraInventory</pre>
<pre>ln -s /usr/bin/awk /bin/awk &lt;-- this was so the root.sh script doesn't fail when trying to find awk</pre>
<p>At this point you should have downloaded the two huge zip files from Oracle&#8217;s download page:</p>
<pre>mv /home/michael/Downloads/linux_11gR2_database_* /home/oracle/
su - oracle
unzip linux_11gR2_database_1of2.zip
rm linux_11gR2_database_1of2.zip
unzip linux_11gR2_database_2of2.zip
rm linux_11gR2_database_2of2.zip</pre>
<p>Here is the where the actual installation begins. You will get a nice GUI for this part.</p>
<pre>cd database
./runInstaller</pre>
<p>On the successive list of screens, select the following to install the database software without creating a test database.</p>
<pre>"Install database software only"
"Single instance database installation"
"Enterprise Edition"
Oracle Base: "/u01/app/oracle"
Software Location: "/u01/app/oracle/product/11.2.0/dbhome_1"
Inventory Directory "/u01/app/oraInventory"
oraInventory Group Name "oinstall"
Database Administrator Group "oinstall"
Database Operator Group "oinstall"</pre>
<p>A list of prerequisites that are failed will be shown on the screen. I reviewed them and selected &#8220;Ignore All&#8221; since I verified all the packages were indeed available.<br />
During the install there were a handful of errors about linking such as:<br />
&#8220;Error in invoking target &#8216;idg4odbc&#8217; of makefile &#8216;/u01/app/oracle/product/11.2.0/dbhome_1/rdbms/lib/ins_rdbms.mk&#8217;.&#8221;<br />
&#8220;Error in invoking target &#8216;idg4odbc&#8217; of makefile &#8216;/u01/app/oracle/product/11.2.0/dbhome_1/rdbms/lib/ins_rdbms.mk&#8217;.&#8221;<br />
&#8220;Error in invoking target &#8216;install&#8217; of makefile &#8216;/u01/app/oracle/product/11.2.0/dbhome_1/ctx/lib/ins_ctx.mk&#8217;.&#8221;<br />
&#8220;Error in invoking target &#8216;all_no_orcl&#8217; of makefile &#8216;/u01/app/oracle/product/11.2.0/dbhome_1/rdbms/lib/ins_rdbms.mk&#8217;.<br />
&#8220;Error in invoking target &#8216;utilities&#8217; of makefile &#8216;/u01/app/oracle/product/11.2.0/dbhome_1/rdbms/lib/ins_rdbms.mk&#8217;.&#8221;</p>
<p>I was able to &#8220;Continue&#8221; past these errors and complete the installation and creation of database without anymore issues. I read a little bit online about some people having these errors and their GUI tools such as DBCA and Universal Installer not working normally, but I have tested the tools that I use and they seem to be fine.<br />
After the install I placed the following lines in the /etc/profile to ensure the ORACLE_* environment variables get set properly after login for any local users:</p>
<pre>export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export PATH=$PATH:$ORACLE_HOME/bin</pre>
<p>At this point, I moved some known *.ora files into the $ORACLE_HOME/network/admin directory to skip the tns setup<br />
From here you should be able to use the oracle client tools to connect to existing databases on your network. Also, I was able to create an 11gR2 database instance locally without any more system changes, besides the normal instructions for creating an instance from the Oracle documentation.</p>
<br />Filed under: <a href='http://iamsys.wordpress.com/category/oracle/'>Oracle</a> Tagged: <a href='http://iamsys.wordpress.com/tag/11g/'>11g</a>, <a href='http://iamsys.wordpress.com/tag/linux/'>linux</a>, <a href='http://iamsys.wordpress.com/tag/ubuntu/'>ubuntu</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/iamsys.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/iamsys.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/iamsys.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/iamsys.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/iamsys.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/iamsys.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/iamsys.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/iamsys.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/iamsys.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/iamsys.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/iamsys.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/iamsys.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/iamsys.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/iamsys.wordpress.com/53/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iamsys.wordpress.com&amp;blog=9173765&amp;post=53&amp;subd=iamsys&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://iamsys.wordpress.com/2010/06/08/oracle-11gr2-on-ubuntu-10-04/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e1b73e40c9150a3070577dd50ca42845?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">sys</media:title>
		</media:content>
	</item>
		<item>
		<title>PX Deq Credit: send blkd caused by IDE (SQL Developer, Toad, PL/SQL Developer)</title>
		<link>http://iamsys.wordpress.com/2010/03/24/px-deq-credit-send-blkd-caused-by-ide-sql-developer-toad-plsql-developer/</link>
		<comments>http://iamsys.wordpress.com/2010/03/24/px-deq-credit-send-blkd-caused-by-ide-sql-developer-toad-plsql-developer/#comments</comments>
		<pubDate>Wed, 24 Mar 2010 04:29:20 +0000</pubDate>
		<dc:creator>sys</dc:creator>
				<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://iamsys.wordpress.com/?p=43</guid>
		<description><![CDATA[The popular IDE&#8217;s used by developers and DBA&#8217;s today have default settings to only return a subset of a queries results. This is a handy feature to get quick results on your screen before you have the IDE &#8220;complete&#8221; your query by asking for all rows, export the data, or something of that nature. In [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iamsys.wordpress.com&amp;blog=9173765&amp;post=43&amp;subd=iamsys&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The popular IDE&#8217;s used by developers and DBA&#8217;s today have default settings to only return a subset of a queries results. This is a handy feature to get quick results on your screen before you have the IDE &#8220;complete&#8221; your query by asking for all rows, export the data, or something of that nature. In SQL Developer, the option is &#8220;Sql Array Fetch Size&#8221; and I am seeing mine is currently set to 50. This means SQL Developer will only get up to 50 rows at a time until I cause it to go fetch more. When a parallel query is executed through the IDE, the &#8220;main&#8221; session is turned into a QC (Query Coordinator) and it gets a specific number of PX slaves. Under the hood, the IDE is only fetching the first 50 rows, and waiting until you tell it to go get more. At this point, the PX slaves just sit there, waiting on the QC to say &#8220;gimme some more rows please&#8221;. So the problem happens when the user for some reason is satisfied with the first set of data on their screen and don&#8217;t need anymore, so they don&#8217;t cause the IDE to go get anymore data. In the background, the QC session is just waiting on the user, and the PX slaves are just waiting on their QC. I see on the database a user session that is INACTIVE with a wait event of &#8220;SQL*Net message from client&#8221; acting as a QC, and its slave sessions ACTIVE with a wait event of &#8220;PX Deq Credit: send blkd&#8221; or &#8220;PX Deq Credit: need buffer&#8221;.</p>
<p>I recently noticed this wait event as the top event on my DSS database. A quick search of what exactly this is will lead you to believe that it is an idle event, and shouldn&#8217;t warrant any attention. Oracle&#8217;s Metalink document 271767.1 &#8220;WAITEVENT: &#8220;PX Deq Credit: send blkd&#8221;" states this is an idle event, and a simple example they provide to reproduce it is to run &#8220;select /*+ parallel(sales, 10) +/ * from sales)&#8221;. (That typo in the hint is Oracle&#8217;s, not mine, I had to leave it for your entertainment purposes). This will cause the QC to become overloaded with messages from the slaves, theoretically 10 would be too many in this case, and the slaves begin waiting on the QC. In this situation, it might be possible to better tune the parallel settings in the database so this doesn&#8217;t happen as often.</p>
<p>In this typical case, the worst thing that seems to happen is that you get too many parallel slaves for a query waiting for a time, and once the query is done processing, so the slaves stop waiting, and move on to other sessions/work. So I assume the reason for the nonchalant behavior towards this event is justified in that case, BUT I have found this other case is affecting my database in a far greater fashion, because PX slaves are being occupied for hours at a time, causing other queries degree of parallelism to be downgraded or removed altogether. In a very busy database, this can make a big difference on performance.</p>
<p>Now I am going to show you how to reproduce this, so you can understand better what is happening. First put the below query into a script called pq.sql to monitor the parallel query sessions</p>
<blockquote><p>col username for a12<br />
col &#8220;QC SID&#8221; for A6<br />
col &#8220;SID&#8221; for A6<br />
col &#8220;QC/Slave&#8221; for A8<br />
col &#8220;Req. DOP&#8221; for 9999<br />
col &#8220;Actual DOP&#8221; for 9999<br />
col &#8220;Slaveset&#8221; for A8<br />
col &#8220;Slave INST&#8221; for A9<br />
col &#8220;QC INST&#8221; for A6<br />
set pages 300 lines 300<br />
col wait_event format a30</p>
<p>select<br />
decode(px.qcinst_id,NULL,username,<br />
&#8216; &#8211; &#8216;||lower(substr(pp.SERVER_NAME,<br />
length(pp.SERVER_NAME)-4,4) ) )&#8221;Username&#8221;,<br />
decode(px.qcinst_id,NULL, &#8216;QC&#8217;, &#8216;(Slave)&#8217;) &#8220;QC/Slave&#8221; ,<br />
to_char( px.server_set) &#8220;SlaveSet&#8221;,<br />
to_char(s.sid) &#8220;SID&#8221;,<br />
to_char(px.inst_id) &#8220;Slave INST&#8221;,<br />
decode(sw.state,&#8217;WAITING&#8217;, &#8216;WAIT&#8217;, &#8216;NOT WAIT&#8217; ) as STATE,<br />
case  sw.state WHEN &#8216;WAITING&#8217; THEN substr(sw.event,1,30) ELSE NULL end as wait_event ,<br />
decode(px.qcinst_id, NULL ,to_char(s.sid) ,px.qcsid) &#8220;QC SID&#8221;,<br />
to_char(px.qcinst_id) &#8220;QC INST&#8221;,<br />
px.req_degree &#8220;Req. DOP&#8221;,<br />
px.degree &#8220;Actual DOP&#8221;<br />
from gv$px_session px,<br />
gv$session s ,<br />
gv$px_process pp,<br />
gv$session_wait sw<br />
where px.sid=s.sid (+)<br />
and px.serial#=s.serial#(+)<br />
and px.inst_id = s.inst_id(+)<br />
and px.sid = pp.sid (+)<br />
and px.serial#=pp.serial#(+)<br />
and sw.sid = s.sid<br />
and sw.inst_id = s.inst_id<br />
order by<br />
decode(px.QCINST_ID,  NULL, px.INST_ID,  px.QCINST_ID),<br />
px.QCSID,<br />
decode(px.SERVER_GROUP, NULL, 0, px.SERVER_GROUP),<br />
px.SERVER_SET,<br />
px.INST_ID<br />
/</p></blockquote>
<p>Now, using your IDE, ( I am using SQL Developer with the Sql Array Fetch Size set to 50 ) run a sample parallel query, and allow the first results to show up:</p>
<blockquote><p>select /*+ parallel(bigtable, 4) +*/ * from bigtable;</p></blockquote>
<p>Now, in another database session, run the pq.sql script to see the issue in action:</p>
<blockquote><p>SQL&gt; @pq</p>
<p>Username     QC/Slave SlaveSet SID    Slave INS STATE    WAIT_EVENT                     QC SID QC INS Req. DOP Actual DOP</p>
<p>&#8212;&#8212;&#8212;&#8212; &#8212;&#8212;&#8211; &#8212;&#8212;&#8211; &#8212;&#8212; &#8212;&#8212;&#8212; &#8212;&#8212;&#8211; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; &#8212;&#8212; &#8212;&#8212; &#8212;&#8212;&#8211; &#8212;&#8212;&#8212;-</p>
<p>USER111      QC                515    1         WAIT     SQL*Net message from client    515</p>
<p>- p000      (Slave)  1        510    1         WAIT     PX Deq Credit: send blkd       515    1             4          4</p>
<p>- p001      (Slave)  1        500    1         WAIT     PX Deq Credit: send blkd       515    1             4          4</p>
<p>- p003      (Slave)  1        494    1         WAIT     PX Deq Credit: send blkd       515    1             4          4</p>
<p>- p002      (Slave)  1        507    1         WAIT     PX Deq Credit: send blkd       515    1             4          4</p></blockquote>
<br />Filed under: <a href='http://iamsys.wordpress.com/category/oracle/'>Oracle</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/iamsys.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/iamsys.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/iamsys.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/iamsys.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/iamsys.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/iamsys.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/iamsys.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/iamsys.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/iamsys.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/iamsys.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/iamsys.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/iamsys.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/iamsys.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/iamsys.wordpress.com/43/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iamsys.wordpress.com&amp;blog=9173765&amp;post=43&amp;subd=iamsys&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://iamsys.wordpress.com/2010/03/24/px-deq-credit-send-blkd-caused-by-ide-sql-developer-toad-plsql-developer/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e1b73e40c9150a3070577dd50ca42845?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">sys</media:title>
		</media:content>
	</item>
		<item>
		<title>How to protect sensitive bind data in redo logs</title>
		<link>http://iamsys.wordpress.com/2010/03/16/how-to-protect-sensitive-bind-data-in-redo-logs/</link>
		<comments>http://iamsys.wordpress.com/2010/03/16/how-to-protect-sensitive-bind-data-in-redo-logs/#comments</comments>
		<pubDate>Tue, 16 Mar 2010 17:18:54 +0000</pubDate>
		<dc:creator>sys</dc:creator>
				<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://iamsys.wordpress.com/?p=37</guid>
		<description><![CDATA[Your sensitive data is only one query away, even if you encrypt it! I have found that bind variables find their way into the redo logs as a side effect of the AWR collecting sql statements along with their bind values. They are also freely available in the AWR tables if they are captured. Using [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iamsys.wordpress.com&amp;blog=9173765&amp;post=37&amp;subd=iamsys&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Your sensitive data is only one query away, even if you encrypt it!</p>
<p>I have found that bind variables find their way into the redo logs as a side effect of the AWR collecting sql statements along with their bind values. They are also freely available in the AWR tables if they are captured.</p>
<p>Using the test case Oracle documented here&#8230; http://www.oracle.com/technology/obe/10gr2_db_vmware/security/tde/tde.htm</p>
<p>This test case shows that when using TDE to encrypt a column, the redo logs are definitely protected for the DML on the target table. The example shows the insert statement &#8220;insert into cust_payment_info values (&#8216;Mike&#8217;, &#8216;Anderson&#8217;, 10004, &#8217;4929889576357400&#8242;,&#8217;YES&#8217;);&#8221; actually gets mined out as &#8220;insert into &#8220;OE&#8221;.&#8221;cust_payment_info&#8221;(&#8220;FIRST_NAME&#8221;,&#8221;LAST_NAME&#8221;,&#8221;ORDER_NUMBER&#8221;,&#8221;CREDIT_CARD_NUMBER&#8221;,&#8221;ACTIVE_CARD&#8221;) values (&#8216;Mike&#8217;, &#8216;Anderson&#8217;, 10004, &#8216;Unsupported Type&#8217;,'YES&#8217;);&#8221;. This shows that the encrypted column CREDIT_CARD_NUMBER actually gets mined out as &#8216;Unsupported Type&#8217; so you are protected there&#8230;</p>
<p>In the case that I observed this, we use our own encryption function that uses dbms_crypto package, not TDE. So we won&#8217;t see the &#8216;Unsupported Type&#8217;, which gets placed by TDE internal mechanisms, but we will see the value as it has been encrypted, so this is acceptable for us&#8230;</p>
<p>But, where I have found you are not protected is the insert into the SYS.WRH$_SQLSTAT table which is part of the Automated Workload Repository data gathering actually has the literal bind value &#8217;4929889576357400&#8242; stored in hexadecimal format in the BIND_DATA column. This occurred when the sql statement used above &#8220;insert into cust_payment_info&#8230;&#8221; got parsed and placed into v$sql and eventually moved into Active Session History, then finally moved into the AWR into the SYS.WRH$_SQLSTAT table. You may want to run this query on your database for entertainment purposes to see what I am talking about: select dbms_sqltune.extract_bind(bind_data, 1).value_string from sys.wrh$_sqlstat where bind_data is not null; The view definition for DBA_HIST_SQLBIND will give you some information on how easy the hexadecimal data is to translate into your real data.</p>
<p>If by using logminer, you mine out inserts into the SYS.WRH$_SQLSTAT, you will see inserts like below:<br />
&#8220;insert into &#8220;SYS&#8221;.&#8221;WRH$_SQLSTAT&#8221;(&#8230;,&#8221;BIND_DATA&#8221;,&#8221;FLAG&#8221;) values (&#8230;HEXTORAW(&#8216;beda0a2003004a4232dd000408c0021603c2191a&#8217;),NULL);&#8221;<br />
I removed most of the columns and literal values but chose to show you the remaining hex value that is inserted into the BIND_DATA column. This is where you would be able to get the card information that was originally inserted into the CREDIT_CARD_NUMBER column. A simple call to the dbms_sqltune.extract_bind procedure will give you the literal card number value. (Note: the hex above is not for this exact statement, and won&#8217;t return the card number in the test, but can be reproduced).</p>
<p>So, no matter if you encrypt a data column using TDE, or by encrypting it using another method before inserting, I have found this BIND_DATA is still in the AWR table and consequently in the redo logs. Since the BIND_DATA appears to be a simple hexadecimal conversion of some sort, it does not meet PCI encryption standards.<br />
When I first presented this to Oracle in a Service Request, their recommendations to workaround this problem were to turn off AWR altogether, disabling bind capturing only, or to disable logging of peeked binds. All of these workarounds could be drastic changes on a production database system, so we needed a fix for this bug, which Oracle did provide. Oracle has provided us “Patch 9065026: BIND_DATA LACKS CONTROL AT SINGLE-SQL LEVEL” to control single sql statements that we know will have sensitive bind values.</p>
<p>The patch readme does not include instructions on how to use it, so I have provided a test case below that Oracle gave to me.</p>
<blockquote><p>connect scott/tiger</p>
<p>set serveroutput on</p>
<p>declare</p>
<p>bindvar varchar2(20);</p>
<p>retval  varchar2(20);</p>
<p>stmt    varchar2(100);</p>
<p>bind_data varchar2(100);</p>
<p>hint    varchar2(100);</p>
<p>stored_stmt varchar2(100);</p>
<p>begin</p>
<p>bindvar := &#8216;TURNER&#8217;;</p>
<p>stmt := &#8216;select &#8216;||</p>
<p>&#8216; ename from emp where ename = :b1&#8242;;</p>
<p>execute immediate stmt into retval using bindvar;</p>
<p>select sql_text, dbms_sqltune.extract_bind(bind_data,1).value_string</p>
<p>into stored_stmt, bind_data from v$sql where sql_text = stmt;</p>
<p>dbms_output.put_line(&#8216;statement: &#8216;||stored_stmt);</p>
<p>dbms_output.put_line(&#8216;bind_data: &#8216;||nvl(bind_data,&#8217;Empty!&#8217;));</p>
<p>end;</p>
<p>/</p>
<p><strong>statement: select  ename from emp where ename = :b1</strong></p>
<p><strong>bind_data: TURNER</strong></p>
<p><a name="DDE_LINK"></a>declare</p>
<p>bindvar varchar2(20);</p>
<p>retval  varchar2(20);</p>
<p>stmt    varchar2(100);</p>
<p>bind_data varchar2(100);</p>
<p>hint    varchar2(100);</p>
<p>stored_stmt varchar2(100);</p>
<p>begin</p>
<p>hint := &#8216; /*+ OPT_PARAM(&#8221;_cursor_bind_capture_area_size&#8221;, 0) */ &#8216;;</p>
<p>bindvar := &#8216;TURNER&#8217;;</p>
<p>stmt := &#8216;select &#8216;||</p>
<p>hint||</p>
<p>&#8216; ename from emp where ename = :b1&#8242;;</p>
<p>execute immediate stmt into retval using bindvar;</p>
<p>select sql_text, dbms_sqltune.extract_bind(bind_data,1).value_string</p>
<p>into stored_stmt, bind_data from v$sql where sql_text = stmt;</p>
<p>dbms_output.put_line(&#8216;statement: &#8216;||stored_stmt);</p>
<p>dbms_output.put_line(&#8216;bind_data: &#8216;||nvl(bind_data,&#8217;Empty!&#8217;));</p>
<p>end;</p>
<p>/</p>
<p><strong>statement: select  /*+ OPT_PARAM(&#8216;_cursor_bind_capture_area_size&#8217;, 0) */  ename</strong></p>
<p><strong>from emp where ename = :b1<br />
bind_data: Empty!</strong></p></blockquote>
<br />Filed under: <a href='http://iamsys.wordpress.com/category/oracle/'>Oracle</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/iamsys.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/iamsys.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/iamsys.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/iamsys.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/iamsys.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/iamsys.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/iamsys.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/iamsys.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/iamsys.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/iamsys.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/iamsys.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/iamsys.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/iamsys.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/iamsys.wordpress.com/37/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iamsys.wordpress.com&amp;blog=9173765&amp;post=37&amp;subd=iamsys&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://iamsys.wordpress.com/2010/03/16/how-to-protect-sensitive-bind-data-in-redo-logs/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e1b73e40c9150a3070577dd50ca42845?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">sys</media:title>
		</media:content>
	</item>
		<item>
		<title>Scheduler Jobs: Using Time Zone versus GMT Offset</title>
		<link>http://iamsys.wordpress.com/2009/11/03/scheduler-jobs-using-time-zone-versus-gmt-offset/</link>
		<comments>http://iamsys.wordpress.com/2009/11/03/scheduler-jobs-using-time-zone-versus-gmt-offset/#comments</comments>
		<pubDate>Wed, 04 Nov 2009 03:25:07 +0000</pubDate>
		<dc:creator>sys</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://iamsys.wordpress.com/?p=28</guid>
		<description><![CDATA[This week after daylight savings time ended here in the Eastern Standard Time Zone, some scheduler jobs were starting one hour early. I have found out that when a job is created with a repeating schedule, and it uses a GMT offset such as GMT -4 for its START_DATE, it will NOT follow daylight savings [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iamsys.wordpress.com&amp;blog=9173765&amp;post=28&amp;subd=iamsys&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This week after daylight savings time ended here in the Eastern Standard Time Zone, some scheduler jobs were starting one hour early. I have found out that when a job is created with a repeating schedule, and it uses a GMT offset such as GMT -4 for its START_DATE, it will NOT follow daylight savings time. If you create a job using a specific Time Zone, such as US/Eastern, it will follow the daylight savings time schedule. To fix this, you can modify the START_DATE attribute of the scheduler job to use a time zone.</p>
<blockquote><p>BEGIN<br />
sys.dbms_scheduler.disable( &#8216;&#8221;OWNER&#8221;.&#8221;JOB_NAME&#8221;&#8216; );<br />
sys.dbms_scheduler.set_attribute( name =&gt; &#8216;&#8221;OWNER&#8221;.&#8221;JOB_NAME&#8221;&#8216;, attribute =&gt; &#8216;start_date&#8217;, value =&gt; to_timestamp_tz(&#8217;2009-10-03 US/Eastern&#8217;, &#8216;YYYY-MM-DD TZR&#8217;));<br />
sys.dbms_scheduler.enable( &#8216;&#8221;OWNER&#8221;.&#8221;JOB_NAME&#8221;&#8216; );<br />
END;<br />
/</p></blockquote>
<p>Note the code will not work while the job is running. When the interval is applied for future job runs, they will run at the proper time.</p>
<p>When you create scheduler jobs using sys.dbms_scheduler.create_job(), pass in the parameter of start_date using a specific timezone, such as &#8220;<tt>start_date =&gt; to_timestamp_tz('2009-11-03 00:00:00 US/Eastern', 'YYYY-MM-DD HH24:MI:SS TZR')</tt>&#8221; or &#8220;start_date =&gt; <tt>systimestamp at time zone '</tt><tt>US/Eastern</tt><tt>'</tt>&#8220;, unless of course you desire your jobs to follow a specific GMT offset, then use the alternate syntax such as &#8220;<tt>start_date =&gt; to_timestamp_tz('2009-11-02 16:40:00 -5:00', 'YYYY-MM-DD HH24:MI:SS TZH:TZM')</tt>&#8221; or &#8220;<tt>start_date =&gt; systimestamp at time zone '-5:00'</tt>&#8220;.</p>
<br />Posted in Uncategorized  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/iamsys.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/iamsys.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/iamsys.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/iamsys.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/iamsys.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/iamsys.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/iamsys.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/iamsys.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/iamsys.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/iamsys.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/iamsys.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/iamsys.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/iamsys.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/iamsys.wordpress.com/28/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iamsys.wordpress.com&amp;blog=9173765&amp;post=28&amp;subd=iamsys&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://iamsys.wordpress.com/2009/11/03/scheduler-jobs-using-time-zone-versus-gmt-offset/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e1b73e40c9150a3070577dd50ca42845?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">sys</media:title>
		</media:content>
	</item>
		<item>
		<title>unique constraints and unique indexes</title>
		<link>http://iamsys.wordpress.com/2009/09/07/unique-constraints-and-unique-indexes/</link>
		<comments>http://iamsys.wordpress.com/2009/09/07/unique-constraints-and-unique-indexes/#comments</comments>
		<pubDate>Mon, 07 Sep 2009 17:28:56 +0000</pubDate>
		<dc:creator>sys</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[constraints]]></category>
		<category><![CDATA[indexes]]></category>

		<guid isPermaLink="false">http://iamsys.wordpress.com/?p=9</guid>
		<description><![CDATA[When you create a unique constraint on a table, Oracle database implicitly creates a unique index using the same name as the constraint to enforce the constraint. If you do not specify the constraint name, Oracle will provide one for you with a SYS% naming convention, and the index will also have a system generated [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iamsys.wordpress.com&amp;blog=9173765&amp;post=9&amp;subd=iamsys&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>When you create a unique constraint on a table, Oracle database implicitly creates a unique index using the same name as the constraint to enforce the constraint. If you do not specify the constraint name, Oracle will provide one for you with a SYS% naming convention, and the index will also have a system generated name.</p>
<p><code>alter table unique_test add constraint uk_unique_test unique (num);</code><br />
<code>select index_name, uniqueness from user_indexes where table_name = 'UNIQUE_TEST';</code><br />
INDEX_NAME                     UNIQUENESS<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; &#8212;&#8212;&#8212;<br />
UK_UNIQUE_TEST                 UNIQUE</p>
<p><code>select constraint_name, constraint_type, index_name from user_constraints where table_name = 'UNIQUE_TEST';</code><br />
CONSTRAINT_NAME                C INDEX_NAME<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; &#8211; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
UK_UNIQUE_TEST                 U UK_UNIQUE_TEST</p>
<p>If there is a preexisting index that can be used, the database will create the unique constraint, and tell it to use the existing index without creating a new one unnecessarily. Look at the INDEX_NAME column of the DBA_CONSTRAINTS view to see which index the constraint is using. The preexisting index does not have to be unique.</p>
<p><code>create index i_unique_test on unique_test(num);</code><br />
<code>alter table unique_test add constraint uk_unique_test unique (num);</code><br />
<code>select index_name, uniqueness from user_indexes where table_name = 'UNIQUE_TEST';</code><br />
INDEX_NAME                     UNIQUENESS<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; &#8212;&#8212;&#8212;<br />
I_UNIQUE_TEST                  NONUNIQUE</p>
<p><code>select constraint_name, constraint_type, index_name from user_constraints where table_name = 'UNIQUE_TEST';</code><br />
CONSTRAINT_NAME                C INDEX_NAME<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; &#8211; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
UK_UNIQUE_TEST                 U I_UNIQUE_TEST</p>
<p>You can have a unique index on a table without a unique constraint. This unique index still seems to perform the same duties as a unique constraint will, even claiming that you have violated a unique constraint, not a unique index.</p>
<p><code>create unique index unique1 on unique_test(num);</code><br />
<code>select index_name, uniqueness from user_indexes where table_name = 'UNIQUE_TEST';</code><br />
INDEX_NAME                     UNIQUENESS<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; &#8212;&#8212;&#8212;<br />
UNIQUE1                        UNIQUE</p>
<p><code>select constraint_name, constraint_type, index_name from user_constraints where table_name = 'UNIQUE_TEST';</code><br />
no rows selected</p>
<p><code>insert into unique_test values (1);</code><br />
insert into unique_test values (1)<br />
*<br />
ERROR at line 1:<br />
ORA-00001: unique constraint (MICHAEL.UNIQUE1) violated</p>
<br />Posted in Oracle Tagged: constraints, indexes <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/iamsys.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/iamsys.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/iamsys.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/iamsys.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/iamsys.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/iamsys.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/iamsys.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/iamsys.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/iamsys.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/iamsys.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/iamsys.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/iamsys.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/iamsys.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/iamsys.wordpress.com/9/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iamsys.wordpress.com&amp;blog=9173765&amp;post=9&amp;subd=iamsys&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://iamsys.wordpress.com/2009/09/07/unique-constraints-and-unique-indexes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e1b73e40c9150a3070577dd50ca42845?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">sys</media:title>
		</media:content>
	</item>
		<item>
		<title>Mystery Failed Login Attempts</title>
		<link>http://iamsys.wordpress.com/2009/08/26/mystery-failed-login-attempts/</link>
		<comments>http://iamsys.wordpress.com/2009/08/26/mystery-failed-login-attempts/#comments</comments>
		<pubDate>Wed, 26 Aug 2009 17:03:06 +0000</pubDate>
		<dc:creator>sys</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[audit]]></category>
		<category><![CDATA[oem]]></category>

		<guid isPermaLink="false">http://iamsys.wordpress.com/?p=5</guid>
		<description><![CDATA[Recently on one of my development databases, my username kept getting locked out and I didn&#8217;t know what was doing it. This would happen every hour or so, and soon became far too annoying to just login to the database as sys and unlock my account. The first step to identifying where these failed login [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iamsys.wordpress.com&amp;blog=9173765&amp;post=5&amp;subd=iamsys&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Recently on one of my development databases, my username kept getting locked out and I didn&#8217;t know what was doing it. This would happen every hour or so, and soon became far too annoying to just login to the database as sys and unlock my account.</p>
<p>The first step to identifying where these failed login attempts were coming from is to turn on Oracle database auditing. Make sure the audit_trail database parameter is set. In its simplest form set AUDIT_TRAIL=DB. There are other auditing options that can be used, and can be researched at Oracle&#8217;s documentation website (tahiti.oracle.com).</p>
<p>Next, turn on auditing on the CREATE SESSION action. This can be set for all users or for specific users. I chose to just audit my username since it was the one in question.</p>
<p><code>SQL&gt; audit create session by michael;</code></p>
<p>Now, every attempt to create a session by the user michael will be audited and placed in the sys.aud$ table. This table can hold a lot more auditing information than just sessions, and because of this reason, it can be very hard to query for a specific set of records. When looking at audited sessions, it is easier to use the DBA_AUDIT_SESSION view which gives you just the information necessary for researching sessions.</p>
<p>To find out where my failed login attempts were coming from, I ran the sql query below to see all of my login attempts, failed or successful.</p>
<p><code>select os_username, username, userhost, timestamp, returncode<br />
from dba_audit_session<br />
where username = 'MICHAEL'<br />
order by timestamp;</code></p>
<p>os_username, username, userhost, timestamp, returncode<br />
oracle    MICHAEL    db08    26-AUG-09 10.07.23    28000<br />
oracle    MICHAEL    db08    26-AUG-09 10.12.23    28000<br />
oracle    MICHAEL    db08    26-AUG-09 10.17.23    1017</p>
<p>Any records that have a returncode &gt; 0 are failed login attempts. I can see in the first two audited records that the returncode of 28000 is for a locked account. At that point, after 10.12, I altered my user account and unlocked it. The next failed login attempt that came in got a returncode of 1017, which is an invalid password error. Until I decided to fix this problem, at this point after I unlocked my account, there would be 10 records with a returncode of 1017, then all subsequent attempts would be 28000. This is because my user profile has the FAILED_LOGIN_ATTEMPTS set to 10.</p>
<p>Note here that the userhost of &#8216;db08&#8242; is the database host in this scenario. This fact was strange to me because I knew that I had no processes of any kind on the database host that would access the database with my username, or so I thought. This database was recently refreshed from a production instance, so I knew my password had been recently changed, and was the reason for the failed logins, so I decided to change my password back to the old password to see if the failed login attempts stopped. At this point, I saw a sucessful connection to the database from the same userhost, as evidenced by the returncode of 0.</p>
<p>oracle    MICHAEL    db08    26-AUG-09 10.22.23    0</p>
<p>I then queried v$session for my username and found the session that was established. From there, I determined by looking at the program and module columns the session was coming from the process &#8220;emagent@db08 (TNS V1-V3)&#8221;. The emagent process is used by grid control to access the database for various reasons. I knew that this wasn&#8217;t me logging into the database through OEM though, because the userhost is the host for the OEM instance, and the os_username is not recorded as evidenced by the below record.</p>
<p>(null)    MICHAEL    dbps07    26-AUG-09 11.03.48    0</p>
<p>So what was emagent doing with my old username and password every five minutes? I determined that oem was attempting to run a user defined metric that I created with my old password.</p>
<p>Takeaways:</p>
<ol>
<li>I got to thinking why the failure of the user defined metric wasn&#8217;t more evident to me, which is because the user defined metric was for business specific rules that check business data to make sure things are going &#8220;normal&#8221;. But this metric is always in a critical state in our development database, because the &#8220;normal&#8221; business doesn&#8217;t take place and isn&#8217;t being replicated in any way. In our production database user defined metrics, we use a special database login that does not have any password expiration rules so this will not become an issue in other environments. Now I am off to change our development user defined metrics to use that login instead of mine.</li>
<li>If you see failed login attempts coming from your database host, and it isn&#8217;t immediately evident what is causing them, check your OEM for user defined metrics that may be running against the database.</li>
</ol>
<br />Posted in Oracle Tagged: audit, oem <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/iamsys.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/iamsys.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/iamsys.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/iamsys.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/iamsys.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/iamsys.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/iamsys.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/iamsys.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/iamsys.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/iamsys.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/iamsys.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/iamsys.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/iamsys.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/iamsys.wordpress.com/5/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iamsys.wordpress.com&amp;blog=9173765&amp;post=5&amp;subd=iamsys&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://iamsys.wordpress.com/2009/08/26/mystery-failed-login-attempts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e1b73e40c9150a3070577dd50ca42845?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">sys</media:title>
		</media:content>
	</item>
	</channel>
</rss>
