<?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>Only Four Left... &#187; Linux</title>
	<atom:link href="http://only4left.jpiwowar.com/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://only4left.jpiwowar.com</link>
	<description>Oracle stuff.  Some Linux and Mac stuff.  ALTER TABLE blog DISABLE UNIQUE (content_type);</description>
	<lastBuildDate>Wed, 14 Sep 2011 12:00:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.4</generator>
		<item>
		<title>Downloading OTN software using wget</title>
		<link>http://only4left.jpiwowar.com/2010/04/wget_otn_downloads/</link>
		<comments>http://only4left.jpiwowar.com/2010/04/wget_otn_downloads/#comments</comments>
		<pubDate>Fri, 23 Apr 2010 00:12:30 +0000</pubDate>
		<dc:creator>jpiwowar</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Oracle misc]]></category>
		<category><![CDATA[StupidLinuxTricks]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://only4left.jpiwowar.com/2010/04/wget_otn_downloads/</guid>
		<description><![CDATA[<p>One of my most frequently-visited blog posts is <a href="http://only4left.jpiwowar.com/2009/02/retrieving-oracle-patches-with-wget/" title="Retrieving Oracle patches with wget">Retrieving Oracle patches with wget</a>. Recently, a commenter asked about using wget to download software from Oracle Technet (OTN). It's a little more complicated to use wget to download from OTN, because there are cookies involved. This post discusses how to extract the relevant cookies from Firefox and Google Chrome, and use those cookies with wget to retrieve files.</p>
]]></description>
			<content:encoded><![CDATA[<div class="none"><div class="g-plusone" data-href="http://only4left.jpiwowar.com/2010/04/wget_otn_downloads/" size="small" count="true"></div></div><p>One of my most frequently-visited posts is "<a href="http://only4left.jpiwowar.com/2009/02/retrieving-oracle-patches-with-wget/" title="Retrieving Oracle patches with wget">Retrieving Oracle patches with wget</a>." Recently, a commenter on that post <a href="http://only4left.jpiwowar.com/2009/02/retrieving-oracle-patches-with-wget/#comment-4771">asked</a> about using wget to download software from Oracle Technet (OTN). It's a little complicated to use wget to download from OTN, because there are cookies involved. This post discusses how to extract the relevant cookies from Firefox and Google Chrome, and use those cookies with wget to retrieve files. If you manage to wade through my excessive exposition, there's even a script at the end that you might find useful.</p>
<p>First things first: This is <b>not</b> a new idea. <a href="http://www.pythian.com" title="Smart people who love data.">Pythian's</a> Marc Fielding wrote an <a href="http://www.pythian.com/library/papers_and_books/downloading_from_otn_directly_to_your_database_server/" title="DOWNLOADING FROM OTN DIRECTLY TO YOUR DATABASE SERVER">excellent article</a> a long time ago about using wget and the text-based browser lynx to download files from OTN. His article is the reason that I even knew this was possible; I'm just expanding on the concept to include other browsers. If you have lynx installed on your server, you can stop reading <b>this</b> post, go read Marc's post instead, and you're all set. In fact, it's a good idea to read Marc's article anyway, because I'm going to reference it a few times in this post.</p>
<h3>Overview and assumptions</h3>
<p>As you've read from Marc's article (you did go to read that, right?), the basic process to set up downloads from OTN with wget is as follows:</p>
<ol>
<li>Authenticate to OTN with your username and password. You need to do this for cookies to be set properly. No workarounds or backdoors here, you have to sign in.</li>
<li>Navigate to the relevant page in the Downloads section for the software to be downloaded</li>
<li>Click the radio button to accept the license agreement. This is necessary to reveal the download links so you can copy the URL to feed to wget. Again, no backdoors, no workarounds.</li>
<li>Copy the URLs of the files you want to download</li>
<li>Extract the cookies created during your browser session into a text file.</li>
<li>Invoke wget with the --load-cookies option to download the desired files.</li>
</ol>
<p>By now, you might be thinking, "If it's that easy, why is the scroll bar next to this post so long?" The answer is that step 5 is somewhat involved.</p>
<p>I'm going to assume a few things. First, we'll be working with either Firefox or Google Chrome, because they store their cookies in similar ways. Safari uses XML to store cookies, and Internet Explorer is just an abomination <img src='http://only4left.jpiwowar.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> , so they're beyond the scope of this post. My second assumption is that you don't need help with steps 1-4 above. We're going to jump right into extracting cookies from Firefox and Chrome.</p>
<p><i><b>Update, 25-Apr-2010:</b> Here's one last opportunity to stop reading and start doing.  If you're a Firefox user, and not averse to using plugins in your browser, you could install a plugin like <a href="https://addons.mozilla.org/en-US/firefox/addon/66579/">Cookie Exporter</a> to extract cookies to a properly-formatted text file.  Also, notwithstanding my crack about IE, I have read that it's possible to export IE's cookies in the correct format without having to resort to any special shenanigans.  I had intended to point out both of these things in my original post, but instead I launched right into the SQLite discussion below.  Sorry about that;  the editing department has been sternly reprimanded.</i></p>
<h3>Extracting cookies</h3>
<p>Lynx very conveniently exports its cookies to a text file, in the format expected by wget (the classic "<a href="http://www.cookiecentral.com/faq/#3.5" title="cookie file format">Netscape cookies.txt</a>" spec). Firefox and Chrome, on the other hand, save cookies in a <a href="http://www.sqlite.org/" title="SQLite.org">SQLite</a> database file. So, I guess that's it, right? Cookies locked up in some goofy binary file. Not going to be able to get those out. Guess I'm out of luck.</p>
<p>Oh. Wait. I do database stuff. There's hope!</p>
<p>The first thing to do is to install a SQLite client. Instructions are beyond the scope of this post, but you can <a href="http://www.sqlite.org/download.html" title="SQLite downloads page">download precompiled binaries of the sqlite3 command-line client</a> from the SQLite site. If you're a Mac user, you're in luck: sqlite3 should already be installed in /usr/bin.</p>
<p>The next step is to locate the cookies database file for your browser. For Firefox, it should be cookies.sqlite in your <a href="http://kb.mozillazine.org/Profile_folder_-_Firefox" title="Firefox profile folder info">default profile</a> directory, and for Chrome, it should be the file creatively named Cookies in you<a href="http://www.google.com/support/forum/p/Chrome/thread?tid=37c4da1ce9f62f12&amp;hl=en" title="This is suprisingly hard-to-find info">r profile directory</a>. If you're really stuck, and are running Linux or OS X, you should be able to find the location by issuing <code>lsof | grep -i cookies</code> while your browser is running.</p>
<p>Here's an example of what the cookies look like in the SQLite database in Firefox:</p>
<pre class="brush: plain; title: ; notranslate">
zathras:~ jpiwowar$ sqlite3 /Users/jpiwowar/Library/Application\ Support/Firefox/Profiles/ftpzvxjz.default/cookies.sqlite
SQLite version 3.6.10
Enter &quot;.help&quot; for instructions
Enter SQL statements terminated with a &quot;;&quot;
sqlite&gt; .schema moz_cookies
CREATE TABLE moz_cookies (id INTEGER PRIMARY KEY, name TEXT, value TEXT, host TEXT, path TEXT,expiry INTEGER, lastAccessed INTEGER, isSecure INTEGER, isHttpOnly INTEGER);
sqlite&gt; select *
...&gt; from moz_cookies
...&gt; where name like 'ORA_UCM%'
...&gt; ;
1271476327342462|ORA_UCM_INFO|3~70969please_dont_copy_my_cookies|.oracle.com|/|1303012327|1271477696515030|0|0
1271476327343576|ORA_UCM_VER|%200|.oracle.com|/|1303012327|1271477696515030|0|0
1271476327344121|ORA_UCM_SRVC|no_really_just_use_your_own|.oracle.com|/|1303012327|1271477696515030|0|0
</pre>
<p>The name of the cookies table in Firefox is moz_cookies. At the time of this post, the OTN cookies needed for this exercise have names starting with ORA_UCM. The name of the SQLite table in the Chrome cookies database is simply 'cookies'. You'll note that some of the column names are also different:</p>
<pre class="brush: plain; title: ; notranslate">
zathras:~ jpiwowar$ sqlite3 /Users/jpiwowar/Library/Application\ Support/Chromium/Default/Cookies
SQLite version 3.6.10
Enter &quot;.help&quot; for instructions
Enter SQL statements terminated with a &quot;;&quot;
sqlite&gt; .schema cookies
CREATE TABLE cookies (creation_utc INTEGER NOT NULL UNIQUE PRIMARY KEY,host_key TEXT NOT NULL,name TEXT NOT NULL,value TEXT NOT NULL,path TEXT NOT NULL,expires_utc INTEGER NOT NULL,secure INTEGER NOT NULL,httponly INTEGER NOT NULL,last_access_utc INTEGER NOT NULL);
</pre>
<p>Of course, a simple "select *" from the cookies table is not going to produce a usable cookies file to use with wget. The <a href="http://www.cookiecentral.com/faq/#3.5" title="cookie file format">cookies.txt</a> spec requires 7 tab-, not pipe-, separated fields, and the expiration timestamp for Chrome cookies is in an unusual format. Rather than take up even more space in this post, I've written a shell script, <a href="http://only4left.jpiwowar.com/wp-content/uploads/2010/04/OTNcookies.txt" title="OTN cookie extractor">OTNcookies.sh</a> (it'll probably download as .txt, not .sh), that performs the work of extracting the cookies in the proper format. Here's a quick overview of the script:</p>
<ul>
<li>Takes two arguments: the first (required) is the location of the cookies database file, and the second (optional) is the name of the text file containing the exported cookies.</li>
<li>Determines the type of cookie database (Firefox or Chrome)</li>
<li>Runs an appropriate query to extract the cookies to the text file specified by the user, or to a default output file.</li>
<li>Tries to accommodate for spaces in filenames and directories, but you <b>will</b> need to escape spaces in the file names that you pass to the script</li>
</ul>
<p>As with any script you grab from the Intertubes, please exercise caution. This isn't designed to do anything malicious or damaging, but that doesn't mean you couldn't do something silly with it (like, say, running it as root and overwriting critical system files with cookies. Wouldn't that be embarrassing? Yes, but it would be your fault, not mine <img src='http://only4left.jpiwowar.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  )</p>
<p>Here's a sample run of the OTNcookies script:</p>
<pre class="brush: plain; title: ; notranslate">
zathras:~ jpiwowar$ OTNcookies.sh /Users/jpiwowar/Library/Application\ Support/Firefox/Profiles/ftpzvxjz.default/cookies.sqlite /var/tmp/FFcookies.txt
Looks like Firefox.
OTN cookies written to /var/tmp/FFcookies.txt
</pre>
<p>After extracting the cookies, it's a simple matter of invoking wget with the load-cookies option, as documented in Marc's article.</p>
<pre class="brush: plain; title: ; notranslate">
zathras:~ jpiwowar$ wget --load-cookies=/var/tmp/FFcookies.txt http://download.oracle.com/otn/mac/instantclient/10204/instantclient-basic-10.2.0.4.0-macosx-x86.zip

--2010-04-22 17:00:39--  http://download.oracle.com/otn/mac/instantclient/10204/instantclient-basic-10.2.0.4.0-macosx-x86.zip
Resolving download.oracle.com... 208.111.133.52, 208.111.133.54
Connecting to download.oracle.com|208.111.133.52|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 34109360 (33M) [application/zip]
Saving to: `instantclient-basic-10.2.0.4.0-macosx-x86.zip'&lt;br /&gt;10% [===&gt;                                   ] 3,563,808    545K/s  eta 65s
</pre>
<p>A final note:  The cookie file should be re-usable, so you don't need to regenerate one for each file you want to download.  The cookies will expire eventually, however, at the time indicated in the expiry or expires_utc field.  At that point, you'll need to go through the whole process again, starting with logging in to OTN to create new cookies.  </p>
<p>Happy downloading!</p>
]]></content:encoded>
			<wfw:commentRss>http://only4left.jpiwowar.com/2010/04/wget_otn_downloads/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Using the rpm &#8220;queryformat&#8221; option to display package architecture</title>
		<link>http://only4left.jpiwowar.com/2010/03/using-the-rpm-queryformat-option-to-display-package-architecture/</link>
		<comments>http://only4left.jpiwowar.com/2010/03/using-the-rpm-queryformat-option-to-display-package-architecture/#comments</comments>
		<pubDate>Mon, 29 Mar 2010 03:30:55 +0000</pubDate>
		<dc:creator>jpiwowar</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[64-bit]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[StupidLinuxTricks]]></category>

		<guid isPermaLink="false">http://only4left.jpiwowar.com/2010/03/using-the-rpm-queryformat-option-to-display-package-architecture/</guid>
		<description><![CDATA[<p>A quick demo of using the --queryformat option to rpm to retrieve the architecture of an installed RPM.</p>
]]></description>
			<content:encoded><![CDATA[<div class="none"><div class="g-plusone" data-href="http://only4left.jpiwowar.com/2010/03/using-the-rpm-queryformat-option-to-display-package-architecture/" size="small" count="true"></div></div><p>Here's one from the "learned something new today" files. When installing Oracle products on 64-bit versions of Linux, it's a common requirement to have both 32- and 64-bit versions of certain packages installed (that's not the "learned something new" part). The default output for the rpm query command, <code>rpm -q</code>, doesn't show the architecture of the queried package (that's not new, either). For example, installing Oracle RDBMS 11gR1 on RHEL4 or OEL4 requires both 32- and 64-bit versions of the libaio and glibc-devel (not the full list of package requirements; I'm just trying to keep the example short). A typical rpm query would show the following output:</p>
<pre class="brush: plain; title: ; notranslate">
[jpiwowar@testsrv ~]$ rpm -q libaio glibc-devel
libaio-0.3.105-2
glibc-devel-2.3.4-2.39
glibc-devel-2.3.4-2.39
</pre>
<p>It's probably safe to assume that those two glibc-devel entries cover the 32- and 64-bit versions, but where's the second libaio? The easy answer is to append the architecture string to the name of the package, but that results in a pretty quiet failure for the package that's not installed:</p>
<pre class="brush: plain; title: ; notranslate">
[jpiwowar@testsrv ~]$ rpm -q libaio.x86_64
libaio-0.3.105-2
[jpiwowar@testsrv ~]$ echo $?
0
[jpiwowar@testsrv ~]$ rpm -q libaio.i386
[jpiwowar@testsrv ~]$ echo $?
0
</pre>
<p>My new favorite trick (finally, the "learned something new" part!) is to use the --queryformat (or --qf) option to display the architecture of an installed package:</p>
<pre class="brush: plain; title: ; notranslate">
[jpiwowar@testsrv ~]$ rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE} %{ARCH}\n' libaio glibc-devel
libaio-0.3.105-2 x86_64
glibc-devel-2.3.4-2.39 i386
glibc-devel-2.3.4-2.39 x86_64
</pre>
<p>It's not perfect, but it makes it a bit easier to spot which version of a package (32-bit libaio, in this case) is missing in a long list of required packages. I'm a bit embarrassed to admit that I didn't know about this option until recently, but if it's new to me, maybe it's new to you too. <img src='http://only4left.jpiwowar.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<h3 id="ref">References</h3>
<ul>
<li><a href="http://www.rpm.org/max-rpm/s1-rpm-query-parts.html" title="">The Parts of an RPM Query</a></li>
<li><a href="https://supporthtml.oracle.com/ep/faces/secure/km/DocumentDisplay.jspx?id=437123.1" title="Requirements for Installing Oracle 11gR1 RDBMS on RHEL 4 on AMD64/EM64T ">My Oracle Support Note 437123.1: Requirements for Installing Oracle 11gR1 RDBMS on RHEL 4 on AMD64/EM64T</a> (just in case you landed here from a Google search for installing 11gR1 on RHEL4)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://only4left.jpiwowar.com/2010/03/using-the-rpm-queryformat-option-to-display-package-architecture/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Things I learned this weekend (5/16-17/2009)</title>
		<link>http://only4left.jpiwowar.com/2009/05/weekend-lessons-05162009/</link>
		<comments>http://only4left.jpiwowar.com/2009/05/weekend-lessons-05162009/#comments</comments>
		<pubDate>Tue, 19 May 2009 02:30:15 +0000</pubDate>
		<dc:creator>jpiwowar</dc:creator>
				<category><![CDATA[EBS]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Grid Control]]></category>
		<category><![CDATA[WowThatWasDumb]]></category>

		<guid isPermaLink="false">http://only4left.jpiwowar.com/2009/05/weekend-lessons-05162009/</guid>
		<description><![CDATA[The excitement of solving mysteries makes me bad at math In my last post, I failed to notice that a HugePages_Total of 4645, while satisfyingly greater than zero, is definitely not 8196, the desired and expected value I had configured. Upon reflection, the reason was pretty obvious: the OS will only allocate contiguous blocks of [...]]]></description>
			<content:encoded><![CDATA[<div class="none"><div class="g-plusone" data-href="http://only4left.jpiwowar.com/2009/05/weekend-lessons-05162009/" size="small" count="true"></div></div><h3>The excitement of solving mysteries makes me bad at math</h3>
<p>In my <a href="http://only4left.jpiwowar.com/2009/05/sles10_hugepages_x8664/" title="Hugepages post">last post</a>, I failed to notice that a HugePages_Total of 4645, while satisfyingly greater than zero, is definitely <i>not</i> 8196, the desired and expected value I had configured. Upon reflection, the reason was pretty obvious: the OS will only allocate contiguous blocks of memory for hugepages, and the server had been up for long enough that memory was a bit fragmented. One reboot later, things were much better:</p>
<pre class="brush: plain; title: ; notranslate">
sles10db:~ # cat /proc/meminfo | grep -i huge
HugePages_Total:  8196
HugePages_Free:   8196
HugePages_Rsvd:      0
Hugepagesize:     2048 kB
</pre>
<h3>Autoconfig giveth, and Autoconfig taketh away</h3>
<p>When an E-Business Suite system is behaving in a way that suggests one or two mangled (some say "corrupt," but I try not to be judgmental) configuration files, a common first response is to run Autoconfig to see if the system can sort itself out. Running Autoconfig is also frequently necessary during the course of normal maintenance, e.g. during some patching, or when renaming/relocating Oracle Apps nodes. This weekend, I was reminded of an interesting side effect of running Autoconfig. After the process was complete, Grid Control started reporting metric collection errors and "Unknown" status for some components on the application tier nodes. In this case, Autoconfig was just doing its job, generating new versions of configuration files for the apps tier, complete with their original file permissions, which overwrote the permission changes I had made to enable the Grid Control agent to monitor some of the OC4J components. Good thing I keep that list of chmod commands in an <a href="http://only4left.jpiwowar.com/2009/01/fix-gc-file-perms/#ebs" title="EBS Grid Control file permission changes">easy-to-find reference location</a>.</p>
<h3>Oh yeah, and...</h3>
<p>I also learned that using wireshark to try to debug a problem with a connection to an Oracle database over VPN is kind of like trying to listen to AM radio in a tunnel. You can tell there's signal there, but good luck making anything of it.</p>
]]></content:encoded>
			<wfw:commentRss>http://only4left.jpiwowar.com/2009/05/weekend-lessons-05162009/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Enabling hugepages on SLES10 x86_64 &#8230; not quite the same as SLES9</title>
		<link>http://only4left.jpiwowar.com/2009/05/sles10_hugepages_x8664/</link>
		<comments>http://only4left.jpiwowar.com/2009/05/sles10_hugepages_x8664/#comments</comments>
		<pubDate>Wed, 13 May 2009 03:41:52 +0000</pubDate>
		<dc:creator>jpiwowar</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[upgrade]]></category>
		<category><![CDATA[WowThatWasDumb]]></category>

		<guid isPermaLink="false">http://only4left.jpiwowar.com/2009/05/sles10_hugepages_x8664/</guid>
		<description><![CDATA[<p>What happens when I try to use instructions for SUSE Linux Enterprise Server 9 (SLES9) to enable hugepages on SLES10? Nothing. And that's a problem.</p>
]]></description>
			<content:encoded><![CDATA[<div class="none"><div class="g-plusone" data-href="http://only4left.jpiwowar.com/2009/05/sles10_hugepages_x8664/" size="small" count="true"></div></div><p>I feel like a <a href="http://twitter.com/jkuramot/status/1770008318" title="Jake, running L33tcheck. Or LOLcheck. Whichever.">n00b</a> for even posting this, but if part of my goal here is to <a href="http://only4left.jpiwowar.com/blog-answers/#what" title="High-minded frippery FTW!">catalog my mistakes</a>, well, here's one I probably won't make again.</p>
<p>I've been involved in a project to migrate an E-Business Suite database tier from 32-bit to 64-bit RDBMS. Thus far it's been pretty straightforward. One thing had been bugging me, though. Our original test platform was 64-bit SUSE Linux Enterprise Server 9 (SLES9), but a decision was made to upgrade to SLES10 instead. Not a big deal in this case, except for one thing: the settings I'd used in SLES9 to allocate hugepages weren't doing a darn thing in SLES10:</p>
<pre class="brush: plain; title: ; notranslate">
sles10db:~ # grep -i nr_huge /etc/sysctl.conf
vm.nr_hugepages = 8196

sles10db:~ # grep memlock /etc/security/limits.conf
oracle soft memlock 17000000
oracle hard memlock 17000000
</pre>
</p>
<p>Okay so far...
<pre class="brush: plain; title: ; notranslate">
sles10db:~ # grep -i huge /proc/meminfo
HugePages_Total:     0
HugePages_Free:      0
HugePages_Rsvd:      0
Hugepagesize:     2048 kB

sles10db:~ # cat /proc/sys/vm/nr_hugepages
0
</pre>
</p>
<p><i>Whahuh?</i> Why wasn't my <code>nr_hugepages</code> setting getting picked up from /etc/sysctl.conf? Wrong question, of course. If other settings in that file were being picked up (they were), then clearly something else was clobbering the value I had set. Sure enough, after not much poking around, I found this:</p>
<pre class="brush: plain; title: ; notranslate">
sles10db:~ # grep -i nr_huge /etc/sysconfig/oracle
# /proc/sys/vm/nr_hugepages indicates the current number of configured hugetlb
NR_HUGE_PAGES=0
</pre>
<p>How embarrassing is that? It's even <a href="http://www.novell.com/support/search.do?cmd=displayKC&amp;docType=kc&amp;externalId=7001835&amp;sliceId=1&amp;docTypeID=DT_TID_1_1&amp;dialogID=50137623&amp;stateId=0%200%2050135944" title="Doh.">documented</a> in a very official, check-here-first sort of place. Since /etc/init.d/oracle is run long after /etc/init.d/boot.sysctl, the values set in /etc/sysconfig/oracle clearly will clobber anything set in /etc/sysctl.conf. My only defense is that <code>NR_HUGE_PAGES</code> was not included in /etc/sysconfig/oracle on our SLES9 test system, which is why I was setting it in /etc/sysctl.conf in the first place. Of course, we might've been using an old version of orarun.rpm on that server, so it's still a pretty weak excuse. At any rate, changing the setting in /etc/sysconfig/oracle and running <code>rcoracle restart</code> did the job:</p>
<pre class="brush: plain; title: ; notranslate">
sles10db:~ # grep -i nr_huge /etc/sysconfig/oracle
# /proc/sys/vm/nr_hugepages indicates the current number of configured hugetlb
NR_HUGE_PAGES=8196

sles10db:~ # grep -i huge /proc/meminfo
HugePages_Total:  4645
HugePages_Free:   4645
HugePages_Rsvd:      0
Hugepagesize:     2048 kB
</pre>
<p>Hope this helps someone out there; otherwise, I'll just sit here, alone in my hopefully-temporary idiocy. <img src='http://only4left.jpiwowar.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://only4left.jpiwowar.com/2009/05/sles10_hugepages_x8664/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Unix shell geekery: Finding the ten largest residents of a directory</title>
		<link>http://only4left.jpiwowar.com/2009/04/ten_largest_directory_residents/</link>
		<comments>http://only4left.jpiwowar.com/2009/04/ten_largest_directory_residents/#comments</comments>
		<pubDate>Tue, 07 Apr 2009 01:31:09 +0000</pubDate>
		<dc:creator>jpiwowar</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[StupidLinuxTricks]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[WowThatWasDumb]]></category>

		<guid isPermaLink="false">http://only4left.jpiwowar.com/2009/04/ten_largest_directory_residents/</guid>
		<description><![CDATA[<p>Strange things can happen when people ask themselves a question and are unwilling to let go of it. Some retreat into seclusion to ponder the meaning of life. Some waste hours reading ultimately unrelated content on Wikipedia. Some spend way too much time writing marginally (if that) useful solutions to their questions. In this post, I'm guilty of that last one, though I've also been known to do the Wikipedia thing. My question? "Hey, if how could I find the largest files and subdirectories in this directory?"</p>
]]></description>
			<content:encoded><![CDATA[<div class="none"><div class="g-plusone" data-href="http://only4left.jpiwowar.com/2009/04/ten_largest_directory_residents/" size="small" count="true"></div></div><p>Finding the largest <em>files</em> in a directory on Linux is ridiculously easy, with the right flags to <code>ls</code>:</p>
<pre class="brush: bash; title: ; notranslate">
[oracle@vir demo]$ ls -1srShA | tail
4.0K jptest_mmnl_4899.trc
4.0K jptest_mmon_3011.trc
4.0K jptest_mmon_10186.trc
4.0K jptest_mmon_4897.trc
4.0K jptest_p001_3996.trc
4.0K jptest_p000_3994.trc
4.0K jptest_p000_3034.trc
4.0K jptest_p001_3036.trc
4.0K big directory with annoying name
104K alert_JPTEST.log
</pre>
<p>But hey, wait…what about that directory? It certainly seems to be conveniently named, almost as if placed there specifically for my follow-up question: What if I what I <em>really</em> want is to know the sizes of the largest files <i>and subdirectories</i> in my current directory? For that, I have to do something a bit more complicated than <code>ls</code>, but less complicated than writing a script:</p>
<pre class="brush: bash; title: ; notranslate">
[oracle@vir demo]$ topten
4.0K    ./jptest_mmnl_4899.trc
4.0K    ./jptest_mmon_10186.trc
4.0K    ./jptest_mmon_3011.trc
4.0K    ./jptest_mmon_4897.trc
4.0K    ./jptest_p000_3034.trc
4.0K    ./jptest_p000_3994.trc
4.0K    ./jptest_p001_3036.trc
4.0K    ./jptest_p001_3996.trc
104K    ./alert_JPTEST.log
529M    ./big directory with annoying name
</pre>
<p><code>topten</code> is a shell function defined as follows (you'll probably need to scroll a bit):</p>
<pre class="brush: bash; title: ; notranslate">
[oracle@vir demo]$ type topten
topten is a function
topten ()
{
    find . -maxdepth 1 -not -name '.' -print0 | xargs -0 du -s | sort -n | tail | cut -f2- | awk '{ printf(&quot;%s%c&quot;, $0, 0) }' | xargs -0 du -sh
}
</pre>
<p>One could claim that this is ridiculously over-engineered, and I would sheepishly agree. In fact, sharing this on a blog is my only hope of recouping the time spent in constructing the function in the first place. After all, what’s wrong with something as simple as <code>du -s * | sort -n | tail</code>? Well, starting with item #1, below, things just sort of snowball:</p>
<ol>
<li>In directories with a lot of files, <code>du -s</code> fails with a “too many arguments” error. $APPLCSF/log on an E-Business Suite midtier springs to mind.</li>
<li>Using <code>xargs</code> solves the "too many arguments" problem, but introduces a new one: <code>xargs</code> will misinterpret whitespace in file names as an argument separator, and split the file name. Whitespace in file names? Hey, I work on a Mac. This stuff happens. Users of Cygwin on Windows probably get bitten by this, too.</li>
<li>The use of <code>find -print0 | xargs -0</code> is a common solution to the "whitespace in filenames" issue.</li>
<li>I like the human-readable output from <code>du -h</code>, but that means I need to pass my top ten files through <code>xargs</code> <em>again</em>, which requires more filtering: <code>cut</code> removes the leading numbers from the output of the first <code>du</code>, and the <code>awk</code> command provides null-terminated output like find's <code>-print0.</code></li>
</ol>
<h3>Caveats and variations</h3>
<ul>
<li>Presumably, this function should work in Bourne-shell variants on any Unix-like system (works fine on Linux and Mac, for example). If you aren't running the GNU versions of the utilities invoked in this function, however, you may need to make some adjustments.</li>
<li>It can be expensive to use <code>du</code>. Choose your starting directory with care. If you run this command in the E-Business Suite APPL_TOP, for example, you might want to find something else to do for a few minutes. If you run this command on an already-busy production system, you may also want to find a place to hide from your sysadmins. <img src='http://only4left.jpiwowar.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </li>
<li>If you don’t care about the prettiness of the human-readable file sizes, then you can shorten the function to omit everything after the <code>tail</code> command:
<pre class="brush: bash; title: ; notranslate">
topten ()
{
find . -maxdepth 1 -not -name '.' -print0 | xargs -0 du -s | sort -n | tail
}
</pre>
</li>
<li>The function is called topten because the default output for the <code>tail</code> command is 10 lines. Provide the appropriate option to <code>tail</code> to change the output length (<code>tail -5</code> for 5, <code>tail -20</code> for 20, etc.)</li>
<li>It may be advantageous to add the <code>-x</code> option to <code>du</code> to prevent it from crossing filesystem boundaries.</li>
<li>There's probably an easier, and still portable, way to do this. I'm kinda hoping that someone stops by with a comment to tell me what that is. <img src='http://only4left.jpiwowar.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://only4left.jpiwowar.com/2009/04/ten_largest_directory_residents/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Retrieving Oracle patches with wget</title>
		<link>http://only4left.jpiwowar.com/2009/02/retrieving-oracle-patches-with-wget/</link>
		<comments>http://only4left.jpiwowar.com/2009/02/retrieving-oracle-patches-with-wget/#comments</comments>
		<pubDate>Sat, 14 Feb 2009 05:05:25 +0000</pubDate>
		<dc:creator>jpiwowar</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Oracle misc]]></category>
		<category><![CDATA[StupidLinuxTricks]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[TypeLess]]></category>

		<guid isPermaLink="false">http://only4left.jpiwowar.com/?p=67</guid>
		<description><![CDATA[While working from home this evening, I had to download some patches to a remote Linux system, and was struck, not for the the first time, by the inconvenience of it all.   So I wrote a quick shell function that helps me grab patches using wget.  And then, I decided to share with the world, or at least the really small portion of the world that visits my blog. ]]></description>
			<content:encoded><![CDATA[<div class="none"><div class="g-plusone" data-href="http://only4left.jpiwowar.com/2009/02/retrieving-oracle-patches-with-wget/" size="small" count="true"></div></div><blockquote><p>Update #1, 13-Nov-2009:  While testing this patch download method in the wake of the recent My Oracle Support cutover, I noticed a new wrinkle.  Instead of a successful patch download, I got the following message from wget:
<pre>Self-signed certificate encountered.
To connect to login.oracle.com insecurely, use `--no-check-certificate'.</pre>
<p>After adding --no-check-certificate to the wget command, I was once again able to retrieve patches, but it took a bit longer than usual, as wget wandered through a tree of redirects.  I've updated the code for the getOraPatch function accordingly.</p>
<p>Update #2, also 13-Nov-2009:  A commenter on Chris Warticki's Oracle Support blog <a href="http://blogs.oracle.com/Support/2009/11/oracle_customer_support_ok_i_t.html#comment-197126">noted</a> that the patch download page provided by the Flash version of My Oracle Support does not present a right-clickable Download button, which would seem to render the wget patch retreival method useless.  Thankfully, there's a workaround: open a new window/tab in your browser, using an URL of the form <code>https://updates.oracle.com/ARULink/PatchDetails/process_form?patch_num=<em>nnnnnnn</em></code>  This will open a patch download page in a plain HTML, non-Flashy interface, and you should be all set to go!</p></blockquote>
<p>No, no, this isn't a back door into the <del>Metalink</del> My Oracle Support patch repository.  Don't get too excited. <img src='http://only4left.jpiwowar.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>While working from home this evening, I had to download some patches to a remote Linux system, and was struck, not for the the first time, by the inconvenience of it all.  The usual options seem to be:</p>
<ol>
<li>Download the patches to a local machine and upload them to the remote system -- annoyingly manual at best, and downright gross when a VPN connection is involved.</li>
<li><del>FTP from the remote system to updates.oracle.com.  That's a tried-and true method, but still involves a lot of typing.</del> Not anymore!  This access option was disabled in November 2009, with the arrival of My Oracle Support.</li>
<li>Start a VNC session on the remote system, launch a web browser, log in to <del>Metalink</del> My Oracle Support, and click the download button.  Not a bad option...unless you <em>can't</em> use VNC for some reason, and are stuck with a command-line interface.  Or if you're trying to navigate in that remote browser over a VPN connection.  Not an exercise for impatient people.</li>
</ol>
<h3 id="script">When life gives you inconvenience, write a shell function!</h3>
<p>At least, I think that's how the old saying goes.  I created the following bash(1) function that uses wget to download a patch from updates.oracle.com, using the URL behind the Download button:<br />
<div id="gist-792717" class="gist">

        <div class="gist-file">
          <div class="gist-data gist-syntax">
              <div class="highlight"><pre><div class='line' id='LC1'><br/></div><div class='line' id='LC2'><span class="c"># Function to retreive patches from Metalink/My Oracle Support via wget</span></div><div class='line' id='LC3'><span class="k">function </span>getOraPatch <span class="o">{</span></div><div class='line' id='LC4'>&nbsp;&nbsp;&nbsp;<span class="o">[[</span> <span class="nv">$mosUser</span> <span class="o">]]</span> <span class="o">||</span> <span class="nb">read</span> -p <span class="s2">&quot;Oracle Support Userid: &quot;</span> mosUser;</div><div class='line' id='LC5'>&nbsp;&nbsp;&nbsp;<span class="o">[[</span> <span class="nv">$mosPass</span> <span class="o">]]</span> <span class="o">||</span> <span class="nb">read</span> -sp <span class="s2">&quot;Oracle Support Password: &quot;</span> mosPass;</div><div class='line' id='LC6'>&nbsp;&nbsp;&nbsp;<span class="nv">fname</span><span class="o">=</span><span class="sb">`</span><span class="nb">echo</span> <span class="nv">$1</span> | awk -F<span class="s2">&quot;=&quot;</span> <span class="s1">&#39;{print $NF;}&#39;</span><span class="sb">`</span>;</div><div class='line' id='LC7'>&nbsp;&nbsp;&nbsp;wget --no-check-certificate --http-user <span class="nv">$mosUser</span> --http-passwd <span class="nv">$mosPass</span> <span class="nv">$1</span> -O <span class="nv">$fname</span>;</div><div class='line' id='LC8'><span class="o">}</span></div></pre></div>
          </div>

          <div class="gist-meta">
            <a href="https://gist.github.com/raw/792717/090156664c652b0e53a1483de294d5b0e57b5f90/getOraPatch.sh" style="float:right;">view raw</a>
            <a href="https://gist.github.com/792717#file_get_ora_patch.sh" style="float:right;margin-right:10px;color:#666">getOraPatch.sh</a>
            <a href="https://gist.github.com/792717">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
          </div>
        </div>
</div>
</p>
<p>The above function prompts for the username and password that you use to access <del>Metalink</del> My Oracle Support.  If the variables are already defined in your session, then it assumes you want to use the existing values and does not prompt you again.  Then, the function parses the patch URL to find the patch's filename, and passes all four values (userid, password, URL, and filename) to wget.</p>
<h3 id="usage">Usage example</h3>
<ol>
<li>Load the above function into your shell session, or copy and paste the code into your .bash_profile to have it loaded when you log in.</li>
<li>Log in to <del>Metalink</del> My Oracle Support and locate the patch.  Can't get around this step, but you can do it in a local browser, instead of dealing with a remote X session as described above in #3.</li>
<li>Right-click on the Download button to copy the patch URL:<br />
<a href='http://only4left.jpiwowar.com/wp-content/uploads/2009/02/downloadpatch.png'><img src="http://only4left.jpiwowar.com/wp-content/uploads/2009/02/downloadpatch-300x129.png" alt="Patch download window" title="downloadpatch" width="300" height="129" class="alignnone size-medium wp-image-68" /></a></li>
<li>Invoke the function, enclosing the super-long patch URL in single quotes:
<pre class="brush: bash; title: ; notranslate">
oracle@testhost:/stage&gt; getOraPatch 'really_long_patch_URL_copied_in_previous_step'
</pre>
</li>
<li>Answer the prompts, and lean back and watch as wget retrieves your patch:
<pre class="brush: plain; title: ; notranslate">Oracle Support Userid: your_MyOracleSupport_login_here
Oracle Support Password: your_MyOracleSupport_password_here
(some wget output snipped)
HTTP request sent, awaiting response... 200 OK
Length: 52,028 [application/zip]

100%[====================================&gt;] 52,028        --.--K/s             

22:27:24 (555.94 KB/s) - `pnnnnnnn_version_platform.zip' saved [52028/52028]
</pre>
</li>
<li>Repeat as necessary.</li>
</ol>
<h3 id="warn">Disclaimers, caveats and commentary</h3>
<ol>
<li>As noted in the opening line of this post, this is not a "back door" into Oracle's patch repository.  You still need a valid Metalink userid and password for this retrieval method to work.  Furthermore, since this method essentially performs the same actions as clicking on a link in a browser, and requires manual collection of the patch download URL, I don't think it qualifies as "automation."  I certainly didn't set out to violate the Oracle.com Terms of Use, so hopefully no one interprets this as such. <img src='http://only4left.jpiwowar.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </li>
<li>I've only tested this on Linux.  Presumably, you could utilize this method on other Unix variants (and even Windows, if you're into that sort of thing).</li>
<li>On Unix/Linux, make sure you enclose the patch URL in single quotes, or the shell will interpret all of the ampersands in the URL as, "wow, you want me to launch 5 or 6 background processes?  O-<em>kay</em>!"</li>
<li>Before copying the patch URL, make sure you've already selected the correct release and platform for the patch.  The values of the aru and file_id parameters in the URL change as you select those values.</li>
<li>You need to have wget installed on your system for this method to work as written above.  It probably would be relatively easy to adapt this to use curl instead, but wget is what I thought to use first.</li>
<li>Some versions of wget use <code>http-password</code> instead of <code>http-passwd</code>.  Check <code>wget --help</code> to verify what's valid for your version.</li>
<li>Using this function will leave the values of your Oracle Support userid and password in the shell variables $mosUser and $mosPass.  If this makes you uncomfortable, remember to use <code>unset</code> on those variables, or just exit your session, when you're done downloading. </li>
<li>If you have any characters in your password that could be interpreted as metacharacters by the shell, you might need to escape them.  I didn't test that too thoroughly. <img src='http://only4left.jpiwowar.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </li>
</ol>
<h3 id="lol">A few random observations</h3>
<ul>
<li>Yes, I'm downloading patches on a Friday night.  And it's not urgent, strictly speaking.  Do I know how to live, or what?</li>
<li>According to The Google, my posting rate for the life of this blog is 0.2 posts/week.  It's not every week that I get to surpass my average output by an order of magnitude.</li>
<li>On second thought, at this rate, I could post twice a week for a while and still bask in the glow of that false feeling of productivity. <img src='http://only4left.jpiwowar.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://only4left.jpiwowar.com/2009/02/retrieving-oracle-patches-with-wget/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>Fixing file permission problems on Grid Control targets</title>
		<link>http://only4left.jpiwowar.com/2009/01/fix-gc-file-perms/</link>
		<comments>http://only4left.jpiwowar.com/2009/01/fix-gc-file-perms/#comments</comments>
		<pubDate>Mon, 26 Jan 2009 21:33:33 +0000</pubDate>
		<dc:creator>jpiwowar</dc:creator>
				<category><![CDATA[EBS]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Oracle misc]]></category>
		<category><![CDATA[Oracle RDBMS]]></category>
		<category><![CDATA[Grid Control]]></category>
		<category><![CDATA[monitoring]]></category>

		<guid isPermaLink="false">http://only4left.jpiwowar.com/?p=64</guid>
		<description><![CDATA[When installing Grid Control on a Linux or Unix platform, a recommended practice is to install the monitoring agent software as a user that doesn’t own the ORACLE_HOMEs to be monitored. This poses a challenge when configuring monitoring for some targets, particularly those based on Oracle Application Server 10g. This post lists some changes you can make to work around a variety of target discovery and metric collection errors.]]></description>
			<content:encoded><![CDATA[<div class="none"><div class="g-plusone" data-href="http://only4left.jpiwowar.com/2009/01/fix-gc-file-perms/" size="small" count="true"></div></div><p>When installing Grid Control agents on a Linux or Unix platform, a <a href="http://www.oracle.com/technology/products/oem/pdf/Security_Paper_OOW_06.pdf" title="Grid Control Security Best Practices">recommended practice</a> is to install as a user that doesn't own the ORACLE_HOMEs to be monitored.  This poses a challenge when configuring monitoring for some targets, particularly those based on Oracle Application Server 10g.  For security purposes, file and directory permissions on some ORACLE_HOMEs are fairly restrictive, and the Grid Control agent can't read all of the files necessary for target discovery and metric collection.  The Grid Control release notes <a href="http://download.oracle.com/docs/cd/B16240_01/doc/doc.102/e10552/toc.htm#sthref81" title="Grid Control 10gR4 Release notes for Linux and Windows">mention this complication</a>, and <a href="https://metalink2.oracle.com/metalink/plsql/showdoc?db=NOT&#038;id=437078.1" title="Metalink Note 437078.1">Metalink Note 437078.1</a> provides additional suggestions for resolving discovery and metric collection errors related to file permission restrictions on a target ORACLE_HOME.  I can't reveal the content of the <del>Metalink</del> My Oracle Support Note, and the information in the publicly-available Release Notes provides inadequate coverage, but the overall problem-solving method reduces to:</p>
<ol>
<li>Make sure that the owner of the agent software is in the same group as the owner of the monitored target software</li>
<li>Check the agent log files for file permission errors, and fix them.</li>
</ol>
<p>My experience so far indicates that fixing some errors tends to reveal others.  Who doesn't love a rousing game of log file <a href="http://en.wikipedia.org/wiki/Whac-A-Mole#Colloquial_usage" title="Wikipedia: Whac-a-mole">whack-a-mole? </a>  In the interest of saving others a few rounds of this, I'm offering up a few additional permission change steps that could make your lives easier.  For ease of navigation, I've broken things into the following sections:</p>
<ul>
<li><a href="#10gAS">Oracle Application Server</a></li>
<li><a href="#db">Database targets</a></li>
<li><a href="#ocs">Oracle Collaboration Suite Calendar Server</a></li>
<li><a href="#ebs">E-Business Suite</a></li>
</ul>
<p>Disclaimer: When considering making the changes I describe below, please consider the trade-off you are making:  more robust monitoring at the expense of <i>some</i> level of security.  The perceived degree of sacrifice will vary from person to person and organization to organization.  I would argue that the benefits outweigh the risks, and since Oracle itself suggests similar changes, this is clearly not a cut-and-dried issue.  Hey, if doing the right thing were always easy, this job wouldn't be any fun, right? <img src='http://only4left.jpiwowar.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Please feel free to leave any similar tips (or links to your own posts about this topic) in the comments.</p>
<h3 id="10gAS">Oracle Application Server</h3>
<p>Note 437078.1 is a good start, but there are a few additional items I found to ease metric collection and discovery errors for Oracle 10g App Server.  ORACLE_HOME refers to the location of the 10gAS software.  Depending on the application server components installed on your system, you may need to change more or fewer permissions. </p>
<pre class="brush: bash; title: ; toolbar: true; notranslate">chmod g+rx $ORACLE_HOME/webcache
chmod g+r $ORACLE_HOME/webcache/*.xml
chmod g+rx $ORACLE_HOME/portal
chmod g+rx $ORACLE_HOME/portal/conf
chmod g+rx $ORACLE_HOME/discoverer
chmod g+rx $ORACLE_HOME/discoverer/config
chmod g+rx $ORACLE_HOME/forms
chmod g+rx $ORACLE_HOME/forms/server
chmod g+rx $ORACLE_HOME/ldap
chmod g+rx $ORACLE_HOME/ldap/das
chmod g+rx $ORACLE_HOME/uix
chmod g+rx $ORACLE_HOME/ultrasearch
chmod g+rx $ORACLE_HOME/ultrasearch/webapp
chmod g+rx $ORACLE_HOME/ultrasearch/webapp/config
chmod g+rx $ORACLE_HOME/jpi
chmod g+rx $ORACLE_HOME/jpi/doc
chmod g+rx $ORACLE_HOME/Apache/oradav
chmod g+rx $ORACLE_HOME/Apache/oradav/conf
chmod g+rx $ORACLE_HOME/Apache/jsp
chmod g+rx $ORACLE_HOME/Apache/jsp/conf
chmod g+rx $ORACLE_HOME/Apache/modplsql
chmod g+rx $ORACLE_HOME/Apache/modplsql/conf
chmod g+rx $ORACLE_HOME/sso
chmod g+rx $ORACLE_HOME/sso/conf</pre>
<h3 id="db">Database targets</h3>
<p>Some environments (for example, the 10gAS infrastructure database) will require permission changes to effectively monitor database and listener targets.  You may find the scope of these changes to be a bit broad; at some point I got tired of chasing down individual files and just hit them all with the same hammer. <img src='http://only4left.jpiwowar.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />   In this case, ORACLE_HOME refers to the ORACLE_HOME of the RDBMS software.</p>
<pre class="brush: bash; title: ; toolbar: true; notranslate">find $ORACLE_HOME/admin -type d -exec chmod g+rx {} \;
find $ORACLE_HOME/admin -type f -exec chmod g+r {} \;

find $ORACLE_HOME/network -type d -exec chmod g+rx {} \;
find $ORACLE_HOME/network -type f -exec chmod g+r {} \;

find $ORACLE_HOME/rdbms -type d -exec chmod g+rx {} \;
find $ORACLE_HOME/rdbms -type f -exec chmod g+r {} \;

## The following are needed for database health checks to work properly...
chmod g+rx $ORACLE_HOME/dbs
chmod g+rw $ORACLE_HOME/dbs/hc*
</pre>
<p>Another general configuration note for the database listener, which I stumbled upon when setting up monitoring for a Secure Enterprise Search repository database:  If sqlnet.ora is configured with <code>TCP.VALIDNODE_CHECKING=yes</code>, then the server that hosts the Grid Control OMS needs to be added to the list of hosts defined by <code>TCP.INVITED_NODES</code>.  Otherwise, you'll get messages like this when attempting to add the database target, even if all monitoring credentials are correct:</p>
<pre class="brush: bash; title: ; notranslate">Failed to connect to the database: Io exception: Got minus one from a read call
The Connect Descriptor was (description=(address=(host=ses.myorg.com)(protocol=tcp)(port=xxxx))
(connect_data=(service_name=SESdb)(instance_name=SESdb)(UR=A)))&lt;/pre&gt;
And corresponding messages in the listener log:
&lt;pre&gt;TNS-12546: TNS:permission denied
 TNS-12560: TNS:protocol adapter error
  TNS-00516: Permission denied
</pre>
<p>Of course, after adding the OMS host to <code>TCP.INVITED_NODES</code> in sqlnet.ora, you need to tell the listener that you've made a change before the OMS will be able to connect to the database and add it as a target:</p>
<pre class="brush: bash; title: ; notranslate">oracle@ses:~&gt; lsnrctl  reload

LSNRCTL for Linux: Version 10.1.0.5.0 - Production on 05-DEC-2008 10:58:45

Copyright (c) 1991, 2004, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ses.myorg.com)(PORT=xxxx)))
The command completed successfully</pre>
<h3 id="ocs">Oracle Collaboration Suite Calendar Server</h3>
<p>These commands will resolve some issues with metric collection for OCS Calendar Server.  I suspect that the intersection of Collaboration Suite administrators (a small set) and readers of this blog (a vanishingly small set) is probably zero, but Google works in mysterious ways.  ORACLE_HOME refers to the OCS software location, not the Grid Control agent home.</p>
<pre class="brush: bash; title: ; toolbar: true; notranslate">chmod g+rx $ORACLE_HOME/ocal/bin
chmod g+rx $ORACLE_HOME/ocal/bin/uniwho
chmod g+rx $ORACLE_HOME/ocal/bin/unireqdump
chmod g+rx $ORACLE_HOME/ocal/bin/uniping
chmod g+rx $ORACLE_HOME/ocal/bin/unistatus
chmod g+rx $ORACLE_HOME/ocal/sbin
chmod g+rx $ORACLE_HOME/ocal/sbin/who
chmod g+rx $ORACLE_HOME/ocal/sbin/reqdump
chmod g+rx $ORACLE_HOME/ocal/sbin/ping
chmod g+rx $ORACLE_HOME/ocal/sbin/status
chmod g+rx $ORACLE_HOME/ocal/oem
chmod g+rx $ORACLE_HOME/ocal/oem/scripts
chmod g+rx $ORACLE_HOME/ocal/oem/scripts/ocal_ps.pl
chmod g+rx $ORACLE_HOME/ocal/oem/scripts/ocal_dbsize.pl
chmod g+rx $ORACLE_HOME/ocas
chmod g+rx $ORACLE_HOME/ocas/linkdb
chmod g+rx $ORACLE_HOME/ocas/sessiondb
chmod g+rx $ORACLE_HOME/lib
chmod g+rx $ORACLE_HOME/ocal/lib
chmod g+r $ORACLE_HOME/ocal/lib/*.so
chmod g+rx $ORACLE_HOME/ocal/db
chmod g+rx $ORACLE_HOME/ocal/db/nodes
find $ORACLE_HOME/ocal/db/nodes -type d -exec chmod g+rx {} \;
find $ORACLE_HOME/ocal/db/nodes -type f -exec chmod g+r {} \;
</pre>
<h3 id="ebs">E-Business Suite</h3>
<p>Setting these permissions in an E-Business Suite R12 instance resolved some metric collection errors of the form
<pre>Couldn't open INST_TOP/ora/10.1.3/j2ee/oafm/application-deployments/oafm/orion-application.xml: Permission denied at AGENT_HOME/sysman/admin/scripts/ias/simpleXPath.pm line 116</pre>
<p>  These errors may not manifest in 11i, since that version's tech stack is not based on 10gAS.  INST_TOP is the "Instance TOP" environment variable for the R12 Apps installation, and serves as a reminder to connect as the Apps owner (not database software owner) to run these commands.</p>
<pre class="brush: bash; title: ; toolbar: true; notranslate">chmod g+r $INST_TOP/ora/10.1.3/j2ee/forms/config/jms.xml
chmod g+r $INST_TOP/ora/10.1.3/j2ee/forms/application-deployments/forms/orion-application.xml
chmod g+r $INST_TOP/ora/10.1.3/j2ee/forms/application-deployments/forms/formsweb/orion-web.xml
chmod g+r $INST_TOP/ora/10.1.3/j2ee/oacore/config/jms.xml
chmod g+r $INST_TOP/ora/10.1.3/j2ee/oacore/application-deployments/oacore/orion-application.xml
chmod g+r $INST_TOP/ora/10.1.3/j2ee/oacore/application-deployments/oacore/html/orion-web.xml
chmod g+r $INST_TOP/ora/10.1.3/j2ee/oafm/config/jms.xml
chmod g+r $INST_TOP/ora/10.1.3/j2ee/oafm/application-deployments/oafm/orion-application.xml
chmod g+r $INST_TOP/ora/10.1.3/j2ee/oafm/application-deployments/oafm/webservices/orion-web.xml
chmod g+r $INST_TOP/ora/10.1.3/j2ee/oafm/application-deployments/mapviewer/orion-application.xml
chmod g+r $INST_TOP/ora/10.1.3/j2ee/oafm/application-deployments/mapviewer/web/orion-web.xml
chmod g+r $INST_TOP/ora/10.1.3/j2ee/oafm/application-deployments/ascontrol/orion-application.xml
</pre>
]]></content:encoded>
			<wfw:commentRss>http://only4left.jpiwowar.com/2009/01/fix-gc-file-perms/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Reference list for deploying Grid Control 10gR4 on Linux</title>
		<link>http://only4left.jpiwowar.com/2008/12/grid-control-10gr4-ref-list/</link>
		<comments>http://only4left.jpiwowar.com/2008/12/grid-control-10gr4-ref-list/#comments</comments>
		<pubDate>Mon, 15 Dec 2008 04:27:19 +0000</pubDate>
		<dc:creator>jpiwowar</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Oracle misc]]></category>
		<category><![CDATA[Grid Control]]></category>
		<category><![CDATA[monitoring]]></category>
		<category><![CDATA[references]]></category>

		<guid isPermaLink="false">http://only4left.jpiwowar.com/?p=50</guid>
		<description><![CDATA[Here's a quick list of reference links for deploying Oracle Grid Control 10.2.0.4 on Linux.  If you're starting out on a Grid Control deployment project, perhaps this will help to jump-start your own research.  This is a non-exhaustive list, but it covers the basics reasonably well.]]></description>
			<content:encoded><![CDATA[<div class="none"><div class="g-plusone" data-href="http://only4left.jpiwowar.com/2008/12/grid-control-10gr4-ref-list/" size="small" count="true"></div></div><p>I've been involved in a project to deploy Oracle Grid Control recently, and thought I would share my list of reference documents.  Even for a relatively simple deployment, there's a lot of reading to be done.  I'm sure this surprises no one. <img src='http://only4left.jpiwowar.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />   I don't claim to have compiled an exhaustive list of documents and patches.  Depending on your platform and deployment architecture, you may have more or less (probably more) research to do.  Nevertheless, if you're in the early stages of planning a Grid Control deployment project, perhaps this link collection will help you get started.  As time goes on, these references may become less relevant.  Patches in particular can have a ridiculously short half-life, but at least the <del>Metalink</del> My Oracle Support documents tend to be updated in place rather than superseded.  </p>
<p>Before I launch into the long list, here's a high-level view of the system I've been deploying, to help you determine if your project is more or less (again, probably more) complicated than mine:</p>
<ul>
<li>2-node Grid Control system (1 repository, 1 OMS)</li>
<li>Linux x86 for repository and OMS</li>
<li>Repository database version 10.2.0.4</li>
<li>OMS and agent versions 10.2.0.4 (sometimes referred to as Grid Control 10gR4)</li>
<li>Small-ish (less than 500) set of monitored targets</li>
<li>Mix of Linux x86, Windows, and Linux x86-64 targets, predominantly Linux x86</li>
<li>Some E-Business Suite targets, with Applications Management Pack licensed</li>
</ul>
<h2 id="metalink">Metalink Reference Documents</h2>
<h3 id="metalink-db">Database</h3>
<dl>
<dt>Note 555577.1: <a href="https://metalink2.oracle.com/metalink/plsql/showdoc?db=NOT&#038;id=555577.1" title="Metalink Note 555577.1">Oracle Database Patch Set Notes 10g Release 2 (10.2.0.4) Patch Set 3 for Linux x86</a></dt>
<dd>A good, quick read for the 10.2.0.1-&gt;10.2.0.4 upgrade.</dd>
<dt>Note 359145.1: <a href="https://metalink2.oracle.com/metalink/plsql/showdoc?db=NOT&#038;id=359145.1" title="Metalink Note 359145.1">Impact of 2007 USA daylight saving changes on the Oracle database</a></dt>
<dd>According to the matrix in this note, RDBMS version 10.2.0.4 contains the necessary fixes for current US DST, so no additional patching required for the repository database
</dd>
<dt>Note 735216.1: <a href="https://metalink2.oracle.com/metalink/plsql/showdoc?db=NOT&#038;id=735216.1" title="Metalink Note 735216.1">Critical Patch Update October 2008 Availability Information for Oracle Database and Fusion Middleware Products</a></dt>
<dd>Also applicable to Application Tier components, as the title suggests.</dd>
</dl>
<h3 id="metalink-ebs">E-Business Suite/AMP</h3>
<dl>
<dt>Note 394448.1: <a href="https://metalink2.oracle.com/metalink/plsql/showdoc?db=NOT&#038;id=394448.1" title="Metalink Note 394448.1">Getting Started with  the Application Management Pack  for Oracle E-Business Suite (Releases 2.0 and 2.0.1)</a></dt>
<dd> A short overview document, most useful for its links to the <a href="https://metalink2.oracle.com/cgi-bin/cr/getfile.cgi?p_attid=394448.1:1" title="AMP Installation Guide">Oracle Application Management Pack for Oracle E-Business Suite Installation Guide</a>, <a href="https://metalink2.oracle.com/cgi-bin/cr/getfile.cgi?p_attid=394448.1:2" title="AMP User's Guide">Oracle Application Management Pack for Oracle E-Business Suite User's Guide</a></dd>
<dt>Note 412044.1: <a href="https://metalink2.oracle.com/metalink/plsql/showdoc?db=NOT&#038;id=412044.1" title="Metalink Note 412044.1">Application Management Pack for Oracle E-Business Suite Release 2.0 and 2.0.1 Troubleshooting Guide</a></dt>
<dd>Probably won't need this, since most deployments go completely smoothly and troubleshooting is rarely required, right? <img src='http://only4left.jpiwowar.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </dd>
<dt>Note 406982.1: <a href="https://metalink2.oracle.com/metalink/plsql/showdoc?db=NOT&#038;id=406982.1" title="Metalink Note 406982.1">Cloning Oracle Applications Release 12 with Rapid Clone</a></dt>
<dd>AMP installation requires the latest Rapid Clone patches.  This is a quick way to get links to them.  If you're running 11i instead of R12, be sure to review the <a href="http://metalink.oracle.com/metalink/plsql/ml2_documents.showNOT?p_id=230672.1" title="Metalink Note 230672.1">relevant document</a> for that release.</dd>
</dl>
<h3 id="metalink-gc">Grid Control</h3>
<dl>
<dt>Note 412431.1: <a href="https://metalink2.oracle.com/metalink/plsql/showdoc?db=NOT&#038;id=412431.1" title="Metalink Note 412431.1">Oracle Enterprise Manager 10g Grid Control Certification Checker</a></dt>
<dd>You could, of course, just use the standard <a href="http://www.oracle.com/technology/support/metalink/index.html" title="Oracle Certification matrix">certification matrix</a> to figure out what versions of the Grid Control components are certified for your platform, but this document is much more concise, not to mention prettier.</dd>
<dt>Note 457792.1: <a href="https://metalink2.oracle.com/metalink/plsql/showdoc?db=NOT&#038;id=457792.1" title="Metalink Note 457792.1">DST Compliance for Grid Control OMS, Repository and Agents: Checks and Updates</a></dt>
<dt>Note 409225.1: <a href="https://metalink2.oracle.com/metalink/plsql/showdoc?db=NOT&#038;id=409225.1" title="Metalink Note 409225.1">Impact of DST changes on Grid Control Release 2 - Preparation and Patching guidelines</a></dt>
<dt>Note 471451.1: <a href="https://metalink2.oracle.com/metalink/plsql/showdoc?db=NOT&#038;id=471451.1" title="Metalink Note 471451.1">DST 2007/2008 Oracore files Version for Grid Control Components</a></dt>
<dd>The preceding three notes will help to untangle the Daylight Savings Time patching requirements for the various components of Grid Control.  The highly-compressed bottom line: Getting all the components to version 10.2.0.4 will save a lot of pain.</dd>
<dt>Note 468959.1: <a href="https://metalink2.oracle.com/metalink/plsql/showdoc?db=NOT&#038;id=468959.1" title="Metalink Note 468959.1">Enterprise Manager Grid Control Known Issues</a></dt>
<dt>Note 602750.1: <a href="https://metalink2.oracle.com/metalink/plsql/showdoc?db=NOT&#038;id=602750.1" title="Metalink Note 602750.1">ConfigureGC.pl Reports - Invalid Username/Password.</a></dt>
<dd>I got bitten by this issue when performing the software-only OMS installation.</dd>
<dt>Note 578715.1: <a href="https://metalink2.oracle.com/metalink/plsql/showdoc?db=NOT&#038;id=578715.1" title="Metalink Note 578715.1">How to Install Grid Control 10.2.0.4.0 with a New Database using the Software-only Option</a></dt>
<dd>Useful reference for "existing database" option as well, as as a supplement to the installation docs.</dd>
<dt>Note 414989.1: <a href="https://metalink2.oracle.com/metalink/plsql/showdoc?db=NOT&#038;id=414989.1" title="Metalink Note 414989.1">How to Fix Generic_MOM_Managed_Host In Pending Status?</a></dt>
<dd>The Note refers to OMS version 10.2.0.3, but I also encountered this issue when deploying version 10.2.0.4</dd>
<dt>Note 437078.1: <a href="https://metalink2.oracle.com/metalink/plsql/showdoc?db=NOT&#038;id=437078.1" title="Metalink Note 437078.1">Problem : iAS Discovery/Monitoring Fails If Agent Is Installed Under Another OS User Than iAS</a></dt>
<dd>This topic is also addressed in the Grid Control release notes, but this Note is more comprehensive.</dd>
</dl>
<h3 id="metalink-as">Application Server 10g</h3>
<dl>
<dt>Note 566418.1: <a href="https://metalink2.oracle.com/metalink/plsql/showdoc?db=NOT&#038;id=566418.1" title="Metalink Note 566418.1">How to Recover OUI to 10.2.0.3/10.2.0.4 after Applying IAS 10.1.2.2 Patchset on Grid Control OMS Home</a></dt>
<dd>Upgrading the OMS IAS software to 10.1.2.2 is necessary to meet the minimum version requirements for the latest CPU patches.  Unfortunately, performing that upgrade <em>downgrades</em> the Oracle Universal Installer in the OMS ORACLE_HOME.  Whoopsie.  This Note describes how to fix it.</dd>
<dt>Note 329361.1: <a href="https://metalink2.oracle.com/metalink/plsql/showdoc?db=NOT&#038;id=329361.1" title="Metalink Note 329361.1">Oracle Application Server 10g Release 2 (10.1.2) Support Status and Alerts</a></dt>
<dd>Useful reference for finding 10gAS patchsets.</dd>
<dt>Note 415222.1: <a href="https://metalink2.oracle.com/metalink/plsql/showdoc?db=NOT&#038;id=415222.1" title="Metalink Note 415222.1">Steps to Maintain Oracle Application Server 10g Release 2 (10.1.2)</a></dt>
<dd>Relevant for upgrading OMS ORACLE_HOME to 10.1.2.2.  Reference "Step 3: Apply Latest Oracle Application Server 10.1.2.2 Patchset (Patch 4960210)."</dd>
<dt>Note 280116.1: <a href="https://metalink2.oracle.com/metalink/plsql/showdoc?db=NOT&#038;id=280116.1" title="Metalink Note 280116.1">How To Reset Ias_admin User Password On AS10G On Unix If The Old Password Is Missing?</a></dt>
<dd>...or, "if you can't be bothered to look up the value of the default password after a silent install, since you're just going to change it anyway."</dd>
<dt>Note 270516.1: <a href="https://metalink2.oracle.com/metalink/plsql/showdoc?db=NOT&#038;id=270516.1" title="Metalink Note 270516.1">How To Change The SYSMAN Password Used For Grid Control</a></dt>
<dd>This information can also be found in the Installation and Configuration Guide on OTN (see below).</dd>
<dt>Note 436299.1: <a href="https://metalink2.oracle.com/metalink/plsql/showdoc?db=NOT&#038;id=436299.1" title="Metalink Note 436299.1">Common reasons for OUI failures on the MS Windows platforms</a></dt>
<dd>I work primarily on Linux, but every now and then, I get an "opportunity" to install Oracle software on Windows.  The little issues listed in this Note are worth reviewing before installing a Grid Control monitoring agent on Windows.
</dd>
</dl>
<h2 id="non-metalink">Non-Metalink references</h2>
<dl>
<dt><a href="http://download.oracle.com/docs/cd/B16240_01/doc/doc.102/e10552/toc.htm" title="Grid Control 10gR4 Release Notes">Oracle® Enterprise Manager Grid Control Release Notes for Linux and Microsoft Windows 10g Release 4 (10.2.0.4.0)</a></dt>
<dd>Although the release notes state that RDBMS 10.2.0.4 is not a certified repository version, the more-up-to-date <a href="https://metalink.oracle.com/metalink/plsql/showdoc?db=NOT&#038;id=412431.1" title="Metalink Note 412431.1">Oracle Enterprise Manager 10g Grid Control Certification Checker</a> refutes this.</dd>
<dt><a href="http://download.oracle.com/docs/cd/B16240_01/doc/install.102/e10953/toc.htm" title="Grid Control Basic Configuration">Oracle Enterprise Manager Grid Control Installation and Basic Configuration 10g Release 4 (10.2.0.4)</a></dt>
<dt><a href="http://download.oracle.com/docs/cd/B16240_01/doc/em.102/e10954/toc.htm" title="Grid Control Advanced Configuration">Oracle Enterprise Manager Advanced Configuration 10g Release 4 (10.2.0.4.0)</a></dt>
<dd>See Section 5.3 for configuring integration w/ Single Sign-On</dd>
<dt><a href="http://www.oracle.com/technology/products/oem/pdf/10gr2_agent_deploy_bp.pdf" title="Agent Deployment Best Practices">10g R2 Management Agent Deployment Best Practices</a></dt>
</dl>
<h2 id="patches">Patches </h2>
<p>Patches tend to be superseded fairly rapidly, CPUs in particular. The following are presented primarily to provide an idea for the amount of patching to expect.  Be sure to check the documentation to verify relevance.</p>
<h3 id="patches-ebs">E-Business Suite</h3>
<dl>
<dt><a href="https://updates.oracle.com/ARULink/PatchDetails/process_form?patch_num=6809246" title="">6809246: APPLICATIONS MANAGEMENT PACK V2.0.2 UPDATE FOR E-BUSINESS SUITE</a></dt>
<dt><a href="https://updates.oracle.com/ARULink/PatchDetails/process_form?patch_num=5489352" title="">5489352: 	EM PLUGIN V2 FOR ORACLE APPLICATIONS</a></p>
</dt>
<dt><a href="https://updates.oracle.com/ARULink/PatchDetails/process_form?patch_num=6510214" title="">6510214: 	R12.AD.A.DELTA.4</a></dt>
<dt><a href="https://updates.oracle.com/ARULink/PatchDetails/process_form?patch_num=6776948" title="">6776948: R12 RAPIDCLONE CONSOLIDATED FIXES JUL/2008</a></dt>
<dt><a href="https://updates.oracle.com/ARULink/PatchDetails/process_form?patch_num=6874927" title="">6874927: R12 Interoperability Patch for AMP 2.0.2 </a></dt>
</dl>
<h3 id="patches-db">Grid Control repository database</h3>
<dl>
<dt><a href="https://updates.oracle.com/ARULink/PatchDetails/process_form?patch_num=6810189" title="">6810189: 10.2.0.4.0 PATCH SET FOR ORACLE DATABASE SERVER</a></dt>
<dt><a href="https://updates.oracle.com/ARULink/PatchDetails/process_form?patch_num=6880880" title="">6880880: Universal Installer: Patch OPatch 10.2</a></dt>
<dd>Be sure to download the 10.2 version!</dd>
<dt><a href="https://updates.oracle.com/ARULink/PatchDetails/process_form?patch_num=7375644" title="">7375644: 	MLR BUG FOR 10.2.0.4 FOR CPUOCT2008</a></dt>
<dd>Oct2008 CPU for Repository database</dd>
</dl>
<h3 id="patches-oms">Grid Control management server</h3>
<dl>
<dt><a href="http://updates.oracle.com/ARULink/PatchDetails/process_form?patch_num=4700543" title="">4700543: 	SSL SESSIONS FAIL DURING NEGOTIATION</a></dt>
<dd>Network client on OMS server, per <a href="https://metalink.oracle.com/metalink/plsql/showdoc?db=NOT&#038;id=415222.1" title="">Note 415222.1</a></dd>
<dt><a href="http://updates.oracle.com/ARULink/PatchDetails/process_form?patch_num=4960210" title="">4960210: PLACEHOLDER BUG FOR AS/DS 10G R2 PATCH SET 2 10.1.2.2 </a></dt>
<dd> At this time, Version 10.1.2.2 is the maximum 10gAS release supported for the Grid Control OMS, and the minimum supported for application of the Oct2008 CPU patchset. </dd>
<dt><a href="https://updates.oracle.com/ARULink/PatchDetails/process_form?patch_num=6342108" title="">6342108: EBS DASHBOARDS FAIL TO RENDER, GENERATE STACK IN OC4J LOG </a></dt>
<dd>Be sure to grab 10.2.0.4 version</dd>
<dt><a href="http://updates.oracle.com/ARULink/PatchDetails/process_form?patch_num=5861907" title="">5861907: IAS 10.1.2.2 PATCHSET UPDATES ORACLEHOMEPROPERTIES.XML WITH WRONG ARU_ID &#038; ARU_I </a></dt>
<dd>Required to enable opatch to apply additional patches once 10gAS ORACLE_HOME has been updated to 10.1.2.2</dd>
<dt><a href="http://updates.oracle.com/ARULink/PatchDetails/process_form?patch_num=2617419" title="">2617419: 	OPATCH FOR EM</a></dt>
<dd>For patching OMS ORACLE_HOME.  Select 10.1.0.2 release when downloading</dd>
<dt><a href="https://updates.oracle.com/ARULink/PatchDetails/process_form?patch_num=7040389" title="">7040389: S/W ONLY AND CONFIG LATER METHOD- WEBSITE TARGET NOT CONFIG AND ONLINE HELP </a></dt>
<dt><a href="https://updates.oracle.com/ARULink/PatchDetails/process_form?patch_num=6640752" title="">6640752: OUI CD PLACE HOLDER ON ARU FOR 10204</a></dt>
<dd>Whoopsies.  Check <a href="https://metalink.oracle.com/metalink/plsql/showdoc?db=NOT&#038;id=566418.1" title="">Note 566418.1</a> for details</dd>
<dt><a href="https://updates.oracle.com/ARULink/PatchDetails/process_form?patch_num=7379121" title="">7379121: MLR ON TOP OF 10.1.2.2 FOR CPUOCT2008</a></dt>
<dd>Oct2008 CPU for OMS tier</dd>
<dt><a href="http://updates.oracle.com/ARULink/PatchDetails/process_form?patch_num=6606233" title="">6606233: PERF: INEFFICIENT QUERY TO CALCULATE TOTAL NUMBER OF NEW POLICY VIOLATIONS</a></dt>
<dd>Be sure to download 10.2.0.4 version.</dd>
<dt><a href="https://updates.oracle.com/ARULink/PatchDetails/process_form?patch_num=3731593" title="">3731593: PATCHSETS FOR ENTERPRISE MANAGER GRID CONTROL</a></dt>
</dl>
<h3 id="patches-agent">Grid Control agent</h3>
<p>			<a href="https://updates.oracle.com/ARULink/PatchDetails/process_form?patch_num=6670069" title="">6670069: 	GETTING INITIALIZATION ERROR WHEN RUNNING FILETRANSFER COMMAND ITERATIVELY</a></p>
]]></content:encoded>
			<wfw:commentRss>http://only4left.jpiwowar.com/2008/12/grid-control-10gr4-ref-list/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Clearing the Oracle environment in a Unix session</title>
		<link>http://only4left.jpiwowar.com/2008/11/clearing-oracle-environment/</link>
		<comments>http://only4left.jpiwowar.com/2008/11/clearing-oracle-environment/#comments</comments>
		<pubDate>Mon, 24 Nov 2008 17:16:10 +0000</pubDate>
		<dc:creator>jpiwowar</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Oracle misc]]></category>
		<category><![CDATA[regex]]></category>
		<category><![CDATA[TypeLess]]></category>

		<guid isPermaLink="false">http://only4left.jpiwowar.com/?p=49</guid>
		<description><![CDATA[Correctly defining Oracle-related environment variables in a Linux or Unix session is pretty important, especially on a system that hosts multiple ORACLE_HOMEs.  Equally important is making sure that old settings are removed from the environment when switching contexts from one ORACLE_HOME to another.  Here's an example of how I do it.]]></description>
			<content:encoded><![CDATA[<div class="none"><div class="g-plusone" data-href="http://only4left.jpiwowar.com/2008/11/clearing-oracle-environment/" size="small" count="true"></div></div><p>When working on servers with multiple ORACLE_HOMEs, keeping a session's Oracle-related environment variables in alignment is critical to an administrator's sanity.  Different versions of the RDBMS or application server software can require different binaries and shared libraries, and different ORACLE_HOMEs may have different network setups.    An improperly configured Oracle environment can lead to TNS errors when attempting to connect to a database ("Oh, it's trying to use <i>that</i> tnsnames.ora..."), restarts of the wrong app server ("Wait a minute, <i>which</i> opmnctl did I just run?"), or wasted weekend afternoons (I once sat on the phone w/ Oracle Support for 3 hours because $ORACLE_HOME/ctx/lib was not in my LD_LIBRARY_PATH.  Good times!).  </p>
<p>Oracle addresses the need for managing environment configuration with the 'oraenv' script, and with the various environment files that need to be sourced to work in the different contexts of Oracle Applications.  Furthermore, a number of common utilities on the application server side of the world, such as emctl and opmnctl, are shell scripts that explicitly set the Unix environment before launching processes that do actual work.  For some systems, however, these tools may not be enough.  For example, the oraenv script does not set TNS_ADMIN, and does not remove any custom additions to the PATH environment variables that are based on a previous value of ORACLE_HOME.</p>
<h3>Some simple solutions</h3>
<p>There are a number of simple ways to prevent your Unix session environment from becoming a tangled mess of inappropriate paths, without resorting to setting individual environment variables manually, including:</p>
<ul>
<li>Don't switch Oracle environments during a session.  Instead, always start a new session to work in a new environment.  This is can be good for maintaining personal discipline, but a bit tedious in practice, and besides, if I stopped there I wouldn't have much of a blog post, would I?</li>
<li>Create separate shell scripts to do the work of setting up the environment variables needed, appending or prepending Oracle-related values.  This is a common practice, but after switching back and forth between environments a few times, the PATH environment variable can grow from this:
<pre class="brush: bash; title: ; notranslate">/u01/app/oracle/product/client/10gR2/bin:/u01/app/oracle/product/client/10gR2/OPatch:
/u01/app/oracle/product/client/10gR2/opmn/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:
/opt/oracle/bin</pre>
<p>...to something like this admittedly contrived monstrosity: </p>
<pre class="brush: bash; title: ; notranslate">/u01/app/oracle/product/client/11gR1/bin:/u01/app/oracle/product/client/11gR1/OPatch:
/u01/app/oracle/product/client/11gR1/opmn/bin:/u01/app/oracle/product/client/10gR2/bin:/u01
/app/oracle/product/client/10gR2/OPatch:/u01/app/oracle/product/client/10gR2/opmn/bin:/u01/app
/oracle/product/client/11gR1/bin:/u01/app/oracle/product/client/11gR1/OPatch:/u01/app/oracle/product
/client/11gR1/opmn/bin:/u01/app/oracle/product/client/10gR2/bin:/u01/app/oracle/product/client
/10gR2/OPatch:/u01/app/oracle/product/client/10gR2/opmn/bin:/usr/kerberos/bin:/usr/local/bin:/bin:
/usr/bin:/opt/oracle/bin</pre>
<p>Alternately, instead of appending/prepending values to the environment variables, you could just reset them to default values, but those defaults may vary across servers, which can decrease portability of your scripts.</li>
<li>Unset all Oracle-related environment variables manually before setting up the new Oracle environment.  This works well for things like ORACLE_HOME and TNS_ADMIN, but what about PATH and LD_LIBRARY_PATH?  Doing 'unset PATH' is a surefire way to wreck a perfectly good session, and resetting PATH by copying only the elements you wish to preserve can be error-prone.</li>
</ul>
<h3>Another solution</h3>
<p>I'd like to have a method to unset <i>just</i> the Oracle environment in my session; that is, it should remove references to the current ORACLE_HOME from the environment and leave other environment variables untouched.  What I've settled on is the code shown below, which can be adapted into a shell function, dropped into an existing environment setup script, or placed in a standalone script:  </p>
<pre class="brush: bash; title: ; toolbar: true; notranslate">
#!/bin/bash
#Remove references to current ORACLE_HOME in various environment variables.
#Do nothing if ORACLE_HOME is not set

if [[ -n $ORACLE_HOME ]]
then
   echo &quot;Removing ORACLE_HOME references from environment&quot;
   echo &quot;Old ORACLE_HOME: $ORACLE_HOME&quot;

   export LD_LIBRARY_PATH=`echo $LD_LIBRARY_PATH | sed &quot;s#$ORACLE_HOME[^:]*:*##g&quot;`
   # Include additional lines for clearing CLASSPATH, PERL5LIB, etc. as
   # needed *before* modifying PATH

   export PATH=`echo $PATH | sed &quot;s#$ORACLE_HOME[^:]*:*##g&quot;`
   unset TNS_ADMIN ORACLE_HOME ORACLE_SID ORACLE_BASE
fi
</pre>
<p>Here's a demo:</p>
<pre class="brush: bash; title: ; notranslate">[oracle@lyta ~]$ . setup_11gR1.env
[oracle@lyta ~]$ echo $ORACLE_HOME; echo $LD_LIBRARY_PATH; echo $PATH
/u01/app/oracle/product/client/11gR1
/u01/app/oracle/product/client/11gR1/lib
/u01/app/oracle/product/client/11gR1/bin:/u01/app/oracle/product/client/11gR1/OPatch:/u01/app/oracle/product/client/11gR1/opmn/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/opt/oracle/bin
[oracle@lyta ~]$ . clear_oracle
Removing ORACLE_HOME references from environment
Old ORACLE_HOME: /u01/app/oracle/product/client/11gR1
[oracle@lyta ~]$ echo $ORACLE_HOME; echo $LD_LIBRARY_PATH; echo $PATH

/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/opt/oracle/bin</pre>
<p>Since one person's completely sensible regular expression can be another person's incomprehensible line noise, here are some notes on the regex used in the sed command:</p>
<ul>
<li>Uses # instead of the traditional / as a separator to prevent errors resulting from interpolation of the $ORACLE_HOME environment variable.
</li>
<li><code>[^:]*</code> matches zero or more non-colon characters.  Since the colon is the separator for entries in the path, this prevents the regex from matching more than one entry at a time.
</li>
<li><code>:*</code> removes the colon from the end of a matched path entry, so the revised path doesn't contain a string of useless separators (<code>:::::::</code>).
</li>
</ul>
<p>I may have just presented a solution in search of problem.  On the other hand, I've found this to be useful, so maybe you will, too.  If so, please leave a glowingly grateful comment.  If not, then I've just revealed myself to the entire Internet as a slightly obsessive geek.  There's a first time for everything. <img src='http://only4left.jpiwowar.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://only4left.jpiwowar.com/2008/11/clearing-oracle-environment/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Enhance your applmgr .profile, part II</title>
		<link>http://only4left.jpiwowar.com/2008/06/enhance-your-applmgr-profile-ii/</link>
		<comments>http://only4left.jpiwowar.com/2008/06/enhance-your-applmgr-profile-ii/#comments</comments>
		<pubDate>Sat, 14 Jun 2008 19:43:36 +0000</pubDate>
		<dc:creator>jpiwowar</dc:creator>
				<category><![CDATA[EBS]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[11i]]></category>
		<category><![CDATA[R12]]></category>
		<category><![CDATA[TypeLess]]></category>

		<guid isPermaLink="false">http://only4left.jpiwowar.com/?p=12</guid>
		<description><![CDATA[This is the second half of a two-part series on useful Linux/Unix environment variables and aliases for enhancing your productivity as an Apps DBA.]]></description>
			<content:encoded><![CDATA[<div class="none"><div class="g-plusone" data-href="http://only4left.jpiwowar.com/2008/06/enhance-your-applmgr-profile-ii/" size="small" count="true"></div></div><p>Here's the second part of the discussion begun in my <a title="part I" href="http://only4left.jpiwowar.com/2008/05/enhance-your-applmgr-profile-i/">last post</a>.  No big reason for the split, other than putting both parts together made the post feel too long, and at some point laziness prevailed and I couldn't bring myself to edit things down any more. <img src='http://only4left.jpiwowar.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<h3 id="dir">Directory shortcuts</h3>
<p>I define the following environment variables after <a href="http://only4left.jpiwowar.com/2008/05/enhance-your-applmgr-profile-i#env">sourcing the Apps environment file</a>.  These shortcuts allow me to navigate to frequently-used directories a bit faster.  Not surprisingly, they relate to concurrent managers and patching:</p>
<pre class="brush: bash; title: ; toolbar: true; notranslate">export CM_LOG=$APPLCSF/$APPLLOG
export CM_OUT=$APPLCSF/$APPLOUT
export PATCH_BASE=/opt/oracle/stage/patch
export EBS_PATCH=$PATCH_BASE/ebs
export PATCH_LOG=$APPL_TOP/admin/$TWO_TASK/log
export WORKER_LOG=$PATCH_LOG</pre>
<p>Yes, those last two are duplicates, which is more an indicator of my laziness (um, I mean, reluctance to context-switch unnecessarily) than anything else.</p>
<h3 id="alias">More fun with aliases: adpatch and adctrl</h3>
<p>The following aliases save some typing at patch time.  The first invokes adpatch in a the typical way, with the benefit of not having to answer all of the startup prompts.  The second, as the name of the alias suggests, allows "hot patching" for those really small patches when you don't want to put the system in maintenance mode (only for use in test systems, though, right?  Of <em>course</em> right).</p>
<pre class="brush: bash; title: ; toolbar: true; notranslate">alias patch_this='adpatch patchtop=`pwd` driver=`ls u*.drv` logfile=`ls u*.drv` defaultsfile=$DEFAULTSFILE workers=$WORKERS'
alias hotpatch_this='patch_this options=hotpatch'</pre>
<p>A few things to note about using these adpatch aliases:</p>
<ul>
<li>It is necessary to be in the directory containing the patch driver before invoking one of the aliases, for example:
<pre class="brush: bash; title: ; notranslate">	applr12@jpr12:~&gt; cd $EBS_PATCH/6510214
	applr12@jpr12:/opt/oracle/stage/patch/ebs/6510214&gt; patch_this</pre>
</li>
<li>The aliases will only work on patches with 'universal' drivers, not the old-style individual copy, generate, and database patch drivers.</li>
<li>The patch log file generated by using the aliases will have a .drv extension instead of .log. I've elected to live with the limitation rather than make the alias more complicated. <img src='http://only4left.jpiwowar.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
<li>Finally, it's necessary to define a WORKERS variable prior to using the aliases, either by exporting it in the .profile or defining it in an individual session.</li>
</ul>
<p>During the patching process, the following aliases help to monitor and manage workers via adctrl:</p>
<pre class="brush: bash; title: ; toolbar: true; notranslate">alias adctrl_base='adctrl defaultsfile=$DEFAULTSFILE'
alias show_workers='adctrl_base menu_option=SHOW_STATUS'
alias start_addist='adctrl_base distributed=y worker_range=$WORKER_RANGE'</pre>
<p><i>Update 04 Dec 2008:  Lon White over at the <a href="http://www.trioragroup.com/" title="The Triora Group">Triora Group</a> has a great (and more detailed) <a href="http://www.trioragroup.com/blog/archives/275" title="Automating E-Business Suite Patches | The Triora Group">description of automated patching</a> that is worth reading if you're unfamiliar with the idea of running adpatch non-interactively.</i></p>
<h3 id="interactive">Interactive or non-interactive?</h3>
<p>When setting up aliases for the AD utilities, I avoid using the <code>interactive=n</code> option.  It's a useful option in the right circumstances, but I do not place it in my aliases by default, because it interferes with my primary goal in creating the shortcuts:  typing less.  Consider the following, after an AutoConfig run that reset the value of the APPLSYS password in the defaults file:</p>
<pre class="brush: plain; title: ; notranslate">applr12@jpr12:~&gt; adadmin defaultsfile=$DEFAULTSFILE menu_option=DISABLE_MAINT_MODE interactive=n
(adadmin startup stuff snipped, until...)
***
Enter the ORACLE password of Application Object Library :
***

AD Administration could not find a response to the above prompt
or found an incorrect response in the defaults file.</pre>
<p>If I had run adadmin in normal, interactive mode, I would have been given a chance to enter the correct password the first time around.  Instead, I now have to re-run adadmin in interactive mode to provide the password.  More typing, not less.  Bah!</p>
<h3 id="notes">Closing notes and annoying preachiness</h3>
<ul>
<li>I've called this short series of posts is "Enhance your applmgr .profile," but it also could have been titled "Fun with AD utility command-line options."  Refer to the Oracle Applications Maintenance Utilities guides for <a title="11i AD Utilities Guide" href="http://download.oracle.com/docs/cd/B25516_18/current/acrobat/11iadutil.pdf">11i</a> and <a title="R12 AD utilities guide" href="http://download.oracle.com/docs/cd/B40089_09/current/acrobat/r12adutil.pdf">R12</a> for more information,  or run the various commands (adadmin, adpatch, adctrl) with the <code>help=y</code> option to see what's possible.</li>
<li>I've compiled a <a rel="attachment wp-att-14" href="http://only4left.jpiwowar.com/2008/06/enhance-your-applmgr-profile-ii/applmgr_profile/">sample applmgr .profile</a> that incorporates the ideas presented in these posts.  Feel free to copy it and revise as necessary to suit your environment.</li>
<li>And now for the preachy part: As fun as it can be to devise shortcuts for your favorite administrative tasks, resist the temptation to overdo it.  Remember, this is primarily about saving time and reducing errors. For example, while having an alias to bounce Apache services can be useful, assigning an alias to adstpall.sh is probably overkill.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://only4left.jpiwowar.com/2008/06/enhance-your-applmgr-profile-ii/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

