<?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-8677961998247325759</id><updated>2026-08-31T09:23:27.230-07:00</updated><category term="oracle"/><category term="unix"/><category term="Oracle User Groups"/><category term="oracle 11.2"/><category term="blogger"/><category term="Oracle Security"/><category term="UKOUG"/><category term="forums"/><category term="upgrade"/><category term="DBA training"/><category term="Employee motivation"/><category term="ORA-04063"/><category term="awk"/><category term="common sense"/><category term="dbms_redefinition"/><category term="google cache"/><category term="online privacy"/><category term="regex"/><category term="sed"/><category term="sql"/><category term="unix find"/><category term="Bing Cache"/><category term="Checker run found %d new persistent data failures"/><category term="Exadata"/><category term="Health Checker"/><category term="MyOracleSupport"/><category term="ORA-06508"/><category term="ORA-06512"/><category term="ORA-12012"/><category term="Oracle 8i"/><category term="Quest Toad"/><category term="Tom Kyte"/><category term="adrci"/><category term="alert.log"/><category term="aud file"/><category term="audit file"/><category term="audit_syslog_level"/><category term="audit_trail"/><category term="autoextend"/><category term="bash"/><category term="blog roll"/><category term="bloglist"/><category term="bloglist widget"/><category term="cluboracle"/><category term="data integrity"/><category term="data sanitization"/><category term="documentation"/><category term="expdp"/><category term="expdp query parameter"/><category term="glogin.sql"/><category term="grep"/><category term="invisible indexes"/><category term="login.sql"/><category term="monitoring"/><category term="nofollow links"/><category term="ora-0600 not in lookup tool"/><category term="oracle 9i"/><category term="oracle midlands"/><category term="random"/><category term="sending sql output to a csv file"/><category term="sqlplus"/><category term="tech13"/><category term="tools"/><category term="touch"/><category term="trc files"/><category term="v$object_usage"/><title type='text'>KelloggsDBA</title><subtitle type='html'>Oracle, Blogging and other Animals</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://kelloggsdba.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8677961998247325759/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://kelloggsdba.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/8677961998247325759/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>AGuidingLife</name><uri>http://www.blogger.com/profile/05823333742737762759</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>49</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8677961998247325759.post-6886124737294303506</id><published>2022-01-11T01:35:00.001-08:00</published><updated>2022-01-11T01:35:15.703-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="awk"/><category scheme="http://www.blogger.com/atom/ns#" term="unix"/><title type='text'>What is a users default shell</title><content type='html'>&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;username=myuser&lt;/div&gt;&lt;div&gt;out=&quot;$(grep &quot;^${username}:&quot; /etc/passwd)&quot;&lt;/div&gt;&lt;div&gt;IFS=:&lt;/div&gt;&lt;div&gt;set -- ${out}&lt;/div&gt;&lt;div&gt;echo &quot;Dir: $6&quot;&lt;/div&gt;&lt;div&gt;echo &quot;Shell: $7&quot;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;username=myuser&lt;/div&gt;&lt;div&gt;awk -v user=$username -F: &#39;($1 == user) {print $6}&#39; /etc/passwd&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kelloggsdba.blogspot.com/feeds/6886124737294303506/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8677961998247325759/6886124737294303506' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8677961998247325759/posts/default/6886124737294303506'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8677961998247325759/posts/default/6886124737294303506'/><link rel='alternate' type='text/html' href='http://kelloggsdba.blogspot.com/2022/01/what-is-users-default-shell.html' title='What is a users default shell'/><author><name>AGuidingLife</name><uri>http://www.blogger.com/profile/05823333742737762759</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><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8677961998247325759.post-2439547338255862358</id><published>2019-10-03T02:13:00.001-07:00</published><updated>2019-10-03T02:13:35.855-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="unix"/><title type='text'>Grep this or that</title><content type='html'>&amp;nbsp;grep &#39;this\|that&#39;&lt;br /&gt;
&lt;br /&gt;
look for a subset of filesystems&lt;br /&gt;
&lt;br /&gt;
df -h |&amp;nbsp; grep &#39;this\|that&#39;</content><link rel='replies' type='application/atom+xml' href='http://kelloggsdba.blogspot.com/feeds/2439547338255862358/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8677961998247325759/2439547338255862358' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8677961998247325759/posts/default/2439547338255862358'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8677961998247325759/posts/default/2439547338255862358'/><link rel='alternate' type='text/html' href='http://kelloggsdba.blogspot.com/2019/10/grep-this-or-that.html' title='Grep this or that'/><author><name>AGuidingLife</name><uri>http://www.blogger.com/profile/05823333742737762759</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><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8677961998247325759.post-5381365732735531136</id><published>2019-09-07T12:13:00.001-07:00</published><updated>2019-09-07T12:13:55.667-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="bash"/><category scheme="http://www.blogger.com/atom/ns#" term="unix"/><category scheme="http://www.blogger.com/atom/ns#" term="unix find"/><title type='text'>Find newest file in a unix directory</title><content type='html'>&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Files and directories have a number of attributes.&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Modification time can be an issue when looking for the &#39;latest&#39; directory.&amp;nbsp; I wrote a shell script that was creating new directories and also writing files into the latest directory depending on the switches past in.&amp;nbsp; I found if I started the two processes at exactly the same time.&amp;nbsp; The oldest directory was modified last, completely stuffing up my sort later looking for the newest directory.&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;find . -name &quot;partname*&quot; -maxdepth 1 -printf &#39;%T@ %p\0&#39; 2&amp;gt;/dev/null | sort -z -nr&lt;/blockquote&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;a href=&quot;https://ss64.com/bash/find.html&quot; target=&quot;_blank&quot;&gt;find&amp;nbsp;&lt;/a&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;-name&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;I only want certain files or directories&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;-maxdepth&amp;nbsp; 1 only look at this level not recursively&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;-printf&lt;br /&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;%T modification time&lt;br /&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; @ seconds since Jan. 1, 1970, 00:00 GMT&lt;div&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; %p file name&lt;br /&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;\0 the terminator rather than \n (newline) to avoid problems with &lt;i&gt;strange&lt;/i&gt; filenames&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&amp;gt;/dev/null don&#39;t include errors in the output&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |&amp;nbsp; (pipe) then do the next command I give you&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;a href=&quot;https://ss64.com/bash/sort.html&quot; target=&quot;_blank&quot;&gt;sort&lt;/a&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -z&amp;nbsp; &amp;nbsp; &amp;nbsp;because I used \0 in the previous command don&#39;t look for a linefeed&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -n&amp;nbsp; &amp;nbsp; sort numerically&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -r&amp;nbsp; &amp;nbsp; &amp;nbsp;put the largest number at the top&lt;br /&gt;
&lt;br /&gt;
But modification time was an issue so I shifted to&amp;nbsp;&lt;a href=&quot;https://www.unixtutorial.org/atime-ctime-mtime-in-unix-filesystems&quot; target=&quot;_blank&quot;&gt;ctime &lt;/a&gt;- which is change time (not creation)&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;change time –ctime&amp;nbsp; &amp;nbsp;%C&amp;nbsp; &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; modify time –mtime %T&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (access time –atime&amp;nbsp; &amp;nbsp; %A )&lt;br /&gt;&lt;br /&gt;Change time is set on creation and alters when there is a chmod, chown or mv on the file.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; find . -name &quot;partname*&quot; -maxdepth 1 -printf &#39;%C@ %p\0&#39;
2&amp;gt;/dev/null | sort -z -nr&lt;/blockquote&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
So in order to scrape off the latest file system name this completes in my scripts with:&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;IFS= read -r -d $&#39;\0&#39; line &amp;lt; &amp;lt; (find . -name &quot;partname*&quot; -maxdepth 1 -printf &#39;%C@ %p\0&#39; 2&amp;gt;/dev/null | sort -z -nr )&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;FullPathToNewestDirectory=&quot;${line#* }&quot;&lt;/blockquote&gt;
&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a href=&quot;https://bash.cyberciti.biz/guide/$IFS&quot; target=&quot;_blank&quot;&gt;IFS&lt;/a&gt; Internal Field Separator - make this the delimiter&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a href=&quot;https://ss64.com/bash/read.html&quot; target=&quot;_blank&quot;&gt;read&lt;/a&gt;&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;-r&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;backslash is not an escape character&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -d&amp;nbsp; $&#39;\0&#39;&amp;nbsp; line&amp;nbsp; &amp;nbsp;take the entire input as one line (&lt;a href=&quot;https://stackoverflow.com/questions/36587660/in-a-bash-script-what-would-0-evaluate-to-and-why&quot; target=&quot;_blank&quot;&gt;the space between the -d and $ is important&lt;/a&gt;)&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; ${line#* }&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; the space after * matters here&amp;nbsp;&amp;nbsp;&lt;a href=&quot;https://unix.stackexchange.com/questions/423859/what-does-linecaused-by-line-mean-in-a-shell-script&quot; target=&quot;_blank&quot;&gt;${parameter#word&lt;/a&gt;&amp;nbsp;the pattern word will be removed from the beginning of the value of $parameter. It&#39;s called &quot;Remove Smallest Prefix Pattern&quot; because it will remove the shortest matching prefix string that matches the pattern in word (with ## in place of # it removes the longest matching prefix string).&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;lt; &amp;lt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Note the space between these two redirect symbols&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
So now I have a variable that looks like&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /dir/dir/dir&amp;nbsp; &amp;nbsp;(I&#39;m looking for a list of directories, yours might be /dir/dir/file it&#39;s all the same)&lt;/div&gt;
&lt;div&gt;
and I only want the last part of this path&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; echo $FullPathToNewestDirectory&amp;nbsp;| awk -F/ &#39;{ print $(NF ) }&#39;&lt;/blockquote&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;echo show contents of the variable&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |&amp;nbsp; (pipe) then do the next command I give you&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;awk&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -F/&amp;nbsp; the fields separator is / (the lack of space between F and / is important)&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&#39;{ print $(NF ) }&#39;&amp;nbsp; &amp;nbsp;&amp;nbsp;NF is number of fields of the current record, printing $NF means printing the last one.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
I use NF because I&#39;m not always sure server to server how many levels of directories I might have:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp;IFS= read -r -d $&#39;\0&#39; line &amp;lt; &amp;lt; (find $BACKUPHOME -name &quot;backupdir_partname*&quot; -maxdepth 1 -printf &#39;%C@ %p\0&#39; 2&amp;gt;/dev/null | sort -z -nr )&lt;br /&gt;FullPathToNewestDirectory=&quot;${line#* }&quot;&lt;br /&gt;ActualDirectory=`echo $FullPathToNewestDirectory&amp;nbsp;| awk -F/ &#39;{ print $(NF ) }&#39;`&lt;/blockquote&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&amp;nbsp;If you plan to work with this in a script you need to consider that if there are no files or directories where you are looking you will end up with an empty (but set) variable, this might mess up anything coming later.&amp;nbsp; You need to be sure you handle that/&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
I found it important to test for&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -z&amp;nbsp; &amp;nbsp;${FullPathToNewestDirectory:+x}&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;This tests that not only is the &lt;a href=&quot;https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_02&quot; target=&quot;_blank&quot;&gt;parameter set but also that it isn&#39;t null&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;  As I&#39;ve been writing this I&#39;ve been trying to recall what prevented me from using&amp;nbsp; &lt;a href=&quot;http://man7.org/linux/man-pages/man1/ls.1.html&quot; target=&quot;_blank&quot;&gt;ls&lt;/a&gt; to get where I needed to be.&amp;nbsp; I know It caught me out and why may come back to me.&amp;nbsp; If it does,&amp;nbsp; I will update again but why not see if it take you where &lt;b&gt;you&lt;/b&gt; need to go first&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
ls -ABc&amp;nbsp;&lt;/blockquote&gt;
&lt;div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://kelloggsdba.blogspot.com/feeds/5381365732735531136/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8677961998247325759/5381365732735531136' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8677961998247325759/posts/default/5381365732735531136'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8677961998247325759/posts/default/5381365732735531136'/><link rel='alternate' type='text/html' href='http://kelloggsdba.blogspot.com/2019/09/find-newest-file-in-unix-directory.html' title='Find newest file in a unix directory'/><author><name>AGuidingLife</name><uri>http://www.blogger.com/profile/05823333742737762759</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><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8677961998247325759.post-601208989518968357</id><published>2019-08-09T12:53:00.000-07:00</published><updated>2019-08-09T12:53:00.626-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="random"/><title type='text'>Generate a random string - really useful for random passwords for new user creation</title><content type='html'>&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
cat /dev/urandom | strings --bytes 1 | tr -d &#39;\n\t &#39; | head
-c32&lt;/div&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://kelloggsdba.blogspot.com/feeds/601208989518968357/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8677961998247325759/601208989518968357' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8677961998247325759/posts/default/601208989518968357'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8677961998247325759/posts/default/601208989518968357'/><link rel='alternate' type='text/html' href='http://kelloggsdba.blogspot.com/2019/08/generate-random-string-really-useful.html' title='Generate a random string - really useful for random passwords for new user creation'/><author><name>AGuidingLife</name><uri>http://www.blogger.com/profile/05823333742737762759</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><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8677961998247325759.post-2600845688910010631</id><published>2019-07-12T14:48:00.000-07:00</published><updated>2019-07-12T14:48:26.046-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="awk"/><category scheme="http://www.blogger.com/atom/ns#" term="grep"/><category scheme="http://www.blogger.com/atom/ns#" term="unix"/><title type='text'>Conditional awk - for when grep is finding duplicates</title><content type='html'>My files that contain information about my databases often look like this &lt;span style=&quot;font-size: x-small;&quot;&gt;(It&#39;s a dirty way to maintain a database inventory on a server with multiple databases when the database product itself doesn&#39;t have a concept of inventory)&lt;/span&gt;:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Mydatabasename:/path/to/product/home:/path/to/conf/myfile.conf&lt;br /&gt;Anotherdatabasename:/path/to/product/home:/path/to/conf/myfile2.conf&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;When the database name appears in 2 lines of the file a simple grep would bring back multiple lines: &lt;br /&gt;&lt;br /&gt;mydb=$1 &lt;br /&gt;DBHome=grep -w $1 ${myfilelistingdbs}| awk -F &quot;:&quot; &#39;{print $2}&#39; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;So do THIS instead: &lt;br /&gt;&lt;br /&gt;mydb=$1 &lt;br /&gt;awk -F &quot;:&quot; -vx=$mydb  &#39;$1==x {print $2}&#39; ${myfilelistingdbs} &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;It says: if the first field matches this then tell me second field contents &lt;br /&gt;&lt;br /&gt;this solves problem of db name popping up in a home path &lt;br /&gt;&lt;br /&gt;e.g&lt;br /&gt;database_cola:/data/database_pepsi/product:/data/database_pepsi/conf/database_cola.conf&lt;br /&gt;database_pepsi:/data/database_pepsi/product:/data/database_pepsi/conf/database_pepsi.conf &lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;A grep on database_pepsi returned two product homes (and upset my scripts expecting only one line!)&lt;br /&gt;Awk on first field means you only get one product home returned</content><link rel='replies' type='application/atom+xml' href='http://kelloggsdba.blogspot.com/feeds/2600845688910010631/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8677961998247325759/2600845688910010631' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8677961998247325759/posts/default/2600845688910010631'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8677961998247325759/posts/default/2600845688910010631'/><link rel='alternate' type='text/html' href='http://kelloggsdba.blogspot.com/2019/07/conditional-awk-for-when-grep-is.html' title='Conditional awk - for when grep is finding duplicates'/><author><name>AGuidingLife</name><uri>http://www.blogger.com/profile/05823333742737762759</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><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8677961998247325759.post-6216651460815398041</id><published>2019-02-12T13:19:00.000-08:00</published><updated>2019-02-12T13:19:04.977-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="touch"/><category scheme="http://www.blogger.com/atom/ns#" term="unix"/><title type='text'>How to change the attributes of a file in linux</title><content type='html'>&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
I often want to change the timestamp of files when testing scripts so I can see whether the logic works with different ages of files etc.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
use touch:&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
touch -a -m -t 201512180130.09 myfile&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
-a&amp;nbsp; change the access time&lt;br /&gt;-m change the modification time&lt;br /&gt;-t STAMP use [[CC]YY]MMDDhhmm[.ss] instead of current time&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://kelloggsdba.blogspot.com/feeds/6216651460815398041/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8677961998247325759/6216651460815398041' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8677961998247325759/posts/default/6216651460815398041'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8677961998247325759/posts/default/6216651460815398041'/><link rel='alternate' type='text/html' href='http://kelloggsdba.blogspot.com/2019/02/how-to-change-attributes-of-file-in.html' title='How to change the attributes of a file in linux'/><author><name>AGuidingLife</name><uri>http://www.blogger.com/profile/05823333742737762759</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><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8677961998247325759.post-5359633478489138555</id><published>2018-12-24T14:21:00.000-08:00</published><updated>2019-07-12T14:46:01.245-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="regex"/><category scheme="http://www.blogger.com/atom/ns#" term="sed"/><category scheme="http://www.blogger.com/atom/ns#" term="unix"/><title type='text'>Removing blank lines or replacing white spaces in a file</title><content type='html'>&lt;div&gt;
in vim:&lt;/div&gt;
&lt;br /&gt;
:g/^$/d&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:&amp;nbsp; put into a state for editing with regex commands&lt;br /&gt;
&lt;br /&gt;
g for every line in the file&lt;br /&gt;
&lt;br /&gt;
/&amp;nbsp; let&#39;s start&lt;br /&gt;
&lt;br /&gt;
^&amp;nbsp; from the start of the line&lt;br /&gt;
&lt;br /&gt;
$&amp;nbsp; &amp;nbsp;to the end of the line (^$ together is a special instruction that says blank line)&lt;br /&gt;
&lt;br /&gt;
/ next instruction&lt;br /&gt;
&lt;br /&gt;
d delete it&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
with vi&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;:g/^[ ]*$/d&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
there&#39;s a space in between those square brackets&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
vim&lt;br /&gt;
&lt;br /&gt;
:g/^\s$/d&lt;br /&gt;
&lt;br /&gt;
\s means white spaces&lt;br /&gt;
&lt;br /&gt;
remove blank lines from a file with sed:&lt;br /&gt;
sed -i &#39;/^$/d&#39; myfile.txt&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Replace white spaces with commas:&lt;/div&gt;
&lt;div&gt;
:%s/\s\+/,/g&lt;br /&gt;
&lt;br /&gt;
replace a word in vi&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
:g;myword;s;;replaceitwiththis;g&lt;br /&gt;
&lt;br /&gt;
For replacing a word after a word see &lt;a href=&quot;https://kelloggsdba.blogspot.com/2018/11/sed-replacing-word-after-word-in-file.html&quot; target=&quot;_blank&quot;&gt;this post&lt;/a&gt;&lt;br /&gt;
&lt;div&gt;
Here is a useful link for regex expressions:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;a href=&quot;https://www.w3schools.com/jsref/jsref_obj_regexp.asp&quot;&gt;https://www.w3schools.com/jsref/jsref_obj_regexp.asp&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
for vim:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;a href=&quot;http://vimdoc.sourceforge.net/htmldoc/pattern.html&quot;&gt;http://vimdoc.sourceforge.net/htmldoc/pattern.html&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://kelloggsdba.blogspot.com/feeds/5359633478489138555/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8677961998247325759/5359633478489138555' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8677961998247325759/posts/default/5359633478489138555'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8677961998247325759/posts/default/5359633478489138555'/><link rel='alternate' type='text/html' href='http://kelloggsdba.blogspot.com/2018/12/removing-blank-lines-or-replacing-white.html' title='Removing blank lines or replacing white spaces in a file'/><author><name>AGuidingLife</name><uri>http://www.blogger.com/profile/05823333742737762759</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><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8677961998247325759.post-5016032502059967255</id><published>2018-11-13T13:01:00.000-08:00</published><updated>2019-07-12T14:46:19.346-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="regex"/><category scheme="http://www.blogger.com/atom/ns#" term="sed"/><category scheme="http://www.blogger.com/atom/ns#" term="unix"/><title type='text'>SED replacing the word after a word in a file</title><content type='html'>&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
There is an application that writes a particular command into a log file whenever it runs.&amp;nbsp; And that command includes a password switch.&amp;nbsp; Which means the password is joyfully sat in a log file.&amp;nbsp; Even though you have to be able to log onto the server, and have permissions to read the log, it is still not ideal.&amp;nbsp; To strip the password out of the log I run:&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
sed -i &#39;s/--password[^ ]* /--password replaced /g&#39; myfile.txt&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
it says find the string &quot;--password morecharacters &quot; and change it to &quot;--password replaced &quot;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Lets break it down:&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;
-i - edit file in place&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;dl&gt;
&lt;dt&gt;&#39;s/regexp/replacement/g&#39;&lt;/dt&gt;
&lt;dt&gt;Attempt to match regexp against the pattern space. If successful, replace that portion matched with replacement.&lt;/dt&gt;
&lt;dt&gt;&lt;br /&gt;&lt;/dt&gt;
&lt;dt&gt;[^ ]* regular expression for match every character except a space - note there is a space after the ^&amp;nbsp; and before the ] and after the *&lt;/dt&gt;
&lt;/dl&gt;
so it is saying match the word --password and whatever comes after it ignoring the first space&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
and up to the next space.&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
g&amp;nbsp; do it for all iterations found in the file (global replace)&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
cat myfile.txt:&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; here be my command --password mypassword --anotherswitch and more words&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
sed -i &#39;s/--password[^ ]* /--password replaced /g&#39; myfile.txt&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
cat myfile.txt:&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; here be my command --password replaced --anotherswitch and more words&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://kelloggsdba.blogspot.com/feeds/5016032502059967255/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8677961998247325759/5016032502059967255' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8677961998247325759/posts/default/5016032502059967255'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8677961998247325759/posts/default/5016032502059967255'/><link rel='alternate' type='text/html' href='http://kelloggsdba.blogspot.com/2018/11/sed-replacing-word-after-word-in-file.html' title='SED replacing the word after a word in a file'/><author><name>AGuidingLife</name><uri>http://www.blogger.com/profile/05823333742737762759</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><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8677961998247325759.post-5937803407393148221</id><published>2018-10-31T14:21:00.001-07:00</published><updated>2018-10-31T14:21:59.314-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="oracle"/><category scheme="http://www.blogger.com/atom/ns#" term="sql"/><title type='text'>Oracle report all users, their roles and privileges</title><content type='html'>&lt;br /&gt;
I took the sql for &lt;a href=&quot;http://www.adp-gmbh.ch/ora/misc/recursively_list_privilege.html&quot; target=&quot;_blank&quot;&gt;listing privileges recursively for Oracle users&lt;/a&gt; from &lt;a href=&quot;https://renenyffenegger.ch/&quot; target=&quot;_blank&quot;&gt;Rene Nyffenegger&lt;/a&gt;&#39;s site, it is very good but only works for one user at a time as it stands, I wanted to run a report that outputted the same way for every user in my database.&amp;nbsp; So it needed to go into a PL/SQL loop.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;
&lt;br /&gt;
set serveroutput on&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;
declare&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
TYPE re_type IS TABLE OF varchar2(1024);&lt;br /&gt;
v_statement varchar2(1024);&lt;br /&gt;
v_result re_type;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
BEGIN&lt;/div&gt;
&lt;div&gt;
for x in ( select username from dba_users)&lt;br /&gt;
LOOP&lt;/div&gt;
&lt;div&gt;
v_statement := &#39;select concat(lpad(&#39;&#39; &#39;&#39;, 2*level), granted_role) line1 from (select null grantee, username granted_role from dba_users where username = &#39;&#39;&#39; || x.username || &#39;&#39;&#39; union select grantee, granted_role from dba_role_privs union select grantee, privilege from dba_sys_privs ) start with grantee is null connect by grantee = prior granted_role&#39;;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;
execute immediate v_statement BULK COLLECT INTO v_result;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
for indx in v_result.FIRST .. v_result.LAST&lt;br /&gt;
loop DBMS_OUTPUT.PUT_LINE(v_result(indx));&lt;/div&gt;
&lt;div&gt;
end loop;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
END LOOP;&lt;/div&gt;
&lt;div&gt;
END;&lt;/div&gt;
&lt;div&gt;
/&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 2.0pt; margin-left: 0cm; margin-right: 0cm; margin-top: 2.0pt; text-autospace: none;&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/blockquote&gt;
You get a formatted output like:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 2.0pt; margin-left: 0cm; margin-right: 0cm; margin-top: 2.0pt; text-autospace: none;&quot;&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
MYUSER1&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;
MYROLE_SESSION&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
ALTER SESSION&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
CREATE SESSION&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;
CONNECT&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
CREATE SESSION&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;
MYROLE1&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;
MYROLE2&lt;br /&gt;
&amp;nbsp; MYUSER2&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;
CONNECT&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
CREATE SESSION&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;
MYROLE1&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;
MYROLE3&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;segoe ui&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/blockquote&gt;
&lt;/div&gt;
&lt;br /&gt;
Particular thanks to &lt;a href=&quot;https://dwpetetechnical.wordpress.com/about/&quot; target=&quot;_blank&quot;&gt;Pete&lt;/a&gt; for seeing me past my quotes and array woes

</content><link rel='replies' type='application/atom+xml' href='http://kelloggsdba.blogspot.com/feeds/5937803407393148221/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8677961998247325759/5937803407393148221' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8677961998247325759/posts/default/5937803407393148221'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8677961998247325759/posts/default/5937803407393148221'/><link rel='alternate' type='text/html' href='http://kelloggsdba.blogspot.com/2018/10/oracle-report-all-users-their-roles-and.html' title='Oracle report all users, their roles and privileges'/><author><name>AGuidingLife</name><uri>http://www.blogger.com/profile/05823333742737762759</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><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8677961998247325759.post-3470935596882217205</id><published>2017-09-19T13:36:00.001-07:00</published><updated>2017-10-24T13:02:38.440-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="unix find"/><title type='text'>using find to find files but ignore lost+found</title><content type='html'>&lt;div class=&quot;MsoNormal&quot;&gt;
Because it took me a while to work this out and I know I&#39;ll never remember how I did it:&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
e.g.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
/usr/bin/find /path/to/search/ -name
&quot;myfile_name_in_some_form*.tar.gz&quot;&amp;nbsp; -not \( -path &quot;.lost+found&quot; -prune
\) -print&amp;nbsp; -mtime +92 -exec ls {} \;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
delete my backup files over 92 days old:&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
/usr/bin/find /backup/mydir/ -name &quot;mybackupfile*.tar.gz&quot;&amp;nbsp; -not \( -path &quot;.lost+found&quot; -prune \) -print&amp;nbsp; -mtime +92 -exec rm {} \;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An alternative:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
/usr/bin/find /backup/mydir/ \! -readable -prune -o&amp;nbsp;
-name &quot;mybackupfile_*.tar.gz&quot; -print&amp;nbsp; -mtime +92 -exec rm {} \;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://kelloggsdba.blogspot.com/feeds/3470935596882217205/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8677961998247325759/3470935596882217205' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8677961998247325759/posts/default/3470935596882217205'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8677961998247325759/posts/default/3470935596882217205'/><link rel='alternate' type='text/html' href='http://kelloggsdba.blogspot.com/2017/09/using-find-to-find-files-but-ignore.html' title='using find to find files but ignore lost+found'/><author><name>AGuidingLife</name><uri>http://www.blogger.com/profile/05823333742737762759</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><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8677961998247325759.post-7141762547314244086</id><published>2017-02-27T13:42:00.000-08:00</published><updated>2017-02-27T13:42:17.059-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="autoextend"/><category scheme="http://www.blogger.com/atom/ns#" term="oracle"/><category scheme="http://www.blogger.com/atom/ns#" term="sql"/><title type='text'>Finding Oracle tablespaces with mixed autoextensible datafiles</title><content type='html'>

&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;br /&gt;Two ways to identify tablespaces where some datafiles are autoextend true and some are false.&lt;/div&gt;
&lt;div&gt;
(Mixing these can cause issues with monitoring, so try to keep them consistent.)&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;SELECT&amp;nbsp;DISTINCT a.tablespace_name&lt;br /&gt;FROM dba_data_files a&lt;br /&gt; WHERE a.autoextensible =&#39;YES&#39;&lt;br /&gt;AND EXISTS&lt;/div&gt;
&lt;div&gt;
(SELECT DISTINCT b.tablespace_name&lt;/div&gt;
&lt;div&gt;
FROM dba_data_files b&lt;br /&gt;WHERE b.autoextensible =&#39;NO&#39;&lt;br /&gt;AND&amp;nbsp;b.tablespace_name=a.tablespace_name )&lt;br /&gt;ORDER BY tablespace_name;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SELECT&amp;nbsp; ddf2.tablespace_name&lt;br /&gt;FROM&lt;/div&gt;
&lt;div&gt;
(SELECT DISTINCT ddf.tablespace_name,ddf.autoextensible&lt;br /&gt;FROM&amp;nbsp; dba_data_files ddf&lt;br /&gt;GROUP BY ddf.tablespace_name,ddf.autoextensible&lt;br /&gt;) ddf2&lt;br /&gt;GROUP BY ddf2.tablespace_name&lt;br /&gt;HAVING&amp;nbsp; count(1) = 2&lt;br /&gt;ORDER BY ddf2.tablespace_name;&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt; &lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://kelloggsdba.blogspot.com/feeds/7141762547314244086/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8677961998247325759/7141762547314244086' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8677961998247325759/posts/default/7141762547314244086'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8677961998247325759/posts/default/7141762547314244086'/><link rel='alternate' type='text/html' href='http://kelloggsdba.blogspot.com/2017/02/finding-oracle-tablespaces-with-mixed.html' title='Finding Oracle tablespaces with mixed autoextensible datafiles'/><author><name>AGuidingLife</name><uri>http://www.blogger.com/profile/05823333742737762759</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><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8677961998247325759.post-885959129133465684</id><published>2016-11-18T12:34:00.001-08:00</published><updated>2016-11-18T12:34:58.261-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ora-0600 not in lookup tool"/><title type='text'>ORA-00600: internal error code, arguments: [kkqctdrvCVM(2): More than one CV!]</title><content type='html'>&lt;br /&gt;
Oracle Database 11g 11.2.0.3.0&lt;br /&gt;
&lt;br /&gt;
ORA-00600: internal error code, arguments: [kkqctdrvCVM(2): More than one CV!], [], [], [], [], [], [], [], [], [], [], []&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;u&gt;Sql causing error&lt;/u&gt;&lt;br /&gt;
/* SQL Analyze(27,1) */ select &quot;foo&quot;.&quot;foo&quot; &quot;foo .....&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;Call Stack&lt;/u&gt;&lt;br /&gt;
kgeadse kgerinv_internal kgerinv kgeasnmierr kkqctdrvCVM&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This error comes out of SQL Tuning Advisor, if you aren&#39;t using the tuning advisor disable it:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
select client_name, status,attributes,service_name&lt;br /&gt; from dba_autotask_client;&lt;br /&gt;&lt;br /&gt;BEGIN&lt;br /&gt;  DBMS_AUTO_TASK_ADMIN.disable(&lt;br /&gt;    client_name =&amp;gt; &#39;sql tuning advisor&#39;,&lt;br /&gt;    operation   =&amp;gt; NULL,&lt;br /&gt;    window_name =&amp;gt; NULL);&lt;br /&gt;END;&lt;br /&gt;/&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
select client_name, status,attributes,service_name&lt;/div&gt;
&lt;div&gt;
from dba_autotask_client;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://kelloggsdba.blogspot.com/feeds/885959129133465684/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8677961998247325759/885959129133465684' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8677961998247325759/posts/default/885959129133465684'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8677961998247325759/posts/default/885959129133465684'/><link rel='alternate' type='text/html' href='http://kelloggsdba.blogspot.com/2016/11/ora-00600-kkqctdrvCVM.html' title='ORA-00600: internal error code, arguments: [kkqctdrvCVM(2): More than one CV!]'/><author><name>AGuidingLife</name><uri>http://www.blogger.com/profile/05823333742737762759</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><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8677961998247325759.post-3195978428328649608</id><published>2016-11-17T13:08:00.002-08:00</published><updated>2016-11-17T13:31:56.209-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="dbms_redefinition"/><title type='text'>Using LPAD with dbms_redefinition to add leading zeros</title><content type='html'>In the &lt;a href=&quot;http://kelloggsdba.blogspot.co.uk/2016/06/change-column-from-number-to-varchar2.html&quot; target=&quot;_blank&quot;&gt;previous post &lt;/a&gt;I showed how to change a column definition in a table from varchar to num (or vice-versa) using dbms_redefinition&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I had reason to need to pad out a converted varchar column with leading zeros.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
begin&lt;br /&gt;
DBMS_REDEFINITION.START_REDEF_TABLE(&lt;br /&gt;
&amp;nbsp; &amp;nbsp;uname &amp;nbsp; &amp;nbsp; &amp;nbsp; =&amp;gt; &#39;MYSCHEMA&#39;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp;orig_table &amp;nbsp;=&amp;gt; &#39;MYTABLE&#39;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp;int_table &amp;nbsp; =&amp;gt; &#39;INT_MYTABLE&#39;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp;col_mapping =&amp;gt; &#39;&amp;nbsp;ORDERNUM &amp;nbsp; &amp;nbsp;&amp;nbsp;ORDERNUM &amp;nbsp;,&lt;br /&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;&lt;b&gt;LPAD &lt;/b&gt;(&lt;b&gt;to_char (COLUMN_TO_BE CHANGED),3,&#39;&#39;0&#39;&#39;)&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;nbsp;COLUMN_TO_BE CHANGED&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;,&lt;/b&gt;&lt;br /&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; LOAD &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;LOAD&#39;&amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;,&lt;br /&gt;
options_flag =&amp;gt; DBMS_REDEFINITION.CONS_USE_ROWID &amp;nbsp;);&lt;br /&gt;
end;&lt;br /&gt;
/&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;a href=&quot;https://docs.oracle.com/cd/B28359_01/olap.111/b28126/dml_functions_2017.htm#OLADM593&quot; target=&quot;_blank&quot;&gt;LPad&lt;/a&gt; will left pad a field for you, so here I am saying take my number column, turn it into a varchar (&lt;a href=&quot;http://kelloggsdba.blogspot.co.uk/2016/06/change-column-from-number-to-varchar2.html&quot; target=&quot;_blank&quot;&gt;see post&lt;/a&gt;&amp;nbsp;) and stick leading zeros on the data that is already in it to make it 3 characters.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
For the process you need to follow to actually make it all happen go to the previous post, but am I writing this here because I just know at some point I&#39;m going to go &quot;I know I&#39;ve done that with redef before, but how the hell did I do it&quot; . &amp;nbsp;So am I going to leave this here so I kick myself when my own post comes up in the google search that I do - you know that feeling too I&#39;m sure !!!&amp;nbsp;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://kelloggsdba.blogspot.com/feeds/3195978428328649608/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8677961998247325759/3195978428328649608' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8677961998247325759/posts/default/3195978428328649608'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8677961998247325759/posts/default/3195978428328649608'/><link rel='alternate' type='text/html' href='http://kelloggsdba.blogspot.com/2016/11/using-lpad-with-dbmsredefinition-to-add.html' title='Using LPAD with dbms_redefinition to add leading zeros'/><author><name>AGuidingLife</name><uri>http://www.blogger.com/profile/05823333742737762759</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><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8677961998247325759.post-8079806416589422866</id><published>2016-06-24T15:24:00.000-07:00</published><updated>2016-06-24T15:34:44.018-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="dbms_redefinition"/><title type='text'>Change column from number to varchar2 using DBMS_REDEF</title><content type='html'>&lt;br /&gt;
This does a to_char but it also works with a to_num if you want to go from a varchar to a number.&lt;br /&gt;
&lt;br /&gt;
STEP 1 :&lt;br /&gt;
Add disk space required&lt;br /&gt;
&lt;br /&gt;
This needs to be enough to repeat the size of the table and its indexes, it is temporary storage for the period of the change only.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
STEP 2:&lt;br /&gt;
Redo&lt;br /&gt;
&lt;br /&gt;
The redefinition is going to churn through redo, make sure you have enough logs and they are large enough or you will get a bottle neck that will slow it up. If your db is in archivelog mode then also make sure you have a cunning plan to deal with them too.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
STEP 3:&lt;br /&gt;
Think about a backout plan&lt;br /&gt;
&lt;br /&gt;
I took an export of my table at the start because I had the luxury to do so. &amp;nbsp;I love a belt and braces approach to change.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
STEP 4 :&lt;br /&gt;
count original table - alway nice to be able to prove you haven&#39;t lost rows when you finish!&lt;br /&gt;
&lt;br /&gt;
select count (*) from myschema.mytable;&lt;br /&gt;
record result&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
STEP 5:&lt;br /&gt;
Note what you have already&lt;br /&gt;
&lt;br /&gt;
select column_id, column_name, data_type, data_length, data_precision, nullable, last_analyzed &amp;nbsp;from dba_tab_columns&lt;br /&gt;
where table_name = &#39;MYTABLE&#39;&lt;br /&gt;
order by column_id;&lt;br /&gt;
&lt;br /&gt;
1&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;ORDERNUM&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&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;NUMBER&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;22&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;8&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;N&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;dd/mm/yyyy hh:mm:ss&lt;br /&gt;
2&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;b&gt;COLUMN_TO_BE CHANGED &amp;nbsp; &amp;nbsp;NUMBER&lt;/b&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;22&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;3&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;N&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;dd/mm/yyyy hh:mm:ss&lt;br /&gt;
3&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;LOAD&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&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;TIMESTAMP(6)&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;11&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;N&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;dd/mm/yyyy hh:mm:ss&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
STEP 6 :&lt;br /&gt;
create an interim table&lt;br /&gt;
&lt;br /&gt;
create myschema.INT_mytable the same as the existing table but with&amp;nbsp;COLUMN_TO_BE CHANGED&amp;nbsp;&amp;nbsp;as a &amp;nbsp;varchar2 instead of a number (There is no need to create the indexes, but I did include the constraints)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE myschema.&lt;b&gt;INT_&lt;/b&gt;mytable&lt;br /&gt;
(&lt;br /&gt;
&amp;nbsp;ORDERNUM&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&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; NUMBER(8) &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;NOT NULL,&lt;br /&gt;
&amp;nbsp;&lt;b&gt;COLUMN_TO_BE CHANGED&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; VARCHAR2(3 CHAR) &amp;nbsp;&lt;/b&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;NOT NULL,&lt;br /&gt;
&amp;nbsp; LOAD &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;TIMESTAMP(6) &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;NOT NULL&lt;br /&gt;
)&lt;br /&gt;
TABLESPACE mytablespace&lt;br /&gt;
other clauses as per your original table definition&lt;br /&gt;
;&lt;br /&gt;
&lt;br /&gt;
STEP 7:&lt;br /&gt;
check it&lt;br /&gt;
&lt;br /&gt;
select column_id, column_name, data_type, data_length, data_precision, nullable, last_analyzed&lt;br /&gt;
from dba_tab_columns&lt;br /&gt;
where table_name = &#39;MYTABLE&#39;&lt;br /&gt;
and column_id =2;&lt;br /&gt;
2&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;COLUMN_TO_BE CHANGED&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;NUMBER&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;22&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;3&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;N&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;dd/mm/yyyy hh:mm:ss&lt;br /&gt;
&lt;br /&gt;
select column_id, column_name, data_type, data_length, data_precision, nullable, last_analyzed&lt;br /&gt;
from dba_tab_columns&lt;br /&gt;
where table_name = &#39;INT_MYTABLE&#39;&lt;br /&gt;
and column_id =2;&lt;br /&gt;
2&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;COLUMN_TO_BE CHANGED&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;VARCHAR2&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;12&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;N&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
STEP 8&lt;br /&gt;
check redef will work&lt;br /&gt;
&lt;br /&gt;
begin&lt;br /&gt;
DBMS_REDEFINITION.can_redef_table(&#39;MYSCHEMA&#39;, &#39;MYTABLE&#39;);&lt;br /&gt;
end;&lt;br /&gt;
/&lt;br /&gt;
&lt;br /&gt;
STEP 9&lt;br /&gt;
Start the redefinition&lt;br /&gt;
&lt;br /&gt;
I parallelised this based on cat /proc/cpuinfo | grep processor | wc -l x 4&lt;br /&gt;
&lt;br /&gt;
set echo on;&lt;br /&gt;
spool redef.txt&lt;br /&gt;
ALTER SESSION FORCE PARALLEL DML PARALLEL 32;&lt;br /&gt;
ALTER SESSION FORCE PARALLEL QUERY PARALLEL 32;&lt;br /&gt;
ALTER SESSION ENABLE RESUMABLE;&lt;br /&gt;
set timing on;&lt;br /&gt;
begin&lt;br /&gt;
DBMS_REDEFINITION.START_REDEF_TABLE(&lt;br /&gt;
&amp;nbsp; &amp;nbsp;uname &amp;nbsp; &amp;nbsp; &amp;nbsp; =&amp;gt; &#39;MYSCHEMA&#39;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp;orig_table &amp;nbsp;=&amp;gt; &#39;MYTABLE&#39;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp;int_table &amp;nbsp; =&amp;gt; &#39;INT_MYTABLE&#39;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp;col_mapping =&amp;gt; &#39;&amp;nbsp;ORDERNUM &amp;nbsp; &amp;nbsp;&amp;nbsp;ORDERNUM &amp;nbsp;,&lt;br /&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; &lt;b&gt;to_char (COLUMN_TO_BE CHANGED)&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;nbsp;COLUMN_TO_BE CHANGED&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;,&lt;/b&gt;&lt;br /&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; LOAD &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;LOAD&#39;&amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;,&lt;br /&gt;
options_flag =&amp;gt; DBMS_REDEFINITION.CONS_USE_ROWID &amp;nbsp;);&lt;br /&gt;
end;&lt;br /&gt;
/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
STEP 10:&lt;br /&gt;
What else do you want to keep as a part of the redefinition, you need to think about this for yourself based on what is relevant.&lt;br /&gt;
&lt;br /&gt;
set serveroutput on;&lt;br /&gt;
DECLARE&lt;br /&gt;
error_count pls_integer := 0;&lt;br /&gt;
begin&lt;br /&gt;
DBMS_REDEFINITION.COPY_TABLE_DEPENDENTS( UNAME =&amp;gt; &#39;MYSCHEMA&#39;,&lt;br /&gt;
ORIG_TABLE =&amp;gt; &#39;MYTABLE&#39;,&lt;br /&gt;
INT_TABLE =&amp;gt; &#39;INT_MYTABLE&#39;,&lt;br /&gt;
COPY_INDEXES =&amp;gt; DBMS_REDEFINITION.cons_orig_params,&lt;br /&gt;
COPY_TRIGGERS =&amp;gt; FALSE,&lt;br /&gt;
COPY_CONSTRAINTS =&amp;gt; FALSE,&lt;br /&gt;
COPY_PRIVILEGES =&amp;gt; TRUE,&lt;br /&gt;
IGNORE_ERRORS =&amp;gt; FALSE,&lt;br /&gt;
COPY_STATISTICS =&amp;gt; TRUE,&lt;br /&gt;
NUM_ERRORS =&amp;gt; error_count);&lt;br /&gt;
DBMS_OUTPUT.PUT_LINE(&#39;errors := &#39; || error_count);&lt;br /&gt;
end;&lt;br /&gt;
/&lt;br /&gt;
&lt;br /&gt;
errors := 0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
STEP 11:&lt;br /&gt;
finish the redefinition&lt;br /&gt;
&lt;br /&gt;
begin&lt;br /&gt;
&amp;nbsp; DBMS_REDEFINITION.finish_redef_table(&lt;br /&gt;
&amp;nbsp; &amp;nbsp; uname &amp;nbsp; &amp;nbsp; &amp;nbsp;=&amp;gt; &#39;MYSCHEMA&#39;, &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; orig_table =&amp;gt; &#39;MYTABLE&#39;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; int_table &amp;nbsp;=&amp;gt; &#39;INT_MYTABLE&#39;); &amp;nbsp; &lt;br /&gt;
&amp;nbsp;end;&lt;br /&gt;
/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
STEP 12:&lt;br /&gt;
check counts and do checks&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
select count (*) from MYSCHEMA.MYTABLE;&lt;br /&gt;
same result as STEP 4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
select column_id, column_name, data_type, data_length, data_precision, nullable, last_analyzed &amp;nbsp;from dba_tab_columns&lt;br /&gt;
where table_name = &#39;MYTABLE&#39;&lt;br /&gt;
order by column_id;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;ORDERNUM&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&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;NUMBER&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;22&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;8&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;N&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;dd/mm/yyyy hh:mm:ss&lt;br /&gt;
2&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;COLUMN_TO_BE CHANGED &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;VARCHAR2&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;12&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;N&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;dd/mm/yyyy hh:mm:ss&lt;br /&gt;
3&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;LOAD&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&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;TIMESTAMP(6)&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;11&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;N&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;dd/mm/yyyy hh:mm:ss&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
select column_id, column_name, data_type, data_length, data_precision, nullable, last_analyzed&lt;br /&gt;
from dba_tab_columns&lt;br /&gt;
where table_name = &#39;MYTABLE&#39;&lt;br /&gt;
and column_id =2;&lt;br /&gt;
2&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;COLUMN_TO_BE CHANGED&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;VARCHAR2&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;12&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;N&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;21/05/2016 18:00:32&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
check parallel on table and indexes - all the same as original&lt;br /&gt;
synonyms still there&lt;br /&gt;
grants still there&lt;br /&gt;
constraints and indexes still there&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
STEP 13:&lt;br /&gt;
drop the &lt;b&gt;interim &lt;/b&gt;table&lt;br /&gt;
&lt;br /&gt;
DROP TABLE MYSCHEMA.&lt;b&gt;INT_&lt;/b&gt;MYTABLE;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
NOTE:&lt;br /&gt;
&lt;br /&gt;
it took a while for me to get my syntax spot on, if you get failure after the redefinition has started you need to abort the process to be able to restart it:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
begin&lt;br /&gt;
&amp;nbsp;DBMS_REDEFINITION.abort_redef_table(&lt;br /&gt;
&amp;nbsp; &amp;nbsp; uname &amp;nbsp; &amp;nbsp; &amp;nbsp;=&amp;gt; &#39;MYSCHEMA&#39;, &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; orig_table =&amp;gt; &#39;MYTABLE&#39;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; int_table &amp;nbsp;=&amp;gt; &#39;INT_MYTABLE&#39;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; end;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://kelloggsdba.blogspot.com/feeds/8079806416589422866/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8677961998247325759/8079806416589422866' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8677961998247325759/posts/default/8079806416589422866'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8677961998247325759/posts/default/8079806416589422866'/><link rel='alternate' type='text/html' href='http://kelloggsdba.blogspot.com/2016/06/change-column-from-number-to-varchar2.html' title='Change column from number to varchar2 using DBMS_REDEF'/><author><name>AGuidingLife</name><uri>http://www.blogger.com/profile/05823333742737762759</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><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8677961998247325759.post-4175127299554328813</id><published>2016-05-20T09:39:00.000-07:00</published><updated>2016-05-20T09:39:13.456-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="expdp"/><category scheme="http://www.blogger.com/atom/ns#" term="expdp query parameter"/><category scheme="http://www.blogger.com/atom/ns#" term="oracle"/><title type='text'>EXPDP using QUERY with to_timestamp or to_date</title><content type='html'>For expdp with select queries using to_timestamp or to_date I&#39;ve had a bit of  game getting the apostrophes to play happy bunny.  Within a parfile I was getting nowhere, so back to my easy friend ksh (run against an 11.2 database):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
#!/bin/ksh&lt;/div&gt;
&lt;br /&gt;#set the environment&lt;br /&gt;export PATH=$PATH:/usr/local/bin&lt;br /&gt;export ORACLE_SID=MYSID&lt;br /&gt;export ORAENV_ASK=NO&lt;br /&gt;. oraenv&lt;br /&gt;unset ORAENV_ASK&lt;br /&gt;&lt;br /&gt;export NLS_LANG=&quot;English_United Kingdom.AL32UTF8&quot;&lt;br /&gt;&lt;br /&gt;#piping password in is good practise for not seeing it when doing a ps -ef | grep expdp&lt;br /&gt;PASSWORD=myuserpassword&lt;br /&gt;echo $PASSWORD | $ORACLE_HOME/bin/expdp myuser \&lt;br /&gt;DIRECTORY=MY_DPUMP_DIR \&lt;br /&gt;CONTENT=ALL \&lt;br /&gt;COMPRESSION=ALL \&lt;br /&gt;DUMPFILE=mydumpfilename.dmp \&lt;br /&gt;LOGFILE=mylogfilename.log \&lt;br /&gt;EXCLUDE=STATISTICS \&lt;br /&gt;tables=schemaowner.table_name \&lt;br /&gt;QUERY=\&quot;where column_name \&amp;gt; to_timestamp\(\&#39;2015-11-10 00:00:00:000000\&#39;,\&#39;YYYY-MM-DD HH24:MI:SS:FF\&#39;\)\&quot;means the parameter is simply ignored&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;br /&gt;&lt;br /&gt;Notes:&lt;br /&gt;&lt;br /&gt;Whilst out of habit I set NLS_LANG parameter, in expdp it is not really needed any more. See &lt;a href=&quot;http://docs.oracle.com/cd/B28359_01/server.111/b28319/dp_export.htm&quot; target=&quot;_blank&quot;&gt;utilities manual&lt;/a&gt;  for further advice&lt;br /&gt;&lt;br /&gt;DIRECTORY:  remember for datapump you need to define the directory in oracle:&lt;br /&gt;&lt;br /&gt;Create directory MY_DPUMP_DIR as &#39;/myfilesystem/mydirectory&#39;;&lt;br /&gt;grant read, write on directory MY_DPUMP_DIR to myuser;&lt;br /&gt;select * from dba_directories;&lt;br /&gt;&lt;br /&gt;My other &lt;a href=&quot;http://docs.oracle.com/cd/B28359_01/server.111/b28319/dp_export.htm#i1006293&quot; target=&quot;_blank&quot;&gt;parameters&lt;/a&gt; like CONTENT, COMPRESSION, EXCLUDE are there for reasons relevant to what I was doing at the time. You need to think about what you need for the type of file you require, where it is going to be imported to and what is actually needed there.  &lt;br /&gt;&lt;br /&gt;http://docs.oracle.com/cd/B28359_01/server.111/b28319/dp_export.htm#i1006293&lt;br /&gt;&lt;br /&gt;and finally, watch your spaces, I found that leaving spaces like this:&lt;br /&gt;&lt;br /&gt;VERSION = 11.1.0 \&lt;br /&gt;&lt;br /&gt;caused the parameter to be ignored&lt;br /&gt;whereas:&lt;br /&gt;&lt;br /&gt;VERSION=11.1.0 \&lt;br /&gt;&lt;br /&gt;it is was taken into account&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://kelloggsdba.blogspot.com/feeds/4175127299554328813/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8677961998247325759/4175127299554328813' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8677961998247325759/posts/default/4175127299554328813'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8677961998247325759/posts/default/4175127299554328813'/><link rel='alternate' type='text/html' href='http://kelloggsdba.blogspot.com/2016/05/expdp-using-query-with-totimestamp-or.html' title='EXPDP using QUERY with to_timestamp or to_date'/><author><name>AGuidingLife</name><uri>http://www.blogger.com/profile/05823333742737762759</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><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8677961998247325759.post-4962984922437951891</id><published>2016-04-24T15:07:00.001-07:00</published><updated>2016-04-24T15:07:23.243-07:00</updated><title type='text'>How to write messages to the Oracle alert log and custom trace files - dbms_system.ksdwrt</title><content type='html'>&lt;br /&gt;
I&#39;ve been finding this useful on occasion because I have plenty of jobs reading and reporting on alert log errors, so it&#39;s saved me having to think of another way to yell &quot;hey DBA&quot; :&lt;br /&gt;
&lt;br /&gt;
exec dbms_system.ksdwrt(1, &#39;This message goes to trace file in the udump location&#39;); &lt;br /&gt;
&lt;br /&gt;
exec dbms_system.ksdwrt(2, &#39;This message goes to the alert log&#39;);&lt;br /&gt;
&lt;br /&gt;
exec dbms_system.ksdwrt(3, &#39;This message goes to the alert log and trace file in the udump location&#39;); &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
example:&lt;br /&gt;
&lt;br /&gt;
exec dbms_system.ksdwrt(2, &#39;ORA-09999 hey you wake up and investigate this&#39;); &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;style13&quot;&gt;You can put a wrapper around the call and grant execute on the function&lt;/span&gt;&lt;span class=&quot;style13&quot;&gt;:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
create or replace function write_alert_log(log_or_trace in number, text_message in varchar2) return number&lt;br /&gt;
&lt;div&gt;
&lt;div class=&quot;style14&quot;&gt;
&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;style14&quot;&gt;
is&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;style14&quot;&gt;
begin&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;style8&quot;&gt;
&lt;span class=&quot;style15&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;style15&quot;&gt;SYS.DBMS_SYSTEM.KSDWRT(log_or_trace,text_message);&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;style8&quot;&gt;
&lt;span class=&quot;style15&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;style15&quot;&gt;return 0;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;style8&quot;&gt;
&lt;span class=&quot;style15&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;style15&quot;&gt;exception&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;style8&quot;&gt;
&lt;span class=&quot;style15&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;style15&quot;&gt;when others then&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;style8&quot;&gt;
&lt;span class=&quot;style15&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;style15&quot;&gt;return 1;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;style14&quot;&gt;
end;&lt;/div&gt;
&lt;br /&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoNormalTable&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;padding: 0cm 0cm 0cm 0cm;&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td style=&quot;padding: 0cm 0cm 0cm 0cm;&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://kelloggsdba.blogspot.com/feeds/4962984922437951891/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8677961998247325759/4962984922437951891' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8677961998247325759/posts/default/4962984922437951891'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8677961998247325759/posts/default/4962984922437951891'/><link rel='alternate' type='text/html' href='http://kelloggsdba.blogspot.com/2016/04/how-to-write-messages-to-oracle-alert.html' title='How to write messages to the Oracle alert log and custom trace files - dbms_system.ksdwrt'/><author><name>AGuidingLife</name><uri>http://www.blogger.com/profile/05823333742737762759</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><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8677961998247325759.post-1646298718448492300</id><published>2016-01-31T13:35:00.000-08:00</published><updated>2016-01-31T13:35:30.584-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="common sense"/><category scheme="http://www.blogger.com/atom/ns#" term="forums"/><category scheme="http://www.blogger.com/atom/ns#" term="tools"/><title type='text'>Talent and intellect is never displayed in disparagement (aka the worst flashlight I have ever owned)</title><content type='html'>&lt;br /&gt;A simple statement appeared on twitter&amp;nbsp;&lt;blockquote class=&quot;tr_bq&quot; style=&quot;background-color: white; color: #292f33; font-family: Arial, sans-serif; font-size: 16px; line-height: 22px; text-align: center; white-space: pre-wrap; word-wrap: break-word;&quot;&gt;
&quot;This feature request scares me, but I reserve the right to be wrong.&quot;&lt;/blockquote&gt;
&lt;div&gt;
This request was to allow sql statements to be run on multiple databases at the same time through a tool. &amp;nbsp;So a bit like OEM allows you to do multi database reporting or even patching. &amp;nbsp;Bearing in mind that anyone connected to a database via a tool will only be able to do what they actually have access to do, I don&#39;t really see this as a problem. &amp;nbsp;My response was:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&quot;With privilege comes responsibility&quot;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;I can have a staging server that can attach to multiple databases, I can write a simple shell script to run through all those database and execute whatever I like within the access privileges of the user I connect with. &amp;nbsp;Simples. &amp;nbsp; I could create a patch plan to patch an entire estate at the same time. &amp;nbsp;No problem. I could write a report to run on a production group of databases that does *&lt;a href=&quot;http://www.jlcomp.demon.co.uk/kiddy_scripts.html#_Always_be_cautious_about_x$_and_v$&quot; target=&quot;_blank&quot;&gt;this&lt;/a&gt;. &lt;span style=&quot;font-size: x-small;&quot;&gt;(Hold that thought in mind, it will resurface.)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Some of the twitter circle within which I roam decided that &#39;people&#39; would destroy the planet with such dangerous functionality:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&quot;If it was my product I&#39;d be worried about giving &#39;em so much rope&quot;&lt;/i&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
So who gets to decide the length of rope the common DBA can hang themselves with? My feeling is: the access level they are granted - nothing like an rm -r * as the oracle software owner to guarantee a long night ahead - who allowed the Oracle DBA access to the server they had to install the software on?! Fools, fools everywhere!&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
I think that the role of experienced people within a community, if they choose to engage, is to offer advice and to share experience but not to judge.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&quot;We should judge&quot;&amp;nbsp;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
I wonder if perhaps more practical comments might be &quot;experience has shown me this could easily cause problems&quot; or &quot;this sort of functionality should be fairly hard to &#39;switch on&#39; or have high clarity&quot;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
But the general ensuing conversation was around: &#39;people&#39; are idiots, &#39;people&#39; would break stuff with it.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Would they? &amp;nbsp;All of them? Some might. But then but some people will also chown -R oracle:dba * on a production server at \ &amp;nbsp;(Got root?! How he lol&#39;d as he rebuilt the server ... not)&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
But is it right to say you can&#39;t have potentially useful functionality because you could potentially break something with it? &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&quot;..that&#39;s what people asking for {the} capability will do..&quot;&amp;nbsp;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Will they? &amp;nbsp;Some might get bitten but if something is well designed then mistakes are less likely and people who forge ahead and do something that is a bad idea....well shit happens and we learn by mistakes (or preferably practise in a sandpit) not by being protected from ourselves.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
So back to *&lt;a href=&quot;http://www.jlcomp.demon.co.uk/kiddy_scripts.html#_Always_be_cautious_about_x$_and_v$&quot; target=&quot;_blank&quot;&gt;this&lt;/a&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&amp;nbsp;&quot;The relevance is, that&#39;s what people want to do to their 60 db&#39;s simultaneous&lt;/i&gt;ly&quot;&lt;br /&gt;&lt;br /&gt;Do they? &amp;nbsp;Maybe they want to do something useful and productive too.&lt;br /&gt;&lt;br /&gt;&lt;i&gt;&quot;My experience has shown me that people do this&lt;/i&gt;&quot;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Not with this tool, because that functionality isn&#39;t there.&lt;br /&gt;&lt;br /&gt;And I suspect it never will be there, but that&#39;s ok because my answer to the person asking for it would be: there&#39;s more than one way to skin a cat and have a look at your other options for running actions on multiple databases if that&#39;s what you need to do.&lt;br /&gt;&lt;br /&gt;But to the experienced, highly skilled, highly talented people out there: &amp;nbsp;Who made you the idiot police? &lt;br /&gt;&lt;br /&gt;Show me someone that&#39;s never screwed up and I&#39;ll show you someone that&#39;s never pushed themselves or worked dog tired under stress. On huge estates wrong services or servers sometimes get shut down. Admins are flogged in public or occasionally dismissed.  &lt;br /&gt;&lt;br /&gt;Should Jonathan Lewis have been considered unsafe to be let loose with sqlplus because he ran a &#39;bad&#39; query. Should the idiot police say &#39;this is what people will do if we allow them to&#39;&lt;br /&gt;&lt;br /&gt;No of course not. And Jonathan himself says about it &#39;hey world look at this, my bad, probably best if you don&#39;t do the same&#39; by sharing his experience.&lt;span style=&quot;font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;(His comments about the poor quotes and the part reproduction of the shared information is a side issue).&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I think it is usually best not to say &#39;why on earth do you want to do that you fool?&#39; but to say &#39;what do you want to achieve here?&#39; &lt;span style=&quot;font-size: x-small;&quot;&gt;(This has generally been the art of response to worrying questions on Ask Tom that was Tom and seems to continue now)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Sometimes we have to remember the very real pressure of a shouty manager saying they want some information from every database by 4pm today and that so often, when the most bizarre JFDIs come in, there is no option to say &#39;well that&#39;s dumb&#39; but we just have to work out a way to do something with least damage all round.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Sometimes the real world pressures can make questions look foolish and sometimes the true talent of an individual is the way in which those &#39;foolish&#39; questions are answered.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
But true talent and intellect is never displayed in disparagement.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
But back to tools: &amp;nbsp;&lt;a href=&quot;http://www.cc-chapman.com/2016/tools-do-whatever-you-use-them-for/&quot; target=&quot;_blank&quot;&gt;&quot;TOOLS DO WHATEVER YOU USE THEM FOR&quot;&lt;/a&gt;&amp;nbsp; (Special thanks to the ever gracious&amp;nbsp;@thatjeffsmith for that link balm)&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgI2KlvI5sQsTx8piB8deyDHzIECSD89O4ICL6a5z7y6_VkSeDGoaCfzx4IR7qhEaY5RPhT-gKy_YXeBTD6fyH8-9ktJBhLPLBRFkpwoE381GTLIaZVXqaF91Z2Abu6OiriR5jvGFV4tIM/s1600/Wrong-never-cut-towards-your-hand.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; height=&quot;214&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgI2KlvI5sQsTx8piB8deyDHzIECSD89O4ICL6a5z7y6_VkSeDGoaCfzx4IR7qhEaY5RPhT-gKy_YXeBTD6fyH8-9ktJBhLPLBRFkpwoE381GTLIaZVXqaF91Z2Abu6OiriR5jvGFV4tIM/s320/Wrong-never-cut-towards-your-hand.jpg&quot; title=&quot;http://paulkirtley.co.uk/2011/bushcraft-knife-safety-for-children/&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
And some people will use them in a way that will make you face-palm&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFMsievSIyc0_YiYpFlDkjrTTKcM4FdYw4vMvYybhD0B3I0lr80D_V8JW7BklnNX0k3LFLQVLBya3R-YKWJobdyfAX0ozrYMhOEngOWv0F4Xm7mj4hoKXsT1s1CE08ruH2VrjDmSTqON8/s1600/probably+not+a+torch.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;246&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFMsievSIyc0_YiYpFlDkjrTTKcM4FdYw4vMvYybhD0B3I0lr80D_V8JW7BklnNX0k3LFLQVLBya3R-YKWJobdyfAX0ozrYMhOEngOWv0F4Xm7mj4hoKXsT1s1CE08ruH2VrjDmSTqON8/s400/probably+not+a+torch.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
And others will never fail to surprise you.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://kelloggsdba.blogspot.com/feeds/1646298718448492300/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8677961998247325759/1646298718448492300' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8677961998247325759/posts/default/1646298718448492300'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8677961998247325759/posts/default/1646298718448492300'/><link rel='alternate' type='text/html' href='http://kelloggsdba.blogspot.com/2016/01/talent-and-intellect-is-never-displayed.html' title='Talent and intellect is never displayed in disparagement (aka the worst flashlight I have ever owned)'/><author><name>AGuidingLife</name><uri>http://www.blogger.com/profile/05823333742737762759</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><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgI2KlvI5sQsTx8piB8deyDHzIECSD89O4ICL6a5z7y6_VkSeDGoaCfzx4IR7qhEaY5RPhT-gKy_YXeBTD6fyH8-9ktJBhLPLBRFkpwoE381GTLIaZVXqaF91Z2Abu6OiriR5jvGFV4tIM/s72-c/Wrong-never-cut-towards-your-hand.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8677961998247325759.post-6617069917384494268</id><published>2015-12-16T14:56:00.001-08:00</published><updated>2015-12-16T23:25:09.027-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="oracle"/><category scheme="http://www.blogger.com/atom/ns#" term="Oracle User Groups"/><category scheme="http://www.blogger.com/atom/ns#" term="UKOUG"/><title type='text'>My experience of UKOUG TECH15 (UK Oracle User Group Technology Conference 2015)</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgiiLWURZZr3GruKjL5rOjw04oL9XUlCHzuQE47AXOvJTFVRUaEtC4x-5-54umfjbYrhlzPfb8sc0aRL2ERG0JUYaL5xCv6KP9ryxuL6iiwJf0OXIhQYo0ZrXq5EfJpujUrBvPWmHiqW7s/s1600/IMG_0394.JPG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;300&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgiiLWURZZr3GruKjL5rOjw04oL9XUlCHzuQE47AXOvJTFVRUaEtC4x-5-54umfjbYrhlzPfb8sc0aRL2ERG0JUYaL5xCv6KP9ryxuL6iiwJf0OXIhQYo0ZrXq5EfJpujUrBvPWmHiqW7s/s400/IMG_0394.JPG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
This year&#39;s&amp;nbsp;UK Oracle User Group Technology Conference took place in Birmingham. &lt;br /&gt;
&lt;br /&gt;
I went on the middle day of the 3 &lt;span style=&quot;font-size: x-small;&quot;&gt;(4 including super Sunday) &lt;/span&gt;day event.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8_jkXoWOI0qY0nsFFzwGFPFsR_mDvfRxhgHegEI5BkeJvSF2-qKJiys6CD1XHWJU8w2HX96ScGyH5YNSTuCzoFYLI8zrSK1DgsYjZECp-5tyhd1mvZiaibL7I6dere3E1WnY0uM-Eifw/s1600/IMG_0392.JPG&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8_jkXoWOI0qY0nsFFzwGFPFsR_mDvfRxhgHegEI5BkeJvSF2-qKJiys6CD1XHWJU8w2HX96ScGyH5YNSTuCzoFYLI8zrSK1DgsYjZECp-5tyhd1mvZiaibL7I6dere3E1WnY0uM-Eifw/s320/IMG_0392.JPG&quot; width=&quot;240&quot; /&gt;&lt;/a&gt;The agenda is huge on every day. &amp;nbsp;There are 7 streams: Database, Apex&amp;amp;DB Dev, Big Data and Warehousing, Business Analytics, Engineered Systems, Integrations and Collaboration, Operating Systems, Virtualisation, Web&amp;amp;Mobile apps, Keynotes and General Cross Topic. &amp;nbsp;And within those streams there are different presentations happening all day, each day - that&#39;s a lot to choose from. &lt;br /&gt;
&lt;br /&gt;
So remembering that Apps15 and JDE15 are also happening at the same time you start to get a feel for how huge it is.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4X8LJjcH9MKACiqhZeK3gWNN2xjtY8Uc9ratMY7uTpQk5h-HZxaxIgKZ5OPYiMIBwzzBHl985uwV2GoossRkngp8KhWdN-NcgxFwrmLjFrmhxjr7ZBWNe00DVCJUm95Q7EFV3sjG3c5I/s1600/IMG_0393.JPG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4X8LJjcH9MKACiqhZeK3gWNN2xjtY8Uc9ratMY7uTpQk5h-HZxaxIgKZ5OPYiMIBwzzBHl985uwV2GoossRkngp8KhWdN-NcgxFwrmLjFrmhxjr7ZBWNe00DVCJUm95Q7EFV3sjG3c5I/s320/IMG_0393.JPG&quot; width=&quot;209&quot; /&gt;&lt;/a&gt;In fairness I rarely use this word but....it&#39;s awesome (!)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I sat down with a print out of the streams I was interested in and a highlighter pen and planned my day in advance. &lt;br /&gt;
&lt;br /&gt;
I plumped for:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Women in IT Breakfast : Debra Lilley and Evolution&lt;br /&gt;
Advanced ASH Analytics ASH Masters: &amp;nbsp;Marcin Przepiorowski&lt;br /&gt;
Keynote: Oracle Database 12c What&#39;s next?&lt;br /&gt;
Oracle Flashback: Connor McDonald&lt;br /&gt;
Adaptive dynamic sampling : Christian Antognini&lt;br /&gt;
Interpreting AWR Reports: &amp;nbsp;Franck Pachot&lt;br /&gt;
Just Don&#39;t Do it: Jonathon Lewis&lt;br /&gt;
Evolution of performance Management: Oracle 12c Adaptive optimization: Nelson Calero&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibBa5NLrRbqCsiWrW7Zx640JanqMyzwUiDHItZ9az1XGQL3UPMVzMbTpXcmHFtD5Q2NbFKVlIZK5GZxStuXE2Z7T3NasK7jFpey9gUlPiGGdtih8-RuDT5JAaqXdDsiY8KIjQNqd8qP6g/s1600/IMG_0386.JPG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;216&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibBa5NLrRbqCsiWrW7Zx640JanqMyzwUiDHItZ9az1XGQL3UPMVzMbTpXcmHFtD5Q2NbFKVlIZK5GZxStuXE2Z7T3NasK7jFpey9gUlPiGGdtih8-RuDT5JAaqXdDsiY8KIjQNqd8qP6g/s320/IMG_0386.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
The mobile app for the conference works well, you tell it your agenda and it tells you where to go and when, simples. &amp;nbsp;The full agenda is on it to look through, the speaker lists and you can leave feedback for the presentations through it. &lt;br /&gt;
&lt;br /&gt;
It was a full day 8am to 5:30pm with little break. &amp;nbsp;I admit to being brain fried by the end of the day. &amp;nbsp;Whilst all the presentations were worthwhile, I have to say that Connor and Franck made the day worth its weight in membership fee and travel time.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHDavFQd3hyphenhyphenziDv5vd86se99IxBHj69SHW3pY_HcEOw4Xxq5b8rDqmd_U_Jq384nfn_QT9Y7Wu3-LqMFpoJfq3wZnnHQym6IKzltHdO5EMLRTDJEbhnChMUn5Uf_g1k-MrxUvxpS-Z8K0/s1600/IMG_0387.JPG&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;185&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHDavFQd3hyphenhyphenziDv5vd86se99IxBHj69SHW3pY_HcEOw4Xxq5b8rDqmd_U_Jq384nfn_QT9Y7Wu3-LqMFpoJfq3wZnnHQym6IKzltHdO5EMLRTDJEbhnChMUn5Uf_g1k-MrxUvxpS-Z8K0/s320/IMG_0387.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
I find it hard to explain the value of this type of training...yes, it is training. &amp;nbsp;Some of it is sound bite, some of it is in-depth, all of it excites me, all of it motivates me to want to use these things in my day to day work and yes, they motivate me to work smarter....I suspect most people attending feel the same way.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPYxzVd3AWyi280CxsiTajzuk442ZG7GwqruOM39CwKkYE3ok3fN-bFbKCr_lr6pQB1aLL_MSDmRME_8uXdMtX4PyscH325gxsN437xtkhyphenhyphenNvgsYL5RfsmxYYHSI0T59hkuBwm8rT2Mx8/s1600/IMG_0396.JPG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;240&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPYxzVd3AWyi280CxsiTajzuk442ZG7GwqruOM39CwKkYE3ok3fN-bFbKCr_lr6pQB1aLL_MSDmRME_8uXdMtX4PyscH325gxsN437xtkhyphenhyphenNvgsYL5RfsmxYYHSI0T59hkuBwm8rT2Mx8/s320/IMG_0396.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
I&#39;m not sure you could keep up the level of presentation attendance I did in one day for 3 (or 4) full days but there are other &#39;diversions&#39;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There was a set of challenges through the &#39;conference explorer&#39; for each day to enter a prize draw (and get scores on the doors), some involved visiting exhibitor stands, getting selfies, tweeting stuff, finding stuff in the app, meeting new people. &amp;nbsp;I quite like things like that.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYYWohqNlxW_hx8Ui7NfVv0WWlJralZfnyWy-U6n_qwbe_4DVWRlH9mhg8FAW_68vdzxVqPvSqEFaRLPxqalU2KE1qstBH-vdR6NshN9gdpBSemsW3Ta8tbRgHmG_DNmx3x1AE4ijkQmc/s1600/IMG_0399.JPG&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;300&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYYWohqNlxW_hx8Ui7NfVv0WWlJralZfnyWy-U6n_qwbe_4DVWRlH9mhg8FAW_68vdzxVqPvSqEFaRLPxqalU2KE1qstBH-vdR6NshN9gdpBSemsW3Ta8tbRgHmG_DNmx3x1AE4ijkQmc/s400/IMG_0399.JPG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
The loudest exhibitor stand seemed to by the golfing area that had putting for pounds. &amp;nbsp;Clever draw. &amp;nbsp;As popular as the &lt;a href=&quot;http://www.kelloggsdba.blogspot.co.uk/2012/12/ukoug-2012-birmingham.html&quot; target=&quot;_blank&quot;&gt;Scalextric&lt;/a&gt;&amp;nbsp;a few years ago.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHta8qLorFTy5AY5luZbznUrJIHYBa7Z9nyEv2T_OfE1XR7-dPYHA3LTQYV7SQuThADjTAgXGuE1GMunK5Bstpq-TmDowoS3ohDcFHdwBdF1PQRXe5VdB9FsQBoVzzca0vLpkWI9ReRZk/s1600/IMG_0397.JPG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;327&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHta8qLorFTy5AY5luZbznUrJIHYBa7Z9nyEv2T_OfE1XR7-dPYHA3LTQYV7SQuThADjTAgXGuE1GMunK5Bstpq-TmDowoS3ohDcFHdwBdF1PQRXe5VdB9FsQBoVzzca0vLpkWI9ReRZk/s400/IMG_0397.JPG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
There was the drinks in the conference hall after the days work and that was followed by the Big Birmingham Bash. &amp;nbsp;I didn&#39;t stay for the bash and I know very little of it, &amp;nbsp;I suspect what happens in Birmingham stays in Birmingham!! &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLFzKeG-eb2ohqc_JJFqwYqMjL6HqbR7_1PCqBzAg2xWMzrnya-smaFInUmstwJd8Gn6e_IAaRNodR_upZ4jUUvXJcHj6dowVjPMcPYjbP-_1hJP9ltOzF576o-yxKFataF_W410bJFrw/s1600/IMG_0418.JPG&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;240&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLFzKeG-eb2ohqc_JJFqwYqMjL6HqbR7_1PCqBzAg2xWMzrnya-smaFInUmstwJd8Gn6e_IAaRNodR_upZ4jUUvXJcHj6dowVjPMcPYjbP-_1hJP9ltOzF576o-yxKFataF_W410bJFrw/s320/IMG_0418.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&amp;nbsp;Badges have become quite the thing and there were many &#39;in house&#39; and &#39;out of house&#39; ones to be collected.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Part of the draw for me for the UKOUG is the incredible community it is. &amp;nbsp;I now know people that go to these events I am proud to call my friends. &amp;nbsp;Of course the good and the great are there to be spoken to (So many ACEs, Masters, OakTable members) but also the people I talk to a lot on social media&lt;span style=&quot;font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;(there may be some cross over there!). &amp;nbsp;T&lt;/span&gt;he people that help each other as problems present themselves across the year. &amp;nbsp;The person that responds to a twitter beg when you really can&#39;t find something in a manual, the ones who write all those great blog posts you&#39;ve been cribbing off all year. &amp;nbsp;It&#39;s a great opportunity to give them a hug/whiskey/wide berth* &lt;span style=&quot;font-size: x-small;&quot;&gt;(delete as appropriate based on last interaction.)&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXz6zVQaCmNpJt39h-aU9qdllnfV_Bs17FJGswiAMAJ5q_FCP38KZE5YWQBJvtBr_7hpEEafPFITo7i8wRUlH0rNgeccVjoqrwn60lJDlfMU_zZIxsTDC8JdEcZqjushez5DiMZRINcDY/s1600/IMG_0421.JPG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXz6zVQaCmNpJt39h-aU9qdllnfV_Bs17FJGswiAMAJ5q_FCP38KZE5YWQBJvtBr_7hpEEafPFITo7i8wRUlH0rNgeccVjoqrwn60lJDlfMU_zZIxsTDC8JdEcZqjushez5DiMZRINcDY/s400/IMG_0421.JPG&quot; width=&quot;300&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
As I said to one twitter friend, you&#39;ll spot me I&#39;m playing &#39;Where&#39;s Wally&#39; but in monochrome!&lt;br /&gt;
&lt;br /&gt;
One year I swear I will get there for the full conference! Now that really would be quite awesome but I think I would have to go for the full red and white stripes.&lt;br /&gt;
&lt;br /&gt;
If you are a member of the UKOUG and get a conference pass but don&#39;t use it: huge mistake - no, seriously - just go - get that training and networking in.&lt;br /&gt;
&lt;br /&gt;
If you aren&#39;t a member of the UKOUG you should look at &lt;a href=&quot;http://www.ukoug.org/membership-new/&quot; target=&quot;_blank&quot;&gt;joining&lt;/a&gt;. &amp;nbsp;If you are working for a company there are many ways you can talk to them about justifying the cost of membership.&lt;br /&gt;
&lt;br /&gt;
For me this one day taught me that we can use Flashback data archive now and it is a good solution for some of my archiving woes. &amp;nbsp;I found out I knew more about Sharding and other up and coming changes than the guy from Oracle that comes into my company to brief us on new features. I got more confident about the way I interpret AWR, and I have already seen Adaptive Sqlplans in explain plans I&#39;ve been looking at and thought &quot;ahhhh I know what you are and how you got there!&quot;&lt;br /&gt;
&lt;br /&gt;
It&#39;s all good.</content><link rel='replies' type='application/atom+xml' href='http://kelloggsdba.blogspot.com/feeds/6617069917384494268/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8677961998247325759/6617069917384494268' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8677961998247325759/posts/default/6617069917384494268'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8677961998247325759/posts/default/6617069917384494268'/><link rel='alternate' type='text/html' href='http://kelloggsdba.blogspot.com/2015/12/my-experience-of-ukoug-tech15-uk-oracle.html' title='My experience of UKOUG TECH15 (UK Oracle User Group Technology Conference 2015)'/><author><name>AGuidingLife</name><uri>http://www.blogger.com/profile/05823333742737762759</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><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgiiLWURZZr3GruKjL5rOjw04oL9XUlCHzuQE47AXOvJTFVRUaEtC4x-5-54umfjbYrhlzPfb8sc0aRL2ERG0JUYaL5xCv6KP9ryxuL6iiwJf0OXIhQYo0ZrXq5EfJpujUrBvPWmHiqW7s/s72-c/IMG_0394.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8677961998247325759.post-6397931416290916673</id><published>2015-10-15T14:42:00.000-07:00</published><updated>2015-10-15T14:42:06.095-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="oracle"/><category scheme="http://www.blogger.com/atom/ns#" term="sending sql output to a csv file"/><title type='text'>sending sql output to a csv file</title><content type='html'>So I would previously have been doing something like this&lt;br /&gt;
&lt;br /&gt;
spool myfile.csv;&lt;br /&gt;
set heading off&lt;br /&gt;
set pages off&lt;br /&gt;
select column1_name||&#39;,&#39;||column2_name||&#39;,&#39;||column3_name||&#39;,&#39;||column4_name&lt;br /&gt;
from mytable order by 1;&lt;br /&gt;
spool off&lt;br /&gt;
&lt;br /&gt;
which is fine but I had to build up the statement each time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Step in Tom, I found this procedure tucked away in an &lt;a href=&quot;https://asktom.oracle.com/pls/asktom/f?p=100:11:0::NO::P11_QUESTION_ID:88212348059&quot; target=&quot;_blank&quot;&gt;asktom page&lt;/a&gt; from 2000&lt;br /&gt;
&lt;br /&gt;
sqlplus / as sysdba&lt;br /&gt;
grant execute on utl_file to system;&lt;br /&gt;
create or replace directory DPUMP_TMP as &#39;/tmp&#39;;&lt;br /&gt;
grant read,write on directory&amp;nbsp;DPUMP_TMP&amp;nbsp;to system;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
CREATE OR REPLACE procedure SYSTEM.dump_table_to_csv( p_tname in varchar2,&lt;br /&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;p_dir &amp;nbsp; in varchar2,&lt;br /&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; p_filename in varchar2 )&lt;br /&gt;
&amp;nbsp; &amp;nbsp;is&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;l_output &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;utl_file.file_type;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;l_theCursor &amp;nbsp; &amp;nbsp; integer default dbms_sql.open_cursor;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; l_columnValue &amp;nbsp; varchar2(4000);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; l_status &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;integer;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; l_query &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; varchar2(1000)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; default &#39;select * from &#39; || p_tname;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; l_colCnt &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;number := 0;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;l_separator &amp;nbsp; &amp;nbsp; varchar2(1);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; l_descTbl &amp;nbsp; &amp;nbsp; &amp;nbsp; dbms_sql.desc_tab;&lt;br /&gt;
&amp;nbsp;begin&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; l_output := utl_file.fopen( p_dir, p_filename, &#39;w&#39; );&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;execute immediate &#39;alter session set nls_date_format=&#39;&#39;dd-mon-yyyy hh24:mi:ss&#39;&#39; &#39;;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;dbms_sql.parse( &amp;nbsp;l_theCursor, &amp;nbsp;l_query, dbms_sql.native );&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; dbms_sql.describe_columns( l_theCursor, l_colCnt, l_descTbl );&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; for i in 1 .. l_colCnt loop&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; utl_file.put( l_output, l_separator || &#39;&quot;&#39; || l_descTbl(i).col_name || &#39;&quot;&#39; );&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;dbms_sql.define_column( l_theCursor, i, l_columnValue, 4000 );&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;l_separator := &#39;,&#39;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; end loop;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;utl_file.new_line( l_output );&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;l_status := dbms_sql.execute(l_theCursor);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; while ( dbms_sql.fetch_rows(l_theCursor) &amp;gt; 0 ) loop&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; l_separator := &#39;&#39;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for i in 1 .. l_colCnt loop&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dbms_sql.column_value( l_theCursor, i, l_columnValue );&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; utl_file.put( l_output, l_separator || l_columnValue );&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; l_separator := &#39;,&#39;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;end loop;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; utl_file.new_line( l_output );&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;end loop;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;dbms_sql.close_cursor(l_theCursor);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;utl_file.fclose( l_output );&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;execute immediate &#39;alter session set nls_date_format=&#39;&#39;dd-MON-yy&#39;&#39; &#39;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;exception&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;when others then&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;execute immediate &#39;alter session set nls_date_format=&#39;&#39;dd-MON-yy&#39;&#39; &#39;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; raise;&lt;br /&gt;
&amp;nbsp;end;&lt;br /&gt;
/&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
exec SYSTEM.DUMP_TABLE_TO_CSV (&#39;schema.tablename&#39;,&#39;DPUMP_TMP&#39;,&#39;myfilename.csv&#39;);&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
If you want to read more about Tom talking about unloading  data to a flat file go here  &lt;a href=&quot;http://tkyte.blogspot.co.uk/2009/10/httpasktomoraclecomtkyteflat.html&quot;&gt;http://tkyte.blogspot.co.uk/2009/10/httpasktomoraclecomtkyteflat.html&lt;/a&gt;&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://kelloggsdba.blogspot.com/feeds/6397931416290916673/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8677961998247325759/6397931416290916673' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8677961998247325759/posts/default/6397931416290916673'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8677961998247325759/posts/default/6397931416290916673'/><link rel='alternate' type='text/html' href='http://kelloggsdba.blogspot.com/2015/10/sending-sql-output-to-csv-file.html' title='sending sql output to a csv file'/><author><name>AGuidingLife</name><uri>http://www.blogger.com/profile/05823333742737762759</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><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8677961998247325759.post-293390560342202207</id><published>2015-05-21T14:49:00.000-07:00</published><updated>2015-05-21T15:16:38.368-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="cluboracle"/><category scheme="http://www.blogger.com/atom/ns#" term="oracle"/><category scheme="http://www.blogger.com/atom/ns#" term="oracle midlands"/><category scheme="http://www.blogger.com/atom/ns#" term="Oracle User Groups"/><title type='text'>Oracle Midlands - ClubOracle</title><content type='html'>It as taken me a while to get to an &lt;a href=&quot;http://oraclemidlands.com/events&quot; target=&quot;_blank&quot;&gt;Oracle Midlands&lt;/a&gt; event - this was the 9th and I&#39;ve been saying I&#39;d go since number 1..

The venue in Birmingham was easy to get to from the train station, there is easy parking at the venue (once you are through city centre traffic!)

&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEheM78jMTWWy4W-kzRRPby0UyDUn3m4oYzR4Gxj6O9HcVmU_GzF0YpiTwM4p837y6kJTJih0-jJJfLOFPqChdlNrhG-PbPtCpUs9VN5RcBAAWDjYAOnV2ZLSfQU4oujcsG-BHvmg2pU1MI/s1600/IMG_3600.JPG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;300&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEheM78jMTWWy4W-kzRRPby0UyDUn3m4oYzR4Gxj6O9HcVmU_GzF0YpiTwM4p837y6kJTJih0-jJJfLOFPqChdlNrhG-PbPtCpUs9VN5RcBAAWDjYAOnV2ZLSfQU4oujcsG-BHvmg2pU1MI/s400/IMG_3600.JPG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
I was surprised at the number of attendees. &amp;nbsp;There were 30 there and I think there would have been more if it weren&#39;t for the dreadful weather on the day combined with the unusually heavy traffic.&lt;br /&gt;
&lt;br /&gt;
The group was really friendly and I was pleased to see people I immediately recognised both from twitter feeds and from previous jobs.&lt;br /&gt;
&lt;br /&gt;
The first speaker at #om9 was Joel Goodman. &amp;nbsp;I think that was a bit of a scoop. Joel is amazing. &amp;nbsp;He is a walking oracle encyclopaedia combined with some of the best training (and presentation) skills I have ever known. &amp;nbsp;He trained me on Oracle 8i Backup and Recovery more years back than I am prepared to admit to.&lt;br /&gt;
&lt;br /&gt;
His session was on Oracle Distributed Transactions. Clear and concise fundamentals including2 phase commits and the killer &quot;this is how it can bite you&quot; information.&lt;br /&gt;
&lt;br /&gt;
I knew by 7:05pm my train ticket had paid for itself when the fog started to clear on some of the reasons for in-doubt transactions and the chain of table locks. &amp;nbsp;Another one of those &#39;I&#39;m sure I knew this once but I really ought to know it all the time&quot; moments.&lt;br /&gt;
&lt;br /&gt;
There was a break for a snack and a chat, a which point the penny dropped for a few of the people I&#39;d been talking to like old friends who I actually was and that they talk to me on-line fairly regularly. &amp;nbsp;And the same for me as people introduced themselves. &amp;nbsp;I love how friendly DBAs are.&lt;br /&gt;
&lt;br /&gt;
The second session was Datapump. &amp;nbsp;I&#39;ll kick back on this I thought, I &lt;i&gt;know&lt;/i&gt; this one. Wrong! &amp;nbsp;Rich Harrison pulled the &quot;oh, I didn&#39;t know that&quot; out of the bag a number of times. &amp;nbsp;He is also a really smooth presenter and one to watch out for in the future. &amp;nbsp;The next day at work a colleague was having a slow running export nightmare and I was all &quot;did you know you can do this?&quot; ! &amp;nbsp;Felt good.&lt;br /&gt;
&lt;br /&gt;
So If you are in the Midlands region (or passing through), I recommend this user group. It is free to attend (sponsored by Redstack Techologies) and in the evening. &amp;nbsp;What&#39;s not to like.&lt;br /&gt;
&lt;br /&gt;
Have a look at the up and coming events &lt;a href=&quot;http://oraclemidlands.com/events&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://kelloggsdba.blogspot.com/feeds/293390560342202207/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8677961998247325759/293390560342202207' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8677961998247325759/posts/default/293390560342202207'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8677961998247325759/posts/default/293390560342202207'/><link rel='alternate' type='text/html' href='http://kelloggsdba.blogspot.com/2015/05/oracle-midlands-cluboracle.html' title='Oracle Midlands - ClubOracle'/><author><name>AGuidingLife</name><uri>http://www.blogger.com/profile/05823333742737762759</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><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEheM78jMTWWy4W-kzRRPby0UyDUn3m4oYzR4Gxj6O9HcVmU_GzF0YpiTwM4p837y6kJTJih0-jJJfLOFPqChdlNrhG-PbPtCpUs9VN5RcBAAWDjYAOnV2ZLSfQU4oujcsG-BHvmg2pU1MI/s72-c/IMG_3600.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8677961998247325759.post-4107908320651918380</id><published>2015-05-15T13:22:00.000-07:00</published><updated>2015-05-16T00:57:59.266-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Oracle Security"/><title type='text'>Security Presumptive</title><content type='html'>We have the auditors currently visiting the office. &amp;nbsp;They don&#39;t mix with anyone at all, from what I can see, apart from the one man that is the &#39;go between&#39;. &amp;nbsp;They work out of a meeting room not very far away from my desk.&lt;br /&gt;
&lt;br /&gt;
I feel it necessary to say before I tell you why I&#39;m telling you about this that I work in a very secure building. &amp;nbsp;It is surrounded by high wire fences, &amp;nbsp;cameras and sound detectors. &amp;nbsp;A secure site within an already secure site. &amp;nbsp;It&#39;s safe to say it is secure! &amp;nbsp;There are very few people that can get in and generally we all know each other fairly well, &amp;nbsp;if not intimately then at least by sight or on &quot;you left your card in the coffee machine&quot; terms.&lt;br /&gt;
&lt;br /&gt;
To get to my internal office door you have to go through 3 sets of secure doors requiring a personal level of access and also past the glass window of the 24 hours manned security office. &amp;nbsp;It&#39;s safe to say by the time you get to my office door you have passed security. &amp;nbsp;There is nothing in my office of merit or value to be secured! &amp;nbsp;There used to be something behind the door to secure. &amp;nbsp;That thing is now many, many miles away. &amp;nbsp;Any security left on my office door is there because a jobsworth didn&#39;t take it away with &#39;the thing&#39;.&lt;br /&gt;
&lt;br /&gt;
So back to my auditor non-interactive-&#39;friend&#39;. &amp;nbsp;Everyday, many times a day she opens my office door with her secure access. &amp;nbsp;My office doors are double doors. &amp;nbsp;The right hand door is next to the security point. &amp;nbsp;The left hand door is not (this is relevant!).&lt;br /&gt;
&lt;br /&gt;
Some office incumbents noticed many moons ago that no one uses the left hand door. &amp;nbsp;People push the right hand door, it is locked, they then try their secure access method and if it says &#39;come on in&#39; they then open the door. &amp;nbsp;An office incumbent took the bolt off the left hand door. &amp;nbsp;So now the office incumbents walk through the left hand door. &amp;nbsp;It can be done backwards whilst balancing a laptop and a hot cup of tea without the need to swing the body part attached to a pass at a reader or punch anything into a keypad with your nose. &amp;nbsp;Others use their pass and come through the locked right hand door.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;So back to my auditor non-interactive-&#39;friend&#39;: &amp;nbsp;everyday, many times a day, she opens the right hand door with her secure access. Today I watched her use her secure access and then open the &lt;i&gt;left&lt;/i&gt; hand door. &amp;nbsp;She has been there at least 2 weeks so this is progress but she still hasn&#39;t thought to just push the door first.&lt;br /&gt;
&lt;br /&gt;
There is another door that leads to a meeting room with a key card reader on it. &amp;nbsp;(Again, there is nothing of merit or value behind this door, even the furniture behind it wouldn&#39;t sell at a car boot!) The door lock does not work, men with hammers are aware of this and on a regular basis they come to it, bang their hammers, scratch their heads and leave again. &amp;nbsp;The key card reader beeps when you do stuff to it with your access and its light turns green if it likes you.&lt;br /&gt;
&lt;br /&gt;
For 2 weeks I have watched my non-interactive-auditor-&#39;friend&#39; use her secure access to go through the door, never once doubting that it is locked. &amp;nbsp;Although bizarrely there is no handle on the door the other side and she must just push the door to get out!!!&lt;br /&gt;
&lt;br /&gt;
So my point is: &amp;nbsp;just because something asks you for a password you shouldn&#39;t assume that it is secure. &amp;nbsp;Does it care what that password is? &amp;nbsp;What happens if you try to get in without the password? &amp;nbsp;The appearance of secure does not mean it is. &amp;nbsp;You might have userids, roles, profiles, passwords, key readers, whatever, &amp;nbsp;but what if, as I found recently, one table has clear text passwords in that could &lt;span style=&quot;font-size: xx-small;&quot;&gt;(note the past tense here - sorted)&lt;/span&gt; be read by a multitude of people?! Or what if people that are fed up with dealing with security on a daily basis can undo a bolt and no one is alerted?!&lt;br /&gt;
&lt;br /&gt;
I am desperate to tell my non-interactive-auditor-&#39;friend&#39; to just walk through the door but I&#39;m also now totally wrapped up in watching to see how many weeks it takes her to twig. &lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg552v8jHQkjz_og5tlwV_9dNygPK3vhrEUHffub5QKyXJ0V3ethnp8wcItgR4z7Kf8SXJX6WLnR5-Xag_iRKJF4ZusXFJWtNfnUyl58JtyojZvp86S1ZvHTY9Dr3dru5m9Dh0rA9adOjo/s1600/P1000936.JPG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg552v8jHQkjz_og5tlwV_9dNygPK3vhrEUHffub5QKyXJ0V3ethnp8wcItgR4z7Kf8SXJX6WLnR5-Xag_iRKJF4ZusXFJWtNfnUyl58JtyojZvp86S1ZvHTY9Dr3dru5m9Dh0rA9adOjo/s400/P1000936.JPG&quot; width=&quot;256&quot; /&gt;&lt;/a&gt;I am also torn about what this tells me about her approach to looking at security. &amp;nbsp;Life for many would be jolly easy if our non-interactive-auditor-&#39;friend&#39; just puts a lovely large green tick on a box to say that she tried the security and it all worked fine and moves onto her next job. But whilst I think/hope/know the baskets of eggs I am responsible for are safe from the foxes, I would really like her to find any security holes in anything because there are lots of people out there that are constantly pushing at the left hand door to see if it opens all on its own and I want to bolt it solid before they even try.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://kelloggsdba.blogspot.com/feeds/4107908320651918380/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8677961998247325759/4107908320651918380' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8677961998247325759/posts/default/4107908320651918380'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8677961998247325759/posts/default/4107908320651918380'/><link rel='alternate' type='text/html' href='http://kelloggsdba.blogspot.com/2015/05/security-presumptive.html' title='Security Presumptive'/><author><name>AGuidingLife</name><uri>http://www.blogger.com/profile/05823333742737762759</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><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg552v8jHQkjz_og5tlwV_9dNygPK3vhrEUHffub5QKyXJ0V3ethnp8wcItgR4z7Kf8SXJX6WLnR5-Xag_iRKJF4ZusXFJWtNfnUyl58JtyojZvp86S1ZvHTY9Dr3dru5m9Dh0rA9adOjo/s72-c/P1000936.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8677961998247325759.post-107329673080218842</id><published>2015-04-10T14:59:00.001-07:00</published><updated>2015-04-10T14:59:54.563-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="DBA training"/><category scheme="http://www.blogger.com/atom/ns#" term="Employee motivation"/><category scheme="http://www.blogger.com/atom/ns#" term="Oracle User Groups"/><category scheme="http://www.blogger.com/atom/ns#" term="UKOUG"/><title type='text'>Yey! Another year of UKOUG</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhk7uzv8OlJMXOayRZ-CoTERWmmFIB0kpoOHCEw-ExxT7Qt2LaA8rkMP7j8a8Ock_nJcI_0pc2AL_SPPJBrjLZVBBlFXHjaCHBv1U0tI4habjKEFhYFTUhFnsuoyvpMxBxDVtfxv0S22vo/s1600/UKOUGRACSIG.JPG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhk7uzv8OlJMXOayRZ-CoTERWmmFIB0kpoOHCEw-ExxT7Qt2LaA8rkMP7j8a8Ock_nJcI_0pc2AL_SPPJBrjLZVBBlFXHjaCHBv1U0tI4habjKEFhYFTUhFnsuoyvpMxBxDVtfxv0S22vo/s1600/UKOUGRACSIG.JPG&quot; height=&quot;300&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&amp;nbsp;I had to &#39;use up&#39; my SIG day that I get with my Bronze UKOUG membership and I&#39;d missed all the good ones (just kidding!) so I went to the RAC Cloud Infrastructure and Availability SIG &lt;span style=&quot;font-size: xx-small;&quot;&gt;(they have to get a decent acronym for that!)&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
One of the main reasons for choosing it was actually because it was a late starter/finisher: 2:30pm to 8pm&lt;br /&gt;
&lt;br /&gt;
It meant I could get a later train to London, without battling the crowds of commuters and yet still be able to get a train home at a reasonable time.&lt;br /&gt;
&lt;br /&gt;
In fact I had a few hours to myself first which I made the most of &lt;a href=&quot;http://www.aguidinglife.co.uk/2015/03/a-walk-along-fleet-street.html&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt; and &lt;a href=&quot;http://www.aguidinglife.co.uk/2015/03/dr-johnsons-house-london.html&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEZZU82-b77_SYupO0VSqfQF8mko7TIB2Ct-oGzyLtHTsSaiNceJxnMiHCcA8lbK-a0tla1JNejJ415f5IAZNytiEL29rWi9_v1IBc9dwDOcGTAayAPKmGsQYDjeWXSvEYvtEwcXYHaLg/s1600/ChandlerDBA.JPG&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEZZU82-b77_SYupO0VSqfQF8mko7TIB2Ct-oGzyLtHTsSaiNceJxnMiHCcA8lbK-a0tla1JNejJ415f5IAZNytiEL29rWi9_v1IBc9dwDOcGTAayAPKmGsQYDjeWXSvEYvtEwcXYHaLg/s1600/ChandlerDBA.JPG&quot; height=&quot;300&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
I love the comradery of the SIGs. &amp;nbsp;It is so motivating to talk to people doing similar jobs, with similar issues in similar companies. &amp;nbsp;It is quite therapeutic to hear of other big companies having virtualisation battles, big and small companies having design problems, communication issues etc.&lt;br /&gt;
&lt;br /&gt;
It&#39;s great to talk to people in companies that have actually bought the big Exadatas and are using them. &amp;nbsp;If nothing else it starts you wondering whether a company switch might be worth considering for the star studded infrastructure or not, when you realise a lot of the things that make a work day have a sigh happen at many other places in the same way.&lt;br /&gt;
&lt;br /&gt;
These few hours always provide amazing training. &amp;nbsp;This time for me, the winners were the changes to ASM in 12c, particularly flex ASM. &amp;nbsp;Trace File Analyser - which is more than it says on the tin! And using Linux control groups to manage virtualised resources.&lt;br /&gt;
&lt;br /&gt;
(That and getting a chance to spend some time with @ChanderDBA&amp;nbsp;and @MDWidlake - thank you both. &amp;nbsp;There was food and beer - I know, what&#39;s not to love!)&lt;br /&gt;
&lt;br /&gt;
Before I arrived I had resigned myself to it being my last ever, thinking it was just too much money to renew membership. &amp;nbsp;Within 30 minutes of being there I knew I was going to renew again. &amp;nbsp;It seriously makes that much difference to my motivation to be a great DBA.&lt;br /&gt;
&lt;br /&gt;
I went back to the office the next day stuffed to the gills with renewed drive and decided to ask, yet again, if my company would pay the membership. &amp;nbsp;And yes, yes they have. It&#39;s at least 6 weeks since the bossman said yes and I&#39;m still hopping happy and actually doing more (if that is possible) and volunteering for extras.&lt;br /&gt;
&lt;br /&gt;
It&#39;s a win-win for me and the company.&lt;br /&gt;
&lt;br /&gt;
My company gain from my renewed motivation, the extra knowledge I&#39;ve picked up and that I am keener at work because them renewing my membership makes me feel valued.&lt;br /&gt;
&lt;br /&gt;
I gain from my renewed motivation, I am happier, I feel like I am part of a community still and it makes me want to share more with the DBA community. &lt;br /&gt;
&lt;br /&gt;
The &lt;a href=&quot;http://www.ukoug.org/home/&quot; target=&quot;_blank&quot;&gt;UKOUG&lt;/a&gt; is a positive thing. &amp;nbsp;There are no losers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://kelloggsdba.blogspot.com/feeds/107329673080218842/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8677961998247325759/107329673080218842' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8677961998247325759/posts/default/107329673080218842'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8677961998247325759/posts/default/107329673080218842'/><link rel='alternate' type='text/html' href='http://kelloggsdba.blogspot.com/2015/04/yey-another-year-of-ukoug.html' title='Yey! Another year of UKOUG'/><author><name>AGuidingLife</name><uri>http://www.blogger.com/profile/05823333742737762759</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><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhk7uzv8OlJMXOayRZ-CoTERWmmFIB0kpoOHCEw-ExxT7Qt2LaA8rkMP7j8a8Ock_nJcI_0pc2AL_SPPJBrjLZVBBlFXHjaCHBv1U0tI4habjKEFhYFTUhFnsuoyvpMxBxDVtfxv0S22vo/s72-c/UKOUGRACSIG.JPG" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8677961998247325759.post-7086662586030553139</id><published>2015-03-15T09:20:00.000-07:00</published><updated>2015-03-15T09:20:16.036-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="forums"/><title type='text'>He who asks is a fool for five minutes</title><content type='html'>&lt;h2&gt;
 &lt;span class=&quot;st&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;He who asks is a fool for five minutes, but he who does not ask remains a fool forever.&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;
The older I get, the more I know...how much I don&#39;t know.&amp;nbsp; This stands true for me at work, home, and life in general.&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;st&quot;&gt;Sometimes I feel so confused with life and its happenings that I&#39;m sure everybody else already must know everything I do and then they have their intelligence&amp;nbsp;on top of that.&amp;nbsp; I find I think like this quite a lot at work.&amp;nbsp; But the same seems to apply to baking, gardening, decorating, suduko, crosswords, laundry without total destruction etc.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;st&quot;&gt;The nature of work in technology means spending a lot of time searching for&amp;nbsp;information on how to do&amp;nbsp;a lot of technical stuff.&amp;nbsp;&amp;nbsp;This searching naturally leads to many technical forums. Often I see, what on the face of it seem to be, fairly simple questions.&amp;nbsp; These questions are usually responded to by someone who considers themselves to be an expert with a &lt;a href=&quot;http://www.urbandictionary.com/define.php?term=rtfm&amp;amp;defid=773100&quot; target=&quot;_blank&quot;&gt;RTFM&lt;/a&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;st&quot;&gt;I&#39;ll accept that as ok, especially if they leave a&amp;nbsp;link&amp;nbsp;to go and&amp;nbsp;have a read.&amp;nbsp; But what if they still don&#39;t understand, what if they need extra guidance, what if the question they asked to begin with wasn&#39;t worded well?&amp;nbsp; Do they deserve to be called a lazy idiot? Should they be told to go away and read it again?&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;st&quot;&gt;Whilst this is aimed at the technical, it&#39;s true anywhere in life.&amp;nbsp; None of us were born knowing how to do things, we all had to learn but why do some people believe that because they learnt the hard way so must everyone else?&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;st&quot;&gt;If I say to my friend &quot;my cakes don&#39;t rise as well as yours what am I doing wrong?&quot; I know she will say &quot;What recipe&amp;nbsp;are you using? Is the method the same as mine?&amp;nbsp; I do this&quot;.&amp;nbsp; Why do so many online user groups and forums do the complete opposite?&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;st&quot;&gt;I believe in freely sharing information and that it is ok to ask others to do the same.&amp;nbsp; I also know that whilst I like to consider myself a special individual, I am not.&amp;nbsp; I know if I have a burning question, someone else probably has it too.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;st&quot;&gt;Times I have asked questions in halls full of parents like &quot;do they need the packup in a carrier to throw away after lunch or in a backpack&quot; and felt an idiot for asking as 100 burning eyes give me the &#39;isn&#39;t it obvious&#39; look. But on the way out someone always says &quot;I&#39;m sooooo glad you asked that, I had no idea either&quot;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;st&quot;&gt;I don&#39;t care if I ask a dumb question, I think this is less dumb than never knowing the answer.&amp;nbsp; And I am happy to be polite and understanding to anyone who asks a question that I know the answer to.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;st&quot;&gt;In a forum I think I have 2 choices: be helpful and polite or don&#39;t get involved.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;st&quot;&gt;The perceived anonymity of the on-line world has turned many people into rude, uncaring individuals.&amp;nbsp; Trolling, whilst not liked, is seen as part of life.&amp;nbsp; It doesn&#39;t have to be this way.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6ohgvhAWlIzAV0xDreHJrja2AMGdgB-nqxlSt-tAC7bkzoSJ3G2RER7slY7IjgzbrODDYGUKTvuRvudKGUvsGh94PmxRPF-h5mWGjCVJz7ryxMV4HPTz5U8tcWkRxGWGdxdPpYynr668/s1600/bartdumb.gif&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6ohgvhAWlIzAV0xDreHJrja2AMGdgB-nqxlSt-tAC7bkzoSJ3G2RER7slY7IjgzbrODDYGUKTvuRvudKGUvsGh94PmxRPF-h5mWGjCVJz7ryxMV4HPTz5U8tcWkRxGWGdxdPpYynr668/s320/bartdumb.gif&quot; height=&quot;204&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;span class=&quot;st&quot;&gt;So just for the record, &amp;nbsp;I am planning&amp;nbsp;to continue to ask as many questions as I can for the rest of my life.&amp;nbsp; I may ask how I can find out, I may just ask for a direct answer and I don&#39;t mind whether you give me one or tell me how I can find out.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;st&quot;&gt;In return I commit to answering as many questions as I can in a polite way and this sometimes might involve a diversionary route to a source of information, yes occasionally that might include&amp;nbsp;a polite&amp;nbsp;&#39;I don&#39;t know but something might popup on Google (&lt;a href=&quot;http://duckduckgo.com/&quot; target=&quot;_blank&quot;&gt;other search engines&lt;/a&gt; are available)&amp;nbsp;just might&#39;.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;st&quot;&gt;For those of you against me in this quest to accept that some people aren&#39;t superhuman all knowing beings :&amp;nbsp; &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0KOXp9fKckUm8QID6ALJmBrlFq1z9lgFgQIBwlEnCCXs7JssUFyrfNoGBVUMVm3Vbv0kbZeoVoOScIg4iEA9AQbECY7h1qt2VKkeD7U8mVmBV1X7iH4LsJrcNp57bqMfIwsW83p39tHo/s1600/dilque.gif&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0KOXp9fKckUm8QID6ALJmBrlFq1z9lgFgQIBwlEnCCXs7JssUFyrfNoGBVUMVm3Vbv0kbZeoVoOScIg4iEA9AQbECY7h1qt2VKkeD7U8mVmBV1X7iH4LsJrcNp57bqMfIwsW83p39tHo/s400/dilque.gif&quot; height=&quot;123&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://kelloggsdba.blogspot.com/feeds/7086662586030553139/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8677961998247325759/7086662586030553139' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8677961998247325759/posts/default/7086662586030553139'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8677961998247325759/posts/default/7086662586030553139'/><link rel='alternate' type='text/html' href='http://kelloggsdba.blogspot.com/2015/03/he-who-asks-is-fool-for-five-minutes.html' title='He who asks is a fool for five minutes'/><author><name>AGuidingLife</name><uri>http://www.blogger.com/profile/05823333742737762759</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><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6ohgvhAWlIzAV0xDreHJrja2AMGdgB-nqxlSt-tAC7bkzoSJ3G2RER7slY7IjgzbrODDYGUKTvuRvudKGUvsGh94PmxRPF-h5mWGjCVJz7ryxMV4HPTz5U8tcWkRxGWGdxdPpYynr668/s72-c/bartdumb.gif" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8677961998247325759.post-3929258065102626011</id><published>2015-01-14T14:42:00.003-08:00</published><updated>2016-04-04T07:23:18.211-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ORA-04063"/><category scheme="http://www.blogger.com/atom/ns#" term="ORA-06508"/><category scheme="http://www.blogger.com/atom/ns#" term="ORA-06512"/><category scheme="http://www.blogger.com/atom/ns#" term="ORA-12012"/><category scheme="http://www.blogger.com/atom/ns#" term="oracle"/><category scheme="http://www.blogger.com/atom/ns#" term="oracle 11.2"/><title type='text'>DBSNMP.BSLN_INTERNAL invalid ORA-12012 ORA-04063 </title><content type='html'>ORA-12012: error on auto execute of job &quot;SYS&quot;.&quot;BSLN_MAINTAIN_STATS_JOB&quot;&lt;br /&gt;
ORA-04063: package body &quot;DBSNMP.BSLN_INTERNAL&quot; has errors&lt;br /&gt;
ORA-06508: PL/SQL: could not find program unit being called: &quot;DBSNMP.BSLN_INTERNAL&quot;&lt;br /&gt;
ORA-06512: at line 1&lt;br /&gt;
&lt;br /&gt;
Tested fix on Oracle version &amp;nbsp;11.2.0.3.7&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I&#39;ve been getting the error in the alert log since the database was built using an rman clone.&lt;br /&gt;
&lt;br /&gt;
I could force the error by running:&lt;br /&gt;
&lt;br /&gt;
As sys:&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;exec dbms_scheduler.run_job(&#39;BSLN_MAINTAIN_STATS_JOB&#39;,false);&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;select log_date,status from dba_scheduler_job_run_details&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;where job_name=&#39;BSLN_MAINTAIN_STATS_JOB&#39; order by log_date;&lt;/i&gt;&lt;br /&gt;
&lt;div&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;
I tried the recommended work around from Oracle to recreate the dbsnmp user:&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;@?/rdbms/admin/catnsnmp.sql&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;@?/rdbms/admin/catsnmp.sql&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
This did not fix it.&lt;br /&gt;
&lt;br /&gt;
Oracle recommended I apply a patch for bug 13637859&lt;br /&gt;
&lt;br /&gt;
This did not fix it.&lt;br /&gt;
&lt;br /&gt;
I rolled back the patch, restored dbsnmp as it was and started a rethink. &amp;nbsp;There were 2 distinct problems happening:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The first one is that the package &lt;b&gt;DBSNMP.BSLN_INTERNAL is invalid&lt;/b&gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;select substr(owner,1,12) owner, substr(object_name,1,30) object, substr(object_type,1,30) type,&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp;status from dba_objects where object=&#39;BSLN_INTERNAL&#39;;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
DBSNMP&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;BSLN_INTERNAL&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;PACKAGE BODY&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;INVALID&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;br /&gt;
&lt;i&gt;alter package DBSNMP.BSLN_INTERNAL compile;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
Warning: Package altered with compilation errors.&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;select * from dba_errors where OWNER=&#39;DBSNMP&#39;;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
DBSNMP &amp;nbsp; BSLN_INTERNAL &amp;nbsp; &amp;nbsp;PACKAGE BODY &amp;nbsp; 1 &amp;nbsp; &amp;nbsp; &amp;nbsp; 1910 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;7&lt;br /&gt;
PLS-00201: identifier &#39;DBMS_JOB&#39; must be declared&lt;br /&gt;
ERROR &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;201&lt;br /&gt;
&lt;br /&gt;
DBSNMP &amp;nbsp;BSLN_INTERNAL PACKAGE BODY &amp;nbsp; 2 &amp;nbsp; &amp;nbsp; &amp;nbsp; 1910 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;7&lt;br /&gt;
PL/SQL: Statement ignored&lt;br /&gt;
ERROR &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0&lt;br /&gt;
&lt;br /&gt;
So DBMS_JOB has a problem, well execute was revoked from public on DBMS_JOB on this database.&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;grant execute on sys.dbms_job to dbsnmp;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;alter package DBSNMP.BSLN_INTERNAL compile;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;revoke execute on sys.dbms_job from dbsnmp;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;select substr(owner,1,12) owner, substr(object_name,1,30) object, substr(object_type,1,30) type,&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp;status from dba_objects where object_name=&#39;BSLN_INTERNAL&#39;;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
DBSNMP&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;BSLN_INTERNAL&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;PACKAGE BODY&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;VALID&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;exec dbms_scheduler.run_job(&#39;BSLN_MAINTAIN_STATS_JOB&#39;,false);&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;select log_date,status from dba_scheduler_job_run_details&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;where job_name=&#39;BSLN_MAINTAIN_STATS_JOB&#39; order by log_date;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
Job Failed&lt;br /&gt;
&lt;br /&gt;
So I have a valid package now but my job is still failing. &amp;nbsp;If your database was not cloned you might find this grant and recompile will fix your problem. (The revoke of the privilege again afterwards was fine, it seemed to only need it to recompile, not to actually run)&lt;br /&gt;
&lt;br /&gt;
My second issue was &lt;b&gt;caused when cloning a new db using rman&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;select * from DBSNMP.BSLN_BASELINES;&lt;/i&gt;&lt;br /&gt;
nnnnnnnn&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;OLDSOURCEDBNAME&amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;xxxxxxxxxxxxxxxxxxxx&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Y&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;ACTIVE&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;dd/mm/yyyy&lt;br /&gt;
&lt;br /&gt;
There was only one row in my table and that had the name of the old database in it, I removed it:&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;delete from DBSNMP.BSLN_BASELINES WHERE INSTANCE_NAME=&#39;OLDSOURCEDBNAME&amp;nbsp;&#39;;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;commit;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;exec dbms_scheduler.run_job(&#39;BSLN_MAINTAIN_STATS_JOB&#39;,false);&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;select log_date,status from dba_scheduler_job_run_details&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;where job_name=&#39;BSLN_MAINTAIN_STATS_JOB&#39; order by log_date;&lt;/i&gt;&lt;br /&gt;
succeeded&lt;br /&gt;
&lt;br /&gt;
This removal of one line is going to be how the Oracle recommended work around for this problem fixes it, you should probably use the Oracle way not my hack. &amp;nbsp;But for me Oracle Enterprise Grid/Cloud/OEM/yet another name change for OEM used DBSNMP and I didn&#39;t want to upset it on my production system, which is why I deleted the row rather than doing:&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;@?/rdbms/admin/catnsnmp.sql&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;@?/rdbms/admin/catsnmp.sql&lt;/i&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
I found at least 3 blogs with pieces of all this information in but none with it together that solved my issue.&lt;br /&gt;
&lt;br /&gt;
Remember here we have considered:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;An invalid package caused by revoking execute on DBMS_JOB fixed by granting execute directly to DBSNMP.&lt;/li&gt;
&lt;li&gt;An entry in DBSNMP.BSLN_BASELINES table carried over from an old source database on clone build.&lt;/li&gt;
&lt;li&gt;The Oracle Workaround covered in Oracle Support&amp;nbsp;Doc ID 1413756.1 ORA-12012: error on auto execute of job &quot;SYS&quot;.&quot;BSLN_MAINTAIN_STATS_JOB&quot;&lt;/li&gt;
&lt;li&gt;An Oracle Patch for Bug 13637859&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
Please speak to Oracle Support if you are in anyway unsure that you have the same issue and always make sure you have a good backup before you change anything.&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://kelloggsdba.blogspot.com/feeds/3929258065102626011/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8677961998247325759/3929258065102626011' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8677961998247325759/posts/default/3929258065102626011'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8677961998247325759/posts/default/3929258065102626011'/><link rel='alternate' type='text/html' href='http://kelloggsdba.blogspot.com/2015/01/dbsnmpbslninternal-invalid-ora-12012.html' title='DBSNMP.BSLN_INTERNAL invalid ORA-12012 ORA-04063 '/><author><name>AGuidingLife</name><uri>http://www.blogger.com/profile/05823333742737762759</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><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8677961998247325759.post-4525958342606602985</id><published>2014-02-15T14:59:00.000-08:00</published><updated>2014-02-15T14:59:07.191-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="blog roll"/><category scheme="http://www.blogger.com/atom/ns#" term="blogger"/><category scheme="http://www.blogger.com/atom/ns#" term="bloglist"/><category scheme="http://www.blogger.com/atom/ns#" term="bloglist widget"/><category scheme="http://www.blogger.com/atom/ns#" term="nofollow links"/><title type='text'>Make a Blogger Bloglist Blog Roll widget NoFollow</title><content type='html'>Having a blog roll (blog list widget) on a Blogger blog has its pros and cons.&lt;br /&gt;
&lt;br /&gt;
I use mine a lot, I like to see when my favourite reads have updated and it&#39;s a habit for me to look there, despite using Bloglovin too. So for me it&#39;s about me not the reader experience. There are cons to having it there like you have to keep it up to date, what if a &#39;bad&#39; site takes over a url on your list and you are inadvertently sending your readers there. &amp;nbsp;Also, they can look at bit outdated these days too. &amp;nbsp;But I also like them on other sites as I will follow links to other blogs for a new read.&lt;br /&gt;
&lt;br /&gt;
But in terms of SEO and Page Rank for your own blog it can have problems as it creates a follow link to all the sites on your blog roll. &amp;nbsp;Follow links aren&#39;t always bad, and Google ought to be taking their own code into account with their PR calculations but some places I read are shouting &quot;Bloglist followlinks BAD&quot;, so why not just make it nofollow and be done with it.&lt;br /&gt;
&lt;br /&gt;
Step 1: on the left of your main blogger dashboard page for your blog, choose &#39;TEMPLATE&#39;&lt;br /&gt;
&lt;br /&gt;
Step 2: BACKUP YOUR CURRENT TEMPLATE NOW. &amp;nbsp;&lt;a href=&quot;http://kelloggsdba.blogspot.co.uk/2012/06/how-to-backup-blogger-blog.html&quot; target=&quot;_blank&quot;&gt;Here&#39;s how&lt;/a&gt; if you are now sure. &amp;nbsp;Do not do anything else until you have a backup in the bag.&lt;br /&gt;
&lt;br /&gt;
Step 2.5: &amp;nbsp;Re-read Step 2 and do it&lt;br /&gt;
&lt;br /&gt;
Step 3: Choose &#39;EDIT HTML&#39;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-gAaGK6ZUho5m8W4UMlNnKV3XVp_iIWTTny3uFQ7UdWdmpDKuz7CyyJZlglipwXEOJMgCq9b9dyRHqLD13I0YhyphenhyphenVVo63_R4OO4O_cfmAu5ZTele6vi_J0SuEdJHTZNurP2_E7c6hHHCU/s1600/bl2.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-gAaGK6ZUho5m8W4UMlNnKV3XVp_iIWTTny3uFQ7UdWdmpDKuz7CyyJZlglipwXEOJMgCq9b9dyRHqLD13I0YhyphenhyphenVVo63_R4OO4O_cfmAu5ZTele6vi_J0SuEdJHTZNurP2_E7c6hHHCU/s1600/bl2.jpg&quot; height=&quot;240&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Step 4: &amp;nbsp;Choose JUMP TO WIDGET, then BLOGLIST1&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipGtpprEPo5LVkeSKiAAF20UpUOALD8xcIx6gCcONU1CX261hQ6eDsuT17EVEH2Yp2EU2TlXPuGUjoQXOK0cQO082oYFsnM3WT3i4_FLAQd5fbidx2FvSUUjHZqnVUFE9GWmoaa0VN5CA/s1600/bl4.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipGtpprEPo5LVkeSKiAAF20UpUOALD8xcIx6gCcONU1CX261hQ6eDsuT17EVEH2Yp2EU2TlXPuGUjoQXOK0cQO082oYFsnM3WT3i4_FLAQd5fbidx2FvSUUjHZqnVUFE9GWmoaa0VN5CA/s1600/bl4.jpg&quot; height=&quot;307&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Step 5: &amp;nbsp;There will be 3 small dots on the line of code for the widget bloglist1, click on them once and the code will expand.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5fC7eumKbi1aMP1rVfoWSHMM0kPg8aOFDB37gmY_Gz6wAWdAXF7foZBHEibN8D3ZUltywCOvpk9i1aESwpdb2VtOd_JyE5Q2rqX6VNYdgqnic3c4qaJFxVnFof3se7IgCwWpCV2kBDQ4/s1600/bl5.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5fC7eumKbi1aMP1rVfoWSHMM0kPg8aOFDB37gmY_Gz6wAWdAXF7foZBHEibN8D3ZUltywCOvpk9i1aESwpdb2VtOd_JyE5Q2rqX6VNYdgqnic3c4qaJFxVnFof3se7IgCwWpCV2kBDQ4/s1600/bl5.jpg&quot; height=&quot;162&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Step 6: &amp;nbsp;But it only expands to 3 lines, there are now 3 more dots on the centre line, click on those once&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZYTCRoAJftxmbw_O04ml-lb2VEr1YhrYmWNgHPVj186T9DDILgqGoNK9NfTMDmAuEkP_DvVoMkK2_PXiZOEcD3Wd00Zp8iyYkFuYvfi86MdU-p_s8YFanEHuUyGo9tUcJhyphenhyphen2-EqJzuP8/s1600/bl6.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZYTCRoAJftxmbw_O04ml-lb2VEr1YhrYmWNgHPVj186T9DDILgqGoNK9NfTMDmAuEkP_DvVoMkK2_PXiZOEcD3Wd00Zp8iyYkFuYvfi86MdU-p_s8YFanEHuUyGo9tUcJhyphenhyphen2-EqJzuP8/s1600/bl6.jpg&quot; height=&quot;230&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Step 7: Now you see the full widget code, there are 3 lines with the entry target=&#39;blank&#39;, find these&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBoSmbZ9i5gTODO2MFce5-QigmnQ-56C6FZ-Oed1ieSHWQGUkENjOhWiZTzzJt1uWRmr0xqyYco2sCzhlZR8PjeSGU4xiSSO_Te9idbsf7Jge_oLRWNzZikzqMnW-V4aeFFpr5rPEw7Vo/s1600/bl7.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBoSmbZ9i5gTODO2MFce5-QigmnQ-56C6FZ-Oed1ieSHWQGUkENjOhWiZTzzJt1uWRmr0xqyYco2sCzhlZR8PjeSGU4xiSSO_Te9idbsf7Jge_oLRWNzZikzqMnW-V4aeFFpr5rPEw7Vo/s1600/bl7.jpg&quot; height=&quot;272&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Step 8: &amp;nbsp;Add the code rel=&#39;nofollow&#39; to those 3 lines, just like below&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRjkFoTaO2n9MJkBIgjfSWGfTHQm14W3f6hEdAQs8wAU1x6FkIheQ6oSs7LQhyPdHq4vr9WwTdo0Azlsdz0K9hsG2SiQhflsd3zCDjKxwbOIAWKIDNS6epZo-ZvO9xccUt9xoK-3Khp2g/s1600/bl8.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRjkFoTaO2n9MJkBIgjfSWGfTHQm14W3f6hEdAQs8wAU1x6FkIheQ6oSs7LQhyPdHq4vr9WwTdo0Azlsdz0K9hsG2SiQhflsd3zCDjKxwbOIAWKIDNS6epZo-ZvO9xccUt9xoK-3Khp2g/s1600/bl8.jpg&quot; height=&quot;276&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Step 9: &amp;nbsp;Save the changes&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqyBx7v7QXN125YEpRqjE_pfLNRHtH4CpYArXAmgCLK4ghCcNgd_BySV43F23R2rPdKeJFgM0f_rCVh1UkapNd_Vqyhqn4PU-B4qAYYte-uc_VZ9vgIlnFy4CduojktJzRFQ_rbF8rwJ0/s1600/bl9.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqyBx7v7QXN125YEpRqjE_pfLNRHtH4CpYArXAmgCLK4ghCcNgd_BySV43F23R2rPdKeJFgM0f_rCVh1UkapNd_Vqyhqn4PU-B4qAYYte-uc_VZ9vgIlnFy4CduojktJzRFQ_rbF8rwJ0/s1600/bl9.jpg&quot; height=&quot;182&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Done.&lt;br /&gt;
&lt;br /&gt;
It&#39;s not hard.&lt;br /&gt;
&lt;br /&gt;
You might want to consider removing the list altogether, but if you want to hang onto it, then this is the way to make it NoFollow.&lt;br /&gt;
&lt;br /&gt;
Remember you should make any badges or other sidebar links NoFollow too, unless you have a very specific reason for not doing so.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://kelloggsdba.blogspot.com/feeds/4525958342606602985/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8677961998247325759/4525958342606602985' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8677961998247325759/posts/default/4525958342606602985'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8677961998247325759/posts/default/4525958342606602985'/><link rel='alternate' type='text/html' href='http://kelloggsdba.blogspot.com/2014/02/make-blogger-bloglist-blog-roll-widget.html' title='Make a Blogger Bloglist Blog Roll widget NoFollow'/><author><name>AGuidingLife</name><uri>http://www.blogger.com/profile/05823333742737762759</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><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-gAaGK6ZUho5m8W4UMlNnKV3XVp_iIWTTny3uFQ7UdWdmpDKuz7CyyJZlglipwXEOJMgCq9b9dyRHqLD13I0YhyphenhyphenVVo63_R4OO4O_cfmAu5ZTele6vi_J0SuEdJHTZNurP2_E7c6hHHCU/s72-c/bl2.jpg" height="72" width="72"/><thr:total>0</thr:total></entry></feed>