<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;AkEGQ3c7fip7ImA9WhBaGE4.&quot;"><id>tag:blogger.com,1999:blog-7032512792942232766</id><updated>2013-05-29T09:43:42.906-05:00</updated><category term="indexes" /><category term="i/o" /><category term="caddyshack" /><category term="rage against the machine" /><category term="buddy rich" /><category term="datatypes" /><category term="kitchen appliances" /><category term="postgresql" /><category term="cli" /><category term="cbo" /><category term="phones" /><category term="puschitz" /><category term="zero wing" /><category term="movies" /><category term="bugs" /><category term="jealousy" /><category term="sga" /><category term="hash" /><category term="pga" /><category term="csscan" /><category term="analytics" /><category term="listener" /><category term="hali" /><category term="upgrade" /><category term="liam" /><category term="yearbook" /><category term="rhel" /><category term="redhat" /><category term="asmm" /><category term="ayb" /><category term="locks" /><category term="xkcd" /><category term="bct" /><category term="11g" /><category term="seppuku" /><category term="marching band" /><category term="bind variables" /><category term="rhetoric" /><category term="hazing" /><category term="pan's labyrinth" /><category term="gifted" /><category term="doug" /><category term="gcj" /><category term="kids" /><category term="tbcsu" /><category term="launchy" /><category term="bomb" /><category term="soviet union" /><category term="resignation" /><category term="java" /><category term="authentication" /><category term="wifi" /><category term="commit" /><category term="utlrp" /><category term="pl/sql" /><category term="dilbert" /><category term="putty" /><category term="memory" /><category term="dst" /><category term="roller coasters" /><category term="happy new year" /><category term="beta" /><category term="oca" /><category term="em dbconsole" /><category term="constraints" /><category term="joins" /><category term="shutdown" /><category term="bands" /><category term="john paul jones" /><category term="design" /><category term="radiohead" /><category term="tora" /><category term="statistics" /><category term="ubuntu" /><category term="apocalypto" /><category term="what-a-screw" /><category term="ADR" /><category term="kevin federline" /><category term="lolcats" /><category term="sheboygan" /><category term="sprintf" /><category term="technorati" /><category term="orly" /><category term="pidgin" /><category term="diagnostics" /><category term="sql developer" /><category term="ocp" /><category term="tumblr" /><category term="ultimate frisbee" /><category term="quest" /><category term="grid" /><category term="warcraft" /><category term="charity" /><category term="licensing" /><category term="pumpkins" /><category term="tuning" /><category term="gimp" /><category term="irc" /><category term="salt" /><category term="x86_64" /><category term="inkscape" /><category term="assm" /><category term="utlirp" /><category term="recovery" /><category term="jonathan lewis" /><category term="osama" /><category term="dba" /><category term="migration" /><category term="music" /><category term="penny arcade" /><category term="athf" /><category term="nascar" /><category term="nocoug" /><category term="paypal" /><category term="sql" /><category term="sysdba" /><category term="walmart" /><category term="razr" /><category term="lnnvl" /><category term="horses" /><category term="gmail" /><category term="metalink" /><category term="diagnostic pack" /><category term="documentation" /><category term="black" /><category term="tkyte" /><category term="keys" /><category term="avatar" /><category term="red son" /><category term="jonathan coulton" /><category term="ora-00600" /><category term="seagal" /><category term="sqlplus" /><category term="wtf" /><category term="hjr" /><category term="date" /><category term="db2" /><category term="child's play" /><category term="patches" /><category term="library" /><category term="ora-01403" /><category term="electric mayhem" /><category term="asmcmd" /><category term="toad" /><category term="family" /><category term="sun" /><category term="roles" /><category term="snpp" /><category term="ocr" /><category term="barracuda" /><category term="muppets" /><category term="ACID" /><category term="blogs" /><category term="duplication" /><category term="cpu" /><category term="young" /><category term="backup" /><category term="calypso" /><category term="autotrace" /><category term="terror" /><category term="centos" /><category term="hasselhoff" /><category term="nothing important" /><category term="mysql" /><category term="security" /><category term="dogs" /><category term="pythian" /><category term="schneier" /><category term="global temporary tables" /><category term="csalter" /><category term="oracle" /><category term="paranoid android" /><category term="lore" /><category term="nerf" /><category term="permissions" /><category term="animal" /><category term="ben stein" /><category term="bomber net" /><category term="mufc" /><category term="buggery" /><category term="read consistency" /><category term="uw" /><category term="gallery" /><category term="morans" /><category term="nub" /><category term="tkprof" /><category term="passwords" /><category term="wait" /><category term="partitions" /><category term="load" /><category term="ussr" /><category term="youtube" /><category term="nls" /><category term="sql injection" /><category term="help" /><category term="harry belafonte" /><category term="mssql" /><category term="developers" /><category term="ldap" /><category term="transactions" /><category term="python" /><category term="internet" /><category term="parallel" /><category term="windows" /><category term="feuerstein" /><category term="cri moer" /><category term="explain plan" /><category term="hype" /><category term="hospitals" /><category term="superman" /><category term="linux" /><category term="cx_oracle" /><category term="oss" /><category term="children" /><category term="office" /><category term="birthday" /><category term="vacation" /><category term="otn" /><category term="warren buffett" /><category term="aang" /><category term="proxy users" /><category term="sniper rifles" /><category term="pio" /><category term="partition exchange" /><category term="null" /><category term="time" /><category term="asm" /><category term="pascal" /><category term="taz" /><category term="blogger" /><category term="the onion" /><category term="ojdbc" /><category term="dbwr" /><category term="history" /><category term="jboss" /><category term="microsoft" /><category term="rman" /><category term="revolution" /><category term="paranoia" /><category term="communism" /><category term="hurra torpedo" /><category term="money" /><title>die Seilerwerks</title><subtitle type="html">Chronicling Life, Love, Linux and Oracle database administration.</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://www.seiler.us/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://www.seiler.us/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/7032512792942232766/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>Don Seiler</name><uri>http://www.blogger.com/profile/06863841688485670148</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="29" height="32" src="http://2.bp.blogspot.com/-8TdBDfGw74I/TfDl-_rQAvI/AAAAAAAAAFc/tfscblA-9t8/s220/dtseiler_oraclenerd.jpg" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>358</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/DieSeilerwerks" /><feedburner:info uri="dieseilerwerks" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;CE8DRnc-fSp7ImA9WhBSEk0.&quot;"><id>tag:blogger.com,1999:blog-7032512792942232766.post-7030971187583798359</id><published>2013-02-15T13:47:00.005-06:00</published><updated>2013-02-18T09:54:37.955-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-02-18T09:54:37.955-06:00</app:edited><title>Views, Datatypes and Nulls</title><content type="html">Had an interesting little case come up today when helping a client re-write a view. This legacy application stored a date value as January 1, 1970 when they didn't have a date (basically using it as a de facto NULL). I did my best to lecture the client on why this was a horrible idea, but there was nothing we could do in the short term.&lt;br /&gt;
&lt;br /&gt;
Anyway, he had a view that would use a DECODE function to convert a date of 1970/01/01 to NULL, otherwise just pass the date through. However, we noticed that the view schema said the field was defined as varchar2(18) instead of date. Here is my example using a view on DBA_OBJECTS:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;SQL&amp;gt; create or replace view test_objects1 (object_name, created) as&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&amp;nbsp; 2 &amp;nbsp;select object_name, decode (created&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&amp;nbsp; 3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;, to_date('1970/01/01','yyyy/mm/dd')&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&amp;nbsp; 4 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;, null, created)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&amp;nbsp; 5 &amp;nbsp;from dba_objects;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;View created.&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;SQL&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;SQL&amp;gt; desc test_objects1;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&amp;nbsp;Name &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Null? &amp;nbsp; &amp;nbsp;Type&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&amp;nbsp;----------------------------------------- -------- -------------&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&amp;nbsp;OBJECT_NAME &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;VARCHAR2(128)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&amp;nbsp;CREATED &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;VARCHAR2(18)&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
I suggested we wrap that NULL in a to_date function just to see what happens, and sure enough that gives us what we want:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;SQL&amp;gt; create or replace view test_objects2 (object_name, created) as&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&amp;nbsp; 2 &amp;nbsp;select object_name, decode (created&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&amp;nbsp; 3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;, to_date('1970/01/01','yyyy/mm/dd')&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&amp;nbsp; 4 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;, to_date(null), created)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&amp;nbsp; 5 &amp;nbsp;from dba_objects;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;View created.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;SQL&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;SQL&amp;gt; desc test_objects2;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&amp;nbsp;Name &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Null? &amp;nbsp; &amp;nbsp;Type&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&amp;nbsp;----------------------------------------- -------- -------------&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&amp;nbsp;OBJECT_NAME &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;VARCHAR2(128)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&amp;nbsp;CREATED &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;DATE&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
It seems silly to wrap NULL in a TO_DATE, or do any function on a NULL value. One would hope that Oracle sees the NULL and short-circuits the function to avoid doing the unnecessary work.&lt;br /&gt;
&lt;br /&gt;
Update: Looks like this is &lt;a class="vt-p" href="http://docs.oracle.com/cd/B19306_01/server.102/b14200/functions040.htm" target="_blank"&gt;documented functionality in the DECODE function&lt;/a&gt;:&lt;br /&gt;
&lt;blockquote class="tr_bq"&gt;
Oracle automatically converts expr and each search value to the datatype of the first search value before comparing. Oracle automatically converts the return value to the same datatype as the first result. If the first result has the datatype CHAR or &lt;i&gt;if the first result is null, then Oracle converts the return value to the datatype VARCHAR2&lt;/i&gt;.&lt;/blockquote&gt;
&lt;br /&gt;
Update #2: Thanks to Sayan in the comments for tipping me off about NULLIF, which seems like the best option, doing exactly what we want without having to convert the type:&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&amp;nbsp;SQL&amp;gt; create or replace view test_objects3 (object_name, created) as&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&amp;nbsp; 2 &amp;nbsp;select object_name&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&amp;nbsp; 3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;, nullif (created&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&amp;nbsp; 4 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;, to_date('1970/01/01','yyyy/mm/dd'))&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&amp;nbsp; 5 &amp;nbsp;from dba_objects;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;View created.&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;SQL&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;SQL&amp;gt; desc test_objects3;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&amp;nbsp;Name &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Null? &amp;nbsp; &amp;nbsp;Type&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&amp;nbsp;----------------------------------------- -------- -------------&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&amp;nbsp;OBJECT_NAME &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;VARCHAR2(128)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&amp;nbsp;CREATED &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;DATE&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;img src="http://feeds.feedburner.com/~r/DieSeilerwerks/~4/w0q5Mo5eM3U" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.seiler.us/feeds/7030971187583798359/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.seiler.us/2013/02/views-datatypes-and-nulls.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7032512792942232766/posts/default/7030971187583798359?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7032512792942232766/posts/default/7030971187583798359?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DieSeilerwerks/~3/w0q5Mo5eM3U/views-datatypes-and-nulls.html" title="Views, Datatypes and Nulls" /><author><name>Don Seiler</name><uri>http://www.blogger.com/profile/06863841688485670148</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="29" height="32" src="http://2.bp.blogspot.com/-8TdBDfGw74I/TfDl-_rQAvI/AAAAAAAAAFc/tfscblA-9t8/s220/dtseiler_oraclenerd.jpg" /></author><thr:total>2</thr:total><feedburner:origLink>http://www.seiler.us/2013/02/views-datatypes-and-nulls.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0UDQHczeCp7ImA9WhBTEEo.&quot;"><id>tag:blogger.com,1999:blog-7032512792942232766.post-3371802102691123141</id><published>2013-02-02T12:00:00.000-06:00</published><updated>2013-02-05T08:41:11.980-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-02-05T08:41:11.980-06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="diagnostics" /><category scheme="http://www.blogger.com/atom/ns#" term="11g" /><category scheme="http://www.blogger.com/atom/ns#" term="ADR" /><category scheme="http://www.blogger.com/atom/ns#" term="dba" /><category scheme="http://www.blogger.com/atom/ns#" term="oracle" /><title>Learning to Love the ADR - Part 4: Incident Packaging Service</title><content type="html">&lt;i style="background-color: white; color: #666666; font-family: 'Trebuchet MS', Trebuchet, Verdana, sans-serif; font-size: 13px; line-height: 18px;"&gt;This post is the fourth (and final) in a short series about Oracle 11g ADR. These posts are based on the presentations I gave at the NoCOUG Summer Conference in August 2011 and at the RMOUG Training Days in February 2012.&lt;/i&gt;&lt;br /&gt;
&lt;i style="background-color: white; color: #666666; font-family: 'Trebuchet MS', Trebuchet, Verdana, sans-serif; font-size: 13px; line-height: 18px;"&gt;&lt;br /&gt;&lt;/i&gt;
&lt;br /&gt;
&lt;h3&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="line-height: 18px;"&gt;IPS&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;br /&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="line-height: 18px;"&gt;Any DBA that has had to file a support request with Oracle Support will be violently nodding their head in agreement when I ask if they've ever had Oracle Support ask for log file after trace file after log file after trace file. It's hard to not be cynical, especially when they sometimes request a file that was already provided! In 11g, Oracle has made some of that work easier by providing the Incident Packaging Service, or IPS, with the ADR. IPS lets you quickly and easily gather up diagnostic files related to a given incident, problem, or timeframe. You can also create empty packages and add whatever files you see fit.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="line-height: 18px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="line-height: 18px;"&gt;It all starts with the IPS CREATE PACKAGE command. This creates a logical package (no package files are created at this point) in the ADR. Various options include:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="line-height: 18px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style="color: #666666; font-family: Courier New, Courier, monospace;"&gt;&lt;span style="line-height: 18px;"&gt;adrci&amp;gt; ips create package incident &amp;lt;incident_id&amp;gt;;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="color: #666666; font-family: Courier New, Courier, monospace;"&gt;&lt;span style="line-height: 18px;"&gt;adrci&amp;gt; ips create package problem &amp;lt;problem_id&amp;gt;;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="color: #666666; font-family: Courier New, Courier, monospace;"&gt;&lt;span style="line-height: 18px;"&gt;adrci&amp;gt; ips create package problemkey "problem_key_string";&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="color: #666666; font-family: Courier New, Courier, monospace;"&gt;&lt;span style="line-height: 18px;"&gt;adrci&amp;gt; ips create package seconds &amp;lt;seconds_before_now&amp;gt;;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="color: #666666; font-family: Courier New, Courier, monospace;"&gt;&lt;span style="line-height: 18px;"&gt;adrci&amp;gt; ips create package time 'start_timestamp' to 'end_timestamp';&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="color: #666666; font-family: Courier New, Courier, monospace;"&gt;&lt;span style="line-height: 18px;"&gt;adrci&amp;gt; ips create package;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="line-height: 18px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="line-height: 18px;"&gt;It is definitely worth your while to review the output of &lt;span style="font-family: Courier New, Courier, monospace;"&gt;help ips create package&lt;/span&gt; to get details on these, as I won't be touching most of them any further. The last command listed creates an empty package, after which you can use the&amp;nbsp;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;ips add incident&lt;/span&gt; or &lt;span style="font-family: Courier New, Courier, monospace;"&gt;ips add file&lt;/span&gt; commands to add data to the package before generating it.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="line-height: 18px;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;span style="color: #666666;"&gt;&lt;span style="line-height: 18px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="line-height: 18px;"&gt;When you are ready to generate the package file to send to Oracle Support, run the IPS GENERATE PACKAGE command, e.g.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="line-height: 18px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="font-family: Courier New, Courier, monospace; line-height: 18px;"&gt;adrci&amp;gt; ips generate package 3 in /home/dts/files/;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="line-height: 18px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="line-height: 18px;"&gt;This will create a zip file in the specified directory. The package number is given to you when you first create the package, as our later example will demonstrate.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="line-height: 18px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="line-height: 18px;"&gt;Focusing on the first example, when you run "show incident" in adrci, it will provide you with the list of incidents and their incident numbers. If you feel the need to create an SR with Oracle Support for this incident, you can use that command to create a package based on that incident number, and then generate the package file for that package. However you can do both in one step using IPS PACK INCIDENT:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="line-height: 18px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="color: #666666; font-family: Courier New, Courier, monospace;"&gt;&lt;span style="line-height: 18px;"&gt;adrci&amp;gt; ips pack incident &amp;lt;incident_id&amp;gt; in &amp;lt;path&amp;gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="line-height: 18px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="line-height: 18px;"&gt;For eaxmple:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="line-height: 18px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="color: #666666; font-family: Courier New, Courier, monospace;"&gt;&lt;span style="line-height: 18px;"&gt;adrci&amp;gt; ips pack incident 13579 in /home/dts/files/;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="line-height: 18px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="line-height: 18px;"&gt;This command creates a package and generates the zip file in one step.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="line-height: 18px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;h3&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="line-height: 18px;"&gt;Example Time!&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="line-height: 18px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="line-height: 18px;"&gt;Now that I've bored you with the details, lets go through an example incident that you can reproduce in your sandboxes at home, as I'm doing now as I write this.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="line-height: 18px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;h4&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="line-height: 18px;"&gt;Step 1: Cause an Incident!&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;
&lt;div&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="line-height: 18px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="line-height: 18px;"&gt;Rather than really cause some harm to my sandbox, let's just set things up so something that normally wouldn't create an incident does so this once:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="line-height: 18px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="color: #666666;"&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style="line-height: 18px;"&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;SQL&amp;gt; alter session set events '942 incident(table_missing)';&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: 18px;"&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;Session altered.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: 18px;"&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: 18px;"&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;SQL&amp;gt; drop table doesnotexist;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: 18px;"&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;drop table doesnotexist&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: 18px;"&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;*&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: 18px;"&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;ERROR at line 1:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: 18px;"&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;ORA-00942: table or view does not exist&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: 18px;"&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: 18px;"&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;SQL&amp;gt; alter session set events '942 trace name context off';&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: 18px;"&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;Session altered.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: 18px;"&gt;
&lt;span style="color: #666666;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: 18px;"&gt;
&lt;span style="color: #666666;"&gt;Viewing the trace (human-readable text) alert log:&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: 18px;"&gt;
&lt;span style="color: #666666;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="line-height: 18px;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;Wed Jan 30 13:56:20 2013&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="line-height: 18px;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;Errors in file /home/oracle/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_ora_25751.trc &amp;nbsp;(incident=10993):&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="line-height: 18px;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;ORA-00700: soft internal error, arguments: [EVENT_CREATED_INCIDENT], [942], [TABLE_MISSING], [], [], [], [], [], [], [], [], []&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="line-height: 18px;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;ORA-00942: table or view does not exist&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="line-height: 18px;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;Incident details in: /home/oracle/app/oracle/diag/rdbms/orcl/orcl/incident/incdir_10993/orcl_ora_25751_i10993.trc&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="line-height: 18px;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;Wed Jan 30 13:56:25 2013&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="line-height: 18px;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;Dumping diagnostic data in directory=[cdmp_20130130135624], requested by (instance=1, osid=25751), summary=[incident=10993].&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="line-height: 18px;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;Wed Jan 30 13:56:25 2013&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="line-height: 18px;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;Sweep [inc][10993]: completed&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="line-height: 18px;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;Sweep [inc2][10993]: completed&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style="line-height: 18px;"&gt;
&lt;span style="color: #666666;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;h4&gt;
&lt;span style="color: #666666;"&gt;Step 2: Use ADRCI to view the incident&lt;/span&gt;&lt;/h4&gt;
&lt;div&gt;
&lt;span style="color: #666666;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: 18px;"&gt;
&lt;span style="color: #666666;"&gt;So our weary DBA is awaked by a page from the monitoring system and can now quickly see what the problem was without having to track down alert log locations and such.&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: 18px;"&gt;
&lt;span style="color: #666666;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="line-height: 18px;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;[oracle@localhost ~]$ adrci&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="line-height: 18px;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="line-height: 18px;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;ADRCI: Release 11.2.0.2.0 - Production on Wed Jan 30 13:58:29 2013&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="line-height: 18px;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="line-height: 18px;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;Copyright (c) 1982, 2009, Oracle and/or its affiliates. &amp;nbsp;All rights reserved.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="line-height: 18px;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="line-height: 18px;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;ADR base = "/home/oracle/app/oracle"&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="line-height: 18px;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;adrci&amp;gt; show homes&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="line-height: 18px;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;ADR Homes:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="line-height: 18px;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;diag/rdbms/orcl/orcl&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="line-height: 18px;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;diag/tnslsnr/localhost/listener&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="line-height: 18px;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;adrci&amp;gt; set home diag/rdbms/orcl/orcl&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="line-height: 18px;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;adrci&amp;gt; show incident&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="line-height: 18px;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="line-height: 18px;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;ADR Home = /home/oracle/app/oracle/diag/rdbms/orcl/orcl:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="line-height: 18px;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;*************************************************************************&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="line-height: 18px;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;INCIDENT_ID &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;PROBLEM_KEY &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CREATE_TIME&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="line-height: 18px;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;-------------------- ----------------------------------------------------------- ----------------------------------------&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="line-height: 18px;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;10993 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ORA 700 [EVENT_CREATED_INCIDENT] [942] [TABLE_MISSING] &amp;nbsp; &amp;nbsp; &amp;nbsp;2013-01-30 13:56:20.294000 -06:00&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="line-height: 18px;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;1 rows fetched&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: 18px;"&gt;
&lt;span style="color: #666666;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style="line-height: 18px;"&gt;
&lt;span style="color: #666666;"&gt;Here we see the INCIDENT_ID is 10993, which we'll need to reference later. Now let's assume it's something more sinister and we feel the need to file an SR with Oracle Support and want to upload some files.&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: 18px;"&gt;
&lt;span style="color: #666666;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;h4&gt;
&lt;span style="color: #666666;"&gt;Step 3: Create a Package!&lt;/span&gt;&lt;/h4&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style="color: #666666;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;adrci&amp;gt; ips create package incident 10993;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;Created package 1 based on incident id 10993, correlation level typical&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;adrci&amp;gt; ips generate package 1 in /home/oracle;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;Generated package 1 in file /home/oracle/ORA700EVE_20130130140011_COM_1.zip, mode complete&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #666666;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #666666;"&gt;... or ...&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #666666;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;adrci&amp;gt; ips pack incident 10993;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;Generated package 2 in file /home/oracle/ORA700EVE_20130130140052_COM_1.zip, mode complete&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #666666;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #666666;"&gt;Both methods achieve the same result, with the exception of the resulting package file name, which as you can see is based on YYYYMMDDHH24MMSS date format. You can see that a new package is generated (1 vs 2). The zip file that is created is a standard zip file, you can use unzip -l &amp;lt;file_name&amp;gt; to look at the contents if you wish. You'll see a number of .dmp files, along with the XML and trace alert log files and other trace files that Oracle has deemed relevant to its needs. Alternatively, you can use IPS to query this information as well:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #666666;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;adrci&amp;gt; ips show files package &amp;lt;package_number&amp;gt;;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #666666;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #666666;"&gt;This will give you a nicely formatted listing of each file in the package, with some metadata for each file.&amp;nbsp;&lt;/span&gt;&lt;span style="color: #666666;"&gt;All that's left now is to upload the package zip file to your SR and hope that Oracle Support can see what they need to see!&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
Well, that's it folks. Hopefully you found this somewhat informative and it leads you to do a little more digging into ADRCI on your own. At the very least you can now get rid of those ugly alert log text scraping scripts!&lt;/div&gt;
&lt;img src="http://feeds.feedburner.com/~r/DieSeilerwerks/~4/krnfXm_gDq0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.seiler.us/feeds/3371802102691123141/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.seiler.us/2013/02/learning-to-love-adr-part-4-incident.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7032512792942232766/posts/default/3371802102691123141?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7032512792942232766/posts/default/3371802102691123141?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DieSeilerwerks/~3/krnfXm_gDq0/learning-to-love-adr-part-4-incident.html" title="Learning to Love the ADR - Part 4: Incident Packaging Service" /><author><name>Don Seiler</name><uri>http://www.blogger.com/profile/06863841688485670148</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="29" height="32" src="http://2.bp.blogspot.com/-8TdBDfGw74I/TfDl-_rQAvI/AAAAAAAAAFc/tfscblA-9t8/s220/dtseiler_oraclenerd.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.seiler.us/2013/02/learning-to-love-adr-part-4-incident.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUEAQXw4cSp7ImA9WhNaFkk.&quot;"><id>tag:blogger.com,1999:blog-7032512792942232766.post-7131913806636502068</id><published>2013-01-30T19:00:00.000-06:00</published><updated>2013-01-31T08:47:20.239-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-01-31T08:47:20.239-06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="diagnostics" /><category scheme="http://www.blogger.com/atom/ns#" term="11g" /><category scheme="http://www.blogger.com/atom/ns#" term="ADR" /><category scheme="http://www.blogger.com/atom/ns#" term="dba" /><category scheme="http://www.blogger.com/atom/ns#" term="oracle" /><title>Learning to Love the ADR - Part 3: Purging (Out With The Old)</title><content type="html">&lt;br /&gt;
&lt;i style="background-color: white; color: #666666; font-family: 'Trebuchet MS', Trebuchet, Verdana, sans-serif; font-size: 13px; line-height: 18px;"&gt;This post is the third in a short series about Oracle 11g ADR. These posts are based on the presentations I gave at the NoCOUG Summer Conference in August 2011 and at the RMOUG Training Days in February 2012.&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
One of the benefits of the new ADR system is the automatic file maintenance (archiving and cleanup) that I mentioned earlier. Depending on the type of file it is, XML log and trace file maintenance is governed by either the long or short purge policy. The values of these policies can be observed from the ADRCI command "show control", e.g.:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;adrci&amp;gt; show control&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;ADR Home = /home/oracle/app/oracle/diag/rdbms/orcl/orcl:&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;*************************************************************************&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;ADRID &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;b&gt;&lt;span style="color: red;"&gt;SHORTP_POLICY&lt;/span&gt;&lt;/b&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;b&gt;&lt;span style="color: red;"&gt;LONGP_POLICY&lt;/span&gt;&lt;/b&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; LAST_MOD_TIME &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;LAST_AUTOPRG_TIME &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;LAST_MANUPRG_TIME &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ADRDIR_VERSION &amp;nbsp; &amp;nbsp; &amp;nbsp; ADRSCHM_VERSION &amp;nbsp; &amp;nbsp; &amp;nbsp;ADRSCHMV_SUMMARY &amp;nbsp; &amp;nbsp; ADRALERT_VERSION &amp;nbsp; &amp;nbsp; CREATE_TIME&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;-------------------- -------------------- -------------------- ---------------------------------------- ---------------------------------------- ---------------------------------------- -------------------- -------------------- -------------------- -------------------- ----------------------------------------&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;1335663986 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;b&gt;&lt;span style="color: red;"&gt;720&lt;/span&gt;&lt;/b&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style="color: red;"&gt;&lt;b&gt;8760&lt;/b&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2012-03-28 09:46:07.813608 -05:00 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2012-09-18 22:19:08.939553 -05:00 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;80 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2012-03-28 09:46:07.813608 -05:00&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
I've highlighted the column names and values in red. It doesn't format very well in the terminal either.&lt;br /&gt;
&lt;br /&gt;
Let's break it down.&lt;br /&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
&lt;h3&gt;
Short Purge Policy - SHORTP_POLICY&lt;/h3&gt;
The short purge policy governs files that usually need to be retained for only a short period of time. This includes trace files, core dumps and packaging information files (from IPS, which we'll cover later).&lt;br /&gt;
&lt;br /&gt;
This policy is identified by the name "SHORTP_POLICY" and the value is represented in hours. The default SHORTP_POLICY is 720 hours, or 30 days. The maximum value is 35,791,394 hours, which is over 4,000 years. Hopefully you don't need any more time than this to retain your files. You can set the value to 0 to indicate that all files under this policy are immediately available for purging.&lt;br /&gt;
&lt;br /&gt;
To set this value, you must use the "set control" command in ADRCI. For example, to set it to 168 hours (7 days), we would use this command:&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;adrci&amp;gt; set control (shortp_policy=168);&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
Long Purge Policy - LONGP_POLICY&lt;/h3&gt;
&lt;div&gt;
Alert logs, incident info and incident dump files are all governed by the long purge policy, known by LONGP_POLICY in the ADR. The default retention time is 8,760 hours, or 365 days. It has the same maximum value as the short purge policy, and similar behavior when the value is set to zero. Similarly, to set the value for LONGP_POLICY to 1,440 hours (60 days):&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;adrci&amp;gt; set control (longp_policy=1440);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style="font-family: inherit;"&gt;You can use show control again to view the new settings:&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;adrci&amp;gt; show control;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;ADR Home = /home/oracle/app/oracle/diag/rdbms/orcl/orcl:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;*************************************************************************&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;ADRID &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SHORTP_POLICY &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;LONGP_POLICY &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; LAST_MOD_TIME &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;LAST_AUTOPRG_TIME &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;LAST_MANUPRG_TIME &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ADRDIR_VERSION &amp;nbsp; &amp;nbsp; &amp;nbsp; ADRSCHM_VERSION &amp;nbsp; &amp;nbsp; &amp;nbsp;ADRSCHMV_SUMMARY &amp;nbsp; &amp;nbsp; ADRALERT_VERSION &amp;nbsp; &amp;nbsp; CREATE_TIME&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;-------------------- -------------------- -------------------- ---------------------------------------- ---------------------------------------- ---------------------------------------- -------------------- -------------------- -------------------- -------------------- ----------------------------------------&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;1335663986 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;b&gt;&lt;span style="color: red;"&gt;168&lt;/span&gt;&lt;/b&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style="color: red;"&gt;&lt;b&gt;1440&lt;/b&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2012-12-28 14:18:02.894677 -06:00 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2012-09-18 22:19:08.939553 -05:00 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;80 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2012-03-28 09:46:07.813608 -05:00&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;1 rows fetched&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h3&gt;
Purge Job&lt;/h3&gt;
&lt;div&gt;
Now just because a file is eligible to be purged doesn't mean it will be purged soon. It means they will be purged when the instance's purge job runs next, and that could take up to a week. The purge job is an MMON slave task, and only runs once every 7 days, according to MOS Doc ID 975448.1. So don't play around with the long or short policy values thinking they will trigger an instant cleanup (like you would expect if you changed the FRA size below the current used space).&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
There is however a known bug (9500575) that affects Oracle 11.1.0.7 &amp;amp; 11.2.0.1 where alert log XML files for listeners are not automatically purged. This has the potential then to fill up the disk where these logs are written to.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h3&gt;
PURGE Command&lt;/h3&gt;
&lt;div&gt;
You can manually purge files from ADRCI with the PURGE command. One common use is to purge files of a certain type older than a certain age. For example, to overcome the listener log purge bug that was just mentioned, you could schedule this to run weekly (ADRCI can be called from the command-line or cron with commands to run):&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;adrci&amp;gt; purge -age 10080 -type alert;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
This purges all alert logs older than 10,080 minutes. Note that the -age parameter here is in minutes, where as the policy values are in hours.&lt;br /&gt;
&lt;br /&gt;
Similarly you could choose to purge all files for a specific incident ID (assuming you are certain you don't need them and can't wait for them to automatically be purged out) with the -i option:&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;adrci&amp;gt; purge -i 13579;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
For more options, type "help purge" at the ADRCI prompt. I can't stress enough how good the ADRCI help facility is.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;img src="http://feeds.feedburner.com/~r/DieSeilerwerks/~4/NLjyFxCpK5E" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.seiler.us/feeds/7131913806636502068/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.seiler.us/2013/01/learning-to-love-adr-part-3-purging-out.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7032512792942232766/posts/default/7131913806636502068?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7032512792942232766/posts/default/7131913806636502068?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DieSeilerwerks/~3/NLjyFxCpK5E/learning-to-love-adr-part-3-purging-out.html" title="Learning to Love the ADR - Part 3: Purging (Out With The Old)" /><author><name>Don Seiler</name><uri>http://www.blogger.com/profile/06863841688485670148</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="29" height="32" src="http://2.bp.blogspot.com/-8TdBDfGw74I/TfDl-_rQAvI/AAAAAAAAAFc/tfscblA-9t8/s220/dtseiler_oraclenerd.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.seiler.us/2013/01/learning-to-love-adr-part-3-purging-out.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0YMQH08fCp7ImA9WhNaFUo.&quot;"><id>tag:blogger.com,1999:blog-7032512792942232766.post-7167786897583205705</id><published>2013-01-29T10:50:00.001-06:00</published><updated>2013-01-30T14:53:01.374-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-01-30T14:53:01.374-06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="diagnostics" /><category scheme="http://www.blogger.com/atom/ns#" term="11g" /><category scheme="http://www.blogger.com/atom/ns#" term="ADR" /><category scheme="http://www.blogger.com/atom/ns#" term="dba" /><category scheme="http://www.blogger.com/atom/ns#" term="oracle" /><title>Learning to Love the ADR - Part 2: Diagnostic Files and ADRCI</title><content type="html">&lt;i style="background-color: white; color: #666666; font-family: 'Trebuchet MS', Trebuchet, Verdana, sans-serif; font-size: 13px; line-height: 18px;"&gt;This post is the second in a short series about Oracle 11g ADR. These posts are based on the presentations I gave at the NoCOUG Summer Conference in August 2011 and at the RMOUG Training Days in February 2012.&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
Wherever the DIAGNOSTIC_DEST is (remember that the default is the $ORACLE_BASE value), Oracle will create a "diag" directory underneath it. Under this you'll find directories based on instance type, for example "rdbms" or "asm" or "tnslsnr". Dig deeper to find directories per database/instance and then the alert, trace, incident, etc. files. What is new with the ADR is the use of XML files for the alert log, as "log.xml" in the "alert" directory. The human-readable alert_XXX.log that you're used to is now in the "trace" directory. One important distinction is that the XML files are maintained by Oracle, archived once they reach 10Mb in size and purged based on policy settings that you can define. The trace files, just as with previous versions, require you to set up some sort of regular rotation/archiving/purging to prevent them from growing out of control. There are other advantages to the XML files, as we'll see in future posts.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
SO. MANY. FILES.&lt;/h3&gt;
Another not-so-fun surprise for those upgrading to Oracle 11g is that the new version generates a LOT more trace data than before. If you monitor those directories for size, your thresholds are likely to be blown away. Some of this was tamed in 11gR2, thankfully. One way to help cut back on some of trace (trc/trm suffixes) file generation is to set the hidden parameter _disable_health_check to TRUE. As with any hidden/underscore parameter, do NOT set this without approval from Oracle support (at least not in production). Another way which is easier, is to run regular PURGE jobs via adrci, which we will get to in another post.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
Problems and Incidents&lt;/h3&gt;
Oracle and the ADR nicely track problems and incidents. It is important to note that they are not one and the same. Problems are critical errors in the database (eg ORA-00600, 07445, 04031, etc). An incident is a single occurrence of a problem. When an incident occurs, Oracle creates incident trace files in addition to the normal alert log message and error trace file. You'll see this noted after the "Incident details in:" line in the alert log. For example:&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;Incident details in: /home/oracle/app/oracle/diag/rdbms/orcl/orcl/incident/incdir_12201/orcl_ora_18457_i12201.trc&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;span style="font-family: inherit;"&gt;However, there is a smarter way to look for incidents and alerts than scraping the human-readable alert log like some kind of animal. We'll use the ADRCI.&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: inherit;"&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;span style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;h2&gt;
ADRCI&lt;/h2&gt;
&lt;div&gt;
ADRCI is the command-line tool to navigate and manage the ADR. The name itself stands for ADR Command Interpreter. When you launch ADRCI, you have to point it to a specific home directory to work under. You first get the list of homes with the "show homes" command, and then set the home you wish to work on. E.g.:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;[oracle@localhost ~]$ adrci&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;ADRCI: Release 11.2.0.2.0 - Production on Fri Dec 28 14:32:41 2012&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;Copyright (c) 1982, 2009, Oracle and/or its affiliates. &amp;nbsp;All rights reserved.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;ADR base = "/home/oracle/app/oracle"&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;adrci&amp;gt; show homes&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;ADR Homes:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;diag/rdbms/orcl/orcl&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;diag/tnslsnr/localhost/listener&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;adrci&amp;gt; set home diag/rdbms/orcl/orcl&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Now I can view incident and alert log information pertaining to my database home. If I wanted to troubleshoot problems with my listener, I would set the home to that directory instead.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
ADRCI HELP&lt;/h3&gt;
Everything you want to know about ADRCI commands can be found by using the help facility with in ADRCI, it is really very well documented. I'm not going to explain everything you can do with ADRCI here, but do want to cover a few of the more useful commands. One listing I would take the time to digest is:&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;adrci&amp;gt; help show alert&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
You'll be glad you did. And that takes us into ...&lt;br /&gt;
&lt;h3&gt;
&lt;/h3&gt;
&lt;h3&gt;
Viewing Alert Log with ADRCI&lt;/h3&gt;
One of the most useful features of ADRCI is being able to view the alert log. You can even use it to view a running tail of the alert log (even on Windows!). Everything starts with the "show alert" command. By default this will open the entire alert log in an external text editor (like Notepad or vim, it is based on the editor option), unless the "-term" option is specified. To get our running tail, we would use this command:&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;adrci&amp;gt; show alert -tail -f&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Note that the -tail option implies the -term.&lt;br /&gt;
&lt;br /&gt;
Now this by itself isn't anything new. Where the real power comes in is in the ability for adrci to show alert log entries based on predicate searches. Again, the "&lt;span style="font-family: Courier New, Courier, monospace;"&gt;help show alert&lt;/span&gt;" command will show you all of the options, but one quick example would be this:&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;adrci&amp;gt; show alert -p "message_text like '%ORA-%'" -term;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
This will return any alert log entries that have a message body containing an ORA- error. This is much smarter than running grep on the text alert log since it includes message timestamps and other contextual information than just getting a line of text. One thing to note is that the search is case-sensitive, and so far I haven't seen any way around that (no upper or lower function in adrci). You can also do patter-matching on other fields, such as host_id, user_id, originating_timestamp, etc.&lt;br /&gt;
&lt;br /&gt;
For example, to get a list of all alert log messages in the last hour:&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;adrci&amp;gt; show alert -p "originating_timestamp &amp;gt;= systimestamp-1/24" -term;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Or, to get all ORA-600 messages in the last 30 days:&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;adrci&amp;gt; show alert -p "originating_timestamp &amp;gt;= systimestamp-30 and message_text like '%ORA-600%'" -term;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
It should be obvious by now that this is perfect for alert log monitoring scripts. ADRCI can execute scripts and spool output to log files as well, just as SQL*Plus does. This leads us to ...&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;
What about those incidents?&lt;/h4&gt;
Ah yes. This all started because we wanted a quick way to find incidents reported in our database. Well, here it is:&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;adrci&amp;gt; show incident&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
That's it. You'll get a list of the incidents recorded in the ADRCI (based on the available XML data), including the incident ID, problem key and time of the incident. Later in this series, I'll set up an incident to demonstrate how a typical on-call DBA can use ADRCI for quick troubleshooting and information gathering using the incident ID.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
ADRCI Scripts&lt;/h3&gt;
&lt;/div&gt;
&lt;div&gt;
I'm the master of the segue. Anyway, as I said, ADRCI can call scripts just like SQL*Plus. And, like SQL*Plus, it uses the "@" sign to execute them interactively:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
adrci&amp;gt; @/home/dts/scripts/test.adrci&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
You can also tell adrci to execute a script from the command line, like this:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
$ adrci script=/home/dts/scripts/test.adrci&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Here's an example script that you might use to monitor the alert log for ORA errors in the past 5 minutes and write them to a log file:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;# ADRCI script to find alert log errors&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;SPOOL /home/dts/logs/alert_log_errors.log&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;ECHO "ALERT LOG ERRORS:";&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;SET HOMEPATH diag/rdbms/orcl/orcl;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;SHOW ALERT -TERM -P "MESSAGE_TEXT LIKE '%ORA-%'&amp;nbsp;AND ORIGINATING_TIMESTAMP &amp;gt;= SYSTIMESTAMP-5/1440";&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;SPOOL OFF&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
The semi-colon line terminator is optional, the script runs the same with or without them. As you can see, the pound character "#" is used to start comments, and the "echo" command just outputs text. Output from one example run on my sandbox is:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;ALERT LOG ERRORS:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;ADR Home = /home/oracle/app/oracle/diag/rdbms/orcl/orcl:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;*************************************************************************&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;2012-07-12 11:40:06.309000 -05:00&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;ORA-1543 signalled during: create temporary tablespace migtemp&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;tempfile size 1G...&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
For my next article, however, we'll do a quick look at how the ADR purges old log files, and when it might not do so.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
30 January 2013 ADDENDUM: X$DBGALERTEXT&lt;/h3&gt;
&lt;br /&gt;
I was working on the rest of this series when I realized I forgot to mention X$DBALERTEXT. You (or your monitoring scripts) can query X$DBALERTEXT to get the same information as ADRCI does. This is an external table that references all of the log*.xml files, and so is dependent on those files being where they should be (just like ADRCI). According to MOS Doc ID 961682.1, this data is "effectively indexed by date," so date-based queries are "efficient and performant."&lt;br /&gt;
&lt;br /&gt;
There is an inst_id column in this table, but from my tests it is NOT RAC-aware. The only data I could see was from the local node.&lt;br /&gt;
&lt;br /&gt;
As of Oracle 11.2, there is a related view named V$DIAG_ALERT_EXT, which is for all intents and purposes, the same as X$DBGALERTEXT. However the new view includes alert information from ALL homes under the ADR (ASM, listeners, clients, etc.).&lt;/div&gt;
&lt;img src="http://feeds.feedburner.com/~r/DieSeilerwerks/~4/oobeGHRlRfQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.seiler.us/feeds/7167786897583205705/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.seiler.us/2013/01/learning-to-love-adr-part-2-diagnostic.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7032512792942232766/posts/default/7167786897583205705?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7032512792942232766/posts/default/7167786897583205705?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DieSeilerwerks/~3/oobeGHRlRfQ/learning-to-love-adr-part-2-diagnostic.html" title="Learning to Love the ADR - Part 2: Diagnostic Files and ADRCI" /><author><name>Don Seiler</name><uri>http://www.blogger.com/profile/06863841688485670148</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="29" height="32" src="http://2.bp.blogspot.com/-8TdBDfGw74I/TfDl-_rQAvI/AAAAAAAAAFc/tfscblA-9t8/s220/dtseiler_oraclenerd.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.seiler.us/2013/01/learning-to-love-adr-part-2-diagnostic.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkEAQX4zfSp7ImA9WhNSE0w.&quot;"><id>tag:blogger.com,1999:blog-7032512792942232766.post-3671807443227556628</id><published>2012-10-26T15:07:00.001-05:00</published><updated>2012-10-27T01:17:20.085-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-10-27T01:17:20.085-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="diagnostics" /><category scheme="http://www.blogger.com/atom/ns#" term="11g" /><category scheme="http://www.blogger.com/atom/ns#" term="ADR" /><category scheme="http://www.blogger.com/atom/ns#" term="dba" /><category scheme="http://www.blogger.com/atom/ns#" term="oracle" /><title>Learning to Love the ADR - Part 1: Location, Location, Location!</title><content type="html">&lt;i&gt;This post is the first in a short series about Oracle 11g ADR. These posts are based on the presentations I gave at the NoCOUG Summer Conference in August 2011 and at the RMOUG Training Days in February 2012.&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
The Automatic Diagnostic Repository, or "ADR", is a location on disk where an Oracle instance keeps many files of diagnostic data that tools like Enterprise Manager or ADR Command Interpreter (adrci) use for gathering and presenting information to the user. When we refer to diagnostic files, we are talking about:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Alert logs (RDBMS instance, ASM instance, Listener)&lt;/li&gt;
&lt;li&gt;Trace files (e.g. 10046 or 10053 as well as system-generated)&lt;/li&gt;
&lt;li&gt;Core dumps&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
Now in prior versions of Oracle, you would expect to find these files under $ORACLE_BASE/admin/$ORACLE_SID in bdump, cdump or udump, by default. You could always specify different locations with the %_DUMP_DEST initialization parameters, of course. The log files would grow ad infinitum if not properly rotated, compressed, archived and/or truncated, possibly causing some headaches with disk space management.&lt;br /&gt;
&lt;br /&gt;
As of Oracle 11g, however, much (but not all) of this is managed by the instance now. As an added bonus, Oracle moved the locations of these files, as I'm sure many of you with alert log monitoring software have found out by now.&amp;nbsp;The thing that catches most DBAs off-guard when upgrading to 11g is the change in location for these files, especially the alert log.&lt;br /&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Well, Oracle Corporation has seen fit to unify all these various alert, trace and dump files under the ADR location, which is specified in the DIAGNOSTIC_DEST initialization parameter. This one parameter replaces all of the %_DUMP_DEST parameters, and defaults to the value of the $ORACLE_BASE environment variable &lt;i&gt;at the time of instance startup&lt;/i&gt;. If the $ORACLE_BASE environment variable is unset, then DIAGNOSTIC_DEST defaults to $ORACLE_HOME/log.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;h3&gt;
Beware the ORACLE_BASE&lt;/h3&gt;
&lt;/div&gt;
&lt;div&gt;
Note that I emphasized "at the time of instance startup" earlier. This is important because you may come across servers where the ORACLE_BASE variable might not be defined when the instance is first started. In this case the ADR will be under $ORACLE_HOME/log. Then a DBA consultant might come along and standardize the login profile with an ORACLE_BASE setting, and upon next startup the DIAGNOSTIC_DEST will move. This can make things confusing for DBAs trying to find older diagnostic files in the new ADR location if they don't know (and rarely expect) this kind of situation. Yet it is one that I have personally witnessed and was one of the initial motivations for me to put this presentation together and learn more about the ADR for my own benefit.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Let's demonstrate this quickly. I have my working 11.2.0.1 sandbox on Oracle Linux. I set the full slate of environment vars via oraenv:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;[oracle@localhost ~]$ . oraenv&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;ORACLE_SID = [oracle] ? ora11201&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;The Oracle base for ORACLE_HOME=/oracle/app/oracle/product/11.2.0/dbhome_1 is /oracle/app/oracle&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Then I launch sqlplus and start the instance, then check the diagnostic_dest parameter value:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;SQL&amp;gt; show parameter diagnost&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;NAME &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; TYPE &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;VALUE&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;------------------------------------ ----------- ------------------------------&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;diagnostic_dest &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;string &amp;nbsp; &amp;nbsp; &amp;nbsp;/oracle/app/oracle&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
That is as expected. I can verify that my ADR files exist under there&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;[oracle@localhost ~]$ ls /oracle/app/oracle/diag/rdbms/ora11201/ora11201/&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;alert &amp;nbsp;cdump &amp;nbsp;hm &amp;nbsp;incident &amp;nbsp;incpkg &amp;nbsp;ir &amp;nbsp;lck &amp;nbsp;metadata &amp;nbsp;stage &amp;nbsp;sweep &amp;nbsp;trace&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Now, shutdown the database and create a pfile from the spfile (if you use an spfile). Then be sure rename the spfile so it isn't used during startup. Next we unset the necessary initialization parameters and environment variable.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;[oracle@localhost dbs]$ echo $ORACLE_BASE&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;/oracle/app/oracle&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;[oracle@localhost dbs]$ unset ORACLE_BASE&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;[oracle@localhost dbs]$ echo $ORACLE_BASE&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;[oracle@localhost dbs]$ vi initora11201.ora&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;[oracle@localhost dbs]$ grep "#" initora11201.ora&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;#ora11201.__oracle_base='/oracle/app/oracle'#ORACLE_BASE set from environment&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;#*.diagnostic_dest='/oracle/app/oracle'&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Note I also had to comment out the __oracle_base instance parameter value in the pfile. At this point our instance will have no knowledge or ties to the old ORACLE_BASE. Now, log back into sqlplus and startup (or even just startup nomount) and check again:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;SQL&amp;gt; show parameter diagnostic_dest&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;NAME &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; TYPE &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;VALUE&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;------------------------------------ ----------- ------------------------------&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;diagnostic_dest &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;string &amp;nbsp; &amp;nbsp; &amp;nbsp;/oracle/app/oracle/product/11.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2.0/dbhome_1/log&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
You can see we're now using the value of $ORACLE_HOME/log. Look under that directory and you'll indeed find the full set of ADR files you would expect:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;[oracle@localhost dbs]$ ls /oracle/app/oracle/product/11.2.0/dbhome_1/log/diag/rdbms/ora11201/ora11201/&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;alert &amp;nbsp;cdump &amp;nbsp;hm &amp;nbsp;incident &amp;nbsp;incpkg &amp;nbsp;ir &amp;nbsp;lck &amp;nbsp;metadata &amp;nbsp;stage &amp;nbsp;sweep &amp;nbsp;trace&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
The only problem is that it doesn't have any of the history contained in the files in the old ADR.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
The bottom line? Be careful and make sure your $ORACLE_BASE is properly set and I strongly advise you to &lt;b&gt;explicitly set your diagnostic_dest&lt;/b&gt; initialization parameter so it doesn't rely on environment variables.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;h3&gt;
V$DIAG_INFO&lt;/h3&gt;
&lt;/div&gt;
&lt;div&gt;
Other than checking the diagnostic_dest value, you can also query the view V$DIAG_INFO to see where everything is going:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;SQL&amp;gt; select name, value from v$diag_info;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;NAME &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;VALUE&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;--------------------- ---------------------------------------------------------&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;Diag Enabled &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;TRUE&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;ADR Base &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;/oracle/app/oracle&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;ADR Home &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;/oracle/app/oracle/diag/rdbms/ora11201/ora11201&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;Diag Trace &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;/oracle/app/oracle/diag/rdbms/ora11201/ora11201/trace&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;Diag Alert &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;/oracle/app/oracle/diag/rdbms/ora11201/ora11201/alert&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;Diag Incident &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /oracle/app/oracle/diag/rdbms/ora11201/ora11201/incident&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;Diag Cdump &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;/oracle/app/oracle/diag/rdbms/ora11201/ora11201/cdump&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;Health Monitor &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;/oracle/app/oracle/diag/rdbms/ora11201/ora11201/hm&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;Default Trace File &amp;nbsp; &amp;nbsp;/oracle/app/oracle/diag/rdbms/ora11201/ora11201/trace/&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;ora1&lt;/span&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;1201_ora_16064.trc&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;NAME &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;VALUE&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;--------------------- ---------------------------------------------------------&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;Active Problem Count &amp;nbsp;0&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;Active Incident Count 0&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;11 rows selected.&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;h3&gt;
Deprecated Variables&lt;/h3&gt;
&lt;/div&gt;
&lt;div&gt;
Now the old %_DUMP_DEST initialization parameters are deprecated and will default to values based on the DIAGNOSTIC_DEST value. But, while I'm here, let's test another question that's rattled around my brain: What happens if we set both DIAGNOSTIC_DEST and BACKGROUND_DUMP_DEST to different paths?&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
To test, I quickly made a bdump directory in my user home and set the old background_dump_dest value in the pfile:&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;[oracle@localhost dbs]$ grep background_dump_dest initora11201.ora&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;*.background_dump_dest='/home/oracle/test_bdump';&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
I'll note that I've also uncommented the diagnosted_dest value from before. Now, we startup and we immediately get a note that we're using a parameter that some might call "old and busted", but the instance does start as normal:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;SQL&amp;gt; startup&lt;br /&gt;&lt;span style="color: red;"&gt;ORA-32004: obsolete or deprecated parameter(s) specified for RDBMS instance&lt;/span&gt;&lt;br /&gt;ORACLE instance started.&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Now when we check, we see that Oracle just completely ignored the setting we specified for the old parameter:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;SQL&amp;gt; show parameter diagnostic_dest&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;NAME &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; TYPE &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;VALUE&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;------------------------------------ ----------- ------------------------------&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;diagnostic_dest &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;string &amp;nbsp; &amp;nbsp; &amp;nbsp;/oracle/app/oracle&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;SQL&amp;gt; show parameter background_dump_dest&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;NAME &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; TYPE &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;VALUE&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;------------------------------------ ----------- ------------------------------&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;background_dump_dest &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; string &amp;nbsp; &amp;nbsp; &amp;nbsp;/oracle/app/oracle/diag/rdbms/&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ora11201/ora11201/trace&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;h3&gt;
Disabling ADR&lt;/h3&gt;
Now, it is possible to disable the ADR and go back to the way things were prior to Oracle 11g. First you'll need to set the hidden parameter _diag_adr_enabled to FALSE, for example if using spfile:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;SQL&amp;gt; alter system set "_diag_adr_enabled"=false scope=spfile;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;System altered.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Then you MUST set the old %_DUMP_DEST parameters to point to the desired locations. These directories must exist and be writable by oracle, obviously.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;SQL&amp;gt; alter system set background_dump_dest='/oracle/app/oracle/admin/ora11201/bdump' scope=spfile;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;System altered.&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;SQL&amp;gt; alter system set core_dump_dest='/oracle/app/oracle/admin/ora11201/cdump' scope=spfile;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;System altered.&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;SQL&amp;gt; alter system set user_dump_dest='/oracle/app/oracle/admin/ora11201/udump' scope=spfile;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;System altered.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then we restart the database instance for the settings to take effect. I've tested this on my 11.2.0.1 sandbox (these are the commands from that very session) and it works. Note that you will again see the ORA-32004 warning about having a deprecated parameter set, that is to be expected. However, this time the settings take effect:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;SQL&amp;gt; show parameter dump_dest&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;NAME &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; TYPE &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;VALUE&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;------------------------------------ ----------- ------------------------------&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;background_dump_dest &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; string &amp;nbsp; &amp;nbsp; &amp;nbsp;/oracle/app/oracle/admin/ora11&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;201/bdump&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;core_dump_dest &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; string &amp;nbsp; &amp;nbsp; &amp;nbsp;/oracle/app/oracle/admin/ora11&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;201/cdump&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;user_dump_dest &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; string &amp;nbsp; &amp;nbsp; &amp;nbsp;/oracle/app/oracle/admin/ora11&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;201/udump&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;SQL&amp;gt; show parameter "_diag_adr_enabled"&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;NAME &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; TYPE &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;VALUE&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;------------------------------------ ----------- ------------------------------&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;_diag_adr_enabled &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;boolean &amp;nbsp; &amp;nbsp; FALSE&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;HOWEVER&lt;/b&gt;, I do not advise doing this in production at all, and certainly not without the blessing of Oracle Support for any reason. I simply don't think there is anything to be gained by reverting to this method, and you lose the flexibility and power of having the alert data in XML format, which we'll see how to harness in a future post!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This ends Part 1 of my ADR intro series, which focused ADR location(s). Part 2 will focus on diagnostic files and how Oracle uses and maintains them.&lt;/div&gt;
&lt;/div&gt;
&lt;img src="http://feeds.feedburner.com/~r/DieSeilerwerks/~4/wWVBHKByXAI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.seiler.us/feeds/3671807443227556628/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.seiler.us/2012/10/learning-to-love-adr-part-1-location.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7032512792942232766/posts/default/3671807443227556628?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7032512792942232766/posts/default/3671807443227556628?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DieSeilerwerks/~3/wWVBHKByXAI/learning-to-love-adr-part-1-location.html" title="Learning to Love the ADR - Part 1: Location, Location, Location!" /><author><name>Don Seiler</name><uri>http://www.blogger.com/profile/06863841688485670148</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="29" height="32" src="http://2.bp.blogspot.com/-8TdBDfGw74I/TfDl-_rQAvI/AAAAAAAAAFc/tfscblA-9t8/s220/dtseiler_oraclenerd.jpg" /></author><thr:total>1</thr:total><feedburner:origLink>http://www.seiler.us/2012/10/learning-to-love-adr-part-1-location.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CE4MSH49fip7ImA9WhRaFEQ.&quot;"><id>tag:blogger.com,1999:blog-7032512792942232766.post-7482552081386798800</id><published>2012-02-16T13:11:00.004-06:00</published><updated>2012-02-17T09:36:29.066-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-02-17T09:36:29.066-06:00</app:edited><title>Me at RMOUG</title><content type="html">&lt;div class="separator" style="clear: both; text-align: center;"&gt;Here's a quick picture of me during my RMOUG 2012 presentation, giving a tour of the Oracle 11g ADR:&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a class="vt-p" href="http://1.bp.blogspot.com/-53xdPZ2kie8/Tz1U6Ov94SI/AAAAAAAAALY/ShIVsRgjEOo/s1600/dts_rmoug.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="480" src="http://1.bp.blogspot.com/-53xdPZ2kie8/Tz1U6Ov94SI/AAAAAAAAALY/ShIVsRgjEOo/s640/dts_rmoug.jpg" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;Thanks to &lt;a class="vt-p" href="http://dbakevlar.com/" target="_blank"&gt;Kellyn Pot'Vin&lt;/a&gt; for the picture!&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DieSeilerwerks/~4/bBoTSbw9VAY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.seiler.us/feeds/7482552081386798800/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.seiler.us/2012/02/me-at-rmoug.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7032512792942232766/posts/default/7482552081386798800?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7032512792942232766/posts/default/7482552081386798800?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DieSeilerwerks/~3/bBoTSbw9VAY/me-at-rmoug.html" title="Me at RMOUG" /><author><name>Don Seiler</name><uri>http://www.blogger.com/profile/06863841688485670148</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="29" height="32" src="http://2.bp.blogspot.com/-8TdBDfGw74I/TfDl-_rQAvI/AAAAAAAAAFc/tfscblA-9t8/s220/dtseiler_oraclenerd.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-53xdPZ2kie8/Tz1U6Ov94SI/AAAAAAAAALY/ShIVsRgjEOo/s72-c/dts_rmoug.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://www.seiler.us/2012/02/me-at-rmoug.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0MBQX4-eyp7ImA9WhRaE04.&quot;"><id>tag:blogger.com,1999:blog-7032512792942232766.post-8303383423925655663</id><published>2012-02-15T14:57:00.000-06:00</published><updated>2012-02-15T14:57:30.053-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-02-15T14:57:30.053-06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="oracle" /><category scheme="http://www.blogger.com/atom/ns#" term="nocoug" /><title>A NoCOUG to Remember</title><content type="html">This post is long overdue, as I was supposed to blog about my appearance at NoCOUG before I left (sorry, Vanessa!). However in my efforts to rehearse and adjust my presentation, blogging about it just fell to the wayside. However now that NoCOUG 2011 Summer Conference is in the books, I'd like to take a few minutes to share my experience not only as an attendee, but also as a first-time speaker.&lt;br /&gt;
&lt;br /&gt;
When I found out that NoCOUG had accepted my abstract, "Oracle 11g: Learning to Love the ADR", I was both ecstatic and terrified. This meant that I actually had to prepare the presentation and speak in front of peers. Surely they would throw me into San Francisco Bay if I didn't bring my A-game, so I set out to do just that.&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Step 1: Learning to Love the ADR&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
The fact is that I chose to speak on the ADR because I knew very little about it myself. This would not only get me into the glorious world of Oracle conference speakers, complete with a lifestyle rivalled only by Caligula, but it would also ensure that I knew as much as I could about the ADR. Until this project, I had only known where to find the human-readable alert log so I could continue on with my Oracle 10g style of monitoring! I had heard tales of creating "packages" for Oracle support, but surely this was a complex, Herculean feat that would take many months of meditation to even begin to understand.&lt;br /&gt;
&lt;br /&gt;
So I scoured Oracle Support notes and the public documentation to get notes on any aspect I could about the ADR. Once I felt I had enough source material, it was time to build an outline for my slides to follow. After that, it was time to eat my own dog food, so I got busy poking around the ADR and playing with adrci on my Oracle 11.2 sandbox, while concurrently applying some new-found knowledge on client installations. The latter helped me find a bug involving listener alert log purging!&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Step 2: The Slides&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
The next step was actually creating a deck of slides. Using the Pythian template and Libre Office 3.4.2, I slowly figured out how this done in the most simple format possible. This means it was all text, baby. No cool stock photos or cute puppy clip-art. That's something I'll work on for next time and/or another topic.&lt;br /&gt;
&lt;br /&gt;
Once I had a first draft of my slides and did a self-rehearsal, I enlisted the help of my Pythian colleagues in our Sydney office to be my test audience to not only judge my presenting pace &amp;amp; speech, but also criticize the content of my presentation. And they did the latter wonderfully, each asking great questions that I hadn't previously considered and making some great suggestions on where to provide a little more info and offering anecdotes from their own ADR experiences. I can definitely say that they made my presentation twice as good as it was before! After implementing those changes, I did another dress-rehearsal for some more colleagues around the world, got a few more notes, and I felt like it was ready.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Step 3: The Conference&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
When I got to the conference in San Ramon, I especially keen to meet &lt;a href="http://jonathanlewis.wordpress.com/"&gt;Jonathan Lewis&lt;/a&gt; for the first time. Jonathan is one of the people in the Oracle world that I respect the most, and it was a joy not only to be in his presence but to also later share a lunch table with him. I was also delighted to finally meet my colleague Chen Shapira, one of the most brilliant DBAs we have at Pythian, which is saying quite a lot!&lt;br /&gt;
&lt;br /&gt;
Jonathan was, naturally, the keynote speaker. He gave fantastic talk on two-table joins (after all, all joins eventually become two-table joins). You can see a &lt;a href="http://jonathanlewis.wordpress.com/2011/06/23/video/"&gt;video of a similar two-table join optimization presentation that he gave to the Turkish OUG earlier this year&lt;/a&gt;. Fantastic improvements are possible when you break things down to their simplest forms. The general idea reminded me also of &lt;a href="http://www.youtube.com/watch?hl=en&amp;amp;v=ZVisY-fEoMw"&gt;this great video by Stephane Faroult&lt;/a&gt;, but Jonathan does go into much more terrific detail.&lt;br /&gt;
&lt;br /&gt;
After the keynote, I stayed for Jonathan's second session, which was titled "A Beginner's Guide to Becoming an Expert", with emphasis on &lt;em&gt;becoming&lt;/em&gt;, rather than &lt;em&gt;being&lt;/em&gt;. This was another great session that emphasized on having easily reproducable tests. Jonathan noted that the script he was using could build a set of tables with over 6.5 million rows on his laptop in under a minute, showing that it doesn't take a lot of effort to have such scripts written and readily available whenever you need to test something. His scripts directory contained over 2600 SQL scripts for all manner of scenarios. One needs to be in the mindset to test repeatedly, making slight changes between tests and understanding the difference in results.&lt;br /&gt;
&lt;br /&gt;
He included a demonstration of how Oracle actually fails the ACID test, which &lt;a href="http://jonathanlewis.wordpress.com/2011/08/19/redo-2/"&gt;he blogged about afterward&lt;/a&gt;, definitely give it a read.&lt;br /&gt;
&lt;br /&gt;
After an outdoor lunch, I decided to pass on the next session to go over my slides again and ensure that everything was working on my laptop as expected. One other session I was really interested seeing was Kyle Hailey's NFS Tuning session, but unfortunately it was at the same time as my own session.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Step 4: Spreading the Love&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
When the time came for my session, I felt very prepared. I did catch myself rushing through words once in a while, but otherwise felt my pace was good. There were a few questions from the audience that I couldn't immediately answer, but was able to find the answer for during the post-session ad-hoc demo that I went through for those that stuck around and had extra questions. Having a live instance to work on was incredibly valuable to the presentation and helped not only to reinforce the information that I was sharing, but also to test scenarios that audience members came up with that I hadn't previously illustrated.&lt;br /&gt;
&lt;br /&gt;
There was some great Q &amp;amp; A at the end of the session, as well as after the session. As I said earlier, I stayed around answering questions and going through new scenarios for some time afterward. Even after packing up and moving out of the room I was speaking with people who had more questions about the ADR, even some that hadn't attended my session! I spent so much time talking, in fact, that I was late for the last sessions and so decided to just catch up on email rather than burst in late and distrub the presenters. As you can see, I ended up only attending Jonathan Lewis' two sessions in addition to my own. Not a bad day altogether, except for losing my jacket (black Outdoor Research spring jacket, if anyone finds one!).&lt;br /&gt;
&lt;br /&gt;
Unfortunately I was taking the red-eye back to the midwest that night so I didn't get to do any sightseeing aside from what I got to see from the BART train. But I did enjoy this change from home:&lt;br /&gt;
&lt;br /&gt;
&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-NjbBI5dUlfk/Tzwb_gIWpCI/AAAAAAAAALQ/fZdqMcEogKw/s1600/grb_sfo_high_temps.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-NjbBI5dUlfk/Tzwb_gIWpCI/AAAAAAAAALQ/fZdqMcEogKw/s1600/grb_sfo_high_temps.jpg" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;&lt;span style="font-size: small; text-align: -webkit-auto;"&gt;I could get used to the San Francisco consistency.&lt;/span&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;It's like a year-round Wisconsin springtime. For those interested, I did provide some &lt;a href="https://twitter.com/#!/search/%23NoCOUG%20from%3Adtseiler"&gt;twitter updates between sessions&lt;/a&gt;. I didn't want to live-tweet because it would have been harder for my simple mind to follow along.&lt;br /&gt;
&lt;br /&gt;
You can &lt;a href="http://nocoug.org/presentations.html"&gt;download the slides from my presentation, as well as a few others, from the NoCOUG website&lt;/a&gt;. I do plan to also record a webinar of this presentation, after I incorporate a few more changes, later this year.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;In Conclusion ...&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
Overall, I think it was a very worthwhile experience. I accomplished my goal of learning about the ADR well enough to speak confidently and competently on it. I also accomplished my year's goal of submitting to 3 conferences and my career goal of becoming an Oracle speaker. I definitely look forward to speaking more on this and other topics at future conferences as well as presenting internally to the rest of my Pythian colleagues.&lt;img src="http://feeds.feedburner.com/~r/DieSeilerwerks/~4/w9bBT6lk0UY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.seiler.us/feeds/8303383423925655663/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.seiler.us/2012/02/nocoug-to-remember.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7032512792942232766/posts/default/8303383423925655663?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7032512792942232766/posts/default/8303383423925655663?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DieSeilerwerks/~3/w9bBT6lk0UY/nocoug-to-remember.html" title="A NoCOUG to Remember" /><author><name>Don Seiler</name><uri>http://www.blogger.com/profile/06863841688485670148</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="29" height="32" src="http://2.bp.blogspot.com/-8TdBDfGw74I/TfDl-_rQAvI/AAAAAAAAAFc/tfscblA-9t8/s220/dtseiler_oraclenerd.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-NjbBI5dUlfk/Tzwb_gIWpCI/AAAAAAAAALQ/fZdqMcEogKw/s72-c/grb_sfo_high_temps.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://www.seiler.us/2012/02/nocoug-to-remember.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0UEQ30zeCp7ImA9WhRaE04.&quot;"><id>tag:blogger.com,1999:blog-7032512792942232766.post-6735260695911567653</id><published>2012-02-15T14:53:00.000-06:00</published><updated>2012-02-15T14:53:22.380-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-02-15T14:53:22.380-06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="bugs" /><category scheme="http://www.blogger.com/atom/ns#" term="upgrade" /><category scheme="http://www.blogger.com/atom/ns#" term="grid" /><category scheme="http://www.blogger.com/atom/ns#" term="oracle" /><title>Upgrading Standalone ASM to Oracle Grid Infrastructure 11.2.0.2? Beware Bug 10283819!</title><content type="html">No, this isn't a re-post of my &lt;a href="http://www.pythian.com/news/18925/upgrading-standalone-asm-to-oracle-grid-infrastructure-11-2-0-2-beware-bug-1233183-1/"&gt;earlier blog about bug 1233183.1&lt;/a&gt;. We've found a fun new bug that seems to be specific to our poor standalone ASM instances when upgrading from Oracle Grid Infrastructure 11.2.0.1 to 11.2.0.2.&lt;br /&gt;
&lt;br /&gt;
The bug was first brought to my attention about four days after completing the Grid Infrastructure upgrade. The client system administrator (SA) noticed that the disk holding the Oracle home directories was slowly filling, at the rate of about 1Gb per day. We identifed that core dump files being created under the new GRID_HOME/log/&lt;hostname&gt;diskmon/ directory, at the rate of about 1 every 10 minutes, each one about 8M in size. That adds up to 1152M (or just over 1Gb) per 24-hour day. Add that to the 8Gb that was being held in GRID_HOME/.patch_storage (we had to rollback the 11.2.0.1 April 2010 PSU and apply the 11.2.0.1 July 2010 PSU just to upgrade to 11.2.0.2), and that put a bit of a squeeze on the free disk.&lt;br /&gt;
&lt;br /&gt;
The good ol' OTN forums led me to bug 10283819. The original poster there shared also that removing the old (11.2.0.1) grid home directory and restarting diskmon services stopped the core dump creation. The poster then went to question a second issue with increased diskmon.log writing. After a solution was found for that, Oracle Support closed the bug for some reason, without ever addressing the core dump creation.&lt;br /&gt;
&lt;br /&gt;
I can verify that removing the old 11.2.0.1 grid home (I did a tar+bz2 first) and restarting the services did stop the core dump creation, and am pushing back to Oracle support to get the bug re-opened or a new bug filed to specifically address this. In the meantime, if you are unable or unsure about removing the old grid infrastructure home, it should be safe to have a regularly scheduled script remove the diskmon core dump directories and save you a full disk surprise late some night.&lt;/hostname&gt;&lt;img src="http://feeds.feedburner.com/~r/DieSeilerwerks/~4/egcH6ZW3nbM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.seiler.us/feeds/6735260695911567653/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.seiler.us/2012/02/upgrading-standalone-asm-to-oracle-grid.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7032512792942232766/posts/default/6735260695911567653?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7032512792942232766/posts/default/6735260695911567653?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DieSeilerwerks/~3/egcH6ZW3nbM/upgrading-standalone-asm-to-oracle-grid.html" title="Upgrading Standalone ASM to Oracle Grid Infrastructure 11.2.0.2? Beware Bug 10283819!" /><author><name>Don Seiler</name><uri>http://www.blogger.com/profile/06863841688485670148</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="29" height="32" src="http://2.bp.blogspot.com/-8TdBDfGw74I/TfDl-_rQAvI/AAAAAAAAAFc/tfscblA-9t8/s220/dtseiler_oraclenerd.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.seiler.us/2012/02/upgrading-standalone-asm-to-oracle-grid.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0YGSXc5fyp7ImA9WhRaE04.&quot;"><id>tag:blogger.com,1999:blog-7032512792942232766.post-1192098397205387622</id><published>2012-02-15T14:52:00.000-06:00</published><updated>2012-02-15T14:52:08.927-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-02-15T14:52:08.927-06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="time" /><category scheme="http://www.blogger.com/atom/ns#" term="grid" /><category scheme="http://www.blogger.com/atom/ns#" term="oracle" /><title>Using a Custom Timezone? Beware Oracle 11.2.0.2 Grid Infrastructure!</title><content type="html">We have a client that runs an application that, for whatever reasons, does NOT like daylight saving time. For that reason, the Oracle server is kept in Eastern Standard Time and does not change with the rest of the eastern United States when DST begins and ends every year. They accomplish this with a custom /etc/localtime file. However, they left /etc/sysconfig/clock set to "TZ=America/New_York," which would prove fateful as I shall point out. So, with the custom localtime file, the "date" command as well as selecting sysdate or systimestamp would always return the current time in Eastern Standard Time. When it is Daylight Saving Time, as it is right now, this would be one hour behind "real" time as we consider it.&lt;br /&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Now, we recently upgraded this client from Oracle Grid Infrastructure (for single-instance ASM) from 11.2.0.1 to 11.2.0.2. The next business day, the client alerted us that their date fields were coming back in Eastern Daylight Time. While this time was still technically right, they needed the time in the EST timezone.&lt;br /&gt;
&lt;br /&gt;
I first set about trying to duplicate the problem. I was able to see the same incorrect results when I connected to the database remotely (e.g. via sqlplus or Oracle SQL Developer over TNS), but not locally (i.e. "sqlplus / as sysdba"). Then I duplicated the problem when connecting locally via TNS, meaning I was going through the listener. So we had narrowed it down to only connections going through the listener. I hadn't considered the listener to be aware of timezones, so this was rather mind-boggling for me.&lt;br /&gt;
&lt;br /&gt;
Here is an example of the incorrect results we saw:&lt;br /&gt;
&lt;tt&gt;&lt;br /&gt;
SQL&amp;gt; select systimestamp from dual;&lt;br /&gt;
&lt;br /&gt;
SYSTIMESTAMP&lt;br /&gt;
---------------------------------------------------------------------------&lt;br /&gt;
14-JUN-11 07.38.31.711902 PM -04:00&lt;br /&gt;
&lt;br /&gt;
SQL&amp;gt; !date&lt;br /&gt;
Tue Jun 14 18:38:33 EST 2011&lt;br /&gt;
&lt;/tt&gt;&lt;br /&gt;
The system date always returned the value we wanted, but now SYSTIMESTAMP (and SYSDATE, and any other date values stored in the database) were coming back in EDT.&lt;br /&gt;
&lt;br /&gt;
My Pythian colleague &lt;a href="http://www.pythian.com/news/author/fielding/"&gt;Marc Fielding&lt;/a&gt; found My Oracle Support document ID 1209444.1, which had these two eye-opening lines:&lt;br /&gt;
&lt;blockquote&gt;1. For 11.2.0.1, shell environment variable TZ is set correctly for grid user and root.&lt;br /&gt;
2. For 11.2.0.2 and above, TZ entry in $GRID_HOME/crs/install/s_crsconfig_&lt;nodename&gt;_env.txt sets to correct time zone.&lt;/nodename&gt;&lt;/blockquote&gt;&lt;br /&gt;
Looking in the s_crsconfig_*_env.txt file on these hosts, I saw this:&lt;br /&gt;
&lt;tt&gt;&lt;br /&gt;
TZ=America/New_York&lt;br /&gt;
&lt;/tt&gt;&lt;br /&gt;
The workaround was to change the TZ value in this file to "EST5" and perform a quick restart the HAS daemon:&lt;br /&gt;
&lt;tt&gt;&lt;br /&gt;
# /etc/init.d/ohasd stop&lt;br /&gt;
# /etc/init.d/ohasd start&lt;br /&gt;
&lt;/tt&gt;&lt;br /&gt;
After doing this, I liked what I was seeing:&lt;br /&gt;
&lt;tt&gt;&lt;br /&gt;
SQL&amp;gt; select systimestamp from dual;&lt;br /&gt;
&lt;br /&gt;
SYSTIMESTAMP&lt;br /&gt;
---------------------------------------------------------------------------&lt;br /&gt;
14-JUN-11 06.42.16.384596 PM -05:00&lt;br /&gt;
&lt;br /&gt;
SQL&amp;gt; !date&lt;br /&gt;
Tue Jun 14 18:42:19 EST 2011&lt;br /&gt;
&lt;/tt&gt;&lt;br /&gt;
&lt;br /&gt;
Marc and I believe that the Grid Infrastructure installer grabs the value in /etc/sysconfig/clock when setting up the env file in question. We've asked the client to ensure that /etc/sysconfig/clock is always properly set in the future.&lt;br /&gt;
&lt;br /&gt;
We imagine that most places don't try to fight Daylight Saving Time this way, but the bug also applies if you are doing any kind of timezone slight-of-hand, like telling your database it is in US Central time when the server might be in US Pacific time. So if your organization is doing this, be sure to double check the crsconfig file after 11.2.0.2 installation!&lt;img src="http://feeds.feedburner.com/~r/DieSeilerwerks/~4/v4ze6FNJtDw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.seiler.us/feeds/1192098397205387622/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.seiler.us/2012/02/using-custom-timezone-beware-oracle.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7032512792942232766/posts/default/1192098397205387622?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7032512792942232766/posts/default/1192098397205387622?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DieSeilerwerks/~3/v4ze6FNJtDw/using-custom-timezone-beware-oracle.html" title="Using a Custom Timezone? Beware Oracle 11.2.0.2 Grid Infrastructure!" /><author><name>Don Seiler</name><uri>http://www.blogger.com/profile/06863841688485670148</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="29" height="32" src="http://2.bp.blogspot.com/-8TdBDfGw74I/TfDl-_rQAvI/AAAAAAAAAFc/tfscblA-9t8/s220/dtseiler_oraclenerd.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.seiler.us/2012/02/using-custom-timezone-beware-oracle.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0YDR3s5eSp7ImA9WhZUEU8.&quot;"><id>tag:blogger.com,1999:blog-7032512792942232766.post-3611065680446340064</id><published>2011-06-03T14:26:00.000-05:00</published><updated>2011-06-03T14:26:16.521-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-06-03T14:26:16.521-05:00</app:edited><title>Vote for my session for Oracle OpenWorld 2011!</title><content type="html">Well I didn't make the judges cut, but through Oracle Mix's Suggest-A-Session, you can still send me to OOW by voting for my session, which is unofficially titled, "&lt;a class="vt-p" href="https://mix.oracle.com/events/oow11/proposals/10904"&gt;Making Love to the ADR ... the Don Seiler Way&lt;/a&gt;." The official title is much less romantic.&lt;br /&gt;
&lt;br /&gt;
Cheers!&lt;img src="http://feeds.feedburner.com/~r/DieSeilerwerks/~4/2UrRVqYOh9U" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.seiler.us/feeds/3611065680446340064/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.seiler.us/2011/06/vote-for-my-session-for-oracle.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7032512792942232766/posts/default/3611065680446340064?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7032512792942232766/posts/default/3611065680446340064?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DieSeilerwerks/~3/2UrRVqYOh9U/vote-for-my-session-for-oracle.html" title="Vote for my session for Oracle OpenWorld 2011!" /><author><name>Don Seiler</name><uri>http://www.blogger.com/profile/06863841688485670148</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="29" height="32" src="http://2.bp.blogspot.com/-8TdBDfGw74I/TfDl-_rQAvI/AAAAAAAAAFc/tfscblA-9t8/s220/dtseiler_oraclenerd.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.seiler.us/2011/06/vote-for-my-session-for-oracle.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0EMQ385cCp7ImA9Wx9XEEo.&quot;"><id>tag:blogger.com,1999:blog-7032512792942232766.post-7452608371123491756</id><published>2011-01-03T11:28:00.000-06:00</published><updated>2011-01-03T11:28:02.128-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-01-03T11:28:02.128-06:00</app:edited><title>Upgrading Standalone ASM to Oracle Grid Infrastructure 11.2.0.2? Beware Bug 1233183.1!</title><content type="html">&lt;span class="Apple-style-span" style="color: #666666; line-height: 18px;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit; font-size: x-small;"&gt;&lt;i&gt;NOTE: This post originally appeared on the &lt;a class="vt-p" href="http://www.pythian.com/news/18925/upgrading-standalone-asm-to-oracle-grid-infrastructure-11-2-0-2-beware-bug-1233183-1/"&gt;Pythian blog&lt;/a&gt;.&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
The past four days have found me very frustrated and at wits' end while testing upgrades of standalone Oracle Grid Infrastructure (ASM) 11.2.0.1 to 11.2.0.2 on RHEL/OEL 5 VMs. The upgrade would seem to go fine, but after rebooting, I would see ASM and LISTENER running under the old (11.2.0.1) grid home directories again.&lt;br /&gt;
&lt;br /&gt;
Looking at /etc/oratab, I saw this:&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;$ grep -i asm /etc/oratab&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;+ASM:/u01/app/grid/product/11.2.0/grid_1:N              # line added by Agent&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
grid_1 is the old grid home, I expect to see grid_2. The comment about being added by Agent led me to a path where I eventually took a look at /etc/init.d/ohasd, which is basically the master script that starts everything up. I noticed that this file hadn't been updated as part of the patching, and contained this:&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;$ grep -i crs_home /etc/init.d/ohasd &lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;ORA_CRS_HOME=/u01/app/grid/product/11.2.0/grid_1&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;export ORA_CRS_HOME&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
I then ran some web searches for "oracle upgrade 11.2.0.1 ohasd" and found a blog post that had the same problem. Searching My Oracle Support then turned up DocID 1233183.1, titled "Standalone GI: init.ohasd/ohasd not updated after 11201 to 11202 upgrade".&lt;br /&gt;
&lt;br /&gt;
The bug is basically what it says, those files are not being updated during upgrades of standalone grid infrastructure. This is due to a logic bug in roothas.pl. I suggest reading the document for details.&lt;br /&gt;
&lt;br /&gt;
The workaround is to manually copy those two files after the upgrade finishes. First backup the old files:&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;$ mkdir ~/ohasd_init_backup&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;$ cd ~/ohasd_init_backup&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;$ ls /etc/init.d/*ohasd*&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;/etc/init.d/init.ohasd  /etc/init.d/ohasd&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;$ cp /etc/init.d/*ohasd* .&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;$ ls&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;init.ohasd  ohasd&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then copy the 11.2.0.2 files into place (as root):&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;# cd /etc/init.d/&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;# cp /u01/app/grid/product/11.2.0/grid_2/crs/init/init.ohasd .&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;cp: overwrite `./init.ohasd'? y   &lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;# cp /u01/app/grid/product/11.2.0/grid_2/crs/init/ohasd .&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;cp: overwrite `./ohasd'? y&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Obviously, substitute "/u01/app/grid/product/11.2.0/grid_2" with the path your 11.2.0.2 installation directory. NOTE: SLES users need to copy ohasd.sles, rather than ohasd. See the MOS document for details&lt;br /&gt;
&lt;br /&gt;
Now, a quick check to make sure the proper home is used:&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;$ grep -i crs_home /etc/init.d/ohasd &lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;ORA_CRS_HOME=/u01/app/grid/product/11.2.0/grid_2&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;export ORA_CRS_HOME&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Now ensure that the two new scripts have the same ownership and permissions as the old ones. Then reboot to ensure that everything takes effect. After the server comes back up, ensure that all services and oratab are still pointing to the new grid home. Be sure to check "srvctl config" for the asm and listener services, and check the paths in /etc/oratab.&lt;br /&gt;
&lt;br /&gt;
This is the second bug with the 11.2.0.2 upgrade process that I've encountered. The first one requires patching the 11.2.0.1 Grid Infrastructure with the July 2010 PSU just to be able to upgrade to 11.2.0.2. Let's hope for some stronger QA in the future.&lt;img src="http://feeds.feedburner.com/~r/DieSeilerwerks/~4/tJ-TALXDhiE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.seiler.us/feeds/7452608371123491756/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.seiler.us/2011/01/upgrading-standalone-asm-to-oracle-grid.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7032512792942232766/posts/default/7452608371123491756?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7032512792942232766/posts/default/7452608371123491756?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DieSeilerwerks/~3/tJ-TALXDhiE/upgrading-standalone-asm-to-oracle-grid.html" title="Upgrading Standalone ASM to Oracle Grid Infrastructure 11.2.0.2? Beware Bug 1233183.1!" /><author><name>Don Seiler</name><uri>http://www.blogger.com/profile/06863841688485670148</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="29" height="32" src="http://2.bp.blogspot.com/-8TdBDfGw74I/TfDl-_rQAvI/AAAAAAAAAFc/tfscblA-9t8/s220/dtseiler_oraclenerd.jpg" /></author><thr:total>1</thr:total><feedburner:origLink>http://www.seiler.us/2011/01/upgrading-standalone-asm-to-oracle-grid.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEQHSXY5eSp7ImA9Wx9QFEQ.&quot;"><id>tag:blogger.com,1999:blog-7032512792942232766.post-2461008191579461314</id><published>2010-12-27T17:25:00.002-06:00</published><updated>2010-12-27T17:25:38.821-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-12-27T17:25:38.821-06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="transactions" /><category scheme="http://www.blogger.com/atom/ns#" term="ACID" /><category scheme="http://www.blogger.com/atom/ns#" term="commit" /><category scheme="http://www.blogger.com/atom/ns#" term="oracle" /><title>I Do Not Think It Means What You Think It Means</title><content type="html">Arup Nanda posted a great blog article about one of the most fundamental, yet misunderstood, behaviors of the Oracle database: &lt;a class="vt-p" href="http://arup.blogspot.com/2010/12/100-things-you-probably-didnt-know.html"&gt;the relationship of the COMMIT statement and buffer caches being flushed to disk&lt;/a&gt;. I plan to re-read this every day for month. This clip seems apropos:&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;object class="BLOGGER-youtube-video" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" data-thumbnail-src="http://1.gvt0.com/vi/G2y8Sx4B2Sk/0.jpg" height="266" width="320"&gt;&lt;param name="movie" value="http://www.youtube.com/v/G2y8Sx4B2Sk&amp;fs=1&amp;source=uds" /&gt;&lt;param name="bgcolor" value="#FFFFFF" /&gt;&lt;embed width="320" height="266" src="http://www.youtube.com/v/G2y8Sx4B2Sk&amp;fs=1&amp;source=uds" type="application/x-shockwave-flash"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/div&gt;&lt;br /&gt;
The article is titled "&lt;span class="Apple-style-span" style="line-height: 25px;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;100 Things You Probably Didn't Know About Oracle Database," and I'm definitely looking forward to the other 99 articles.&lt;/span&gt;&lt;/span&gt;&lt;img src="http://feeds.feedburner.com/~r/DieSeilerwerks/~4/rP41poUXxh4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.seiler.us/feeds/2461008191579461314/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.seiler.us/2010/12/arup-nanda-posted-great-blog-article.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7032512792942232766/posts/default/2461008191579461314?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7032512792942232766/posts/default/2461008191579461314?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DieSeilerwerks/~3/rP41poUXxh4/arup-nanda-posted-great-blog-article.html" title="I Do Not Think It Means What You Think It Means" /><author><name>Don Seiler</name><uri>http://www.blogger.com/profile/06863841688485670148</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="29" height="32" src="http://2.bp.blogspot.com/-8TdBDfGw74I/TfDl-_rQAvI/AAAAAAAAAFc/tfscblA-9t8/s220/dtseiler_oraclenerd.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.seiler.us/2010/12/arup-nanda-posted-great-blog-article.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0ENRH06fip7ImA9Wx9TEk4.&quot;"><id>tag:blogger.com,1999:blog-7032512792942232766.post-7934549041618360651</id><published>2010-11-19T22:45:00.001-06:00</published><updated>2010-11-20T00:48:15.316-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-11-20T00:48:15.316-06:00</app:edited><title>Back to Blogger!</title><content type="html">With the &lt;a href="http://googlereader.blogspot.com/2010/11/welcome-google-apps-users.html?utm_source=feedburner&amp;amp;utm_medium=feed&amp;amp;utm_campaign=Feed:+blogspot/dtKx+(Official+Google+Reader+Blog)&amp;amp;utm_content=Google+Reader"&gt;recent announcement of Google Apps for Domains integration with the rest of the Google tools suite&lt;/a&gt;, I've decided to further simplify my life and run this blog on Google's blogger utility. I've been considering coming back for a while, given that Wordpress doesn't let me do everything I want (e.g. Amazon associate links) and now Blogger does what I wanted before (e.g. Pages).&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;The big task now is to find a way to import from Wordpress to Blogger. I can import everything from my previous Blogger blog, but might have to manually copy posts since then (3 years ago). I don't know that there are that many since then, so it might not be too bad. Plus I'm on vacation this week.&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DieSeilerwerks/~4/1NnQSsf6cWI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.seiler.us/feeds/7934549041618360651/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.seiler.us/2010/11/back-to-blogger.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7032512792942232766/posts/default/7934549041618360651?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7032512792942232766/posts/default/7934549041618360651?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DieSeilerwerks/~3/1NnQSsf6cWI/back-to-blogger.html" title="Back to Blogger!" /><author><name>Don Seiler</name><uri>http://www.blogger.com/profile/06863841688485670148</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="29" height="32" src="http://2.bp.blogspot.com/-8TdBDfGw74I/TfDl-_rQAvI/AAAAAAAAAFc/tfscblA-9t8/s220/dtseiler_oraclenerd.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.seiler.us/2010/11/back-to-blogger.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0UBRHo7fSp7ImA9Wx9TEko.&quot;"><id>tag:blogger.com,1999:blog-7032512792942232766.post-4605358928070863866</id><published>2010-11-12T14:29:00.005-06:00</published><updated>2010-11-20T10:40:55.405-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-11-20T10:40:55.405-06:00</app:edited><title>Beware the /var/tmp/.oracle Hidden Directory!</title><content type="html">NOTE: This post originally appeared on the Pythian blog.&lt;br /&gt;
&lt;br /&gt;
A few months ago, we had a test instance complaining that it couldn't write to ASM. This was an 11.1.0.7 single (non-RAC) instance on Oracle Enterprise Linux 5, using ASM for the storage. We first saw these errors in the alert log:&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;ORA-15032: not all alterations performed&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;ORA-29702: error occurred in Cluster Group Service operation&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;ORA-29702: error occurred in Cluster Group Service operation&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;ERROR: error ORA-15032 caught in ASM I/O path&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Uh-oh, that doesn't look good. So I log into the ASM instance and try to see if the disks are OK:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;SQL&amp;gt; select path, mount_status from v$asm_disk;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;select path, mount_status from v$asm_disk&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; *&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;ERROR at line 1:&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;ORA-15032: not all alterations performed&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;ORA-29702: error occurred in Cluster Group Service operation&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;ORA-29702: error occurred in Cluster Group Service operation&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
I can't even query that. &lt;a href="http://www.youtube.com/watch?v=1DsFMJQHbMs"&gt;As Ted would say&lt;/a&gt;, "strange things are afoot at the Circle K."&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;To be safe, I thought I'd try to shutdown the DBMS instance, which also failed without having to abort:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;SQL&amp;gt; shutdown immediate&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;ORA-00204: error in reading (block 1, # blocks 1) of control file&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;ORA-00202: control file: '+FOOTEST_DATA/footest1_footest_db/control01.ctl'&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;ORA-15081: failed to submit an I/O operation to a disk&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;SQL&amp;gt; shutdown abort ORACLE instance shut down.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
We decided to restart the whole DBMS/ASM/CSS stack, but CSS wouldn't stop either:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;-bash-3.2# /etc/init.d/init.cssd stop&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Stopping Cluster Synchronization Services.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Unable to communicate with the Cluster Synchronization Services daemon.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Shutdown has begun. The daemons should exit soon.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
We ended up booting the server altogether, after which everything came up nicely. We filed an SR with Oracle Support, who directed us to Note 391790.1 (Unable To Connect To Cluster Manager Ora-29701). This note lists the cause, quite simply, as:&lt;br /&gt;
&lt;blockquote&gt;The hidden directory '/var/tmp/.oracle' was removed while instances &amp;amp; the CRS stack were up and running. Typically this directory contains a number of "special" socket files that are used by local clients to connect via the IPC protocol (sqlnet) to various Oracle processes including the TNS listener, the CSS, CRS &amp;amp; EVM daemons or even database or ASM instances. These files are created when the "listening" process starts.&lt;/blockquote&gt;The solution is to restart CRS or reboot the machine. Our /var/tmp/.oracle directory looked like this:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;[oracle@footest ~]$ ls -la /var/tmp/.oracle&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;total 12&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;drwxrwxrwt 2 root &amp;nbsp; root 4096 May &amp;nbsp;8 15:03 .&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;drwxrwxrwt 3 root &amp;nbsp; root 4096 May 10 07:02 ..&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;srwxrwxrwx 1 oracle dba &amp;nbsp; &amp;nbsp; 0 May &amp;nbsp;8 15:03 s#18854.1&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;srwxrwxrwx 1 oracle dba &amp;nbsp; &amp;nbsp; 0 May &amp;nbsp;8 15:03 s#18854.2&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;srwxrwxrwx 1 oracle dba &amp;nbsp; &amp;nbsp; 0 May &amp;nbsp;8 15:03 sEXTPROC&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;srwxrwxrwx 1 oracle dba &amp;nbsp; &amp;nbsp; 0 May &amp;nbsp;8 14:44 sfootestDBG_CSSD&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;srwxrwxrwx 1 oracle dba &amp;nbsp; &amp;nbsp; 0 May &amp;nbsp;8 14:44 sOCSSD_LL_footest_&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;srwxrwxrwx 1 oracle dba &amp;nbsp; &amp;nbsp; 0 May &amp;nbsp;8 14:44 sOCSSD_LL_footest_localhost&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;srwxrwxrwx 1 oracle dba &amp;nbsp; &amp;nbsp; 0 May &amp;nbsp;8 14:44 sOracle_CSS_LclLstnr_localhost_0&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;srwxrwxrwx 1 oracle dba &amp;nbsp; &amp;nbsp; 0 May &amp;nbsp;8 15:03 sPNPKEY&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
I did some sandbox testing, and found that only the Oracle and root OS users could delete that directory, and was able to duplicate the error every time when doing so.&lt;br /&gt;
&lt;br /&gt;
However, I really was dumbstruck that Oracle would have so critical a directory in /var/tmp! I politely note this to Oracle Support, who justified this location with a few solid reasons:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;It has always been in this location (and still is in 11gR2).&amp;nbsp;&lt;/li&gt;
&lt;li&gt;/var/tmp/.oracle is a hidden directory, so it probably won't be noticed by any miscreants looking to cause trouble.&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;OK, I was being sarcastic, these reasons are awful. The only safeguard they gave was "make sure no one deletes it." We scoured the server for cron jobs that would automatically clean out /var/tmp but didn't find any, nor any bash history suggesting malice. The only thing that we could think of was that this test server was in a VM (Citrix Xen), although one would hope that it doesn't happen at all, regardless. We certainly could not find an explanation, but now we're aware to not delete /var/tmp/.oracle while the instances are running (even though we never did before).&lt;br /&gt;
&lt;br /&gt;
Surachart Opun has also &lt;a href="http://surachartopun.com/2009/01/vartmporacle-hidden-directory.html"&gt;blogged on this topic&lt;/a&gt;.&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DieSeilerwerks/~4/6czTTMVFIIM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.seiler.us/feeds/4605358928070863866/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.seiler.us/2010/11/beware-vartmporacle-hidden-directory.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7032512792942232766/posts/default/4605358928070863866?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7032512792942232766/posts/default/4605358928070863866?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DieSeilerwerks/~3/6czTTMVFIIM/beware-vartmporacle-hidden-directory.html" title="Beware the /var/tmp/.oracle Hidden Directory!" /><author><name>Don Seiler</name><uri>http://www.blogger.com/profile/06863841688485670148</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="29" height="32" src="http://2.bp.blogspot.com/-8TdBDfGw74I/TfDl-_rQAvI/AAAAAAAAAFc/tfscblA-9t8/s220/dtseiler_oraclenerd.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.seiler.us/2010/11/beware-vartmporacle-hidden-directory.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkEGQnc5eCp7ImA9WhZXFkw.&quot;"><id>tag:blogger.com,1999:blog-7032512792942232766.post-824440629419323491</id><published>2010-06-30T15:37:00.007-05:00</published><updated>2011-05-05T11:57:03.920-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-05-05T11:57:03.920-05:00</app:edited><title>Installing Oracle 11gR2 Enterprise Edition on Ubuntu 10.04 (Lucid Lynx)</title><content type="html">&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;i&gt;Note: This post originally appeared on &lt;a class="vt-p" href="http://www.pythian.com/news/13291/installing-oracle-11gr2-enterprise-edition-on-ubuntu-10-04-lucid-lynx/"&gt;The Pythian Group blog&lt;/a&gt;.&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
I recently reformatted my laptop with the latest &lt;a class="vt-p" href="http://www.ubuntu.com/"&gt;Ubuntu&lt;/a&gt; LTS release, 10.04, aka &lt;a class="vt-p" href="https://wiki.ubuntu.com/LucidLynx"&gt;Lucid Lynx&lt;/a&gt;. Since I like to have a native client installation as well as a portable sandbox server, I decided to install the latest version of Oracle EE, 11.2.0.1.&lt;br /&gt;
&lt;br /&gt;
Rather than re-invent the wheel, I'm going to direct you to the &lt;a class="vt-p" href="http://www.pythian.com/news/2329/installing-oracle-11gr1-on-ubuntu-904-jaunty-jackalope/"&gt;previous Oracle-on-Ubuntu&lt;/a&gt; post by my colleague Augusto Bott. Many of the directions there hold true here (even with 32-bit vs 64-bit), with a few exceptions.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Download the Software&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
First and foremost, download the 32-or-64-bit installer files (there are 2 of them) from OTN.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Installing Pre-requisite Packages&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Install these software packages on your Ubuntu 10.04 system:&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;$ sudo apt-get install unzip build-essential x11-utils rpm ksh lsb-rpm libaio1&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Ubuntu 10.04 comes with libstdc++6 installed. However, Oracle 11gR2 requires libstdc++5. If you do not install libstdc++5, you will see &lt;a class="vt-p" href="http://forums.oracle.com/forums/thread.jspa?threadID=1077139&amp;amp;tstart=0"&gt;errors as described in this OTN thread&lt;/a&gt;. The fix, as described in that thread, is to download and manually shoehorn the libstdc++5 library files onto Ubuntu 10.04:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;$ wget http://mirrors.kernel.org/ubuntu/pool/universe/g/gcc-3.3/libstdc++5_3.3.6-17ubuntu1_amd64.deb&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;$ dpkg-deb -x libstdc++5_3.3.6-17ubuntu1_amd64.deb ia64-libs&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;$ sudo cp ia64-libs/usr/lib/libstdc++.so.5.0.7 /usr/lib64/ $ cd /usr/lib64/&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;$ sudo ln -s libstdc++.so.5.0.7 libstdc++.so.5&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;$ wget http://security.ubuntu.com/ubuntu/pool/universe/i/ia32-libs/ia32-libs_2.7ubuntu6.1_amd64.deb&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;$ dpkg-deb -x ia32-libs_2.7ubuntu6.1_amd64.deb ia32-libs&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;$ sudo cp ia32-libs/usr/lib32/libstdc++.so.5.0.7 /usr/lib32/&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;$ cd /usr/lib32 $ sudo ln -s libstdc++.so.5.0.7 libstdc++.so.5&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Now we're ready to move on.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Create User and Groups&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
First create the oinstall and dba groups:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;$ sudo su - # addgroup oinstall # addgroup dba&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Then create the oracle user and assign it to those groups:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;# useradd -g oinstall -G dba -d /home/oracle -s /bin/bash oracle&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;# passwd oracle&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Enter new UNIX password:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Retype new UNIX password:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;passwd: password updated successfully&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;# mkdir /home/oracle&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;# chown -R oracle:dba /home/oracle&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Now we create some symbolic links to give the Ubuntu system a more "Red Hat-ish layout," as Augusto put it:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;# ln -s /usr/bin/awk /bin/awk&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;# ln -s /usr/bin/rpm /bin/rpm&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;# ln -s /usr/bin/basename /bin/basename&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;# mkdir /etc/rc.d&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;# for i in 0 1 2 3 4 5 6 S ; do ln -s /etc/rc$i.d /etc/rc.d/rc$i.d ; done&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;# mkdir -p /u01/app/oracle&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;# chown -R oracle:dba /u01&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Then we update some sysctl parameters by editing /etc/sysctl.conf. It is wisest to backup this file first and then add these lines to the end of /etc/sysctl.conf:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;fs.file-max = 6815744&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;fs.aio-max-nr = 1048576&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;kernel.shmall = 2097152&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;kernel.shmmax = 2147483648&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;kernel.shmmni = 4096&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;kernel.sem = 250 32000 100 128&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;net.core.rmem_default = 4194304&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;net.core.rmem_max = 4194304&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;net.core.wmem_default = 1048576&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;net.core.wmem_max = 1048576&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;net.ipv4.ip_local_port_range = 9000 65535&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Note that these values are different from what was needed in 11gR1.&lt;br /&gt;
&lt;br /&gt;
Now we update some limits for the oracle software owner by adding these lines to the end of /etc/security/limits.conf:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;oracle soft nproc 2047&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;oracle hard nproc 16383&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;oracle soft nofile 1023&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;oracle hard nofile 65535&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Again, it is best to backup the file first.&lt;br /&gt;
&lt;br /&gt;
Now we activate the new settings from /etc/sysctl.conf with this command:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;# sysctl -p&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
You should see the new settings in the output of that command.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;b&gt;Unpack and Install the Software&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
From here we go into the directory containing our two 11gR2 database zip files. I'm using the 64-bit edition, so my files are named linux.x64_11gR2_databaseXof2.zip, where X is 1 or 2. I unzip both of these files, which creates a "database" subdirectory:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;$ unzip linux.x64_11gR2_database_1of2.zip&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;$ unzip linux.x64_11gR2_database_2of2.zip&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Each of these commands will produce a large volume of output to the terminal as it lists each file being unpacked. Once this is done, your directory should look something like this:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;$ ls -lh total 2.2G&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;drwxr-xr-x 8 seiler seiler 4.0K 2009-08-20 14:34 database&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;-rw-r--r-- 1 seiler seiler 1.2G 2010-03-09 11:33 linux.x64_11gR2_database_1of2.zip&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;-rw-r--r-- 1 seiler seiler 1.1G 2010-03-09 12:38 linux.x64_11gR2_database_2of2.zip&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Now you simply cd into the database directory and run the runInstaller program:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;$ cd database&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;$ ./runInstaller&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
This will launch the Oracle Universal Installer, or OUI, program. The rest is pretty straight forward. Since this is just a sandbox, I chose not to provide any email info and declined to receive updates. I chose to first install the software only, which went perfectly well. OUI will complain about missing packages, since it is checking for RPMs. We can safely ignore these and proceed with installation.&lt;br /&gt;
&lt;br /&gt;
Once installation is done I set these variables in my bash environment:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;export ORACLE_BASE=/u01/app/oracle&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;export ORACLE_SID=orcl&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;export LD_LIBRARY_PATH=$ORACLE_HOME/lib&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;export PATH=$ORACLE_HOME/bin:$PATH&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;export EDITOR=/usr/bin/vi&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Then some quick tests to verify installation:&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;$ sqlplus /nolog&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;SQL*Plus: Release 11.2.0.1.0 Production on Thu Jun 10 23:46:42 2010&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Copyright (c) 1982, 2009, Oracle. &amp;nbsp;All rights reserved.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;SQL&amp;gt; quit&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;$ /u01/app/oracle/product/11.2.0/dbhome_1/OPatch/opatch lsinventory&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Invoking OPatch 11.1.0.6.6&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Oracle Interim Patch Installer version 11.1.0.6.6&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Copyright (c) 2009, Oracle Corporation. &amp;nbsp;All rights reserved.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Oracle Home &amp;nbsp; &amp;nbsp; &amp;nbsp; : /u01/app/oracle/product/11.2.0/dbhome_1&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Central Inventory : /u01/app/oraInventory&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp; from &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; : /etc/oraInst.loc&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;OPatch version &amp;nbsp; &amp;nbsp;: 11.1.0.6.6&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;OUI version &amp;nbsp; &amp;nbsp; &amp;nbsp; : 11.2.0.1.0&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;OUI location &amp;nbsp; &amp;nbsp; &amp;nbsp;: /u01/app/oracle/product/11.2.0/dbhome_1/oui&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Log file location : /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2010-06-10_23-46-53PM.log&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Patch history file: /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch_history.txt&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Lsinventory Output file location : /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/lsinv/lsinventory2010-06-10_23-46-53PM.txt&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;--------------------------------------------------------------------------------&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Installed Top-level Products (1):&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Oracle Database 11g &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;11.2.0.1.0&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;There are 1 products installed in this Oracle Home.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;There are no Interim patches installed in this Oracle Home.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;--------------------------------------------------------------------------------&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;OPatch succeeded.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
Everything looks &lt;a class="vt-p" href="http://www.last.fm/music/David+Bowie/Hunky+Dory"&gt;hunky-dory&lt;/a&gt;. Let's create an instance.&lt;br /&gt;
&lt;br /&gt;
I launched dbca to create an Oracle 11gR2 instance. The one problem I encountered here was that, at the end of dbca prompts, the "Confirmation" dialog window was blank. Other blog posts on the internet suggested blindly clicking around until you magically hit the "OK" button, but more often than not I would hit the "Cancel" button. Turns out this is a not-so-uncommon &lt;a class="vt-p" href="http://www.google.ca/search?sourceid=chrome&amp;amp;ie=UTF-8&amp;amp;q=gnome+visual+effects+java+swing"&gt;problem with Java Swing and Gnome's visual effects&lt;/a&gt;. The solution for Gnome users is to disable Visual Effects in the Appearance preferences before launching dbca. If you are using a lightweight desktop environment such as &lt;a class="vt-p" href="http://lxde.org/"&gt;LXDE&lt;/a&gt;, you shouldn't have this problem.&lt;br /&gt;
&lt;br /&gt;
And that's that. The rest is nothing new to those who have done installations before. You can optionally configure TNS names or Listener with the netca tool, or log into your new instance and enjoy.&lt;br /&gt;
&lt;br /&gt;
Special thanks to Augusto Bott for not only authoring the previous Oracle-on-Ubuntu articles but also for suggesting the Gnome Visual Effects conflict!&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DieSeilerwerks/~4/7gvzrOn_qkA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.seiler.us/feeds/824440629419323491/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.seiler.us/2010/06/installing-oracle-11gr2-enterprise.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7032512792942232766/posts/default/824440629419323491?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7032512792942232766/posts/default/824440629419323491?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DieSeilerwerks/~3/7gvzrOn_qkA/installing-oracle-11gr2-enterprise.html" title="Installing Oracle 11gR2 Enterprise Edition on Ubuntu 10.04 (Lucid Lynx)" /><author><name>Don Seiler</name><uri>http://www.blogger.com/profile/06863841688485670148</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="29" height="32" src="http://2.bp.blogspot.com/-8TdBDfGw74I/TfDl-_rQAvI/AAAAAAAAAFc/tfscblA-9t8/s220/dtseiler_oraclenerd.jpg" /></author><thr:total>1</thr:total><feedburner:origLink>http://www.seiler.us/2010/06/installing-oracle-11gr2-enterprise.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CE8AQn0-fSp7ImA9Wx9TEko.&quot;"><id>tag:blogger.com,1999:blog-7032512792942232766.post-1916295334306527426</id><published>2010-06-30T15:36:00.003-05:00</published><updated>2010-11-20T11:07:23.355-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-11-20T11:07:23.355-06:00</app:edited><title>Applying Oracle 11.2 April 2010 PSU for Single-Instance ASM and DBMS</title><content type="html">&lt;i&gt;Note: This post originally appeared at &lt;a href="http://www.pythian.com/news/11881/applying-oracle-11-2-april-2010-psu-for-single-instance-asm-and-dbms/"&gt;The Pythian Group blog&lt;/a&gt;.&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;NOTE NOTE: Grid Infrastructure PSU 9343627 has since been revoked by Oracle, and replaced with a newer PSU. &lt;b&gt;&lt;span class="Apple-style-span" style="color: #cc0000;"&gt;Do not apply PSU 9343627&lt;/span&gt;&lt;/b&gt;. I'm leaving this post up for educational purposes only.&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
When news of the April 2010 PSU for Oracle 11.2 came out, I was excited to see it, since it marked the first non-one-off patch release for the 11.2 database software.  I happened to have an 11gR2 test system running on 11gR2 ASM via standalone Grid Infrastructure.  I applied PSU 9352237 to the DBMS home and fired it up, only to see the folly of my ways when any ASM file operations like disk resizing (or auto-extending) failed with ORA-1653.  This was due to the DBMS component now having a higher version number than the ASM component, which ASM does not allow.  The Grid Infrastucture PSU would need to be applied to bring the ASM component up to snuff, but that patch (9343627) was, at that time, only "announced" with no ETA.  Alas, the patch was rolled back and we continued testing without it.&lt;br /&gt;
&lt;br /&gt;
Then this week I check again and saw that PSU 9343627 was released and gave it a whirl.  I was a little confused when the README seemed to contain a lot of instructions that always assumed it to be on a clustered, RAC install.  My setup was a single-instance Grid Infrastructure installation just to provide ASM.  I soon met problem upon problem when going through first this setup step:&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;# GRID_HOME/crs/install/rootcrs.pl -unlock&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;2010-05-03 11:40:42: Parsing the host name&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;2010-05-03 11:40:42: Checking for super user privileges&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;2010-05-03 11:40:42: User has super user privileges&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Using configuration parameter file: GRID_HOME/crs/install/crsconfig_params&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;CRS-4013: This command is not supported in a single-node configuration.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;CRS-4000: Command Stop failed, or completed with errors.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;You must kill crs processes or reboot the system to properly &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;cleanup the processes started by Oracle clusterware&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;The Oracle Clusterware stack failed to stop.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;You should stop the stack with 'crsctl stop crs' and rerun the command&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
I decided to try the PSU anyway, thinking Oracle would certainly have noted in the README if this was a problem for single-node installations.  Turns out I was wrong:&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;$ GRID_HOME/OPatch/opatch napply -local -oh GRID_HOME -id 9343627,9352237&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Invoking OPatch 11.2.0.1.2&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;... snip ...&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Running prerequisite checks...&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Prerequisite check "CheckApplicable" failed.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;The details are:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Patch 9343627:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Copy Action: Desctination File "GRID_HOME/bin/oradnssd" is not writeable.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;'oracle.crs, 11.2.0.1.0': Cannot copy file from 'oradnssd' to 'GRID_HOME/bin/oradnssd'&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;UtilSession failed: Prerequisite check "CheckApplicable" failed.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;OPatch failed with error code 73&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
I created an SR with Oracle support, and after reviewing my case agreed that the instructions were not right for single-instance Grid Infrastructure installations.  They will be updating the README, but in the meantime I'd like to share the revised instructions that got me through two successful GI/DBMS PSU applications today.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Naming Conventions&lt;/strong&gt;&lt;br /&gt;
First a few naming conventions to avoid confusion:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;DBMS_HOME - The Oracle DBMS installation directory.&lt;/li&gt;
&lt;li&gt;GRID_HOME - The Oracle Grid Infrastructure installation directory.&lt;/li&gt;
&lt;/ul&gt;I've replaced all references to the directories in my examples with DBMS_HOME and GRID_HOME.  Whenever you see those strings, substitute the actual path to your DBMS install or GRID install, whichever the case may be.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Download the PSU and OPatch 11.2&lt;/strong&gt;&lt;br /&gt;
First, you'll obviously need to download patch 9343627 that contains the PSU for your platform.  In my case that's Linux x86_64.  As of this writing, I believe it's only available for Linux x86 and x86_64.  Note that patch 9343627 also includes patch 9352237.  You do not have to, and should not, download that PSU separately.  Everything you need is in the 9343627 download.&lt;br /&gt;
&lt;br /&gt;
Second, choose a working directory to unzip that file.  In my case, this is &lt;code&gt;/home/oracle/software/11gR2/psu/gi&lt;/code&gt;, which looked like this after unzipping the PSU zip file:&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;$ ls&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;9343627  9352237  p9343627_112010_Linux-x86-64.zip&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Unlike normal one-off patches, where you would descend into the individual patch-number-named directories, you'll stay at this level.&lt;br /&gt;
&lt;br /&gt;
Note also that you'll need OPatch 11.2 or higher.  See MOS Doc ID 6880880 and get the latest version of OPatch for your platform.  Then just unzip the file in the DBMS_HOME and GRID_HOME directories, overwriting the old OPatch directory.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Pre-Patch Steps&lt;/strong&gt;&lt;br /&gt;
First I'm assuming that you have shut down all DBMS instances on this server.  We will shut down ASM later in this process, so &lt;em&gt;be sure to shutdown the DBMS instances now&lt;/em&gt;.&lt;br /&gt;
&lt;br /&gt;
Now we'll start the pre-patch steps.  First we stop the database on this server, saving the state of the database configuration in /tmp/oracle_home.stat:&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;$ DBMS_HOME/bin/srvctl stop home -o DBMS_HOME -s /tmp/oracle_home.stat&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Repeat this for any additional Oracle database home installs on the server.&lt;br /&gt;
&lt;br /&gt;
Next we save the database home configuration.  This only needs to be done if we're also going to patch the DBMS home in addition to the GI home.  This is done from the directory where we unzipped the PSU:&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;$ ./9343627/custom/server/9343627/custom/scripts/prepatch.sh -dbhome DBMS_HOME&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;./9343627/custom/server/9343627/custom/scripts/prepatch.sh completed successfully.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
After that, we shut down ASM as one would normally do it:&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;$ . oraenv&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;+ASM&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;$ sqlplus / as sysasm&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;SQL&amp;gt; shutdown immediate;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;SQL&amp;gt; quit&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Then, as root, we unlock and shutdown HAS (not CRS, as the original README would have you do):&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;# GRID_HOME/crs/install/roothas.pl -unlock&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;2010-05-04 17:14:08: Checking for super user privileges&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;2010-05-04 17:14:08: User has super user privileges&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;2010-05-04 17:14:08: Parsing the host name&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Using configuration parameter file: GRID_HOME/crs/install/crsconfig_params&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'localhost'&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;CRS-2673: Attempting to stop 'ora.cssd' on 'localhost'&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;CRS-2677: Stop of 'ora.cssd' on 'localhost' succeeded&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;CRS-2673: Attempting to stop 'ora.diskmon' on 'localhost'&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;CRS-2677: Stop of 'ora.diskmon' on 'localhost' succeeded&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'localhost' has completed&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;CRS-4133: Oracle High Availability Services has been stopped.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Successfully unlock GRID_HOME&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Now we're ready to do some patching.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Applying PSU 9343627 and 9352237 to Oracle 11.2 Grid Infrastructure&lt;/strong&gt;&lt;br /&gt;
As I mentioned earlier, the PSU contains both 9343627 and 9352237, and it is advised that you apply both.  I did so successfully with these commands:&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;$ GRID_HOME/OPatch/opatch napply -oh GRID_HOME -id 9343627&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;$ GRID_HOME/OPatch/opatch napply -oh GRID_HOME -id 9352237&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
For each one, you'll go through the normal opatch [y|n] confirmation prompts, and also prompted for an email address.  I entered in my MOS login email, and left the password blank (it is optional).  The rest was automatic and finished without error for both cases.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Applying PSU 9343627 and 9352237 to Oracle 11.2 DBMS&lt;/strong&gt;&lt;br /&gt;
Here is something slightly different when applying the 9343627 patch to the DBMS_HOME, we specify a subdirectory after the "napply" parameter:&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;$ DBMS_HOME/OPatch/opatch napply 9343627/custom/server/ -oh DBMS_HOME -id 9343627&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
For patch 9352237, we use the regular syntax:&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;$ DBMS_HOME/OPatch/opatch napply -oh DBMS_HOME -id 9352237&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Note that I use OPatch from DBMS_HOME when patching DBMS_HOME, and from GRID_HOME when patching GRID_HOME.  I can't say if it is actually necessary, but I like to keep things tidy.  This is why I advised installing the new OPatch into both homes earlier.&lt;br /&gt;
&lt;br /&gt;
As of this moment, both homes are patched, but we aren't done yet!&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Post-Patch Steps&lt;/strong&gt;&lt;br /&gt;
First we run the postpatch.sh script included in patch 9343627 to reset some file permissions on the DBMS_HOME:&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;$ ./9343627/custom/server/9343627/custom/scripts/postpatch.sh -dbhome DBMS_HOME&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Now we re-lock the GRID_HOME and restart the GI stack.  As root:&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;# GRID_HOME/crs/install/roothas.pl -patch&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;2010-05-04 17:33:41: Checking for super user privileges&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;2010-05-04 17:33:41: User has super user privileges&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;2010-05-04 17:33:41: Parsing the host name&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Using configuration parameter file: GRID_HOME/crs/install/crsconfig_params&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;CRS-4123: Oracle High Availability Services has been started.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Verify that the services we need are started (again as root):&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;# crsctl check has&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;CRS-4638: Oracle High Availability Services is online&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;# crsctl check css&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;CRS-4529: Cluster Synchronization Services is online&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
If you don't see CSS started, then you aren't alone.  On both of my servers, CSS was not set to auto-start from OHASD.  This was fixed by running these commands as the GRID_HOME owner (oracle):&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;$ crsctl modify resource "ora.cssd" -attr "AUTO_START=1"&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;$ crsctl modify resource "ora.diskmon" -attr "AUTO_START=1"&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Then, as root:&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;# crsctl stop has&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'localhost'&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;CRS-2673: Attempting to stop 'ora.cssd' on 'localhost'&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;CRS-2677: Stop of 'ora.cssd' on 'localhost' succeeded&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;CRS-2673: Attempting to stop 'ora.diskmon' on 'localhost'&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;CRS-2677: Stop of 'ora.diskmon' on 'localhost' succeeded&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'localhost' has completed&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;CRS-4133: Oracle High Availability Services has been stopped.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;# crsctl start has&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;CRS-4123: Oracle High Availability Services has been started.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;# crsctl check has&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;CRS-4638: Oracle High Availability Services is online&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;# crsctl check css&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;CRS-4529: Cluster Synchronization Services is online&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Moving on in the post-patch steps, we start the DBMS_HOME from the state file we created earlier:&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;$ DBMS_HOME/bin/srvctl start home -o DBMS_HOME -s /tmp/oracle_home.stat&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
At this point, we are done.  You can start ASM and the DBMS instances.  For some affirmation, run this for both GRID_HOME and DBMS_HOME (just using GRID_HOME in this example)&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;$ GRID_HOME/OPatch/opatch lsinventory&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Invoking OPatch 11.2.0.1.2&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Oracle Interim Patch Installer version 11.2.0.1.2&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Copyright (c) 2010, Oracle Corporation.  All rights reserved.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Oracle Home       : GRID_HOME&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Central Inventory : /opt/oracle/app/oraInventory&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;from           : /etc/oraInst.loc&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;OPatch version    : 11.2.0.1.2&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;OUI version       : 11.2.0.1.0&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;OUI location      : GRID_HOME/oui&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Log file location : GRID_HOME/cfgtoollogs/opatch/opatch2010-05-04_18-36-23PM.log&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Patch history file: GRID_HOME/cfgtoollogs/opatch/opatch_history.txt&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Lsinventory Output file location : GRID_HOME/cfgtoollogs/opatch/lsinv/lsinventory2010-05-04_18-36-23PM.txt&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;--------------------------------------------------------------------------------&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Installed Top-level Products (1): &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Oracle Grid Infrastructure                                           11.2.0.1.0&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;There are 1 products installed in this Oracle Home.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Interim patches (2) :&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Patch  9352237      : applied on Tue May 04 18:22:41 EDT 2010&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Unique Patch ID:  12381846&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Created on 25 Mar 2010, 00:05:17 hrs PST8PDT&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Bugs fixed:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;8661168, 8769239, 8898852, 8801119, 9054253, 8706590, 8725286, 8974548&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;8778277, 8780372, 8769569, 9027691, 9454036, 9454037, 9454038, 8761974&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;7705591, 8496830, 8702892, 8639114, 8723477, 8729793, 8919682, 8818983&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;9001453, 8475069, 9328668, 8891929, 8798317, 8820324, 8733749, 8702535&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;8565708, 9036013, 8735201, 8684517, 8870559, 8773383, 8933870, 8812705&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;8405205, 8822365, 8813366, 8761260, 8790767, 8795418, 8913269, 8897784&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;8760714, 8717461, 8671349, 8775569, 8898589, 8861700, 8607693, 8642202&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;8780281, 9369797, 8780711, 8784929, 8834636, 9015983, 8891037, 8828328&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;8570322, 8832205, 8665189, 8717031, 8685253, 8718952, 8799099, 8633358&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;9032717, 9321701, 8588519, 8783738, 8796511, 8782971, 8756598, 9454385&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;8856497, 8703064, 9066116, 9007102, 8721315, 8818175, 8674263, 9352237&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;8753903, 8720447, 9057443, 8790561, 8733225, 9197917, 8928276, 8991997, 8837736&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Patch  9343627      : applied on Tue May 04 18:18:31 EDT 2010&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Unique Patch ID:  12381846&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Created on 15 Apr 2010, 11:28:38 hrs PST8PDT&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Bugs fixed:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;9343627, 9262748, 9262722&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;--------------------------------------------------------------------------------&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;OPatch succeeded.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
As I said, Oracle support will be updating the README for PSU 9343627, but in the meantime I hope this guide helps you as much as it helped me.  I'd like to thank my Pythian colleague Alex Gorbachev for his help in diagnosing some of the GI problems after the first broken patching, and also Esteban B. at Oracle Support for working closely with us to get a new single-node action plan.&lt;img src="http://feeds.feedburner.com/~r/DieSeilerwerks/~4/7X94zkvQYf4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.seiler.us/feeds/1916295334306527426/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.seiler.us/2010/06/applying-oracle-112-april-2010-psu-for.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7032512792942232766/posts/default/1916295334306527426?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7032512792942232766/posts/default/1916295334306527426?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DieSeilerwerks/~3/7X94zkvQYf4/applying-oracle-112-april-2010-psu-for.html" title="Applying Oracle 11.2 April 2010 PSU for Single-Instance ASM and DBMS" /><author><name>Don Seiler</name><uri>http://www.blogger.com/profile/06863841688485670148</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="29" height="32" src="http://2.bp.blogspot.com/-8TdBDfGw74I/TfDl-_rQAvI/AAAAAAAAAFc/tfscblA-9t8/s220/dtseiler_oraclenerd.jpg" /></author><thr:total>1</thr:total><feedburner:origLink>http://www.seiler.us/2010/06/applying-oracle-112-april-2010-psu-for.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C08FSX8ycSp7ImA9Wx9TEk4.&quot;"><id>tag:blogger.com,1999:blog-7032512792942232766.post-8107115227108352990</id><published>2009-11-22T10:28:00.000-06:00</published><updated>2010-11-19T23:43:38.199-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-11-19T23:43:38.199-06:00</app:edited><title>A Drupal Backup Script</title><content type="html">&lt;div style="color: #222222; font-family: 'Lucida Grande', 'Lucida Sans Unicode', Helvetica, Arial, sans-serif; font-size: 13px; line-height: 1.5; margin-bottom: 15px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;I maintain a drupal codebase that hosts multiple sites. I’ve been shamefully lax in getting regular backups of those files and databases, until today. Here is a pretty basic bash script that will create a bzip2 archive of the drupal codebase (including site-specific dirs), and then create mysqldump exports of each site’s database and gzip those files. This particular script requires that the drupal install directory be named “drupal”, but you can change this easily enough to suit your needs.&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;script src="https://gist.github.com/707648.js?file=drupalbackup.sh"&gt;&lt;/script&gt;&lt;br /&gt;
&lt;div style="color: #222222; font-family: 'Lucida Grande', 'Lucida Sans Unicode', Helvetica, Arial, sans-serif; font-size: 13px; line-height: 1.5; margin-bottom: 15px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;This does require a ~/.drupalsites file that contains the needed database login info (suggest chmod 600). Like I said, nothing too clever.This script runs fine from cron, I have it scheduled for a weekly run. I then plan to rsync this to my home server for an offsite copy, even though the hosting service provides backups as well.&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DieSeilerwerks/~4/F_oS3QJOBdY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.seiler.us/feeds/8107115227108352990/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.seiler.us/2010/11/drupal-backup-script.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7032512792942232766/posts/default/8107115227108352990?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7032512792942232766/posts/default/8107115227108352990?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DieSeilerwerks/~3/F_oS3QJOBdY/drupal-backup-script.html" title="A Drupal Backup Script" /><author><name>Don Seiler</name><uri>http://www.blogger.com/profile/06863841688485670148</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="29" height="32" src="http://2.bp.blogspot.com/-8TdBDfGw74I/TfDl-_rQAvI/AAAAAAAAAFc/tfscblA-9t8/s220/dtseiler_oraclenerd.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.seiler.us/2010/11/drupal-backup-script.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CU8CQX87fSp7ImA9Wx9TEko.&quot;"><id>tag:blogger.com,1999:blog-7032512792942232766.post-1321282861502676460</id><published>2009-10-27T12:51:00.000-05:00</published><updated>2010-11-20T11:24:20.105-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-11-20T11:24:20.105-06:00</app:edited><title>Moving Oracle Datafiles to a ZFS Filesystem with the Correct Recordsize</title><content type="html">&lt;em&gt;Originally posted on &lt;a href="http://www.pythian.com/news/3627/moving-oracle-datafiles-to-a-zfs-filesystem-with-the-correct-recordsize"&gt;The Pythian Group blog&lt;/a&gt;.&lt;/em&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;em&gt;Full credit for this tale should go to my colleague &lt;a href="http://www.pythian.com/news/author/kutrovsky"&gt;Christo Kutrovsky&lt;/a&gt; for the inspiration and basic plan involved.&lt;br /&gt;
&lt;/em&gt;&lt;br /&gt;
&lt;br /&gt;
We recently migrated a large database from Solaris SPARC to Solaris x86-64. All seemed to go well with the migration, but in the next few weeks, we noticed some I/O issues cropping up. Some research led us to find that the ZFS filesystem used to hold the datafiles was killing us on I/O. The default “recordsize” setting for ZFS was 128k.&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;$ /usr/sbin/zfs get recordsize zfs-data&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;NAME      PROPERTY    VALUE     SOURCE&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;zfs-data  recordsize  128K      default&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
An Oracle database typically uses 8k for the block size, but in this case it was 16k. We saw basically the same thing that Neelakanth Nadgir described in his blog post, &lt;a href="http://blogs.sun.com/realneel/entry/zfs_and_databases"&gt;Databases and ZFS&lt;/a&gt;:&lt;br /&gt;
&lt;blockquote&gt;With ZFS, not only was the throughput much lower, but we used more [than] twice the amount of CPU per transaction, and we are doing 2x times the IO. The disks are also more heavily utilized. We noticed that we were not only reading in more data, but we were also doing more IO operations [than] what is needed.&lt;/blockquote&gt;The fix is to set the ZFS recordsize for a datafile filesystem to match the Oracle instance’s &lt;code&gt;db_block_size&lt;/code&gt;.  We also read in &lt;a href="http://www.solarisinternals.com/wiki/index.php/ZFS_Best_Practices_Guide#ZFS_and_Database_Recommendations"&gt;the ZFS Best Practices Guide&lt;/a&gt; that redo logs should be in a separate filesystem with the default ZFS recordsize of 128k. We already had them separate, so we just needed to get our datafiles on a ZFS filesystem with a 16k recordsize.&lt;br /&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
The first step is to change the ZFS recordsize for the current filesystem. Easy enough, but the change in recordsize will only apply to new files written there. It doesn’t do anything for our existing terabyte-plus of datafiles. This means we need to move the files to a new ZFS filesystem with the correct recordsize already set. That’s where the magic happens.&lt;br /&gt;
&lt;br /&gt;
My first thought was that we’d need whole other slab of disk. Then I learned that we can simply create a new ZFS filesystem on the same pool of disks as the old filesystem. Obviously we won’t be able to hold two complete copies of the datafiles, but this would let us migrate groups of files at a time (for example, a tablespace). When the move is complete, disk space is released from the old filesystem, so the sum of used disk is essentially unchanged.&lt;br /&gt;
&lt;br /&gt;
The rest is just a matter of moving datafiles. Now, we all know you can’t just move or copy Oracle datafiles from a running instance. We also know that clients want as little downtime as possible, so doing a complete shutdown/move/mount/rename/open is out of the question. We could offline a tablespace, move its datafiles, rename them in the database, then online the tablespace again. Here’s a sample scenario, starting with tablespace and datafile creation:&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;SQL&amp;gt; create tablespace zfstest&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;2          datafile '/u01/app/oracle/oradata/orcl/zfs128k/zfstest01.dbf'&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;3          size 128m;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Tablespace created.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;SQL&amp;gt; alter tablespace zfstest&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;2          add datafile '/u01/app/oracle/oradata/orcl/zfs128k/zfstest02.dbf'&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;3          size 128m;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Tablespace altered.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;SQL&amp;gt; create table zfsobjects tablespace zfstest&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;2          as select * from dba_objects;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Table created.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
Accept the following:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;code&gt;/u01/app/oracle/oradata/orcl/zfs128k/&lt;/code&gt; is a ZFS filesystem with default 128k recordsize&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/u01/app/oracle/oradata/orcl/zfs16k/&lt;/code&gt; is a ZFS filesystem with a 16k recordsize&lt;/li&gt;
&lt;/ul&gt;So here we have datafiles created on a ZFS filesystem with the default 128k recordsize, and a small table just to test data access. To move the entire tablespace in one go, we do this:&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;SQL&amp;gt; alter tablespace zfstest offline;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Tablespace altered.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;SQL&amp;gt; !mv /u01/app/oracle/oradata/orcl/zfs128k/zfstest01.dbf&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;/u01/app/oracle/oradata/orcl/zfs16k/zfstest01.dbf&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;SQL&amp;gt; alter database rename file '/u01/app/oracle/oradata/orcl/zfs128k/zfstest01.dbf' to&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;'/u01/app/oracle/oradata/orcl/zfs16k/zfstest01.dbf';&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Database altered.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;SQL&amp;gt; !mv /u01/app/oracle/oradata/orcl/zfs128k/zfstest02.dbf&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;/u01/app/oracle/oradata/orcl/zfs16k/zfstest02.dbf&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;SQL&amp;gt; alter database rename file '/u01/app/oracle/oradata/orcl/zfs128k/zfstest02.dbf' to&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;'/u01/app/oracle/oradata/orcl/zfs16k/zfstest02.dbf';&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Database altered.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;SQL&amp;gt; alter tablespace zfstest online;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Tablespace altered.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;SQL&amp;gt; select count(*) from zfsobjects;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;COUNT(*)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;----------&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;68844&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
Pretty simple.  We do the one escape to the OS &lt;code&gt;mv&lt;/code&gt; command to move the datafile.  If you want to be safe, you could use &lt;code&gt;cp&lt;/code&gt; instead of &lt;code&gt;mv&lt;/code&gt; to copy the file.  Just know that disk space from the old filesystem won’t be released until you delete the old files.&lt;br /&gt;
&lt;br /&gt;
Note that this operation could take a very long time in the case of large tablespaces. We could try a somwhat similar approach of taking one datafile offline at a time and moving it. We’d just need to perform a quick recovery before bringing it online. That would look like this:&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;SQL&amp;gt; alter database datafile '/u01/app/oracle/oradata/orcl/zfs128k/zfstest01.dbf' offline;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Database altered.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;SQL&amp;gt; !mv /u01/app/oracle/oradata/orcl/zfs128k/zfstest01.dbf&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;/u01/app/oracle/oradata/orcl/zfs16k/zfstest01.dbf&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;SQL&amp;gt; alter database rename file '/u01/app/oracle/oradata/orcl/zfs128k/zfstest01.dbf' to&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;'/u01/app/oracle/oradata/orcl/zfs16k/zfstest01.dbf';&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Database altered.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;SQL&amp;gt; recover datafile '/u01/app/oracle/oradata/orcl/zfs16k/zfstest01.dbf';&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Media recovery complete.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;SQL&amp;gt; alter database datafile '/u01/app/oracle/oradata/orcl/zfs16k/zfstest01.dbf' online;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Database altered.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;SQL&amp;gt; alter database datafile&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;'/u01/app/oracle/oradata/orcl/zfs128k/zfstest02.dbf' offline;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Database altered.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;SQL&amp;gt; !mv /u01/app/oracle/oradata/orcl/zfs128k/zfstest02.dbf&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;/u01/app/oracle/oradata/orcl/zfs16k/zfstest02.dbf&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;SQL&amp;gt; alter database rename file '/u01/app/oracle/oradata/orcl/zfs128k/zfstest02.dbf'&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;to '/u01/app/oracle/oradata/orcl/zfs16k/zfstest02.dbf';&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Database altered.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;SQL&amp;gt; recover datafile '/u01/app/oracle/oradata/orcl/zfs16k/zfstest02.dbf';&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Media recovery complete.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;SQL&amp;gt; alter database datafile '/u01/app/oracle/oradata/orcl/zfs16k&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;/zfstest02.dbf' online;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Database altered.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;SQL&amp;gt; select count(*) from zfsobjects;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;COUNT(*)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;----------&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;68844&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
Seems fine. Note that your instance needs to be in ARCHIVELOG mode to be able to take datafiles offline. Obviously, if someone tried to access data on an offline datafile they’d get this error:&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;SQL&amp;gt; select count(*) from zfsobjects;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;select count(*) from zfsobjects&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;*&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;ERROR at line 1:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;ORA-00376: file 6 cannot be read at this time&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;ORA-01110: data file 6: '/u01/app/oracle/oradata/orcl/zfs16k/zfstest01.dbf'&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
So if a datafile is particularly large, this can mean still a few minutes of some data being offline. We have one more tool at our disposal that provides for a quicker turnaround: RMAN’s &lt;code&gt;BACKUP AS COPY&lt;/code&gt; command. As it says, this creates a copy of a datafile as a backup. The benefit is that it does this while the current datafile (and data) remains online. We then just need to offline, switch, recover, and online each datafile, which takes very little time compared to the time spent moving a large datafile. That process would be something like this.&lt;br /&gt;
&lt;br /&gt;
First, we want to know the file numbers of our datafiles. This is because the RMAN procedure doesn’t provide for an easy way to preserve datafile names when we backup an entire tablespace (which we’re going to do):&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;SQL&amp;gt; select file_id, file_name&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;2  from dba_data_files&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;3  where tablespace_name='ZFSTEST';&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;FILE_ID FILE_NAME&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;---------- -------------------------------------------------------&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;6 /u01/app/oracle/oradata/orcl/zfs128k/zfstest01.dbf&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;7 /u01/app/oracle/oradata/orcl/zfs128k/zfstest02.dbf&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
So we have file numbers 6 and 7.  Now we create our RMAN command file and execute it:&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;RMAN&amp;gt; backup as copy&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;2&amp;gt;  tablespace zfstest format '/u01/app/oracle/oradata/orcl/zfs16k/%U';&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;3&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;4&amp;gt; sql 'alter database datafile 6 offline';&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;5&amp;gt; switch datafile 6 to copy;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;6&amp;gt; recover datafile 6;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;7&amp;gt; sql 'alter database datafile 6 online';&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;8&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;9&amp;gt; sql 'alter database datafile 7 offline';&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;10&amp;gt; switch datafile 7 to copy;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;11&amp;gt; recover datafile 7;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;12&amp;gt; sql 'alter database datafile 7 online';&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;13&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Starting backup at 18-AUG-09&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;using target database control file instead of recovery catalog&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;allocated channel: ORA_DISK_1&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;channel ORA_DISK_1: SID=134 device type=DISK&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;channel ORA_DISK_1: starting datafile copy&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;input datafile file number=00006 name=/u01/app/oracle/oradata/orcl/zfs128k/zfstest01.dbf&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;output file name=/u01/app/oracle/oradata/orcl/zfs16k/data_D-ORCL_I-1203425866_TS-ZFSTEST_FNO-6_01kn0irh tag=TAG20090818T140640 RECID=2 STAMP=695225208&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;channel ORA_DISK_1: starting datafile copy&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;input datafile file number=00007 name=/u01/app/oracle/oradata/orcl/zfs128k/zfstest02.dbf&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;output file name=/u01/app/oracle/oradata/orcl/zfs16k/data_D-ORCL_I-1203425866_TS-ZFSTEST_FNO-7_02kn0is0 tag=TAG20090818T140640 RECID=3 STAMP=695225222&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Finished backup at 18-AUG-09&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;sql statement: alter database datafile 6 offline&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;datafile 6 switched to datafile copy&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;"/u01/app/oracle/oradata/orcl/zfs16k/data_D-ORCL_I-1203425866_TS-ZFSTEST_FNO-6_01kn0irh"&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Starting recover at 18-AUG-09&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;using channel ORA_DISK_1&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;starting media recovery&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;media recovery complete, elapsed time: 00:00:00&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Finished recover at 18-AUG-09&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;sql statement: alter database datafile 6 online&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;sql statement: alter database datafile 7 offline&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;datafile 7 switched to datafile copy&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;"/u01/app/oracle/oradata/orcl/zfs16k/data_D-ORCL_I-1203425866_TS-ZFSTEST_FNO-7_02kn0is0"&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Starting recover at 18-AUG-09&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;using channel ORA_DISK_1&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;starting media recovery&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;media recovery complete, elapsed time: 00:00:00&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Finished recover at 18-AUG-09&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;sql statement: alter database datafile 7 online&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Recovery Manager complete.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
Voila!  The tablespace is moved with minimal downtime:&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;SQL&amp;gt; select file_id, file_name&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;2  from dba_data_files&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;3  where tablespace_name='ZFSTEST';&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;FILE_ID&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;----------&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;FILE_NAME&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;--------------------------------------------------------------------------------&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;6&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;/u01/app/oracle/oradata/orcl/zfs16k/data_D-ORCL_I-1203425866_TS-ZFSTEST_FNO-6_01kn0irh&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;7&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;/u01/app/oracle/oradata/orcl/zfs16k/data_D-ORCL_I-1203425866_TS-ZFSTEST_FNO-7_02kn0is0&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;SQL&amp;gt; select count(*) from zfsobjects;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;COUNT(*)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;----------&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;68844&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
Obviously, you can generate all your statements from SQL scripts, and you’ll definitely want to do this if your tablespace has a large amount of datafiles. If you are scripting, you could opt to backup one datafile at a time if you need to preserve file names. In this case, I wasn’t too concerned.&lt;br /&gt;
&lt;br /&gt;
UPDATE: Teammate Marc Billette pointed out that the old datafiles were not removed when doing a datafile copy and switch. I clearly left them on disk, continuing to use space! So, once we are done with all the datafile switches, then our original datafiles become the copies, and we can list and delete those in RMAN like this:&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;RMAN&amp;gt; list datafilecopy all;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;List of Datafile Copies&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;=======================&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Key     File S Completion Time Ckp SCN    Ckp Time&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;------- ---- - --------------- ---------- ---------------&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;4       6    A 18-AUG-09       629982     18-AUG-09&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Name: /u01/app/oracle/oradata/orcl/zfs128k/zfstest01.dbf&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;5       7    A 18-AUG-09       630001     18-AUG-09&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Name: /u01/app/oracle/oradata/orcl/zfs128k/zfstest02.dbf&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;RMAN&amp;gt; delete datafilecopy all;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;allocated channel: ORA_DISK_1&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;channel ORA_DISK_1: SID=135 device type=DISK&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;List of Datafile Copies&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;=======================&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Key     File S Completion Time Ckp SCN    Ckp Time&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;------- ---- - --------------- ---------- ---------------&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;4       6    A 18-AUG-09       629982     18-AUG-09&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Name: /u01/app/oracle/oradata/orcl/zfs128k/zfstest01.dbf&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;5       7    A 18-AUG-09       630001     18-AUG-09&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Name: /u01/app/oracle/oradata/orcl/zfs128k/zfstest02.dbf&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Do you really want to delete the above objects (enter YES or NO)? YES&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;deleted datafile copy&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;datafile copy file name=/u01/app/oracle/oradata/orcl/zfs128k/zfstest01.dbf RECID=4 STAMP=695225227&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;deleted datafile copy&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;datafile copy file name=/u01/app/oracle/oradata/orcl/zfs128k/zfstest02.dbf RECID=5 STAMP=695225228&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Deleted 2 objects&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
Thanks to Marc for catching this early in the published life of the article!&lt;br /&gt;
&lt;br /&gt;
I hope this post can help other people that run into this problem with Oracle on ZFS (I’ve heard from one on twitter already), or people just wanting to move datafiles. Again, thanks to Pythian DBA Christo Kutrovsky for laying this process out for us!&lt;br /&gt;
&lt;br /&gt;
&lt;em&gt;Note: this process was tested on Oracle 10gR2 (10.2.0.2) and 11gR1 (11.1.0.6).&lt;/em&gt;&lt;img src="http://feeds.feedburner.com/~r/DieSeilerwerks/~4/j3Fu_0IMweQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.seiler.us/feeds/1321282861502676460/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.seiler.us/2009/10/moving-oracle-datafiles-to-zfs.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7032512792942232766/posts/default/1321282861502676460?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7032512792942232766/posts/default/1321282861502676460?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DieSeilerwerks/~3/j3Fu_0IMweQ/moving-oracle-datafiles-to-zfs.html" title="Moving Oracle Datafiles to a ZFS Filesystem with the Correct Recordsize" /><author><name>Don Seiler</name><uri>http://www.blogger.com/profile/06863841688485670148</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="29" height="32" src="http://2.bp.blogspot.com/-8TdBDfGw74I/TfDl-_rQAvI/AAAAAAAAAFc/tfscblA-9t8/s220/dtseiler_oraclenerd.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.seiler.us/2009/10/moving-oracle-datafiles-to-zfs.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUQCRnsyeip7ImA9Wx9TEko.&quot;"><id>tag:blogger.com,1999:blog-7032512792942232766.post-6171891122832905879</id><published>2009-10-27T12:49:00.001-05:00</published><updated>2010-11-20T11:16:07.592-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-11-20T11:16:07.592-06:00</app:edited><title>HOWTO: Oracle Cross-Platform Migration with Minimal Downtime</title><content type="html">&lt;em&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Originally posted at &lt;a href="http://www.pythian.com/news/3653/howto-oracle-cross-platform-migration-with-minimal-downtime"&gt;The Pythian Group blog&lt;/a&gt;.&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;
&lt;br /&gt;
I recently performed a migration from Oracle 10gR2 on Solaris to the same version on Linux, immediately followed by an upgrade to 11g.  Both platforms were x86-64.  Migrating to Linux also included migrating to ASM, whereas we had been using ZFS to hold the datafiles on Solaris.  Restoring files into ASM meant we would have to use RMAN (which we would probably choose to use anyway).&lt;br /&gt;
&lt;br /&gt;
As with many databases, the client wanted minimal downtime.  It was obvious to us that the most time-consuming operation would be the restore and recovery into the new instance.  We were basically doing a restore and recovery from production backups and archived redo logs.  It quickly dawned on me that we could start this operation well before the scheduled cutover time and downtime window, chopping at least six hours from the downtime window.  The client would only need to keep the new instance in mount mode after the initial restore/recovery finished, periodically re-catalog the source instance's FRA (which was mounted via NFS), and then re-run the &lt;code&gt;recover database&lt;/code&gt; command in RMAN.  Once the time comes to cutover, simply &lt;code&gt;archivelog current&lt;/code&gt; the original instance and &lt;code&gt;shutdown immediate&lt;/code&gt;.  Then open the new instance with the &lt;code&gt;RESETLOGS&lt;/code&gt; option, and voila!  Migration complete!&lt;br /&gt;
&lt;br /&gt;
I'll try to recreate a simple example here.  &lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
On the new instance, assume that you have ASM set up and configured with two disk groups, &lt;code&gt;DATA&lt;/code&gt; and &lt;code&gt;REDO&lt;/code&gt;.  Let's also assume that you have the FRA directory (or the directory where you hold backups and archivelogs) mounted from the Solaris host to the Linux host under &lt;code&gt;/solfra/prod/&lt;/code&gt;.  Here's the command we used:&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;mount -o hard,bg,tcp,nfsvers=3,suid,rsize=32768,wsize=32768,nointr,noac,ro solhost:/fra /solfra/&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
We then need to get a pfile and edit it for &lt;em&gt;ASM-ification&lt;/em&gt;.  You can either restore the spfile from backup or just export a pfile from the current running production instance.  To do the former, you'd need to go into RMAN and run an operation similar to this (best to ensure that the &lt;code&gt;ORACLE_HOME&lt;/code&gt;, &lt;code&gt;ORACLE_SID&lt;/code&gt;, and other Oracle-related environment variables are set properly):&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;RMAN&amp;gt; startup force&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;startup failed: ORA-01078: failure in processing system parameters&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;LRM-00109: could not open parameter file '/home/oracle/app/oracle/product/10.2.0/db_1/dbs/initprod.ora'&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;starting Oracle instance without parameter file for retrival of spfile&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Oracle instance started&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;RMAN-00571: ===========================================================&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;RMAN-00571: ===========================================================&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;RMAN-03002: failure of startup command at 06/29/2009 13:34:50&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;ORA-00205: error in identifying control file, check alert log for more info&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;RMAN&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;RMAN&amp;gt; restore spfile to pfile 'initprod.ora' from autobackup recovery area = '/solfra/' db_unique_name = 'PROD';&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Starting restore at 29-JUN-09&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;using target database control file instead of recovery catalog&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;allocated channel: ORA_DISK_1&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;channel ORA_DISK_1: sid=36 devtype=DISK&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;recovery area destination: /solfra/&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;database name (or database unique name) used for search: PROD&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;channel ORA_DISK_1: autobackup found in the recovery area&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;channel ORA_DISK_1: autobackup found: /solfra/PROD/autobackup/2009_06_29/o1_mf_s_690813149_54kypcxz_.bkp&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;channel ORA_DISK_1: SPFILE restore from autobackup complete&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Finished restore at 29-JUN-09&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
From here you can go into sqlplus and &lt;code&gt;CREATE PFILE FROM SPFILE;&lt;/code&gt;.&lt;br /&gt;
&lt;br /&gt;
Now we have our text pfile in &lt;code&gt;$ORACLE_HOME/dbs/initprod.ora&lt;/code&gt;, and we want to make these changes specific to the transition to ASM:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;*.control_files='+DATA','+REDO'
*.db_create_file_dest='+DATA'
*.db_create_online_log_dest_1='+REDO'
*.db_recovery_file_dest='/path/to/fra'
*.db_recovery_file_dest_size='2000G'
&lt;/pre&gt;&lt;br /&gt;
Obviously, the last two parameters about location and size of the FRA should be tailored to your setup.&lt;br /&gt;
&lt;br /&gt;
We then create a new SPFILE with &lt;code&gt;CREATE SPFILE FROM PFILE;&lt;/code&gt;.&lt;br /&gt;
&lt;br /&gt;
Now we're ready to restore the controlfile(s) from backup:&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;RMAN&amp;gt; startup force;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Oracle instance started&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;RMAN-00571: ===========================================================&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;RMAN-00571: ===========================================================&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;RMAN-03002: failure of startup command at 08/13/2009 20:20:56&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;ORA-00205: error in identifying control file, check alert log for more info&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;RMAN&amp;gt; restore controlfile from autobackup recovery area = '/solfra/' db_unique_name = 'PROD';&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Starting restore at 13-AUG-09&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;using target database control file instead of recovery catalog&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;allocated channel: ORA_DISK_1&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;channel ORA_DISK_1: sid=650 devtype=DISK&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;recovery area destination: /solfra/&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;database name (or database unique name) used for search: PROD&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;channel ORA_DISK_1: autobackup found in the recovery area&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;channel ORA_DISK_1: autobackup found: /solfra/PROD/autobackup/2009_08_13/o1_mf_s_694801261_5890xyoj_.bkp&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;channel ORA_DISK_1: control file restore from autobackup complete&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;output filename=+DATA/prod/controlfile/current.256.694815695&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;output filename=+REDO/prod/controlfile/current.256.694815697&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Finished restore at 13-AUG-00&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Note that if you restored the spfile from backup, you don't need to specify the recovery area in the &lt;code&gt;restore controlfile from autobackup&lt;/code&gt; command.  In this case, because I chose to create a pfile from the source instance, I needed to supply the recovery area location.  Note that this is the recovery area that holds the source backups, not the recovery area that your new instance will use once it is opened.&lt;br /&gt;
&lt;br /&gt;
With the control files restored, we can mount the new instance:&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;RMAN&amp;gt; alter database mount;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;database mounted&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;released channel: ORA_DISK_1&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
The next step is to catalog the backup files and archivelogs from the remote FRA.&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;RMAN&amp;gt; CATALOG START WITH '/solfra/PROD' NOPROMPT;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Starting implicit crosscheck backup at 13-AUG-09&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;allocated channel: ORA_DISK_1&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;channel ORA_DISK_1: sid=646 devtype=DISK&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;allocated channel: ORA_DISK_2&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;channel ORA_DISK_2: sid=650 devtype=DISK&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Crosschecked 565 objects&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Finished implicit crosscheck backup at 13-AUG-09&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Starting implicit crosscheck copy at 13-AUG-09&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;using channel ORA_DISK_1&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;using channel ORA_DISK_2&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Finished implicit crosscheck copy at 13-AUG-09&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;searching for all files in the recovery area&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;cataloging files...&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
This will continue listing all the files in the catalog, and some files that were not cataloged (e.g. online redo logs, non-RMAN files, etc.).&lt;br /&gt;
&lt;br /&gt;
Now we're ready to begin our RESTORE phase.  You'll need an rman command file that looks something like this:&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;run {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;set newname for datafile X to new;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;# ... (repeat for other datafiles)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;set newname for tempfile Y to new;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;# ... (repeat for other tempfiles)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;restore database;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;switch datafile all;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;switch tempfile all;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;recover database;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Note that X and Y are the file# of the individual datafile and tempfile, respectively.  You will probably want to generate this file if you have a large number of datafiles.&lt;br /&gt;
&lt;br /&gt;
It is important that you read MetaLink Doc 415884.1, if you are performing a migration to a different platform with the same endian.  Oracle suggests that you should perform a CONVERT DATABASE, but later admits that you only need to perform a CONVERT on tablespaces containing UNDO segments:&lt;br /&gt;
&lt;blockquote&gt;The convert database command is a no operation command for all files that do not contain undo but they are scanned regardless during the conversion. Using the convert tablespace/datafile for those containing undo will suffice and all other source files not containing undo can be moved to the target (same endian) platform without the Recovery Manager conversion. This will greatly reduce the time required to move and database with thousands of files from source to target platform also decreasing the amount of time the database is unavailable.&lt;/blockquote&gt;We had an internal debate over whether or not it is truly necessary even to do this.  However, I would advise you to read this document and discuss it with Oracle Support Services.  They would most likely try to convince you to do it or threaten to not support your database.&lt;br /&gt;
&lt;br /&gt;
Once the script finishes with the &lt;code&gt;recover database&lt;/code&gt; portion, this query should indicate that datafile headers and controlfiles are in sync:&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;SQL&amp;gt; alter session set nls_date_format='YYYY/MON/DD hh24:mi:ss';&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Session altered.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;SQL&amp;gt; select checkpoint_time,fuzzy,count(*),status&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;from ( select checkpoint_time,fuzzy,status&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;from v$datafile_header&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;union all&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;select controlfile_time,'CTL',null from v$database)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;group by checkpoint_time,fuzzy,status;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;CHECKPOINT_TIME      FUZ   COUNT(*) STATUS&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;-------------------- --- ---------- -------&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;2009/AUG/14 02:22:11 CTL   1&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;2009/AUG/14 02:22:11 YES       1266 ONLINE&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
The database is still in mount mode.  If we were ready to cut over now, we could open the database with the &lt;code&gt;RESETLOGS&lt;/code&gt; option.  However, we are still a few hours or a day away from the cutover.  What we want to do is apply more logs from the current production instance as they get archived. To minimize the babysitting, we decided to run this in a script once every few hours:&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;CATALOG START WITH '/solfra/PROD' NOPROMPT;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;RECOVER DATABASE;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
As you can guess, this re-catalogs the NFS-mounted FRA, ignoring files that were already cataloged.  So now the controlfile knows about the new archivelogs.  The &lt;code&gt;RECOVER DATABASE&lt;/code&gt; command then beautifully applies logs from where it left off until it runs out of logs again.  We re-run this periodically to keep our new instance as close to current as possible until it's time to cut over.&lt;br /&gt;
&lt;br /&gt;
When the cutover time comes, we run this on the current production instance:&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;SQL&amp;gt; alter system archive log current;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;System altered.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;SQL&amp;gt; shutdown immediate;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Database closed.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Database dismounted.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;ORACLE instance shut down.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Then, on the new instance, we do one last catalog and recover.  This should bring us completely up to date with the original prod instance.  Now we just need to open with resetlogs:&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;SQL&amp;gt; alter database open resetlogs;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Database altered.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
In my case, I manually renamed the online and standby redo logs to &lt;code&gt;+REDO&lt;/code&gt; (they still had the old filesystem names in v$logfile), but I believe that &lt;code&gt;OPEN RESETLOGS&lt;/code&gt; does this automatically anyway.&lt;br /&gt;
&lt;br /&gt;
And so, here we are in Linux on on the same version (10.2.0.2) as Solaris with appropriate one-off patches, using ASM.  At this point, I was just under 30 minutes into my downtime window since the original prod instance was shutdown.  I don't think that's too bad for moving a 1.3T database!&lt;br /&gt;
&lt;br /&gt;
After this, I immediately went into upgrading to 11gR1 (11.1.0.7) and then building a new standby instance, but that is outside the scope of the initial migration that I wanted to share with you today.  Cheers!&lt;img src="http://feeds.feedburner.com/~r/DieSeilerwerks/~4/gBMVDL0YIsI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.seiler.us/feeds/6171891122832905879/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.seiler.us/2009/10/howto-oracle-cross-platform-migration.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7032512792942232766/posts/default/6171891122832905879?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7032512792942232766/posts/default/6171891122832905879?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DieSeilerwerks/~3/gBMVDL0YIsI/howto-oracle-cross-platform-migration.html" title="HOWTO: Oracle Cross-Platform Migration with Minimal Downtime" /><author><name>Don Seiler</name><uri>http://www.blogger.com/profile/06863841688485670148</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="29" height="32" src="http://2.bp.blogspot.com/-8TdBDfGw74I/TfDl-_rQAvI/AAAAAAAAAFc/tfscblA-9t8/s220/dtseiler_oraclenerd.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.seiler.us/2009/10/howto-oracle-cross-platform-migration.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkUHRno_fyp7ImA9Wx9TEko.&quot;"><id>tag:blogger.com,1999:blog-7032512792942232766.post-4426775554330440379</id><published>2009-08-26T16:06:00.000-05:00</published><updated>2010-11-20T11:30:37.447-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-11-20T11:30:37.447-06:00</app:edited><title>Turn Off db_cache_advice To Avoid Latch Contention Bugs</title><content type="html">&lt;em&gt;Originally posted on &lt;a href="http://www.pythian.com/news/2838/turn-off-db_cache_advice-to-avoid-latch-contention-bugs"&gt;The Pythian Group blog&lt;/a&gt;.&lt;/em&gt;&lt;br /&gt;
&lt;br /&gt;
A couple of weeks ago, we noticed some timeouts in some of our standard Oracle RDBMS health check scripts on a new instance. I had just migrated this instance to bigger, better, badder hardware and so it had been given more SGA to use, namely a bigger buffer cache. The software version was still Oracle 10.2.0.2, as we wanted to introduce as few variables as possible (we were already moving to a new platform with an &lt;a href="http://en.wikipedia.org/wiki/Endianness"&gt;endian&lt;/a&gt; change).&lt;br /&gt;
&lt;br /&gt;
At first the timeouts were infrequent, but over the course of a week started to grow in frequencey until the point where none of the checks were finishing in the allowed timeframe. We ran an AWR report, and tucked far down in the “Latch Activity” section, a colleague noticed this:&lt;br /&gt;
&lt;pre&gt;Pct    Avg   Wait                 Pct
                                    Get    Get   Slps   Time       NoWait NoWait
Latch Name                     Requests   Miss  /Miss    (s)     Requests   Miss
------------------------ -------------- ------ ------ ------ ------------ ------
...
&lt;strong&gt;simulator lru latch          10,032,617    3.3    0.7  44950      336,837    0.3&lt;/strong&gt;
...
 Latch Activity                             DB/Inst: FOO/foo  Snaps: 156-157
-&amp;gt; "Get Requests", "Pct Get Miss" and "Avg Slps/Miss" are statistics for
   willing-to-wait latch get requests
-&amp;gt; "NoWait Requests", "Pct NoWait Miss" are for no-wait latch get requests
-&amp;gt; "Pct Misses" for both should be very close to 0.0

                                           Pct    Avg   Wait                 Pct
                                    Get    Get   Slps   Time       NoWait NoWait
Latch Name                     Requests   Miss  /Miss    (s)     Requests   Miss
------------------------ -------------- ------ ------ ------ ------------ ------
transaction branch alloc        112,412    0.0    0.0      0            0    N/A
undo global data                466,321    0.0    0.0      0            0    N/A
user lock                         7,440    0.8    0.4      1            0    N/A
          -------------------------------------------------------------&lt;/pre&gt;The “simulator lru latch” event brought us to MetaLink note 5918642.8 and bug 5918642. Affecting 10g and 11g prior to 10.2.0.4 and 11.1.0.7, respectively. The bug is with the database buffer cache advisor, controlled by the parameter &lt;a href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/initparams042.htm#sthref126"&gt;db_cache_advice&lt;/a&gt;, which defaults to ON (depending on statistics_level).  The note simply states:&lt;br /&gt;
&lt;blockquote&gt;High simulator lru latch contention can occur when db_cache_advice is set to ON if there is a large buffer cache.&lt;/blockquote&gt;We simply set db_cache_advice to OFF (thankfully it is a dynamic parameter), and pretty quickly our checks were running just fine.&lt;br /&gt;
&lt;br /&gt;
My suggestion is to simply turn this off unless you are actively using the cache advisor to tune an instance. Once you are done tuning, and are no longer using the advisor, turn it off.&lt;br /&gt;
&lt;br /&gt;
NOTE: &amp;nbsp;As Mladen Gogola pointed out in the comments, turning this off will cause problems if you are using automatic memory management (i.e. sga_target &amp;gt; 0). &amp;nbsp; Re-pasting his post here:&lt;br /&gt;
&lt;blockquote&gt;The problem with that advice is that it will prevent automatic memory management from resizing the buffer cache and the instance will end up with a huge, mostly empty, shared pool and default buffer cache. Automatic memory management is biased toward shared pool even with the cache dvice turned on, without it, buffer cache will be reduced to the minimum size, usually only 64MB. If you disable cache advice, I would also recommend disabling the automatic memory management and configuring SGA manually.&lt;/blockquote&gt;&lt;img src="http://feeds.feedburner.com/~r/DieSeilerwerks/~4/KfekmkPgoHM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.seiler.us/feeds/4426775554330440379/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.seiler.us/2009/08/turn-off-dbcacheadvice-to-avoid-latch.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7032512792942232766/posts/default/4426775554330440379?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7032512792942232766/posts/default/4426775554330440379?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DieSeilerwerks/~3/KfekmkPgoHM/turn-off-dbcacheadvice-to-avoid-latch.html" title="Turn Off db_cache_advice To Avoid Latch Contention Bugs" /><author><name>Don Seiler</name><uri>http://www.blogger.com/profile/06863841688485670148</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="29" height="32" src="http://2.bp.blogspot.com/-8TdBDfGw74I/TfDl-_rQAvI/AAAAAAAAAFc/tfscblA-9t8/s220/dtseiler_oraclenerd.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.seiler.us/2009/08/turn-off-dbcacheadvice-to-avoid-latch.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkcHR389fyp7ImA9Wx9TEko.&quot;"><id>tag:blogger.com,1999:blog-7032512792942232766.post-1774002754212201284</id><published>2009-08-19T12:37:00.000-05:00</published><updated>2010-11-20T11:27:16.167-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-11-20T11:27:16.167-06:00</app:edited><title>Setting up Network ACLs in Oracle 11g… For Dummies</title><content type="html">&lt;em&gt;Originally posted on &lt;a href="http://www.pythian.com/news/3434/setting-up-network-acls-in-oracle-11g-for-dummies"&gt;The Pythian Group blog&lt;/a&gt;.&lt;br /&gt;
&lt;/em&gt;&lt;br /&gt;
&lt;br /&gt;
Having recently performed a test upgrade for a client from Oracle RDBMS 10g to 11g, I can tell you that one of the big changes that will likely require action on your part as DBA is the new fine-grained access control for the packages &lt;code&gt;UTL_SMTP&lt;/code&gt;, &lt;code&gt;UTL_TCP&lt;/code&gt;, &lt;code&gt;UTL_MAIL&lt;/code&gt;, &lt;code&gt;UTL_HTTP&lt;/code&gt; and &lt;code&gt;UTL_INADDR&lt;/code&gt;.  Part of the Oracle 11g pre-upgrade tool will &lt;a href="http://download.oracle.com/docs/cd/B28359_01/server.111/b28300/upgrade.htm#BABJHIHH"&gt;notify you of users that will require new privileges&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
Of course, Oracle’s &lt;a href="http://download.oracle.com/docs/cd/B28359_01/server.111/b28300/afterup.htm#BABFCBJI"&gt;post-upgrade network ACL setup documentation&lt;/a&gt; is much more confusing than it needs to be, at least for simple minds like me. A colleague stepped forward with a simple set of commands for a basic setup that even the tired and stressed can understand.&lt;br /&gt;
&lt;br /&gt;
I’ll share that here, with some basic explanation:&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;BEGIN&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;-- Create the new ACL, naming it "netacl.xml", with a description.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;-- Also, provide one starter privilege, granting user FOO&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;-- the privilege to connect.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;DBMS_NETWORK_ACL_ADMIN.CREATE_ACL('netacl.xml',&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;'Allow usage to the UTL network packages', 'FOO', TRUE, 'connect');&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;-- Now grant privilege to resolve DNS names for FOO,&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;-- and then grant connect and resolve to user BAR&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE('netacl.xml' ,'FOO', TRUE, 'resolve');&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE('netacl.xml' ,'BAR', TRUE, 'connect');&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE('netacl.xml' ,'BAR', TRUE, 'resolve');&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;-- Specify which hosts this ACL applies to,&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;-- for simplicity, we're saying all (*)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;-- You might want to specify certain hosts to lock this down.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL('netacl.xml','*');&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;END;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;/&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
As you can see, this example will let the &lt;code&gt;FOO&lt;/code&gt; and &lt;code&gt;BAR&lt;/code&gt; database users connect and resolve to any host.  The &lt;code&gt;ASSIGN_ACL&lt;/code&gt; section in the full package documentation (see link below) details how this can be used to lock down a user’s ability to make outside connections.&lt;br /&gt;
&lt;br /&gt;
Of course, nothing beats reading the &lt;a href="http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28419/d_networkacl_adm.htm#insertedID0"&gt;Oracle 11g DBMS_NETWORK_ACL_ADMIN documentation&lt;/a&gt;, where you can see some examples of stricter ACL setups.&lt;img src="http://feeds.feedburner.com/~r/DieSeilerwerks/~4/3VqGBmuE0dM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.seiler.us/feeds/1774002754212201284/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.seiler.us/2009/08/setting-up-network-acls-in-oracle-11g.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7032512792942232766/posts/default/1774002754212201284?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7032512792942232766/posts/default/1774002754212201284?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DieSeilerwerks/~3/3VqGBmuE0dM/setting-up-network-acls-in-oracle-11g.html" title="Setting up Network ACLs in Oracle 11g… For Dummies" /><author><name>Don Seiler</name><uri>http://www.blogger.com/profile/06863841688485670148</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="29" height="32" src="http://2.bp.blogspot.com/-8TdBDfGw74I/TfDl-_rQAvI/AAAAAAAAAFc/tfscblA-9t8/s220/dtseiler_oraclenerd.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.seiler.us/2009/08/setting-up-network-acls-in-oracle-11g.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkIFQnY8fSp7ImA9Wx9TEko.&quot;"><id>tag:blogger.com,1999:blog-7032512792942232766.post-5759278013173304883</id><published>2009-08-19T12:32:00.000-05:00</published><updated>2010-11-20T11:35:13.875-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-11-20T11:35:13.875-06:00</app:edited><title>Sending Timezone-Aware Email with UTL_SMTP</title><content type="html">&lt;em&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Originally posted at &lt;a href="http://www.pythian.com/news/1976/sending-timezone-aware-email-with-utl_smtp"&gt;The Pythian Group blog&lt;/a&gt;.&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;
&lt;br /&gt;
I’m back again with another in what I hope will be a long line of “Quick Tips for Newbies” series.&lt;br /&gt;
&lt;br /&gt;
At The Pythian Group, we have employees all over the globe, from our headquarters in Ottawa to regional offices in Boston, Prague, India and Sydney, and a few scattered remote workers in Seattle, Paris, Kiev, Brazil, South Africa and Wisconsin, among other places. In other words, we are spread across multiple timezones, and since it wasn’t too long ago that everyone was in Ottawa, this is something that still presents little quirks.&lt;br /&gt;
&lt;br /&gt;
One such quirk involved email generated by one of our internal Oracle instances—via a stored procedure that used &lt;code&gt;UTL_SMTP&lt;/code&gt; to send the messages—did not have timezone information in the “Date” email header. As a result, they would be stamped with the hour in Eastern timezone (Ottawa time), but the mail clients would think that hour was local. Depending on where you are relative to Ottawa, this could be many hours in the past or future. Of course, this wouldn’t be noticed if you were in Ottawa or even Boston, both in Eastern. For the rest, it was at the very least, an annoyance—but one that is easily fixed.&lt;br /&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;Looking at the PL/SQL stored procedure that we used to generate email messages, I saw that the “Date” header was being built with this code:&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;date_hdr := 'Date: '||to_char(sysdate,'dd Mon yy hh24:mi:ss');&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
The fix is almost trivial—just use &lt;code&gt;SYSTIMESTAMP&lt;/code&gt; instead of &lt;code&gt;SYSDATE&lt;/code&gt;, and include the timezone in the &lt;code&gt;TO_CHAR&lt;/code&gt; function:&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;date_hdr := 'Date: '||to_char(systimestamp,'dd Mon yy hh24:mi:ss tzhtzm');&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Voila!  Emails now had a full Date header. And there was much rejoicing from around the world.&lt;br /&gt;
&lt;br /&gt;
Here’s a quick query to highlight the difference:&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;SQL&amp;gt; select to_char(sysdate,'dd Mon yy hh24:mi:ss') from dual;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;TO_CHAR(SYSDATE,'D&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;------------------&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;01 Dec 08 18:50:02&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;SQL&amp;gt; select to_char(systimestamp,'dd Mon yy hh24:mi:ss tzhtzm') from dual;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;TO_CHAR(SYSTIMESTAMP,'DD&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;------------------------&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;01 Dec 08 18:50:10 -0500&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
Even if you aren’t sending email to all the ends of the Earth, it won’t hurt to make your messages timezone-aware. I’m sure it will save some confusion and frustration down the line.&lt;br /&gt;
&lt;br /&gt;
&lt;em&gt;Note: I discovered the fix via &lt;a href="http://hidowb.blogspot.com/2008/04/time-zone-and-header-in-emails-using.html"&gt;this blog post&lt;/a&gt;, which seems to be invite-only at the time of this writing.&lt;/em&gt;&lt;img src="http://feeds.feedburner.com/~r/DieSeilerwerks/~4/MTJmq1ayQIs" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.seiler.us/feeds/5759278013173304883/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.seiler.us/2009/08/sending-timezone-aware-email-with.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7032512792942232766/posts/default/5759278013173304883?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7032512792942232766/posts/default/5759278013173304883?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DieSeilerwerks/~3/MTJmq1ayQIs/sending-timezone-aware-email-with.html" title="Sending Timezone-Aware Email with UTL_SMTP" /><author><name>Don Seiler</name><uri>http://www.blogger.com/profile/06863841688485670148</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="29" height="32" src="http://2.bp.blogspot.com/-8TdBDfGw74I/TfDl-_rQAvI/AAAAAAAAAFc/tfscblA-9t8/s220/dtseiler_oraclenerd.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.seiler.us/2009/08/sending-timezone-aware-email-with.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkEHRX46eip7ImA9Wx9TEko.&quot;"><id>tag:blogger.com,1999:blog-7032512792942232766.post-6799498752612923602</id><published>2009-08-19T12:20:00.000-05:00</published><updated>2010-11-20T11:37:14.012-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-11-20T11:37:14.012-06:00</app:edited><title>ORA-16069? You May Need A New Standby Controlfile</title><content type="html">&lt;em&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Originally posted on &lt;a href="http://www.pythian.com/news/1902/ora-16069-new-standby-controlfile"&gt;The Pythian Group blog&lt;/a&gt;.&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;
&lt;br /&gt;
On a recent Monday, I had to perform an emergency Oracle standby switchover for a client whose primary instance host had mysteriously rebooted itself over the previous day. Confidence in that host was, understandably, shaken.&lt;br /&gt;
&lt;br /&gt;
The Oracle Data Guard configuration is a 3-instance setup using Data Guard Broker: one primary, we’ll call it OraA, feeding two standby instances, OraB and OraC. In this particular configuration, we perform switchovers between OraA and OraC. Caught in the middle is OraB, which is on a 60-minute standby delay.&lt;br /&gt;
&lt;br /&gt;
After this particular switchover, OraB started complaining with this message in the alert log:&lt;br /&gt;
&lt;br /&gt;
&lt;span id="more-1902"&gt; &lt;/span&gt;&lt;br /&gt;
&lt;pre&gt;ORA-16069: Archive Log standby database activation identifier mismatch&lt;/pre&gt;&lt;pre&gt;&lt;/pre&gt;We had seen this occasionally in prior switchovers, and the problem would fix itself once the standby delay passed and the OraB standby would process the log notifying it of the switchover. This time, however, recovery was stopped and more than enough time had elapsed. OraA and OraC were performing perfectly fine.&lt;br /&gt;
&lt;br /&gt;
Much of the reference searching I saw suggested that the standby instance would have to be completely rebuilt. Not an appetizing option. A search of metalink turned up Bug 4048687, which seemed to demonstrate a similar problem, although on a different OS/Platform. That solution was to recreate the standby controlfile. Trust me, it sounds more drastic than it is!&lt;br /&gt;
&lt;br /&gt;
Here’s how to do it in just 6 easy steps!&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Shutdown the misbehaving standby.&lt;/li&gt;
&lt;li&gt;Copy one of the current standby controlfiles for safekeeping (just in case).&lt;/li&gt;
&lt;li&gt;On the primary instance, create a new standby controlfile: &lt;code&gt;alter database create standby controlfile as '/tmp/stdby.ctl';&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Transfer that new standby controlfile to the standby host.&lt;/li&gt;
&lt;li&gt;Copy the new controlfile to the controlfile location(s) used by the instance (you have more than one, right?).&lt;/li&gt;
&lt;li&gt;STARTUP MOUNT the standby instance. If you use the Data Guard Broker, it should automatically begin recovery for you; otherwise restart managed recovery with &lt;code&gt;alter database recover managed standby database disconnect;&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;Voila.  Standby recovery should resume nicely, assuming logs are there to apply.&lt;img src="http://feeds.feedburner.com/~r/DieSeilerwerks/~4/130xxITRv30" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.seiler.us/feeds/6799498752612923602/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.seiler.us/2009/08/ora-16069-you-may-need-new-standby.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7032512792942232766/posts/default/6799498752612923602?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7032512792942232766/posts/default/6799498752612923602?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DieSeilerwerks/~3/130xxITRv30/ora-16069-you-may-need-new-standby.html" title="ORA-16069? You May Need A New Standby Controlfile" /><author><name>Don Seiler</name><uri>http://www.blogger.com/profile/06863841688485670148</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="29" height="32" src="http://2.bp.blogspot.com/-8TdBDfGw74I/TfDl-_rQAvI/AAAAAAAAAFc/tfscblA-9t8/s220/dtseiler_oraclenerd.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.seiler.us/2009/08/ora-16069-you-may-need-new-standby.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Dk4BSX47fSp7ImA9Wx9TEko.&quot;"><id>tag:blogger.com,1999:blog-7032512792942232766.post-3448308440623065519</id><published>2008-10-01T10:20:00.000-05:00</published><updated>2010-11-20T11:42:38.005-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-11-20T11:42:38.005-06:00</app:edited><title>GNU basename in PL/SQL</title><content type="html">&lt;em&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Reposted from &lt;a href="http://www.pythian.com/blogs/1229/gnu-basename-in-plsql"&gt;The Pythian Group blog&lt;/a&gt;.&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;
&lt;br /&gt;
In the process of scripting a database migration, I was in need of something akin to the &lt;a href="http://www.opengroup.org/onlinepubs/007908799/xcu/basename.html"&gt;GNU basename&lt;/a&gt; utility that I know and love on Linux.  &lt;code&gt;basename&lt;/code&gt; is most famous for taking a full file path string and stripping away the leading path component, returning just the name of the file. This can be emulated in PL/SQL with calls to &lt;code&gt;SUBSTR&lt;/code&gt; and &lt;code&gt;INSTR&lt;/code&gt;, like this:&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;substr(dirname,instr(dirname,'/',-1)+1)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
(Thanks to Ian Cary, who shared this logic on &lt;a href="http://www.freelists.org/archives/oracle-l/08-2005/msg01654.html"&gt;oracle-l&lt;/a&gt;)&lt;br /&gt;
&lt;br /&gt;
As you can see, this simply finds the last occurence of &lt;code&gt;/&lt;/code&gt;, which is our directory separator on *nix and Solaris operating systems.  On Windows, it would be &lt;code&gt;\&lt;/code&gt;. It then returns a substring beginning one character after that last separator until the end of the string. Voila, a basic basename routine!&lt;br /&gt;
&lt;br /&gt;
Upon reading the &lt;a href="http://www.opengroup.org/onlinepubs/007908799/xcu/basename.html"&gt;basename man page&lt;/a&gt; again, I found that basename also takes an optional parameter, a suffix string. If this suffix string is provided, basename will also truncate that string from the end. For example:&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;$ basename /home/seiler/bookmarks.html&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;bookmarks.html&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;$ basename /home/seiler/bookmarks.html .html&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;bookmarks&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
I decided that this would be handy to have, and set out to create a compatible basename function in PL/SQL. Here is what I came up with:&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;CREATE OR REPLACE FUNCTION basename (v_full_path IN VARCHAR2,&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;v_suffix IN VARCHAR2 DEFAULT NULL,&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;v_separator IN CHAR DEFAULT '/')&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;RETURN VARCHAR2&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;IS&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;v_basename VARCHAR2(256);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;BEGIN&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;v_basename := SUBSTR(v_full_path, INSTR(v_full_path,v_separator,-1)+1);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;IF v_suffix IS NOT NULL THEN&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;v_basename := SUBSTR(v_basename, 1, INSTR(v_basename, v_suffix, -1)-1);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;END IF;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;RETURN v_basename;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;END;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;/&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
I’ve also added an optional third parameter to specify a directory separator other than the default. It would probably be rarely useful, but not hard to remove if you don’t like it. As you can see, I’ve used similar SUBSTR/INSTR logic to identify the suffix index and prune it out.&lt;br /&gt;
&lt;br /&gt;
Here it is in action:&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;SQL&amp;gt; COLUMN file_name FORMAT a45;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;SQL&amp;gt; COLUMN basename FORMAT a15;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;SQL&amp;gt; COLUMN no_suffix FORMAT a12;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;SQL&amp;gt; SELECT file_name&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;2          , basename(file_name) as basename&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;3          , basename(file_name, '.dbf') as no_suffix&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;4  FROM dba_data_files;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;FILE_NAME &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; BASENAME &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;NO_SUFFIX&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;--------------------------------------------- --------------- ------------&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;/u01/app/oracle/oradata/orcl/users01.dbf &amp;nbsp; &amp;nbsp; &amp;nbsp;users01.dbf &amp;nbsp; &amp;nbsp; users01&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;/u01/app/oracle/oradata/orcl/sysaux01.dbf &amp;nbsp; &amp;nbsp; sysaux01.dbf &amp;nbsp; &amp;nbsp;sysaux01&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;/u01/app/oracle/oradata/orcl/undotbs01.dbf &amp;nbsp; &amp;nbsp;undotbs01.dbf &amp;nbsp; undotbs01&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;/u01/app/oracle/oradata/orcl/system01.dbf &amp;nbsp; &amp;nbsp; system01.dbf &amp;nbsp; &amp;nbsp;system01&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;/u01/app/oracle/oradata/orcl/example01.dbf &amp;nbsp; &amp;nbsp;example01.dbf &amp;nbsp; example01&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
I hope this makes your work just a little bit easier, as it has mine.&lt;img src="http://feeds.feedburner.com/~r/DieSeilerwerks/~4/pl5dePDdMHo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.seiler.us/feeds/3448308440623065519/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.seiler.us/2000/10/gnu-basename-in-plsql.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7032512792942232766/posts/default/3448308440623065519?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7032512792942232766/posts/default/3448308440623065519?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DieSeilerwerks/~3/pl5dePDdMHo/gnu-basename-in-plsql.html" title="GNU basename in PL/SQL" /><author><name>Don Seiler</name><uri>http://www.blogger.com/profile/06863841688485670148</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="29" height="32" src="http://2.bp.blogspot.com/-8TdBDfGw74I/TfDl-_rQAvI/AAAAAAAAAFc/tfscblA-9t8/s220/dtseiler_oraclenerd.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.seiler.us/2000/10/gnu-basename-in-plsql.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0cBSX0-eip7ImA9Wx9TEko.&quot;"><id>tag:blogger.com,1999:blog-7032512792942232766.post-4400287131821877868</id><published>2008-10-01T10:10:00.000-05:00</published><updated>2010-11-20T11:44:18.352-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-11-20T11:44:18.352-06:00</app:edited><title>Does Oracle’s Block Change Tracking File Shrink?</title><content type="html">&lt;em&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Reposted from &lt;a href="http://www.pythian.com/blogs/1163/does-oracle-block-change-tracking-file-shrink"&gt;The Pythian Group blog&lt;/a&gt;.&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;
&lt;br /&gt;
Just a quick post to get myself back into blogging mode.  Recently in IRC (&lt;a href="irc://irc.freenode.net/#oracle"&gt;#oracle on freenode&lt;/a&gt;, to be precise), a fresh face asked if the &lt;a href="http://www.oracle.com/technology/oramag/oracle/04-nov/o64rman.html"&gt;Block Change Tracking file&lt;/a&gt; ever shrinks.  She had been worrying about the file in her instance continuing to grow.  A number of us speculated (non-&lt;a href="http://www.battleagainstanyguess.com/"&gt;BAAG&lt;/a&gt;!) that perhaps taking an RMAN backup would somehow purge the file of what it was keeping track of, and then the magical Oracle fairies would promptly resize it for us. Needless to say, I was hesitant to take this theory forward with &lt;a href="http://www.pythian.com/blogs/483/block-change-tracking-internals-x-tables-research-xkrc-snappack"&gt;Alex Gorbachev&lt;/a&gt; aware of my home address.&lt;br /&gt;
&lt;br /&gt;
After setting up Oracle 10.2.0.1 on a nice &lt;a href="http://www.virtualbox.org/"&gt;VirtualBox&lt;/a&gt; image&amp;nbsp;(more on that in another post) running &lt;a href="http://centos.org/"&gt;CentOS&lt;/a&gt; 5, I began to do some reading.  For some reason, actually reading &lt;a href="http://tahiti.oracle.com/"&gt;the official tahiti docs&lt;/a&gt; was last on my list.  A search of the 10gR2 docs quickly yielded &lt;a href="http://download.oracle.com/docs/cd/B19306_01/backup.102/b14192/bkup004.htm#sthref424"&gt;this (from &lt;em&gt;RMAN Incremental Backups&lt;/em&gt;)&lt;/a&gt;:&lt;br /&gt;
&lt;blockquote&gt;&lt;strong&gt;4.4.4.4 Estimating Size of the Change Tracking File on Disk&lt;br /&gt;
&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
The size of the change tracking file is proportional to the size of the database and the number of enabled threads of redo. The size is not related to the frequency of updates to the database. Typically, the space required for block change tracking is approximately 1/30,000 the size of the data blocks to be tracked. Note, however, the following two factors that may cause the file to be larger than this estimate suggests:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;To avoid overhead of allocating space as your database grows, the change tracking file size starts at 10MB, and new space is allocated in 10MB incremenents [&lt;em&gt;sic&lt;/em&gt;]. Thus, for any database up to approximately 300GB the file size is no smaller than 10MB, for up to approximately 600GB the file size is no smaller than 20MB, and so on.&lt;/li&gt;
&lt;li&gt;For each datafile, a minimum of 320K of space is allocated in the change tracking file, regardless of the size of the file. Thus, if you have a large number of relatively small datafiles, the change tracking file is larger than for databases with a smaller number of larger datafiles containing the same data.&lt;/li&gt;
&lt;/ul&gt;&lt;/blockquote&gt;So (if the docs are to be trusted), it would seem that whether or not a backup is taken has no effect on the size of the file, or at least wouldn’t cause it to be shrunk. The size is tied to the amount of data in the database itself, not necessarily the changes in the database waiting to be included in the next incremental RMAN backup.&lt;br /&gt;
&lt;br /&gt;
The documentation does suggest, however, that file size might be affected if (for example) a tablespace and its datafiles were dropped from the database. I’ll save this test for another day!&lt;img src="http://feeds.feedburner.com/~r/DieSeilerwerks/~4/gHcSayUKseA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.seiler.us/feeds/4400287131821877868/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.seiler.us/2008/10/does-oracles-block-change-tracking-file.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7032512792942232766/posts/default/4400287131821877868?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7032512792942232766/posts/default/4400287131821877868?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DieSeilerwerks/~3/gHcSayUKseA/does-oracles-block-change-tracking-file.html" title="Does Oracle’s Block Change Tracking File Shrink?" /><author><name>Don Seiler</name><uri>http://www.blogger.com/profile/06863841688485670148</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="29" height="32" src="http://2.bp.blogspot.com/-8TdBDfGw74I/TfDl-_rQAvI/AAAAAAAAAFc/tfscblA-9t8/s220/dtseiler_oraclenerd.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.seiler.us/2008/10/does-oracles-block-change-tracking-file.html</feedburner:origLink></entry></feed>
