<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' 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'><id>tag:blogger.com,1999:blog-2291826243498100498</id><updated>2024-10-25T03:04:38.140+13:00</updated><category term="database"/><category term="unix"/><category term="sql"/><category term="performance"/><category term="documentation"/><category term="backup"/><category term="data dictionary"/><category term="parameters"/><category term="rman"/><category term="security"/><category term="text editor"/><category term="development"/><category term="metalink"/><category term="oracle"/><category term="oracle errors"/><category term="recovery"/><category term="redo"/><category term="stats"/><category term="windows"/><category term="adrci"/><category term="client"/><category term="constraints"/><category term="database datapump"/><category term="dba"/><category term="delete backup"/><category term="distributed"/><category term="drop database"/><category term="error"/><category term="excel"/><category term="function"/><category term="gzip"/><category term="install"/><category term="java"/><category term="ksh"/><category term="maintenance"/><category term="me"/><category term="os"/><category term="osx"/><category term="partitions"/><category term="password file"/><category term="plsql"/><category term="programming"/><category term="schedule window"/><category term="scheduler"/><category term="sqlplus"/><category term="standby"/><category term="tar"/><category term="unsupport notices"/><category term="vi"/><category term="vnc"/><category term="xwindows"/><title type='text'>Sam&#39;s Oracle BLOG</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://sams-oracle-blog.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2291826243498100498/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://sams-oracle-blog.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/2291826243498100498/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Sam Matthews</name><uri>http://www.blogger.com/profile/17519957832896882044</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>103</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2291826243498100498.post-4800004434082538017</id><published>2012-03-20T11:06:00.001+13:00</published><updated>2012-03-20T11:11:30.620+13:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="osx"/><title type='text'>MarsEdit</title><content type='html'>&lt;p&gt;MarsEdit, http://www.red-sweater.com/marsedit/, looking quite good.&lt;br /&gt; Firstly, easy to setup, I give it a label and http address, the MarsEdit goes and asks for my google userid and password, linked to my blog.&lt;br /&gt; &lt;br /&gt; I then get a nice interface, with my categories, i.e., tags, a list of all of my blog entries, so simple.&lt;br /&gt; So here I am, writing a blog entry. Lets see what it looks like on the other side.&lt;br /&gt; &lt;br /&gt; ...&lt;br /&gt; &lt;br /&gt; On the other side, it doesn&#39;t look too bad.&lt;br /&gt; &lt;br /&gt; And on the other side -&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;yip looks pretty good.&lt;/p&gt;
&lt;/blockquote&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2291826243498100498/posts/default/4800004434082538017'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2291826243498100498/posts/default/4800004434082538017'/><link rel='alternate' type='text/html' href='http://sams-oracle-blog.blogspot.com/2012/03/marsedit.html' title='MarsEdit'/><author><name>Sam Matthews</name><uri>http://www.blogger.com/profile/17519957832896882044</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2291826243498100498.post-1421984066486084722</id><published>2011-11-24T16:35:00.001+13:00</published><updated>2011-11-24T16:38:42.931+13:00</updated><title type='text'>Missing DBMS_SCHEDULER Jobs via OEM</title><content type='html'>Under OEM 11.1, have noticed that SYS jobs are not included in the list of current jobs. Of course no DBA would create objects under SYS, however sometimes we do.&lt;br /&gt;
&lt;br /&gt;
If you notice a job is running, even an os command, then query the dba_scheduler_jobs view. This will list all dbms_scheduler jobs, then use notmal dbms_scheduler options to work with this job, prefrebably drop the job.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2291826243498100498/posts/default/1421984066486084722'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2291826243498100498/posts/default/1421984066486084722'/><link rel='alternate' type='text/html' href='http://sams-oracle-blog.blogspot.com/2011/11/missing-dbmsscheduler-jobs-via-oem.html' title='Missing DBMS_SCHEDULER Jobs via OEM'/><author><name>Sam Matthews</name><uri>http://www.blogger.com/profile/17519957832896882044</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2291826243498100498.post-2689002556574487145</id><published>2011-11-17T15:14:00.001+13:00</published><updated>2011-11-17T15:26:48.854+13:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="oracle"/><category scheme="http://www.blogger.com/atom/ns#" term="performance"/><category scheme="http://www.blogger.com/atom/ns#" term="sql"/><title type='text'>Invisible Indexes</title><content type='html'>This is a really nice feature, particulary for me, a development DBA. Essentially you can make an index invisible so the optimizer doesn&#39;t use this index. This is excellent testing new indexes. You don&#39;t need to spend the time waiting for an index to be recreated each time you want to compare the differences.&lt;br /&gt;
&lt;br /&gt;
To make an index invisable then run:&lt;br /&gt;
&lt;strong&gt;sql&amp;gt; alter index &amp;lt;index name&amp;gt; INVISIBLE;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
To make an index visible:&lt;br /&gt;
&lt;strong&gt;sql&amp;gt; alter index &amp;lt;index name&amp;gt; VISIBLE;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
You can also make the optimizer use all invisible indexes by for the current session by:&lt;br /&gt;
&lt;strong&gt;sql&amp;gt; alter session set optimizer_use_invisible_indexes = true ;&lt;/strong&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2291826243498100498/posts/default/2689002556574487145'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2291826243498100498/posts/default/2689002556574487145'/><link rel='alternate' type='text/html' href='http://sams-oracle-blog.blogspot.com/2011/11/invisible-indexes.html' title='Invisible Indexes'/><author><name>Sam Matthews</name><uri>http://www.blogger.com/profile/17519957832896882044</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2291826243498100498.post-1732350734174401740</id><published>2011-11-12T21:07:00.001+13:00</published><updated>2011-11-12T21:28:40.608+13:00</updated><title type='text'>TAR and Excluding Files</title><content type='html'>This blog will quickly discuss how to exclude files when using TAR to create an archive.&lt;br /&gt;
&lt;br /&gt;
The syntax to do this is:&lt;br /&gt;
&lt;br /&gt;
tar cvfX &amp;lt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2291826243498100498/posts/default/1732350734174401740'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2291826243498100498/posts/default/1732350734174401740'/><link rel='alternate' type='text/html' href='http://sams-oracle-blog.blogspot.com/2011/11/tar-and-excluding-files.html' title='TAR and Excluding Files'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2291826243498100498.post-4285147205215979244</id><published>2011-11-11T10:55:00.001+13:00</published><updated>2011-11-11T11:17:09.902+13:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="adrci"/><category scheme="http://www.blogger.com/atom/ns#" term="database"/><title type='text'>Packaging Oracle Incidents</title><content type='html'>Under version 11, oracle introduced an interesting mechanism called &quot;adrci&quot; aka &lt;br /&gt;
&lt;br /&gt;
&quot;AUTOIMATIC DIAGNOSTIC REPOSITORY&quot;&lt;br /&gt;
&lt;br /&gt;
This tool, among other tasks does the following:&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;- Automatically purges trace files, alert log files etc&lt;br /&gt;
&amp;nbsp;- Manages &quot;incidents&quot;&lt;br /&gt;
&amp;nbsp;- Packages incidents.&lt;br /&gt;
&lt;br /&gt;
This blog will talk about how to manage the logs and manage incidents. Although many features discussed in this blog can be completed via OEM, I will be discussing how to do this from the command interface.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;To Log On, run:&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
unix&amp;gt; adrci&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;To show your current environment, run:&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
adrci&amp;gt; show homes&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;To set a HOME environment, run:&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
adrci&amp;gt; set home &lt;homename&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;To show current incidents, run:&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
adrci&amp;gt; show incidents&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: #ffe599; font-size: xx-small;&quot;&gt;&lt;strong&gt;ADR Home = /opt/oracle/admin/diag/rdbms/xxx/XXX:&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #ffe599; font-size: xx-small;&quot;&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #ffe599; font-size: xx-small;&quot;&gt;&lt;strong&gt;*************************************************************************&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #ffe599; font-size: xx-small;&quot;&gt;&lt;strong&gt;INCIDENT_ID PROBLEM_KEY CREATE_TIME&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #ffe599; font-size: xx-small;&quot;&gt;&lt;strong&gt;-------------------- ----------------------------------------------------------- ------------------&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #ffe599; font-size: xx-small;&quot;&gt;&lt;strong&gt;12426 ORA 3137 [12333] 2011-11-02 16:47:50.277000 +13:00&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #ffe599; font-size: xx-small;&quot;&gt;&lt;strong&gt;1 rows fetched&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;strong&gt;To purge a particular incident, run:&lt;/strong&gt;&lt;/span&gt; &lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
adrci&amp;gt; purge -i n nn nnn &lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&lt;strong&gt;To purge a type of data, run:&lt;/strong&gt; &lt;br /&gt;
&lt;strong&gt;&lt;/strong&gt;&amp;nbsp; &lt;br /&gt;
&lt;strong&gt;adrci&amp;gt; purge -age nn -type xxx&lt;/strong&gt; &lt;br /&gt;
&lt;strong&gt;&lt;/strong&gt;&amp;nbsp; &lt;br /&gt;
&lt;strong&gt;where age is defined in minutes and type can be &quot;alert, incident, trace, dump etc&quot;&lt;/strong&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2291826243498100498/posts/default/4285147205215979244'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2291826243498100498/posts/default/4285147205215979244'/><link rel='alternate' type='text/html' href='http://sams-oracle-blog.blogspot.com/2011/11/packaging-oracle-incidents.html' title='Packaging Oracle Incidents'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2291826243498100498.post-6455719662637804601</id><published>2011-11-08T20:48:00.003+13:00</published><updated>2011-11-08T20:55:19.075+13:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="database"/><category scheme="http://www.blogger.com/atom/ns#" term="maintenance"/><category scheme="http://www.blogger.com/atom/ns#" term="schedule window"/><category scheme="http://www.blogger.com/atom/ns#" term="scheduler"/><category scheme="http://www.blogger.com/atom/ns#" term="sql"/><title type='text'>11.2 Update Window Details</title><content type='html'>One of the nice features introduced in recent oracle releases was automated maintenance jobs. This is a nice feature as oracle tries to automate STATS generation and automating execution of advisors. &lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Sometimes, however the default schedule for these maintenance jobs is not good enough, so to change these windows.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In a nutshell, you need to disable the window, set attributes, duration time, start time etc.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;A sample would be:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;p style=&quot;font-family: Helvetica; font-size: medium; &quot;&gt;&lt;span style=&quot;font-family:Courier New;font-size:85%;&quot;&gt;BEGIN&lt;br /&gt;DBMS_SCHEDULER.DISABLE(&lt;br /&gt;name=&amp;gt;&#39;&quot;SYS&quot;.&quot;SATURDAY_WINDOW&quot;&#39;,&lt;br /&gt;force=&amp;gt;TRUE);&lt;br /&gt;END;&lt;br /&gt;&lt;br /&gt;BEGIN&lt;br /&gt;DBMS_SCHEDULER.SET_ATTRIBUTE(&lt;br /&gt;name=&amp;gt;&#39;&quot;SYS&quot;.&quot;SATURDAY_WINDOW&quot;&#39;,&lt;br /&gt;attribute=&amp;gt;&#39;DURATION&#39;,&lt;br /&gt;value=&amp;gt;numtodsinterval(1080, &#39;minute&#39;));&lt;br /&gt;END;&lt;br /&gt;&lt;br /&gt;BEGIN&lt;br /&gt;DBMS_SCHEDULER.SET_ATTRIBUTE(&lt;br /&gt;name=&amp;gt;&#39;&quot;SYS&quot;.&quot;SATURDAY_WINDOW&quot;&#39;,&lt;br /&gt;attribute=&amp;gt;&#39;REPEAT_INTERVAL&#39;,&lt;br /&gt;value=&amp;gt;&#39;FREQ=WEEKLY;BYDAY=SAT;BYHOUR=3;BYMINUTE=0;BYSECOND=0&#39;);&lt;br /&gt;END;&lt;br /&gt;&lt;br /&gt;BEGIN&lt;br /&gt;DBMS_SCHEDULER.ENABLE(&lt;br /&gt;name=&amp;gt;&#39;&quot;SYS&quot;.&quot;SATURDAY_WINDOW&quot;&#39;);&lt;br /&gt;END;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family:Courier New;font-size:85%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2291826243498100498/posts/default/6455719662637804601'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2291826243498100498/posts/default/6455719662637804601'/><link rel='alternate' type='text/html' href='http://sams-oracle-blog.blogspot.com/2011/11/112-update-window-details.html' title='11.2 Update Window Details'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2291826243498100498.post-3067825807774776995</id><published>2011-08-11T16:22:00.002+12:00</published><updated>2011-08-11T16:25:07.537+12:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="gzip"/><category scheme="http://www.blogger.com/atom/ns#" term="tar"/><category scheme="http://www.blogger.com/atom/ns#" term="unix"/><title type='text'>tar / compress in one command</title><content type='html'>To tar and then compress in one command use the following:&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;tar cvf - directory | gzip &amp;gt; filename.tar.gz&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;To uncompress and untar, use the following:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;cat  filename.tar.gz | gunzip | tar xvf -&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2291826243498100498/posts/default/3067825807774776995'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2291826243498100498/posts/default/3067825807774776995'/><link rel='alternate' type='text/html' href='http://sams-oracle-blog.blogspot.com/2011/08/tar-compress-in-one-command.html' title='tar / compress in one command'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2291826243498100498.post-8233836204292347253</id><published>2011-08-10T15:30:00.004+12:00</published><updated>2011-08-12T09:37:03.931+12:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="delete backup"/><category scheme="http://www.blogger.com/atom/ns#" term="drop database"/><category scheme="http://www.blogger.com/atom/ns#" term="rman"/><title type='text'>rman delete</title><content type='html'>I have the following scenario. I have database backups I want to delete as I am recreating a database tomorrow morning, long story, but we have found a bug when running a block size of 16k.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I don&#39;t want to run the &quot;RMAN DROP DATABASE INCLUDING BACKUPS NOPROMPT&quot; command as the business testers want this environment back reasonably quickly.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;What I did was:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;unix&amp;gt; rman target /&lt;/div&gt;&lt;div&gt;rman&amp;gt; CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 1 DAYS;&lt;/div&gt;&lt;div&gt;rman &amp;gt; DELETE NOPROMPT ALL;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Then it listed all the backup to remove, and I said &quot;YES&quot;. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now when I run the RMAN DROP DATABASE command tomorrow, it will complete in good time, not 2-3 hours it took to delete all my backups.&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2291826243498100498/posts/default/8233836204292347253'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2291826243498100498/posts/default/8233836204292347253'/><link rel='alternate' type='text/html' href='http://sams-oracle-blog.blogspot.com/2011/08/rman-delete.html' title='rman delete'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2291826243498100498.post-1110081944256663084</id><published>2011-08-03T14:05:00.003+12:00</published><updated>2011-08-03T14:09:00.900+12:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="unix"/><category scheme="http://www.blogger.com/atom/ns#" term="vi"/><title type='text'>vi search and replace</title><content type='html'>Use &quot;%s/searchstring/replacestring/g&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If the searchstring or replacestring has a &quot;/&quot;, then place a &quot;\&quot; in front. This is an escape character meaning that any character that follows is taken as its literal meaning.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2291826243498100498/posts/default/1110081944256663084'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2291826243498100498/posts/default/1110081944256663084'/><link rel='alternate' type='text/html' href='http://sams-oracle-blog.blogspot.com/2011/08/vi-search-and-replace.html' title='vi search and replace'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2291826243498100498.post-3298885333920984904</id><published>2011-05-16T11:34:00.001+12:00</published><updated>2011-05-16T11:37:09.459+12:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ksh"/><category scheme="http://www.blogger.com/atom/ns#" term="unix"/><title type='text'>ksh Setting Variables only if the variable is not set</title><content type='html'>ORATAB=${ORATAB:-/var/opt/oracle/oratab}&lt;br /&gt;&lt;br /&gt;DATESTRING=${DATESTRING:-$(date)}</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2291826243498100498/posts/default/3298885333920984904'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2291826243498100498/posts/default/3298885333920984904'/><link rel='alternate' type='text/html' href='http://sams-oracle-blog.blogspot.com/2011/05/ksh-setting-variables-only-if-variable.html' title='ksh Setting Variables only if the variable is not set'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2291826243498100498.post-7107572469280787166</id><published>2011-05-04T20:21:00.000+12:00</published><updated>2011-05-04T20:21:51.897+12:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="unix"/><title type='text'>Xauth x11 forwarding on unix</title><content type='html'>Use the following commands to set pup xauth forwarding on unix using putty. &lt;br /&gt;
&lt;br /&gt;
1. Update putty X11 settings. Click the &quot;ENABLE X11 FORWARDING&quot;, for each putty connection. &lt;br /&gt;
&lt;br /&gt;
2. Login to unix server. &lt;br /&gt;
&lt;br /&gt;
3. Run &gt; xauth list&lt;br /&gt;
&lt;br /&gt;
Output will be something like &lt;server&gt;/unix:nn MIT ...&lt;br /&gt;
&lt;br /&gt;
Where nn is a number like 10, 11, 12, ...&lt;br /&gt;
&lt;br /&gt;
4. Start exceed / similar server. &lt;br /&gt;
&lt;br /&gt;
5. Run &gt; export DISPLAY=localhost:nn&lt;br /&gt;
&lt;br /&gt;
If sudoing to another unix account then run the following:&lt;br /&gt;
&lt;br /&gt;
1. Sudo to unix account&lt;br /&gt;
&lt;br /&gt;
2. Run &gt; xauth add unix:nn ... Output from xauth list command ran in step 3 above. &lt;br /&gt;
&lt;br /&gt;
3. Run &gt; export DISPLAY=localhost:nn&lt;br /&gt;
&lt;br /&gt;
 Now run your x11 application.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2291826243498100498/posts/default/7107572469280787166'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2291826243498100498/posts/default/7107572469280787166'/><link rel='alternate' type='text/html' href='http://sams-oracle-blog.blogspot.com/2011/05/xauth-x11-forwarding-on-unix.html' title='Xauth x11 forwarding on unix'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2291826243498100498.post-7998400962510781672</id><published>2011-05-04T20:00:00.000+12:00</published><updated>2011-05-04T20:00:49.782+12:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="unix"/><title type='text'>Hostid on solaris</title><content type='html'>A pretty simple command, just run:&lt;br /&gt;
&lt;br /&gt;
&gt; hostid</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2291826243498100498/posts/default/7998400962510781672'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2291826243498100498/posts/default/7998400962510781672'/><link rel='alternate' type='text/html' href='http://sams-oracle-blog.blogspot.com/2011/05/hostid-on-solaris.html' title='Hostid on solaris'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2291826243498100498.post-5514052139399959974</id><published>2011-02-22T11:31:00.003+13:00</published><updated>2011-05-03T14:22:03.311+12:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="backup"/><category scheme="http://www.blogger.com/atom/ns#" term="database"/><category scheme="http://www.blogger.com/atom/ns#" term="recovery"/><category scheme="http://www.blogger.com/atom/ns#" term="rman"/><title type='text'>Remove unwanted files from FLASH_RECOVERY_AREA</title><content type='html'>Move backups from the flash recovery area to tertiary storage such as tape. &lt;br /&gt;&lt;div&gt;&lt;span style=&quot;font-family:Verdana;font-size:85%;&quot;&gt;&lt;br /&gt;&lt;div class=&quot;kmnotebox&quot;&gt;RMAN&amp;gt; BACKUP RECOVERY AREA;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;Note : Flashback logs cannot be backed up outside the recovery area and so are not backed up by BACKUP RECOVERY AREA.&lt;br /&gt;&lt;br /&gt;NOTE: Removing these files with an operating system utility will physically remove these files, but the database will still think the files exist and the problem of archival error may still occur. Use the following commands to synchronize the files with the database and use rman to remove these files. &lt;/p&gt;&lt;br /&gt;&lt;div class=&quot;kmnotebox&quot;&gt;RMAN&amp;gt;CROSSCHECK BACKUP;&lt;br /&gt;RMAN&amp;gt;CROSSCHECK ARCHIVELOG ALL;&lt;br /&gt;&lt;br /&gt;RMAN&amp;gt;Delete expired backup;&lt;br /&gt;RMAN&amp;gt;Delete expired archivelog all;&lt;br /&gt;RMAN&amp;gt;Delete force obsolete;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;4. Make sure that your guaranteed restore points are necessary. If not, delete them &lt;/p&gt;&lt;br /&gt;&lt;div class=&quot;kmnotebox&quot;&gt;SQL&amp;gt;Drop restore point restore_point_name&lt;/div&gt;&lt;br /&gt;&lt;p&gt;5. If flashback logs are enabled then make sure you have enough space for all the flashback logs. If its not required then you can turn off flashback.&lt;/p&gt;&lt;br /&gt;&lt;div class=&quot;kmnotebox&quot;&gt;SQL&amp;gt; Alter database FLASHBACK OFF;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;6. Review your backup retention policy and if required change the RMAN RETENTION POLICY &lt;/p&gt;&lt;br /&gt;&lt;div class=&quot;kmnotebox&quot;&gt;RMAN&amp;gt; CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;&lt;/div&gt;&lt;br /&gt;&lt;h3 class=&quot;km&quot;&gt;&lt;a name=&quot;aref7&quot;&gt;&lt;/a&gt;Exceptions :&lt;br /&gt;&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;- If RMAN is not part of backup strategy and archivelogs are going to FRA then manual intervention required for deletion of archivelogs. Periodically purse old archivelogs &lt;/p&gt;&lt;br /&gt;&lt;p&gt;for example&lt;/p&gt;&lt;br /&gt;&lt;div class=&quot;kmnotebox&quot;&gt;RMAN&amp;gt; Delete archivelog all completed before &#39;SYSDATE-7&#39;;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;- By default RMAN backup goes to FRA. While taking RMAN backup if backup location explictly specified to flash recovery area location then those backup pieces are not considered as part of FRA for auto managment.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;- For Archivelogs backup to FRA use USE_DB_RECOVERY_FILE_DEST rather than giving explict path of FRA&lt;/p&gt;&lt;br /&gt;&lt;div class=&quot;kmnotebox&quot;&gt;SQL&amp;gt; alter system set log_archive_dest_10=&#39;LOCATION=USE_DB_RECOVERY_FILE_DEST&#39; scope=both;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;- Bug 4911954&lt;/p&gt;&lt;br /&gt;&lt;div class=&quot;kmcodeblock&quot; style=&quot;WIDTH: 95%&quot;&gt;&lt;code class=&quot;km&quot;&gt;Details:&lt;br /&gt;V$RECOVERY_FILE_DEST SPACE_USED and NUMBER_OF_FILES values may be wrong.&lt;br /&gt;eg: Number of files in V$FLASH_RECOVERY_AREA_USAGE and V$RECOVERY_FILE_DEST are different.&lt;br /&gt;This problem can lead to recovery area files being deleted even though there is no space pressure.&lt;br /&gt;Fixed in : 10.2.0.3 , 11.1.0.6&lt;br /&gt;&lt;/code&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;- Bug 5106952&lt;/p&gt;&lt;br /&gt;&lt;div class=&quot;kmcodeblock&quot; style=&quot;WIDTH: 95%&quot;&gt;&lt;code class=&quot;km&quot;&gt;Details:&lt;br /&gt;Flashback logs are not reclaimed by flash recovery area when using guaranteed&lt;br /&gt;restore point (after dropping guaranteed restore point) or when changing&lt;br /&gt;db_flashback_retention_target to a lower value.&lt;br /&gt;&lt;/code&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family:Verdana;font-size:10;&quot;&gt;&lt;br /&gt;&lt;p&gt;&lt;span style=&quot;font-family:Verdana;font-size:78%;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;/span&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2291826243498100498/posts/default/5514052139399959974'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2291826243498100498/posts/default/5514052139399959974'/><link rel='alternate' type='text/html' href='http://sams-oracle-blog.blogspot.com/2011/02/remove-unwanted-files-from.html' title='Remove unwanted files from FLASH_RECOVERY_AREA'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2291826243498100498.post-3197221776389268796</id><published>2011-02-14T10:53:00.002+13:00</published><updated>2011-02-14T16:10:06.758+13:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="database"/><category scheme="http://www.blogger.com/atom/ns#" term="recovery"/><title type='text'>11.2 recovery - free up spaceon DB_RECOVERY_FILE_DEST*</title><content type='html'>&lt;!-- Converted from text/rtf format --&gt;  &lt;p style=&quot;font-family: courier new;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;Make more disk space available and increase DB_RECOVERY_FILE_DEST_SIZE &lt;/span&gt; &lt;/p&gt;&lt;div style=&quot;font-family: courier new;&quot; class=&quot;kmnotebox&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;SQL&gt; alter system set db_recovery_file_dest_size=xG  SCOPE=BOTH;  -- (larger amount)&lt;br /&gt;&lt;/span&gt;&lt;/div&gt; &lt;p style=&quot;font-family: courier new;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;br /&gt;2. Move backups from the flash recovery area to tertiary storage such as  tape. &lt;/span&gt;&lt;/p&gt; &lt;div style=&quot;font-family: courier new;&quot; class=&quot;kmnotebox&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;RMAN&gt;BACKUP RECOVERY AREA;&lt;/span&gt;&lt;/div&gt; &lt;p style=&quot;font-family: courier new;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;Note : Flashback logs cannot be backed up outside the recovery area and so  are not backed up by BACKUP RECOVERY AREA.&lt;br /&gt;&lt;br /&gt;3. Run DELETE for any files  that have been removed with an operating system utility. If you use host  operating system commands to delete files, then the database will not be aware  of the resulting free space. &lt;/span&gt;&lt;/p&gt; &lt;div style=&quot;font-family: courier new;&quot; class=&quot;kmnotebox&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;RMAN&gt;CROSSCHECK BACKUP;&lt;br /&gt;RMAN&gt;CROSSCHECK  ARCHIVELOG ALL;&lt;br /&gt;&lt;br /&gt;RMAN&gt;Delete expired backup;&lt;br /&gt;RMAN&gt;Delete  expired archivelog all;&lt;br /&gt;RMAN&gt;Delete force obsolete;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt; &lt;p style=&quot;font-family: courier new;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;4. Make sure that your guaranteed restore points are necessary. If not,  delete them &lt;/span&gt;&lt;/p&gt; &lt;div style=&quot;font-family: courier new;&quot; class=&quot;kmnotebox&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;SQL&gt;Drop restore point &lt;restore_point_name&gt;;&lt;/span&gt;&lt;/div&gt; &lt;p style=&quot;font-family: courier new;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;5. If flashback logs are enable then make sure you have enough space for all  the flashback logs. If its not required then you can turn off flashback.&lt;/span&gt;&lt;/p&gt; &lt;div style=&quot;font-family: courier new;&quot; class=&quot;kmnotebox&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;SQL&gt;Alter database FLASHBACK OFF;&lt;/span&gt;&lt;/div&gt; &lt;p style=&quot;font-family: courier new;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;6. Review your backup retention policy and if required change the RMAN  RETENTION POLICY &lt;/span&gt;&lt;/p&gt; &lt;div style=&quot;font-family: courier new;&quot; class=&quot;kmnotebox&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;RMAN&gt;CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7  DAYS;&lt;/span&gt;&lt;/div&gt; &lt;h3 style=&quot;font-family: courier new;&quot; class=&quot;km&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;a name=&quot;aref7&quot;&gt;&lt;/a&gt;Exceptions :&lt;br /&gt;&lt;/span&gt;&lt;/h3&gt; &lt;p style=&quot;font-family: courier new;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;- If RMAN is not part of backup strategy  and archivelogs are going to FRA  then manual intervention  required for deletion of archivelogs. Periodically  purse old archivelogs &lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;font-family: courier new;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;for example&lt;/span&gt;&lt;/p&gt; &lt;div style=&quot;font-family: courier new;&quot; class=&quot;kmnotebox&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;RMAN&gt;Delete archivelog all completed before   &#39;SYSDATE-7&#39;;&lt;/span&gt;&lt;/div&gt; &lt;p style=&quot;font-family: courier new;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;- By default RMAN backup goes to FRA. While taking RMAN backup if backup  location explictly specified to flash recovery area location then those backup  pieces are not considered as part of FRA for auto managment.&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;font-family: courier new;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;- For Archivelogs backup to FRA use USE_DB_RECOVERY_FILE_DEST rather than  giving explict path of FRA&lt;/span&gt;&lt;/p&gt; &lt;div style=&quot;font-family: courier new;&quot; class=&quot;kmnotebox&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;SQL&gt; alter system set  log_archive_dest_10=&#39;LOCATION=USE_DB_RECOVERY_FILE_DEST&#39;  scope=both;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt; &lt;p style=&quot;font-family: courier new;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;font-family: courier new;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;- Bug 4911954&lt;/span&gt;&lt;/p&gt; &lt;div class=&quot;kmcodeblock&quot; style=&quot;width: 95%; font-family: courier new;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;code class=&quot;km&quot;&gt;&lt;span&gt;Details:             &lt;br /&gt;  V$RECOVERY_FILE_DEST SPACE_USED and NUMBER_OF_FILES values may be wrong. &lt;br /&gt;  eg: Number of files in V$FLASH_RECOVERY_AREA_USAGE and V$RECOVERY_FILE_DEST are different. &lt;br /&gt;  This problem can lead to recovery area files being deleted even though there is no space pressure.&lt;br /&gt;Fixed  in : 10.2.0.3 , 11.1.0.6&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;/div&gt; &lt;p style=&quot;font-family: courier new;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;- Bug 5106952&lt;/span&gt;&lt;/p&gt; &lt;div class=&quot;kmcodeblock&quot; style=&quot;width: 95%;&quot;&gt;&lt;code class=&quot;km&quot;&gt;&lt;span&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family: courier new;&quot;&gt;Details:              &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: courier new;&quot;&gt;  Flashback logs are not reclaimed by flash recovery area when using guaranteed  &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: courier new;&quot;&gt;  restore point (after dropping guaranteed restore point) or when changing  &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: courier new;&quot;&gt;  db_flashback_retention_target to a lower value. &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2291826243498100498/posts/default/3197221776389268796'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2291826243498100498/posts/default/3197221776389268796'/><link rel='alternate' type='text/html' href='http://sams-oracle-blog.blogspot.com/2011/02/112-recovery-free-up-spaceon.html' title='11.2 recovery - free up spaceon DB_RECOVERY_FILE_DEST*'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2291826243498100498.post-467275525399635000</id><published>2010-11-16T11:27:00.002+13:00</published><updated>2010-11-16T11:31:35.745+13:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="unix"/><title type='text'>Zone Commands</title><content type='html'>prstat - top like command that can be run on zones and give some nice memory / cpu summary information of what is going on with the zones.&lt;br /&gt;&lt;br /&gt;/usr/sbin/arp -a - nice way of finding what the global zone is.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2291826243498100498/posts/default/467275525399635000'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2291826243498100498/posts/default/467275525399635000'/><link rel='alternate' type='text/html' href='http://sams-oracle-blog.blogspot.com/2010/11/zone-commands.html' title='Zone Commands'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2291826243498100498.post-5819971201812465220</id><published>2010-09-22T15:38:00.003+12:00</published><updated>2011-02-22T11:33:35.464+13:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="database"/><category scheme="http://www.blogger.com/atom/ns#" term="development"/><category scheme="http://www.blogger.com/atom/ns#" term="sql"/><category scheme="http://www.blogger.com/atom/ns#" term="sqlplus"/><title type='text'>sql escape character setup</title><content type='html'>&lt;div&gt;&lt;span class=&quot;565163603-22092010&quot;&gt;&lt;span style=&quot;;font-family:Verdana;font-size:85%;&quot;  &gt;in sqlplus setting  the &quot;&amp;amp;&quot; as a literal, you need to do the following.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span class=&quot;565163603-22092010&quot;&gt;&lt;span style=&quot;;font-family:Verdana;font-size:85%;&quot;  &gt;&lt;/span&gt;&lt;/span&gt; &lt;/div&gt; &lt;div&gt;&lt;span class=&quot;565163603-22092010&quot;&gt;&lt;span style=&quot;;font-family:Verdana;font-size:85%;&quot;  &gt;set escape  \&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span class=&quot;565163603-22092010&quot;&gt;&lt;span style=&quot;;font-family:Verdana;font-size:85%;&quot;  &gt;&lt;/span&gt;&lt;/span&gt; &lt;/div&gt; &lt;div&gt;&lt;span class=&quot;565163603-22092010&quot;&gt;&lt;span style=&quot;;font-family:Verdana;font-size:85%;&quot;  &gt;select * from bla  where blabla = &#39;xxx \&amp;amp;&#39;;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span class=&quot;565163603-22092010&quot;&gt;&lt;span style=&quot;;font-family:Verdana;font-size:85%;&quot;  &gt;&lt;/span&gt;&lt;/span&gt; &lt;/div&gt; &lt;div&gt;&lt;span class=&quot;565163603-22092010&quot;&gt;&lt;span style=&quot;;font-family:Verdana;font-size:85%;&quot;  &gt;note: you should  really set the escape sqlplus parameter in a glogin.sql or  login.sql&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;!-- Converted from text/rtf format --&gt;&lt;span style=&quot;;font-family:Verdana;font-size:10pt;&quot;  &gt;&lt;br /&gt;&lt;/span&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2291826243498100498/posts/default/5819971201812465220'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2291826243498100498/posts/default/5819971201812465220'/><link rel='alternate' type='text/html' href='http://sams-oracle-blog.blogspot.com/2010/09/sql-escape-character-setup.html' title='sql escape character setup'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2291826243498100498.post-3494776346573171034</id><published>2010-09-21T17:22:00.003+12:00</published><updated>2010-09-21T17:52:38.825+12:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="development"/><category scheme="http://www.blogger.com/atom/ns#" term="sql"/><title type='text'>sample login.sql using sql variabes</title><content type='html'>&lt;span style=&quot;font-family:Verdana;font-size:85%;&quot;&gt;Use the following to set up variables that are based on values from sql output.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:Verdana;font-size:85%;&quot;&gt;Use the new_value option in the sqlplus column command.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:Verdana;font-size:85%;&quot;&gt;See the example below which grabs the instance name of the database that is being used.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:Verdana;font-size:85%;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;SQL&gt; set termout off timing off feedback off&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;SQL&gt; column instance new_value instance_name&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;SQL&gt; select instance_name instance from v$instance ;&lt;br /&gt;SQL&gt; set termout on timing on feedback on&lt;br /&gt;SQL&gt; prompt &amp;amp;instance_name&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:78%;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:78%;&quot;&gt;&lt;span style=&quot;font-family:verdana;font-size:85%;&quot;&gt;note: The first set statement hides the output from running the v$instance sql query.&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family:courier new;font-size:78%;&quot;&gt;&lt;/span&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2291826243498100498/posts/default/3494776346573171034'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2291826243498100498/posts/default/3494776346573171034'/><link rel='alternate' type='text/html' href='http://sams-oracle-blog.blogspot.com/2010/09/sample-loginsql-using-sql-variabes.html' title='sample login.sql using sql variabes'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2291826243498100498.post-2444751225967132544</id><published>2010-06-24T16:13:00.002+12:00</published><updated>2010-06-24T16:15:54.984+12:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="excel"/><category scheme="http://www.blogger.com/atom/ns#" term="windows"/><title type='text'>excel - auto calculations</title><content type='html'>&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;If excel is not auto calculating then check -&lt;br /&gt;&lt;br /&gt;TOOLS/OPTIONS/CALCULATION and make sure that the automatic option is selected under &quot;Calculation&quot;.&lt;/span&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2291826243498100498/posts/default/2444751225967132544'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2291826243498100498/posts/default/2444751225967132544'/><link rel='alternate' type='text/html' href='http://sams-oracle-blog.blogspot.com/2010/06/excel-auto-calculations.html' title='excel - auto calculations'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2291826243498100498.post-2750144992464931328</id><published>2010-06-04T12:44:00.003+12:00</published><updated>2010-06-04T12:51:00.247+12:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="unix"/><title type='text'>unix user management commands</title><content type='html'>Various commands to create groups, add groups to users and make a group the default group.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Create New Group&lt;/span&gt;&lt;br /&gt;# groupadd -g &quot;groupid&quot; &quot;groupname&quot;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Add Group to user, additional group&lt;/span&gt;&lt;br /&gt;# usermod -G &quot;groupname&quot; &quot;username&quot;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Add Group to user, primary group&lt;/span&gt;&lt;br /&gt;# usermod -g &quot;groupname&quot; &quot;username&quot;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2291826243498100498/posts/default/2750144992464931328'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2291826243498100498/posts/default/2750144992464931328'/><link rel='alternate' type='text/html' href='http://sams-oracle-blog.blogspot.com/2010/06/unix-user-management-commands.html' title='unix user management commands'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2291826243498100498.post-924876140440253492</id><published>2010-04-16T11:07:00.003+12:00</published><updated>2010-04-16T11:10:29.933+12:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="os"/><category scheme="http://www.blogger.com/atom/ns#" term="unix"/><title type='text'>unix - redirecting output</title><content type='html'>&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;In UNIX, run the following to ensure any errors (known as stderr) is not displayed on the screen.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;Use 2&gt; /dev/null &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;i.e.:&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;df -k 2&gt; /dev/null&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:Courier New;font-size:85%;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:Courier New;font-size:85%;&quot;&gt;This works when using the ksh shell. There will be other derivitives when using other shells.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:Courier New;font-size:85%;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;/span&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2291826243498100498/posts/default/924876140440253492'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2291826243498100498/posts/default/924876140440253492'/><link rel='alternate' type='text/html' href='http://sams-oracle-blog.blogspot.com/2010/04/unix-redirecting-output.html' title='unix - redirecting output'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2291826243498100498.post-4681748119734442458</id><published>2010-02-03T14:42:00.004+13:00</published><updated>2010-02-03T15:07:27.882+13:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="database"/><title type='text'>transportable tablespaces</title><content type='html'>&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;References: metalink note:77523.1&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;Refer to the relevant database documentation, correct version for restrictions when using this feature.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;note: &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;a Ensure the following scripts have been run in the database. These would normally be run at database creation time.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;$ORACLE_HOME/rdbms/admin/catplug.sql&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;$ORACLE_HOME/rdbms/admin/dbmsplts.sql &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;$ORACLE_HOME/rdbms/admin/prvtplts.plb&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;sql&gt; desc dbms_plugts&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;b If running this procedure by a user other than sys then ensure the user has dba privileges and PUBLIC SYNONYMS for the following following have been created.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;DBMS_PLUGTS&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;DBMS_TTS&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;1. Identify tablespaces that need to be migrated. note: Dependent data objects need to be incapsuated in the process. i.e.: Data + Index objects need to be included.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;2. Put relevent tablespaces into readonly mode.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;sql&gt; alter tablespace ... readonly;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;3. Export metadata from tablesspaces&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;unix&gt; exp userid/password file=... tablespaces=... transport_tablespaces=y&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;note: multiple tablespaces need to be delimited by a comma.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;4. Copy datafiles that make up the tablespaces identified above into the target environment.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;5. Copy the export dat file created in step 3.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;6. Import metadata into target database.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;unix&gt; imp ... tablespaces=... datafiles=... transport_tablespaces=y&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;note: tablespaces and datafiles need to be seperated by comma&#39;s.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;7. Verify tablespaces are updated correctly by querying relevent views, dba_tablespaces and v$datafile.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;8. Put tablespaces into read write mode in source and target databases.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;sql&gt; alter tablespace ... read write;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;&lt;/span&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2291826243498100498/posts/default/4681748119734442458'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2291826243498100498/posts/default/4681748119734442458'/><link rel='alternate' type='text/html' href='http://sams-oracle-blog.blogspot.com/2010/02/transportable-tablespaces.html' title='transportable tablespaces'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2291826243498100498.post-1922085708594694655</id><published>2009-12-16T17:06:00.004+13:00</published><updated>2009-12-16T17:19:26.831+13:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="sql"/><title type='text'>rank</title><content type='html'>&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;RANK and its mates can be useful functions to use when you need to order a list of records. &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;For example, I needed to transform a database from OMF (oracle managed files) to OSF (oracle standard files). As you may know, OMF bear no resemblance to the datafile standard most corporates seem to run, a typical omf data file might look like  &lt;strong&gt;o1_mf_ts_ofsaa_2gt2g1hr_.dbf, &lt;/strong&gt;while a osf might look like user_01.dbf&lt;strong&gt; &lt;/strong&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;Being a good dba I wanted to script and automate the CREATE CONTROLFILE statement. My soltion to the above problem was to use the rank function.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;So something like -&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;&lt;strong&gt;select tablespace_name, file_name, rank() over (PARTITION BY tablespace_name order by file_id) &quot;id&quot;&lt;/strong&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;solved my problem and produced an output something like - &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;tablespace1 somefile1 1&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;tablespace1 somefile2 2&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;tablespace2 somefile1 1&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;...&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;I was then able to use the above statement to generate the datafile section of the create controlfile file.&lt;/span&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2291826243498100498/posts/default/1922085708594694655'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2291826243498100498/posts/default/1922085708594694655'/><link rel='alternate' type='text/html' href='http://sams-oracle-blog.blogspot.com/2009/12/rank.html' title='rank'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2291826243498100498.post-6077447476333823155</id><published>2009-12-04T15:25:00.001+13:00</published><updated>2009-12-04T15:29:12.981+13:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="oracle"/><title type='text'>EXIT from PL/SQL procedure block</title><content type='html'>&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;A simple method to EXIT from a PL/SQL block is to use the RETURN keyword. You should also be able to return an EXIT status.&lt;br /&gt;&lt;br /&gt;So if we run something like -&lt;br /&gt;&lt;br /&gt;1 BEGIN&lt;br /&gt;2 dbms_output.put_line(&#39;one.&#39;);&lt;br /&gt;3 return;&lt;br /&gt;4 dbms_output.put_line(&#39;two.&#39;);&lt;br /&gt;5* end;&lt;br /&gt;n990538@edrtst&gt; /&lt;br /&gt;one.&lt;br /&gt;&lt;br /&gt;PL/SQL procedure successfully completed.&lt;/span&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2291826243498100498/posts/default/6077447476333823155'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2291826243498100498/posts/default/6077447476333823155'/><link rel='alternate' type='text/html' href='http://sams-oracle-blog.blogspot.com/2009/12/exit-from-plsql-procedure-block.html' title='EXIT from PL/SQL procedure block'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2291826243498100498.post-5802407053001974980</id><published>2009-10-28T11:14:00.003+13:00</published><updated>2009-10-28T11:26:48.605+13:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="database"/><category scheme="http://www.blogger.com/atom/ns#" term="function"/><title type='text'>instr, substr</title><content type='html'>&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;A couple of usefull oracle functions for manipulating strings.&lt;br /&gt;&lt;br /&gt;instr(string1, string2, start position, nth appearance) returns the position where the string exists.&lt;br /&gt;&lt;br /&gt;where&lt;br /&gt;string1 is the original string to search from&lt;br /&gt;string2 is the string to search in string 1&lt;br /&gt;start posititon is optional and is the start position to start searching from&lt;br /&gt;nth appearance is optional and is the number of occurances of string2 in string1.&lt;br /&gt;&lt;br /&gt;instr(&#39;Tech on the net&#39;, &#39;e&#39;, 1, 3) would return 14.&lt;br /&gt;&lt;br /&gt;substr(string1, start position, length) returns a string.&lt;br /&gt;&lt;br /&gt;where&lt;br /&gt;string1 is the string to check.&lt;br /&gt;start position is the position in the string to start the substring from&lt;br /&gt;length is optional and the length of the position.&lt;br /&gt;&lt;br /&gt;substr(&#39;Tech on the net&#39;,1,5) would return &#39;Tech &#39;&lt;br /&gt;&lt;br /&gt;Often using a combination of the above functions is useful.&lt;br /&gt;&lt;br /&gt;substr(&#39;Tech on the net&#39;,1, instr(&#39;Tech on the net&#39;, &#39;e&#39;, 1, 3)) would return &#39;&#39;Tech on the ne&#39;&lt;/span&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2291826243498100498/posts/default/5802407053001974980'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2291826243498100498/posts/default/5802407053001974980'/><link rel='alternate' type='text/html' href='http://sams-oracle-blog.blogspot.com/2009/10/instr-substr.html' title='instr, substr'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2291826243498100498.post-4263332125186022988</id><published>2009-10-21T16:45:00.002+13:00</published><updated>2009-10-21T16:48:14.149+13:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="database"/><category scheme="http://www.blogger.com/atom/ns#" term="metalink"/><title type='text'>bug - 2942857 - OERI:12327 from complex view merging</title><content type='html'>&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;Bug 2942857 - OERI:12327 from complex view merging &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;DOC ID 2942857.8&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;Fixed: 9.2.05, 10.1.0.2&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;Complex view merging may fail with ORA-600[12327] if an COUNT(*) is used and the query has a subquery predicate against the COUNT(*) .&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;Workaround:  Set &quot;_complex_view_merging&quot;=false&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;Affects EDR, EDMT, DWH.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;&lt;/span&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2291826243498100498/posts/default/4263332125186022988'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2291826243498100498/posts/default/4263332125186022988'/><link rel='alternate' type='text/html' href='http://sams-oracle-blog.blogspot.com/2009/10/bug-2942857-oeri12327-from-complex-view.html' title='bug - 2942857 - OERI:12327 from complex view merging'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry></feed>