<?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: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-7125731310934907247</id><updated>2012-02-16T05:31:40.907-05:00</updated><category term='Oracle Scripts'/><category term='RMAN'/><category term='RAC'/><category term='SQL'/><category term='load test data'/><category term='MV'/><title type='text'>Oracle Database Administration</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>80</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-4081937127760491244</id><published>2012-01-23T08:49:00.002-05:00</published><updated>2012-01-23T08:53:52.822-05:00</updated><title type='text'>SQL to find RMAN Backup Duration</title><content type='html'>&lt;span style="font-size:120;"&gt;&lt;br /&gt;&lt;div align="justify"&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;select TO_CHAR(start_time,'yyyy-mm-dd hh24:mi:ss') Start_Time,&lt;br /&gt;TO_CHAR(end_time,'yyyy-mm-dd hh24:mi:ss') End_Time , INPUT_TYPE, round(ELAPSED_SECONDS/60) MINUTES&lt;br /&gt;from v$rman_backup_job_details order by Start_Time asc&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;START_TIME END_TIME INPUT_TYPE MINUTES&lt;br /&gt;------------------------------ ------------------------------ ------------- ----------&lt;br /&gt;2012-01-02 01:00:24 2012-01-02 01:43:34 DB INCR 43&lt;br /&gt;2012-01-02 18:01:07 2012-01-02 19:10:20 ARCHIVELOG 69&lt;br /&gt;2012-01-06 14:52:48 2012-01-06 20:11:54 DB FULL 319&lt;br /&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-4081937127760491244?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/4081937127760491244/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=4081937127760491244' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/4081937127760491244'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/4081937127760491244'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2012/01/sql-to-find-rman-backup-duration.html' title='SQL to find RMAN Backup Duration'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-5969119501252722644</id><published>2011-09-29T12:59:00.001-04:00</published><updated>2011-09-29T12:59:33.865-04:00</updated><title type='text'>ASM DG to Physical Disk Mapping</title><content type='html'>&lt;span style="font-family:Lucida Console;font-size:120;"&gt;&lt;br /&gt;#!/bin/ksh&lt;br /&gt;for i in `/etc/init.d/oracleasm listdisks`&lt;br /&gt;do&lt;br /&gt;v_asmdisk=`/etc/init.d/oracleasm querydisk -d $i | awk  '{print $2}'`&lt;br /&gt;v_minor=`/etc/init.d/oracleasm querydisk -d $i | awk -F[ '{print $2}'| awk -F] '{print $1}' | awk '{print $1}'`&lt;br /&gt;v_major=`/etc/init.d/oracleasm querydisk -d $i | awk -F[ '{print $2}'| awk -F] '{print $1}' | awk '{print $2}'`&lt;br /&gt;v_device=`ls -la /dev | grep $v_minor | grep $v_major | awk '{print $10}'`&lt;br /&gt;echo "ASM disk $v_asmdisk based on /dev/$v_device  [$v_minor $v_major]"&lt;br /&gt;done&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-5969119501252722644?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/5969119501252722644/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=5969119501252722644' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/5969119501252722644'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/5969119501252722644'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2011/09/asm-dg-to-physical-disk-mapping.html' title='ASM DG to Physical Disk Mapping'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-921223371004497594</id><published>2011-09-21T16:35:00.000-04:00</published><updated>2011-09-21T16:36:04.380-04:00</updated><title type='text'>CRS Diagnostic Data Gathering</title><content type='html'>&lt;span style="font-family:Lucida Console;font-size:120;"&gt;&lt;br /&gt;CRS Diagnostic Data Gathering&lt;br /&gt;&lt;br /&gt;For 10gR2 &lt;br /&gt;=========&lt;br /&gt;Ensure that the environment variable ORA_CRS_HOME is set to the CRS home &lt;br /&gt;Ensure that the environment variable ORACLE_BASE is set &lt;br /&gt;Ensure that the environment variable HOSTNAME is set to the name of the host. &lt;br /&gt;$./diagcollection.pl -collect &lt;br /&gt;&lt;br /&gt;For 11gR1&lt;br /&gt;=========&lt;br /&gt;Execute diagcollection.pl by passing the crs_home as the following&lt;br /&gt;export ORA_CRS_HOME=/u01/crs&lt;br /&gt;$ORA_CRS_HOME/bin/diagcollection.pl -crshome=$ORA_CRS_HOME --collect&lt;br /&gt;&lt;br /&gt;For 11gR2&lt;br /&gt;=========&lt;br /&gt;Execute &lt;GRID_HOME&gt;/bin/diagcollection.sh &lt;br /&gt;&lt;br /&gt;NOTE: --nocore  &lt;UNIX ONLY&gt; This option significantly reduces the size of the final file by excluding the core files &lt;br /&gt;&lt;br /&gt;OS Watcher (OSW)&lt;br /&gt;================&lt;br /&gt;For platforms where Cluster Health Monitor is not available, OS Watcher can collect OS performance statistics. &lt;br /&gt;The OS Watcher guide for Windows is found in Oracle Metalink Document 433472.1 - OS Watcher For Windows (OSWFW) User Guide.  However, CHM for Windows is far superior to OS Watcher for Windows and should be used wherever possible.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;For all other platforms, the OS Watcher user guide can be found in Document 301137.1 &lt;br /&gt;&lt;br /&gt;The OS Watcher output or the compressed output can be manually collected from the osw installation directories.  Browsing the OSW output will show the server performance profile. &lt;br /&gt;If OS Watcher is not running, then you can start the data collection manually from the osw installation directory: &lt;br /&gt;&lt;br /&gt;nohup ./startOSW.sh &amp; &lt;br /&gt;&lt;br /&gt;OS Watcher should be in init.d to ensure that it starts automatically at server start. &lt;br /&gt;The script tarupfiles.sh should be run regularly to compress the OS watcher data collection output. This should be configured in crontab. &lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-921223371004497594?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/921223371004497594/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=921223371004497594' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/921223371004497594'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/921223371004497594'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2011/09/crs-diagnostic-data-gathering.html' title='CRS Diagnostic Data Gathering'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-4820190847189757475</id><published>2011-09-21T13:38:00.002-04:00</published><updated>2011-09-21T13:39:45.251-04:00</updated><title type='text'>Find out about dropped network packets</title><content type='html'>&lt;span style="font-family:Lucida Console;font-size:120;"&gt;&lt;br /&gt;$ netstat -s &lt;br /&gt;OR&lt;br /&gt;$ ifconfig -a&lt;br /&gt;the above gives information about "dropped network packets"&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-4820190847189757475?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/4820190847189757475/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=4820190847189757475' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/4820190847189757475'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/4820190847189757475'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2011/09/find-out-about-dropped-network-packets_21.html' title='Find out about dropped network packets'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-2250917725726121627</id><published>2011-07-29T12:03:00.001-04:00</published><updated>2011-07-29T12:03:46.112-04:00</updated><title type='text'>List files for a particular date</title><content type='html'>&lt;span style="font-family:Lucida Console;font-size:120;"&gt;&lt;br /&gt;&lt;br /&gt;ls -latR | grep 'Jul 23'&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-2250917725726121627?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/2250917725726121627/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=2250917725726121627' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/2250917725726121627'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/2250917725726121627'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2011/07/list-files-for-particular-date.html' title='List files for a particular date'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-2595483107444816484</id><published>2011-07-27T09:38:00.002-04:00</published><updated>2011-07-27T09:44:09.211-04:00</updated><title type='text'>Perl script to run any UNIX/LINUX command and email the output</title><content type='html'>&lt;span style="font-family:Lucida Console;font-size:120;"&gt;&lt;br /&gt;&lt;br /&gt;The following script would run command "lsof -u oracle | wc -l" and then check for &lt;br /&gt;the threshold value and if the threshold is exceeded, it will email the output.&lt;br /&gt; &lt;br /&gt;#!/usr/bin/perl -w&lt;br /&gt;use POSIX 'strftime';&lt;br /&gt;my $date = strftime '%m-%d-%Y %H:%M:%S', localtime;&lt;br /&gt;my $command = `/usr/sbin/lsof -u oracle | wc -l `;&lt;br /&gt;my $host = `hostname`; chomp($host);&lt;br /&gt;my $to = "abc\@yahoo.com";&lt;br /&gt;my $title = "LSOF Threshold Exceeded" ;&lt;br /&gt;my $from = "DBA\@yahoo.com";&lt;br /&gt;my $subject = "Threshold lsof exceeded";&lt;br /&gt;my $thresh = 10;&lt;br /&gt;&lt;br /&gt;if( $command ge $thresh ) {&lt;br /&gt;open(MAIL, "|/usr/sbin/sendmail -t ");&lt;br /&gt;&lt;br /&gt;print MAIL "To: $to\n";&lt;br /&gt;print MAIL "From: $from\n";&lt;br /&gt;print MAIL "Subject: $title for host : $host\n";&lt;br /&gt;&lt;br /&gt;print MAIL "$date\n HOSTNAME: $host\n LSOF Count: $command\n\n";&lt;br /&gt;print MAIL "LSOF Count has Exceeded the threshold of $thresh";&lt;br /&gt;&lt;br /&gt;close(MAIL);&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-2595483107444816484?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/2595483107444816484/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=2595483107444816484' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/2595483107444816484'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/2595483107444816484'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2011/07/perl-script-to-run-any-unixlinux.html' title='Perl script to run any UNIX/LINUX command and email the output'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-6601257079062447897</id><published>2011-06-15T08:39:00.000-04:00</published><updated>2011-06-15T08:40:29.203-04:00</updated><title type='text'>Remove Job from another user : DBMS_IJOB.REMOVE</title><content type='html'>&lt;span style="font-family:Lucida Console;font-size:120;"&gt;&lt;br /&gt;SQL&gt; exec dbms_job.remove(40682);&lt;br /&gt;BEGIN dbms_job.remove(40682); END;&lt;br /&gt;&lt;br /&gt;*&lt;br /&gt;ERROR at line 1:&lt;br /&gt;ORA-23421: job number 40682 is not a job in the job queue&lt;br /&gt;ORA-06512: at "SYS.DBMS_SYS_ERROR", line 86&lt;br /&gt;ORA-06512: at "SYS.DBMS_IJOB", line 687&lt;br /&gt;ORA-06512: at "SYS.DBMS_JOB", line 174&lt;br /&gt;ORA-06512: at line 1&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; EXECUTE SYS.DBMS_IJOB.REMOVE (40682);&lt;br /&gt;&lt;br /&gt;PL/SQL procedure successfully completed.&lt;br /&gt;&lt;br /&gt;SQL&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-6601257079062447897?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/6601257079062447897/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=6601257079062447897' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/6601257079062447897'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/6601257079062447897'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2011/06/remove-job-from-another-user.html' title='Remove Job from another user : DBMS_IJOB.REMOVE'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-1693017421750470633</id><published>2011-06-03T15:49:00.001-04:00</published><updated>2011-06-03T15:49:42.602-04:00</updated><title type='text'>Find session activity</title><content type='html'>&lt;span style="font-family:Lucida Console;font-size:120;"&gt;&lt;br /&gt;select event,'/usr/ucb/ps -aux | grep'||spid,pga_used_mem,sid,a.serial#,b.inst_id,logon_time,a.username,module,last_call_et/60,subst&lt;br /&gt;r(machine,1,20),process,sql_id&lt;br /&gt;from gv$session a,gv$process b where addr=paddr&lt;br /&gt;and status='ACTIVE'&lt;br /&gt;and a.username is not null&lt;br /&gt;and a.username = 'GCP_USER'&lt;br /&gt;and a.inst_id=b.inst_id&lt;br /&gt;and last_call_et/60 &gt; 1&lt;br /&gt;order by b.inst_id&lt;br /&gt;/&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-1693017421750470633?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/1693017421750470633/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=1693017421750470633' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/1693017421750470633'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/1693017421750470633'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2011/06/find-session-activity.html' title='Find session activity'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-2651463844921289235</id><published>2011-06-03T07:27:00.001-04:00</published><updated>2011-06-03T07:27:46.941-04:00</updated><title type='text'>Who's using the UNDO segments</title><content type='html'>&lt;span style="font-family:Lucida Console;font-size:120;"&gt;&lt;br /&gt;SELECT TO_CHAR (s.SID) || ',' || TO_CHAR (s.serial#) sid_serial,&lt;br /&gt;NVL (s.username, 'None') orauser, s.program, r.NAME undoseg,&lt;br /&gt;t.used_ublk * TO_NUMBER (x.VALUE) / 1024 || 'K' "Undo"&lt;br /&gt;FROM SYS.v_$rollname r,&lt;br /&gt;SYS.v_$session s,&lt;br /&gt;SYS.v_$transaction t,&lt;br /&gt;SYS.v_$parameter x&lt;br /&gt;WHERE s.taddr = t.addr&lt;br /&gt;AND r.usn = t.xidusn(+)&lt;br /&gt;AND x.NAME = 'db_block_size'&lt;br /&gt;/&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-2651463844921289235?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/2651463844921289235/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=2651463844921289235' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/2651463844921289235'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/2651463844921289235'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2011/06/whos-using-undo-segments.html' title='Who&apos;s using the UNDO segments'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-8191026667579595019</id><published>2011-05-18T14:40:00.001-04:00</published><updated>2011-05-18T14:40:25.256-04:00</updated><title type='text'>Find out who's locking the accounts</title><content type='html'>&lt;span style="font-family:Lucida Console;font-size:120;"&gt;&lt;br /&gt;set lines 200&lt;br /&gt;set pages 200&lt;br /&gt;&lt;br /&gt;column USERNAME format a12&lt;br /&gt;column OS_USERNAME format a12&lt;br /&gt;column USERHOST format a25&lt;br /&gt;column EXTENDED_TIMESTAMP format a40&lt;br /&gt;&lt;br /&gt;SELECT USERNAME, OS_USERNAME, USERHOST, EXTENDED_TIMESTAMP&lt;br /&gt;FROM SYS.DBA_AUDIT_SESSION WHERE returncode != 0 and username = '&amp;Account_Locked'&lt;br /&gt;and EXTENDED_TIMESTAMP &gt; (systimestamp-1) order by 4 desc&lt;br /&gt;/&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-8191026667579595019?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/8191026667579595019/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=8191026667579595019' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/8191026667579595019'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/8191026667579595019'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2011/05/find-out-whos-locking-accounts.html' title='Find out who&apos;s locking the accounts'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-1975244069616494665</id><published>2011-05-11T14:59:00.000-04:00</published><updated>2011-05-13T16:45:48.489-04:00</updated><title type='text'>Query to find HISTOGRAMS</title><content type='html'>&lt;span style="font-family:Lucida Console;font-size:120;"&gt;&lt;br /&gt;select owner,table_name,histogram from DBA_TAB_COL_STATISTICS where &lt;br /&gt;owner='SCOTT' and table_name='EMPLOYEE'&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-1975244069616494665?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/1975244069616494665/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=1975244069616494665' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/1975244069616494665'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/1975244069616494665'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2011/05/query-to-find-histograms.html' title='Query to find HISTOGRAMS'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-8556898864047366703</id><published>2011-05-09T16:04:00.002-04:00</published><updated>2011-05-09T16:53:05.807-04:00</updated><title type='text'>Default STATS Collection in 11g</title><content type='html'>&lt;span style="font-family:Lucida Console;font-size:120;"&gt;&lt;br /&gt;-    The GATHER_STATS_JOB Oracle’s default stats collection job does not exist in &lt;br /&gt;     11g (the name does not exist) as it was there in 10g. Instead it has been &lt;br /&gt;     included in Automatic Maintenance Tasks&lt;br /&gt;&lt;br /&gt;-    How to check, Oracle’s default stats collection job is enable or disabled&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; select CLIENT_NAME,status from DBA_AUTOTASK_CLIENT;&lt;br /&gt;&lt;br /&gt;CLIENT_NAME                                                      STATUS&lt;br /&gt;---------------------------------------------------------------- --------&lt;br /&gt;auto optimizer stats collection                                  DISABLED&lt;br /&gt;auto space advisor                                               ENABLED&lt;br /&gt;sql tuning advisor                                               ENABLED&lt;br /&gt;&lt;br /&gt;- How to disable if it is enabled (run below query to disable it). Below PL/SQL block has to be executed by SYS&lt;br /&gt;&lt;br /&gt;BEGIN&lt;br /&gt;DBMS_AUTO_TASK_ADMIN.DISABLE(&lt;br /&gt;client_name =&gt; 'auto optimizer stats collection', &lt;br /&gt;operation =&gt; NULL, &lt;br /&gt;window_name =&gt; NULL);&lt;br /&gt;END;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-8556898864047366703?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/8556898864047366703/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=8556898864047366703' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/8556898864047366703'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/8556898864047366703'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2011/05/null-end.html' title='Default STATS Collection in 11g'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-530396545446178984</id><published>2011-04-24T13:00:00.001-04:00</published><updated>2011-04-24T13:02:10.305-04:00</updated><title type='text'>EXPDP - EXCLUDE Multiple TABLES and SCHEMAS</title><content type='html'>&lt;span style="font-family:Lucida Console;font-size:120;"&gt;&lt;br /&gt;&lt;br /&gt;The below example gives syntax to EXCLUDE multiple tables and multiple schemas while doing a full database export using expdp&lt;br /&gt;&lt;br /&gt;=== BEGIN expdp_exclude.par&lt;br /&gt;&lt;br /&gt;DIRECTORY=DATA_PUMP_DIR&lt;br /&gt;DUMPFILE=abc.dmp&lt;br /&gt;LOGFILE=abc.log&lt;br /&gt;FULL=Y&lt;br /&gt;EXCLUDE=STATISTICS&lt;br /&gt;EXCLUDE=TABLE:"IN ('NAME', 'ADDRESS' , 'EMPLOYEE' , 'DEPT')"&lt;br /&gt;EXCLUDE=SCHEMA:"IN ('WMSYS', 'OUTLN')"&lt;br /&gt;&lt;br /&gt;=== END expdp_exclude.par&lt;br /&gt;&lt;br /&gt;In the above example parameter file; tables NAME and ADDRESS are owned by SCOTT and tables EMPLOYEE and DEPT are owned by HR&lt;br /&gt;EXCLUDE=TABLE =&gt; You do not have to prefix the OWNER name, in fact, if you put the OWNER.TABLE_NAME, it would not work. &lt;br /&gt;It will EXCLUDE all TABLES having the name mentioned in the list, even if more than one owner has the same object name.&lt;br /&gt;For example: If ADDRESS table is owned by user SCOTT and user HR, that table will be EXCLUDED from both the users.&lt;br /&gt;&lt;br /&gt;The above commands would work only via parameter file and would not work on the command line.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;COMMAND LINE SYNTAX for EXPDP&lt;br /&gt;&lt;br /&gt;expdp system/password DIRECTORY=DATA_PUMP_DIR DUMPFILE=abc.dmp FULL=Y &lt;br /&gt;EXCLUDE=TABLE:\"IN \(\'NAME\', \'ADDRESS\' , \'EMPLOYEE\' , \'DEPT\'\)\"  &lt;br /&gt;EXCLUDE=SCHEMA:\"IN \(\'WMSYS\', \'OUTLN\'\)\"&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-530396545446178984?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/530396545446178984/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=530396545446178984' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/530396545446178984'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/530396545446178984'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2011/04/expdp-exclude-multiple-tables-and.html' title='EXPDP - EXCLUDE Multiple TABLES and SCHEMAS'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-8447851682071924985</id><published>2011-03-28T13:49:00.005-04:00</published><updated>2011-03-28T13:53:52.467-04:00</updated><title type='text'>Find Current CPU or PSU Applied</title><content type='html'>&lt;span style="font-family:Lucida Console;font-size:120;"&gt;&lt;br /&gt;mylx1:product/11.1.0/OPatch/ $ &lt;strong&gt;./opatch lsinv -bugs_fixed | grep -i 'database psu'  &lt;/strong&gt;&lt;br /&gt;8833297    9352179   Mon Sep 13 22:00:34 EDT 2010   DATABASE PSU 11.1.0.7.1 (INCLUDES CPUOCT2009)&lt;br /&gt;9209238    9352179   Mon Sep 13 22:00:34 EDT 2010   DATABASE PSU 11.1.0.7.2 (INCLUDES CPUJAN2010)&lt;br /&gt;9352179    9352179   Mon Sep 13 22:00:34 EDT 2010   DATABASE PSU 11.1.0.7.3 (INCLUDES CPUAPR2010)&lt;br /&gt;mylx1:product/11.1.0/OPatch/ $ &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;REM This script outputs the current CPU applied on the database.&lt;/strong&gt;column action format a15&lt;br /&gt;column action_time format a30&lt;br /&gt;column comments format a35&lt;br /&gt;column action format a20&lt;br /&gt;set linesize 300&lt;br /&gt;&lt;br /&gt;select comments,action_time,action&lt;br /&gt;from&lt;br /&gt;(select action,action_time,comments&lt;br /&gt;from sys.registry$history&lt;br /&gt;where action in ('CPU','APPLY')&lt;br /&gt;order by action_time desc)&lt;br /&gt;where comments &lt;&gt; 'view recompilation'&lt;br /&gt;and rownum &lt; 2&lt;br /&gt;/&lt;br /&gt;-- Output from above script --&lt;br /&gt;COMMENTS                            ACTION_TIME                    ACTION&lt;br /&gt;----------------------------------- ------------------------------ --------------------&lt;br /&gt;PSU 11.1.0.7.3                      09-AUG-10 09.14.20.562314 AM   APPLY&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-8447851682071924985?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/8447851682071924985/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=8447851682071924985' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/8447851682071924985'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/8447851682071924985'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2011/03/find-current-cpu-or-psu-applied.html' title='Find Current CPU or PSU Applied'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-2771262942872181205</id><published>2011-02-23T08:33:00.002-05:00</published><updated>2011-02-23T08:36:17.097-05:00</updated><title type='text'>Expdp Options</title><content type='html'>&lt;span style="font-family:Lucida Console;font-size:120;"&gt;&lt;br /&gt;expdp system/******** schemas=SCOTT directory=SCOTT_DUMP dumpfile=scott.dmp logfile=scott.log EXCLUDE=TABLE:\"LIKE \'EMP%\'\", TABLE:\"LIKE \'%ABC%\'\"&lt;br /&gt;&lt;br /&gt;if you just type EXCLUDE=TABLE:"LIKE 'EMP%'", TABLE:"LIKE '%ABC%'":&lt;br /&gt;&lt;br /&gt;you will get the following error.&lt;br /&gt;&lt;br /&gt;ORA-39001: invalid argument value&lt;br /&gt;ORA-39071: Value for EXCLUDE is badly formed.&lt;br /&gt;ORA-00911: invalid character&lt;br /&gt;&lt;br /&gt;you need to include escape characters in the statement, e.g.:&lt;br /&gt;EXCLUDE=TABLE:\"LIKE \'EMP%\'\", TABLE:\"LIKE \'%ABC%\'\" , &lt;br /&gt;this would exclude tables starting with EMP and any tables having ABC in their table name.&lt;br /&gt;&lt;br /&gt;Using the NOT IN OPERATOR&lt;br /&gt;EXCLUDE=TABLE:\"NOT IN \(\'ABC\',\'XYZ\'\)\"&lt;br /&gt;&lt;br /&gt;Using the IN OPERATOR&lt;br /&gt;EXCLUDE=TABLE:\"IN \(\'ABC\',\'XYZ\'\)\"&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-2771262942872181205?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/2771262942872181205/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=2771262942872181205' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/2771262942872181205'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/2771262942872181205'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2011/02/expdp-options.html' title='Expdp Options'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-3006994068388340596</id><published>2010-11-22T10:12:00.002-05:00</published><updated>2010-11-22T10:13:23.595-05:00</updated><title type='text'>Find Unindexes FK Constraints</title><content type='html'>&lt;span style="font-family:Lucida Console;font-size:120;"&gt;&lt;br /&gt;col table_name format a32&lt;br /&gt;col columns format a40&lt;br /&gt;set lines 140&lt;br /&gt;set pages 200&lt;br /&gt;select table_name, constraint_name,&lt;br /&gt;      cname1 || nvl2(cname2,','||cname2,null) ||&lt;br /&gt;      nvl2(cname3,','||cname3,null) || nvl2(cname4,','||cname4,null) ||&lt;br /&gt;      nvl2(cname5,','||cname5,null) || nvl2(cname6,','||cname6,null) ||&lt;br /&gt;      nvl2(cname7,','||cname7,null) || nvl2(cname8,','||cname8,null)&lt;br /&gt;             columns&lt;br /&gt;   from ( select b.table_name,&lt;br /&gt;                 b.constraint_name,&lt;br /&gt;                 max(decode( position, 1, column_name, null )) cname1,&lt;br /&gt;                 max(decode( position, 2, column_name, null )) cname2,&lt;br /&gt;                  max(decode( position, 3, column_name, null )) cname3,&lt;br /&gt;                  max(decode( position, 4, column_name, null )) cname4,&lt;br /&gt;                 max(decode( position, 5, column_name, null )) cname5,&lt;br /&gt;                 max(decode( position, 6, column_name, null )) cname6,&lt;br /&gt;                 max(decode( position, 7, column_name, null )) cname7,&lt;br /&gt;                 max(decode( position, 8, column_name, null )) cname8,&lt;br /&gt;                 count(*) col_cnt&lt;br /&gt;             from (select substr(table_name,1,30) table_name,&lt;br /&gt;                         substr(constraint_name,1,30) constraint_name,&lt;br /&gt;                         substr(column_name,1,30) column_name,&lt;br /&gt;                         position&lt;br /&gt;                     from user_cons_columns ) a,&lt;br /&gt;                 user_constraints b&lt;br /&gt;            where a.constraint_name = b.constraint_name&lt;br /&gt;              and b.constraint_type = 'R'&lt;br /&gt;            group by b.table_name, b.constraint_name&lt;br /&gt;         ) cons&lt;br /&gt;   where col_cnt &gt; ALL&lt;br /&gt;           ( select count(*)&lt;br /&gt;               from user_ind_columns i&lt;br /&gt;              where i.table_name = cons.table_name&lt;br /&gt;                and i.column_name in (cname1, cname2, cname3, cname4,&lt;br /&gt;                                      cname5, cname6, cname7, cname8 )&lt;br /&gt;                and i.column_position &lt;= cons.col_cnt&lt;br /&gt;              group by i.index_name&lt;br /&gt;           )&lt;br /&gt;order by table_name&lt;br /&gt;/&lt;br /&gt;(Credit goes to the original author, found it somewhere on internet)&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-3006994068388340596?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/3006994068388340596/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=3006994068388340596' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/3006994068388340596'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/3006994068388340596'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2010/11/find-unindexes-fk-constraints.html' title='Find Unindexes FK Constraints'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-7164947745543483475</id><published>2010-11-05T12:12:00.001-04:00</published><updated>2010-11-05T12:12:50.379-04:00</updated><title type='text'>FTS with Table Name</title><content type='html'>&lt;span style="font-family:Lucida Console;font-size:120;"&gt;&lt;br /&gt;select distinct a.sql_id,b.object_name&lt;br /&gt;--dbms_lob.substr(a.sql_text)&lt;br /&gt;from dba_hist_sqltext a,&lt;br /&gt;(select SQL_ID,object_name from dba_hist_sql_plan where object_owner='SCOTT'and OPERATION = 'TABLE ACCESS' and OPTIONS =&lt;br /&gt;'FULL') b&lt;br /&gt;where a.sql_id = b.sql_id&lt;br /&gt;order by 1&lt;br /&gt;/&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-7164947745543483475?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/7164947745543483475/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=7164947745543483475' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/7164947745543483475'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/7164947745543483475'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2010/11/fts-with-table-name.html' title='FTS with Table Name'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-8935991966174748282</id><published>2010-11-03T14:29:00.000-04:00</published><updated>2010-11-03T14:30:21.140-04:00</updated><title type='text'>Find SQLs doing Full Table Scans</title><content type='html'>&lt;span style="font-family:Lucida Console;font-size:120;"&gt;&lt;br /&gt;select sql_id,sql_text from dba_hist_sqltext&lt;br /&gt;where sql_id in (select distinct SQL_ID  from dba_hist_sql_plan where object_owner='SCOTT'&lt;br /&gt;and OPERATION = 'TABLE ACCESS' and OPTIONS = 'FULL')&lt;br /&gt;/&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-8935991966174748282?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/8935991966174748282/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=8935991966174748282' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/8935991966174748282'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/8935991966174748282'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2010/11/find-sqls-doing-full-table-scans.html' title='Find SQLs doing Full Table Scans'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-5383718942631855153</id><published>2010-10-11T10:06:00.000-04:00</published><updated>2010-10-11T10:08:17.064-04:00</updated><title type='text'>crsctl.bin: error while loading shared libraries: libclntsh.so.11.1: cannot open shared object file: No such file or directory</title><content type='html'>&lt;span style="font-family:Lucida Console;font-size:120;"&gt;&lt;br /&gt;After upgrading the CRS to 11g (11.1.0.7) and at the time of running the root111.sh (at 11.1.0.7), got the below error&lt;br /&gt;&lt;br /&gt;/usr/local/opt/oracrs/bin/crsctl.bin: error while loading shared libraries: libclntsh.so.11.1: cannot open shared object file: No such file or directory &lt;br /&gt;&lt;br /&gt;And found the workaround in the below note.&lt;br /&gt;&lt;br /&gt;After Installing Patchset Crsctl Fails To Load Libclntsh.so [ID 333233.1]&lt;br /&gt;&lt;br /&gt;Workaround was to manually change the permission of libclntsh.so.11.1 and After applying the workaround all services in the cluster were ONLINE.&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-5383718942631855153?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/5383718942631855153/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=5383718942631855153' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/5383718942631855153'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/5383718942631855153'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2010/10/crsctlbin-error-while-loading-shared.html' title='crsctl.bin: error while loading shared libraries: libclntsh.so.11.1: cannot open shared object file: No such file or directory'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-6208658572895870908</id><published>2010-10-04T11:24:00.000-04:00</published><updated>2010-10-04T11:25:20.463-04:00</updated><title type='text'>Oracle RAC Commands</title><content type='html'>&lt;span style="font-family:Lucida Console;font-size:120;"&gt;&lt;br /&gt;To shutdown RDBMS on all nodes run the following command: &lt;br /&gt;&lt;br /&gt;$ORACLE_HOME/bin/srvctl stop database -d dbname     &lt;br /&gt;&lt;br /&gt;To shutdown RDBMS instance on the local node run the following command:&lt;br /&gt;&lt;br /&gt;$ORACLE_HOME/bin/srvctl stop instance -d dbname -i instance_name&lt;br /&gt;&lt;br /&gt;To shutdown ASM instances run the following command on each node:&lt;br /&gt;&lt;br /&gt;$ORACLE_HOME/bin/srvctl stop asm -n &lt;node_name&gt;;&lt;br /&gt;&lt;br /&gt;To shutdown listeners run the following command on each node:&lt;br /&gt;&lt;br /&gt;$ORACLE_HOME/bin/srvctl stop listener -n &lt;node_name&gt;;&lt;br /&gt;&lt;br /&gt;To shutdown nodeapps run the following comand on each node:&lt;br /&gt;&lt;br /&gt;$ORA_CRS_HOME/bin/srvctl stop nodeapps -n &lt;node_name&gt;;&lt;br /&gt;&lt;br /&gt;To shutdown CRS daemons on each node by running as root:&lt;br /&gt;&lt;br /&gt;# crsctl stop crs&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-6208658572895870908?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/6208658572895870908/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=6208658572895870908' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/6208658572895870908'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/6208658572895870908'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2010/10/oracle-rac-commands.html' title='Oracle RAC Commands'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-6779395656038526441</id><published>2010-09-27T13:16:00.002-04:00</published><updated>2010-09-27T13:20:45.995-04:00</updated><title type='text'>How to suppress Oracle Banner</title><content type='html'>&lt;span style="font-family:Lucida Console;font-size:120;"&gt;&lt;br /&gt;&lt;br /&gt;Disabling "Banner" assumes significance in case of Oracle RAC Install. The result of not temporarily removing the banner is that the dba will see errors that say, "User equivalence failed for user oracle". &lt;br /&gt;&lt;br /&gt;• Log in (or sudo to) user oracle&lt;br /&gt;• cd ~/.ssh&lt;br /&gt;• Modify (or create) a file named “config” in this directory, to add the following line (case-sensitive, left-justified):&lt;br /&gt;&lt;br /&gt;LogLevel QUIET&lt;br /&gt;&lt;br /&gt;• Save and close the file.&lt;br /&gt;• Test to ensure that oracle can ssh to all other RAC nodes in the cluster, without being presented with a banner.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;What is displayed as Banner is stored under /usr/localcw/opt/tcpwrapper/banners/&lt;xyz&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-6779395656038526441?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/6779395656038526441/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=6779395656038526441' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/6779395656038526441'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/6779395656038526441'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2010/09/how-to-suppress-oracle-banner.html' title='How to suppress Oracle Banner'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-4664738334844010476</id><published>2010-09-27T10:12:00.001-04:00</published><updated>2010-09-27T10:14:03.165-04:00</updated><title type='text'>How to start Oracle runInstaller in TRACING mode</title><content type='html'>&lt;span style="font-family:Lucida Console;font-size:120;"&gt;&lt;br /&gt;Launch the installer with tracing turned on&lt;br /&gt;&lt;br /&gt;./runInstaller -J-DTRACING.ENABLED=true -J-DTRACING.LEVEL=2&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-4664738334844010476?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/4664738334844010476/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=4664738334844010476' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/4664738334844010476'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/4664738334844010476'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2010/09/how-to-start-oracle-runinstaller-in.html' title='How to start Oracle runInstaller in TRACING mode'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-9066675728872672688</id><published>2010-09-24T15:12:00.003-04:00</published><updated>2010-09-24T15:14:35.841-04:00</updated><title type='text'>How to Check OCR and Voting Disk</title><content type='html'>&lt;span style="font-family:Lucida Console;font-size:120;"&gt;&lt;br /&gt;How to find out which raw devices are used for OCR and which ones are used for Voting Disk.&lt;br /&gt;&lt;br /&gt;mylxd1-&gt;ocrcheck&lt;br /&gt;Status of Oracle Cluster Registry is as follows :&lt;br /&gt;         Version                  :          2&lt;br /&gt;         Total space (kbytes)     :     487980&lt;br /&gt;         Used space (kbytes)      :       3884&lt;br /&gt;         Available space (kbytes) :     484096&lt;br /&gt;         ID                       : 2006423852&lt;br /&gt;         Device/File Name         : /dev/raw/raw1&lt;br /&gt;                                    Device/File integrity check succeeded&lt;br /&gt;         Device/File Name         : /dev/raw/raw2&lt;br /&gt;                                    Device/File integrity check succeeded&lt;br /&gt;&lt;br /&gt;         Cluster registry integrity check succeeded&lt;br /&gt;&lt;br /&gt;         Logical corruption check succeeded&lt;br /&gt;&lt;br /&gt;mylxd1-&gt;crsctl query css votedisk&lt;br /&gt; 0.     0    /dev/raw/raw3&lt;br /&gt; 1.     0    /dev/raw/raw4&lt;br /&gt; 2.     0    /dev/raw/raw5&lt;br /&gt;Located 3 voting disk(s).&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-9066675728872672688?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/9066675728872672688/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=9066675728872672688' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/9066675728872672688'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/9066675728872672688'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2010/09/how-to-check-oct-and-voting-disk.html' title='How to Check OCR and Voting Disk'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-6275247239422665236</id><published>2010-08-25T15:25:00.002-04:00</published><updated>2010-08-25T15:29:10.016-04:00</updated><title type='text'>Database restart on HOST reboot</title><content type='html'>&lt;span style="font-family:Lucida Console;font-size:120;"&gt;&lt;br /&gt;Create a script to stop/start the database&lt;br /&gt;&lt;br /&gt;Execute these as ROOT.&lt;br /&gt;&lt;br /&gt;            cp {script to stop/start the database to} /etc/init.d/oracle&lt;br /&gt;            chmod 755 /etc/init.d/oracle&lt;br /&gt;            ln –s /etc/init.d/oracle /etc/rc0.d/K05oracle&lt;br /&gt;            ln –s /etc/init.d/oracle /etc/rc3.d/S90oracle&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-6275247239422665236?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/6275247239422665236/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=6275247239422665236' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/6275247239422665236'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/6275247239422665236'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2010/08/database-restart-on-host-reboot.html' title='Database restart on HOST reboot'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-2516396576945143024</id><published>2010-08-25T14:33:00.000-04:00</published><updated>2010-08-25T14:34:41.631-04:00</updated><title type='text'>Delete archivelogs using RMAN until date</title><content type='html'>&lt;span style="font-family:Lucida Console;font-size:120;"&gt;&lt;br /&gt;RMAN&gt; run&lt;br /&gt;{&lt;br /&gt;DELETE archivelog until time "to_date('2010-08-23:10:00:00','YYYY-MM-DD:hh24:mi:ss')";&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-2516396576945143024?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/2516396576945143024/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=2516396576945143024' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/2516396576945143024'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/2516396576945143024'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2010/08/delete-archivelogs-using-rman-until.html' title='Delete archivelogs using RMAN until date'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-8794122749560533921</id><published>2010-08-24T11:27:00.001-04:00</published><updated>2010-08-24T11:29:48.895-04:00</updated><title type='text'>ORA-27054: NFS file system where the file is created or resides is not mounted with correct options</title><content type='html'>&lt;span style="font-family:Lucida Console;font-size:120;"&gt;&lt;br /&gt;lxtestbox:/exp/expdp/ $ impdp system/password parfile=imp_from_test.par&lt;br /&gt;&lt;br /&gt;Import: Release 10.2.0.4.0 - 64bit Production on Tuesday, 24 August, 2010 9:43:41&lt;br /&gt;&lt;br /&gt;Copyright (c) 2003, 2007, Oracle.  All rights reserved.&lt;br /&gt;&lt;br /&gt;Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production&lt;br /&gt;With the Partitioning, Real Application Clusters, Data Mining and Real Application Testing options&lt;br /&gt;ORA-39001: invalid argument value&lt;br /&gt;ORA-39000: bad dump file specification&lt;br /&gt;ORA-31640: unable to open dump file "/exp/expdp/test01.dmp" for read&lt;br /&gt;ORA-27054: NFS file system where the file is created or resides is not mounted with correct options&lt;br /&gt;Additional information: 3&lt;br /&gt;&lt;br /&gt;Solution&lt;br /&gt;&lt;br /&gt;Mount the file system with the following option&lt;br /&gt;&lt;br /&gt;rw,noac,bg,intr,hard,timeo=600,wsize=32768,rsize=32768,nfsvers=3,tcp &lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-8794122749560533921?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/8794122749560533921/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=8794122749560533921' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/8794122749560533921'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/8794122749560533921'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2010/08/ora-27054-nfs-file-system-where-file-is.html' title='ORA-27054: NFS file system where the file is created or resides is not mounted with correct options'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-6830428961085051822</id><published>2010-08-23T19:36:00.001-04:00</published><updated>2010-08-23T19:36:19.937-04:00</updated><title type='text'>RMAN Restore</title><content type='html'>&lt;span style="font-family:Lucida Console;font-size:120;"&gt;&lt;br /&gt;run {&lt;br /&gt;allocate channel t1 type disk ;&lt;br /&gt;allocate channel t2 type disk ;&lt;br /&gt;allocate channel t3 type disk ;&lt;br /&gt;allocate channel t4 type disk ;&lt;br /&gt;set until time "to_date('2010-08-23 08:15:00','YYYY-MM-DD HH24:MI:SS')" ;&lt;br /&gt;restore database ;&lt;br /&gt;recover database ;&lt;br /&gt;sql 'alter database open resetlogs' ;&lt;br /&gt;release channel t1;&lt;br /&gt;release channel t2;&lt;br /&gt;release channel t3;&lt;br /&gt;release channel t4;&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-6830428961085051822?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/6830428961085051822/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=6830428961085051822' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/6830428961085051822'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/6830428961085051822'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2010/08/rman-restore.html' title='RMAN Restore'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-4203624124312022133</id><published>2010-05-14T13:50:00.001-04:00</published><updated>2010-05-14T13:51:30.852-04:00</updated><title type='text'>Script to find foreign key constraints</title><content type='html'>&lt;span style="font-family:Lucida Console;font-size:120;"&gt;&lt;br /&gt;&lt;strong&gt;Script to find foreign key constraints&lt;/strong&gt;&lt;br /&gt;select owner,constraint_name,constraint_type,table_name,r_owner,r_constraint_name&lt;br /&gt;from all_constraints &lt;br /&gt;where constraint_type='R'&lt;br /&gt;and r_constraint_name in (select constraint_name from all_constraints &lt;br /&gt;where constraint_type in ('P','U') and table_name='&amp;TABLE_NAME')&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-4203624124312022133?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/4203624124312022133/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=4203624124312022133' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/4203624124312022133'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/4203624124312022133'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2010/05/script-to-find-foreign-key-constraints.html' title='Script to find foreign key constraints'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-3820269518340382717</id><published>2010-05-14T11:59:00.001-04:00</published><updated>2010-05-14T12:01:24.785-04:00</updated><title type='text'>Find Oracle Database Character Set</title><content type='html'>&lt;span style="font-family:Lucida Console;font-size:120;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Character Sets &lt;/strong&gt;&lt;br /&gt;(Ordinary) character set&lt;br /&gt;The (ordinary) character set for a database can be determined with: &lt;br /&gt;&lt;br /&gt;SQL&gt; select value from nls_database_parameters where parameter = 'NLS_CHARACTERSET';&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;National character set&lt;/strong&gt;&lt;br /&gt;The national character set for a database can be determined with: &lt;br /&gt;&lt;br /&gt;SQL&gt; select value from nls_database_parameters &lt;br /&gt;     where parameter = 'NLS_NCHAR_CHARACTERSET';&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-3820269518340382717?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/3820269518340382717/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=3820269518340382717' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/3820269518340382717'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/3820269518340382717'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2010/05/find-oracle-database-character-set.html' title='Find Oracle Database Character Set'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-8827932244507205370</id><published>2010-04-26T10:27:00.000-04:00</published><updated>2010-04-26T10:28:08.249-04:00</updated><title type='text'>How to find number of sessions per hour for EACH INSTANCE in a RAC</title><content type='html'>&lt;span style="font-family:Lucida Console;font-size:120;"&gt;&lt;br /&gt;SELECT&lt;br /&gt;       to_char(TRUNC(s.begin_interval_time,'HH24'),'DD-MON-YYYY HH24:MI:SS') snap_begin,&lt;br /&gt;       r.instance_number        instance,&lt;br /&gt;       r.current_utilization    sessions     &lt;br /&gt;FROM&lt;br /&gt;       dba_hist_resource_limit r,&lt;br /&gt;       dba_hist_snapshot s&lt;br /&gt;WHERE ( TRUNC(s.begin_interval_time,'HH24'),s.snap_id ) IN&lt;br /&gt;(       &lt;br /&gt;--Select the Maximum of the Snapshot IDs within an hour if all of the snapshot IDs&lt;br /&gt;--have the same number of sessions&lt;br /&gt;SELECT      TRUNC(sn.begin_interval_time,'HH24'),MAX(rl.snap_id)&lt;br /&gt;FROM        dba_hist_resource_limit rl,dba_hist_snapshot sn&lt;br /&gt;WHERE       TRUNC(sn.begin_interval_time) &gt;= TRUNC(sysdate-1)&lt;br /&gt;AND         rl.snap_id          = sn.snap_id&lt;br /&gt;AND         rl.resource_name    = 'sessions'&lt;br /&gt;AND         rl.instance_number  = sn.instance_number&lt;br /&gt;AND        ( TRUNC(sn.begin_interval_time,'HH24'),rl.CURRENT_UTILIZATION ) IN&lt;br /&gt;(&lt;br /&gt;--Select the Maximum no.of sessions for a given begin interval time&lt;br /&gt;SELECT      TRUNC(s.begin_interval_time,'HH24'),MAX(r.CURRENT_UTILIZATION) "no_of_sess"&lt;br /&gt;FROM        dba_hist_resource_limit r,dba_hist_snapshot s&lt;br /&gt;WHERE       r.snap_id = s.snap_id&lt;br /&gt;AND         TRUNC(s.begin_interval_time) &gt;= TRUNC(sysdate-1)&lt;br /&gt;AND         r.instance_number=s.instance_number&lt;br /&gt;AND         r.resource_name = 'sessions'&lt;br /&gt;GROUP BY    TRUNC(s.begin_interval_time,'HH24')&lt;br /&gt;)&lt;br /&gt;GROUP BY TRUNC(sn.begin_interval_time,'HH24'),CURRENT_UTILIZATION&lt;br /&gt;)&lt;br /&gt;AND   r.snap_id         = s.snap_id&lt;br /&gt;AND   r.instance_number = s.instance_number&lt;br /&gt;AND   r.resource_name   = 'sessions'&lt;br /&gt;ORDER BY snap_begin,instance&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-8827932244507205370?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/8827932244507205370/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=8827932244507205370' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/8827932244507205370'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/8827932244507205370'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2010/04/how-to-find-number-of-sessions-per-hour_26.html' title='How to find number of sessions per hour for EACH INSTANCE in a RAC'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-1918427687295723653</id><published>2010-04-26T10:26:00.000-04:00</published><updated>2010-04-26T10:27:00.841-04:00</updated><title type='text'>How to find number of sessions per hour</title><content type='html'>&lt;span style="font-family:Lucida Console;font-size:120;"&gt;&lt;br /&gt;SELECT&lt;br /&gt;       to_char(TRUNC(s.begin_interval_time,'HH24'),'DD-MON-YYYY HH24:MI:SS') snap_begin,&lt;br /&gt;       sum(r.current_utilization) sessions&lt;br /&gt;FROM&lt;br /&gt;       dba_hist_resource_limit r,&lt;br /&gt;       dba_hist_snapshot s&lt;br /&gt;WHERE ( TRUNC(s.begin_interval_time,'HH24'),s.snap_id ) IN&lt;br /&gt;(       &lt;br /&gt;--Select the Maximum of the Snapshot IDs within an hour if more than one snapshot IDs&lt;br /&gt;--have the same number of sessions within that hour , so then picking one of the snapIds&lt;br /&gt;SELECT      TRUNC(sn.begin_interval_time,'HH24'),MAX(rl.snap_id)&lt;br /&gt;FROM        dba_hist_resource_limit rl,dba_hist_snapshot sn&lt;br /&gt;WHERE       TRUNC(sn.begin_interval_time) &gt;= TRUNC(sysdate-1)&lt;br /&gt;AND         rl.snap_id          = sn.snap_id&lt;br /&gt;AND         rl.resource_name    = 'sessions'&lt;br /&gt;AND         rl.instance_number  = sn.instance_number&lt;br /&gt;AND        ( TRUNC(sn.begin_interval_time,'HH24'),rl.CURRENT_UTILIZATION ) IN&lt;br /&gt;(&lt;br /&gt;--Select the Maximum no.of sessions for a given begin interval time&lt;br /&gt;-- All the snapshots within a given hour will have the same begin interval time when TRUNC is used&lt;br /&gt;-- for HH24 and we are selecting the Maximum sessions for a given one hour&lt;br /&gt;SELECT      TRUNC(s.begin_interval_time,'HH24'),MAX(r.CURRENT_UTILIZATION) "no_of_sess"&lt;br /&gt;FROM        dba_hist_resource_limit r,dba_hist_snapshot s&lt;br /&gt;WHERE       r.snap_id = s.snap_id&lt;br /&gt;AND         TRUNC(s.begin_interval_time) &gt;= TRUNC(sysdate-1)&lt;br /&gt;AND         r.instance_number=s.instance_number&lt;br /&gt;AND         r.resource_name = 'sessions'&lt;br /&gt;GROUP BY    TRUNC(s.begin_interval_time,'HH24')&lt;br /&gt;)&lt;br /&gt;GROUP BY TRUNC(sn.begin_interval_time,'HH24'),CURRENT_UTILIZATION&lt;br /&gt;)&lt;br /&gt;AND   r.snap_id         = s.snap_id&lt;br /&gt;AND   r.instance_number = s.instance_number&lt;br /&gt;AND   r.resource_name   = 'sessions'&lt;br /&gt;GROUP BY&lt;br /&gt;      to_char(TRUNC(s.begin_interval_time,'HH24'),'DD-MON-YYYY HH24:MI:SS')&lt;br /&gt;ORDER BY snap_begin&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-1918427687295723653?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/1918427687295723653/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=1918427687295723653' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/1918427687295723653'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/1918427687295723653'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2010/04/how-to-find-number-of-sessions-per-hour.html' title='How to find number of sessions per hour'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-2725565380267590994</id><published>2010-03-25T08:23:00.001-04:00</published><updated>2010-03-25T08:24:39.373-04:00</updated><title type='text'>Linux GUI</title><content type='html'>&lt;span style="font-family:Lucida Console;font-size:120;"&gt;&lt;br /&gt;&lt;br /&gt;How to find system resource utilization in Linux&lt;br /&gt;&lt;br /&gt;$ export DISPLAY=90.30.212.197:0.0&lt;br /&gt;$ gnome-system-monitor&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-2725565380267590994?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/2725565380267590994/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=2725565380267590994' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/2725565380267590994'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/2725565380267590994'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2010/03/linux-gui.html' title='Linux GUI'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-3563559687349274708</id><published>2010-01-06T10:58:00.004-05:00</published><updated>2010-01-06T11:21:23.493-05:00</updated><title type='text'>Kernel Parameters for RedHat Linux</title><content type='html'>&lt;span style="font-family:Lucida Console;font-size:120;"&gt;&lt;br /&gt;$ ipcs -l&lt;br /&gt;&lt;br /&gt;------ Shared Memory Limits --------&lt;br /&gt;max number of segments = 4096                   // SHMMNI&lt;br /&gt;max seg size (kbytes) = 66046570                // SHMMAX&lt;br /&gt;max total shared memory (kbytes) = 66046568     // SHMALL&lt;br /&gt;min seg size (bytes) = 1&lt;br /&gt;&lt;br /&gt;------ Semaphore Limits --------&lt;br /&gt;max number of arrays = 128                      // SEMMNI&lt;br /&gt;max semaphores per array = 250                  // SEMMSL&lt;br /&gt;max semaphores system wide = 32000              // SEMMNS&lt;br /&gt;max ops per semop call = 100                    // SEMOPM&lt;br /&gt;semaphore max value = 32767&lt;br /&gt;&lt;br /&gt;------ Messages: Limits --------&lt;br /&gt;max queues system wide = 16                     // MSGMNI&lt;br /&gt;max size of message (bytes) = 65536             // MSGMAX&lt;br /&gt;default max size of queue (bytes) = 65536       // MSGMNB&lt;br /&gt;&lt;br /&gt;&gt;&gt;  Set shmmax to 0.5 * Total Memory (free -b)&lt;br /&gt;&lt;br /&gt;&gt;&gt; SHMMAX is the maximum size of a shared memory segment on a Linux system &lt;br /&gt;   whereas SHMALL is the maximum allocation of shared memory pages on a system.&lt;br /&gt;&lt;br /&gt;&gt;&gt; SHMALL is set to 8 GB by default (8388608 KB = 8 GB). If you have more physical   memory than this, &lt;br /&gt;and it is to be used for oracle database, then this parameter should be increased to approximately &lt;br /&gt;80% of the physical memory. For instance, if you have a server with 16 GB of memory to be used primarily &lt;br /&gt;for oracle, then 80% of 16 GB is 12.8 GB divided by 4 KB (the base page size). The ipcs output has converted &lt;br /&gt;SHMALL into kilobytes. The kernel requires this value as a number of pages.&lt;br /&gt;&lt;br /&gt;&gt;&gt; The next section "Semaphore Limits" covers the amount of semaphores available to the operating system. &lt;br /&gt;The kernel parameter semaphore consists of 4 tokens, SEMMSL, SEMMNS, SEMOPM and SEMMNI. &lt;br /&gt;SEMMNS is the result of SEMMSL multiplied by SEMMNI. &lt;br /&gt;The database manager requires that the number of arrays (SEMMNI) be increased as necessary. &lt;br /&gt;Typically, SEMMNI should be twice the maximum number of connections allowed (MAXAGENTS) multiplied by the &lt;br /&gt;number of logical partitions on the database server plus the number of local application connections&lt;br /&gt;on the database server.&lt;br /&gt;&lt;br /&gt;&gt;&gt; Section "Messages: Limits" covers messages on the system.&lt;br /&gt;&lt;br /&gt;MSGMNI affects the number of agents that can be started, MSGMAX affects the size of the message that can be &lt;br /&gt;sent in a queue, and MSGMNB affects the size of the queue.&lt;br /&gt;&lt;br /&gt;To modify these kernel parameters, we need to edit the /etc/sysctl.conf file.&lt;br /&gt;for example:&lt;br /&gt;kernel.msgmnb = 65536&lt;br /&gt;kernel.msgmax = 65536&lt;br /&gt;kernel.shmmax = 67631687680&lt;br /&gt;kernel.sem=250 32000 100 128&lt;br /&gt;kernel.shmmni=4096&lt;br /&gt;kernel.shmall=16511642&lt;br /&gt;&lt;br /&gt;Name  Description&lt;br /&gt;------  --------------------------------------------------------&lt;br /&gt;SHMMAX  Maximum size of shared memory segment (bytes)  &lt;br /&gt;SHMMIN  Minimum size of shared memory segment (bytes)  &lt;br /&gt;SHMALL  Total amount of shared memory available (bytes or pages) &lt;br /&gt;SHMSEG  Maximum number of shared memory segments per process &lt;br /&gt;SHMMNI  Maximum number of shared memory segments system-wide &lt;br /&gt;SEMMNI  Maximum number of semaphore identifiers (that is, sets) &lt;br /&gt;SEMMNS  Maximum number of semaphores system-wide &lt;br /&gt;SEMMSL  Maximum number of semaphores per set&lt;br /&gt;SEMMAP  Number of entries in semaphore map &lt;br /&gt;SEMVMX  Maximum value of semaphore &lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-3563559687349274708?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/3563559687349274708/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=3563559687349274708' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/3563559687349274708'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/3563559687349274708'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2010/01/kernel-parameters-for-redhat-linux.html' title='Kernel Parameters for RedHat Linux'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-1687263516786924106</id><published>2009-11-05T15:02:00.002-05:00</published><updated>2009-11-05T15:06:04.209-05:00</updated><title type='text'>(APEX) &amp; the Embedded PL/SQL Gateway (EPG) in an 11G</title><content type='html'>&lt;span style="font-family:Lucida Console;font-size:120;"&gt;&lt;br /&gt;After installing Oracle 11g, run the following to configure APEX&lt;br /&gt;Run apxconf.sql from $ORACLE_HOME/apex&lt;br /&gt;When prompted, enter the port for the Oracle XML DB HTTP server. The default port number is 8080. &lt;br /&gt;Unlock the anonymous user&lt;br /&gt;SQL&gt; ALTER USER ANONYMOUS ACCOUNT UNLOCK; &lt;br /&gt;&lt;br /&gt;You should be able to log into apex as the admin user from a browser using -&gt; http://machine.domain:port/apex &lt;br /&gt;&lt;br /&gt;The machine is the DB host and the port is the one input during configure step.&lt;br /&gt;&lt;br /&gt;If you get an error and can't log in, verify the EPG is up by running the following in your browser -&gt;&lt;br /&gt;&lt;br /&gt;http://machine.domain:port&lt;br /&gt;&lt;br /&gt;If it's up, you should be prompted for a username and password for XDB.&lt;br /&gt;&lt;br /&gt;If the EPG is not up, accomplish the following to start it:&lt;br /&gt;&lt;br /&gt;1. Log in as SYS as SYSDBA&lt;br /&gt;2. Run the following statement: &lt;br /&gt;3. EXEC DBMS_XDB.SETHTTPPORT(port); ==&gt;&gt; Where port is the plsql gatway port.&lt;br /&gt;4. COMMIT; &lt;br /&gt;&lt;br /&gt;For example: &lt;br /&gt;EXEC DBMS_XDB.SETHTTPPORT(8080); &lt;br /&gt;COMMIT; &lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-1687263516786924106?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/1687263516786924106/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=1687263516786924106' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/1687263516786924106'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/1687263516786924106'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2009/11/apex-embedded-plsql-gateway-epg-in-11g.html' title='(APEX) &amp; the Embedded PL/SQL Gateway (EPG) in an 11G'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-1944074916691137577</id><published>2009-11-02T08:45:00.001-05:00</published><updated>2009-11-02T08:45:20.294-05:00</updated><title type='text'>How to find size of LOB</title><content type='html'>&lt;span style="font-family:Lucida Console;font-size:120;"&gt;&lt;br /&gt;Select b.table_name,b.Column_name,c.data_type,a.Segment_name,a."size"&lt;br /&gt;  from&lt;br /&gt;  (Select Segment_name , (bytes/(1024*1024*1024)) "size"&lt;br /&gt;  from User_Segments&lt;br /&gt;  where (bytes/(1024*1024*1024))&gt;0.5 )a,&lt;br /&gt;  (Select Table_name,Column_name,Segment_name&lt;br /&gt;  from User_Lobs)b,&lt;br /&gt;  (Select table_name,Column_Name,Data_type from User_Tab_Columns&lt;br /&gt;  Where Data_Type in ('CLOB','BLOB','LONG','LONG RAW')  ) c&lt;br /&gt;  Where a.segment_name=b.segment_name&lt;br /&gt;  and   b.table_name=c.table_name&lt;br /&gt;  and   b.column_name=c.column_name&lt;br /&gt;Order by c.data_type&lt;br /&gt;/&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-1944074916691137577?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/1944074916691137577/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=1944074916691137577' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/1944074916691137577'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/1944074916691137577'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2009/11/how-to-find-size-of-lob.html' title='How to find size of LOB'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-7993487990282715425</id><published>2009-10-26T11:03:00.001-04:00</published><updated>2009-10-26T11:03:26.597-04:00</updated><title type='text'>RMAN Backup on the Standby Database</title><content type='html'>&lt;span style="font-family:Lucida Console;font-size:120;"&gt;&lt;br /&gt;Running RMAN Backup on the Standby Database&lt;br /&gt;&lt;br /&gt;We can put the standby database in good use by running the RMAN backups there along with all the good reasons we have the standby database in place.&lt;br /&gt;&lt;br /&gt;. If your Standby database is a Physical Standby database and you are taking backups ONLY on the physical standby database.&lt;br /&gt;&lt;br /&gt;. The data file directories on the primary and standby database are identical.&lt;br /&gt;&lt;br /&gt;. RMAN recovery catalog is required. Since the standby database has the same DBID as the primary database and is always from the same incarnation, the RMAN datafile backups are interchangeable.&lt;br /&gt;&lt;br /&gt;. RMAN will connect to the standby database as target database. The backups taken can be used to restore the Primary Database.&lt;br /&gt;&lt;br /&gt;. Primary database should not use Oracle Managed Files (OMF) for this to work. If we are using OMF then the file names of Primary and Standby could differ.&lt;br /&gt;&lt;br /&gt;Configuration required on Primary and Standby Database.&lt;br /&gt;&lt;br /&gt;. Configure Flash Recovery Area&lt;br /&gt;. Use of SPFILE&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-7993487990282715425?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/7993487990282715425/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=7993487990282715425' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/7993487990282715425'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/7993487990282715425'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2009/10/rman-backup-on-standby-database.html' title='RMAN Backup on the Standby Database'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-1530599807339511027</id><published>2009-10-23T21:33:00.001-04:00</published><updated>2009-10-23T21:34:16.990-04:00</updated><title type='text'>Split the file in two</title><content type='html'>&lt;span style="font-family:Lucida Console;font-size:120;"&gt;&lt;br /&gt;I have a file with 10 lines and want to split the file in two but with even rows in one file and odd rows in one file.&lt;br /&gt;&lt;br /&gt;sed -n '2,${p;n;}' stat1.sql &gt; even.sql&lt;br /&gt;sed -n '1,${p;n;}' stat1.sql &gt; odd.sql&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-1530599807339511027?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/1530599807339511027/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=1530599807339511027' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/1530599807339511027'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/1530599807339511027'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2009/10/split-file-in-two.html' title='Split the file in two'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-1098644204046943495</id><published>2009-10-06T13:14:00.001-04:00</published><updated>2009-10-06T13:14:46.295-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL'/><title type='text'>Update table and commit every n rows</title><content type='html'>&lt;span style="font-family:Lucida Console;font-size:120;"&gt;&lt;br /&gt;Declare&lt;br /&gt;&lt;br /&gt;i integer;&lt;br /&gt;x  NUMBER ;&lt;br /&gt;v_min NUMBER ;&lt;br /&gt;v_max NUMBER ;&lt;br /&gt;&lt;br /&gt;begin&lt;br /&gt;&lt;br /&gt;select max(EMPID) into x from EMPLOYEE ;&lt;br /&gt;&lt;br /&gt;v_min :=0 ;&lt;br /&gt;v_max :=25000 ;&lt;br /&gt;&lt;br /&gt;loop&lt;br /&gt;    update  EMPLOYEE set CIO_NAME = 'JOHN' where EMPID &gt;= v_min and EMPID &lt; v_max ;&lt;br /&gt;    commit ;&lt;br /&gt;    v_min := v_min+25000 ;&lt;br /&gt;    v_max := v_min+25000 ;&lt;br /&gt;    if v_max &gt; (x+30000) then&lt;br /&gt;        commit ;&lt;br /&gt;        dbms_output.put_line('All rows updated successfully ....') ;&lt;br /&gt;        exit ;&lt;br /&gt;    end if ;&lt;br /&gt;end loop ;&lt;br /&gt;&lt;br /&gt;Exception When others then&lt;br /&gt;dbms_output.put_line('Error Occured ...') ;&lt;br /&gt;&lt;br /&gt;end ;&lt;br /&gt;/&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-1098644204046943495?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/1098644204046943495/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=1098644204046943495' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/1098644204046943495'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/1098644204046943495'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2009/10/update-table-and-commit-every-n-rows.html' title='Update table and commit every n rows'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-1993727869811495036</id><published>2009-10-05T15:56:00.002-04:00</published><updated>2009-10-05T16:00:20.238-04:00</updated><title type='text'>Sequence cache misses were consuming significant database time</title><content type='html'>&lt;span style="font-family:Lucida Console;font-size:120;"&gt;&lt;br /&gt;Many times looking at the AWR Report, you come across "Sequence cache misses were consuming significant database time" when there is a slow performance on inserts.&lt;br /&gt;&lt;br /&gt;Try increasing the cache size of the Sequence and use noorder if you are running a RAC database. Increasing the cache size would help improve the performance of inserts.&lt;br /&gt;&lt;br /&gt;More details to follow on this topic ......&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-1993727869811495036?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/1993727869811495036/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=1993727869811495036' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/1993727869811495036'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/1993727869811495036'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2009/10/sequence-cache-misses-were-consuming.html' title='Sequence cache misses were consuming significant database time'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-2460360532165293290</id><published>2009-09-28T16:59:00.001-04:00</published><updated>2009-09-28T17:03:37.775-04:00</updated><title type='text'>Flashback Table to a time in the past</title><content type='html'>&lt;span style="font-family:Lucida Console;font-size:120;"&gt;&lt;br /&gt;Scenario:  Someone deleted some data accidently from a database accidently and now wants to get back the data erroneously deleted.&lt;br /&gt;&lt;br /&gt;Solution:  You can do flashback table to a particular point in time.&lt;br /&gt;(Flashback Table uses undo segments to retrieve data, so all depends if the data is still there)&lt;br /&gt;&lt;br /&gt;Login as schema owner and enable the row movement.&lt;br /&gt;&lt;br /&gt;SQL&gt; alter table EMPLOYEE enable row movement;&lt;br /&gt;&lt;br /&gt;Get time stamp to which you want to go back and then&lt;br /&gt;&lt;br /&gt;SQL&gt; flashback table EMPLOYEE to timestamp to_timestamp('Jan 15 2009 10:00:00','Mon DD YYYY HH24:MI:SS');&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-2460360532165293290?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/2460360532165293290/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=2460360532165293290' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/2460360532165293290'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/2460360532165293290'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2009/09/flashback-table-to-time-in-past.html' title='Flashback Table to a time in the past'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-1909269762690798046</id><published>2009-09-28T16:36:00.000-04:00</published><updated>2009-09-28T16:37:16.588-04:00</updated><title type='text'>Find all files having the string in Linux</title><content type='html'>&lt;span style="font-family:Lucida Console;font-size:120;"&gt;&lt;br /&gt;To Find all files having the string "SPECIALMAIL"&lt;br /&gt;&lt;br /&gt;find . -exec grep -i -l "SPECIALMAIL" {} \;&lt;br /&gt;&lt;br /&gt;-i =&gt; Ignore Case&lt;br /&gt;&lt;br /&gt;-l =&gt; List file names only&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-1909269762690798046?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/1909269762690798046/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=1909269762690798046' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/1909269762690798046'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/1909269762690798046'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2009/09/find-all-files-having-string-in-linux.html' title='Find all files having the string in Linux'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-3008947076215763822</id><published>2009-09-28T16:30:00.004-04:00</published><updated>2009-10-06T13:18:55.387-04:00</updated><title type='text'>DataPump Command EXCLUDE/INCLUDE/REMAP_SCHEMA</title><content type='html'>&lt;span style="font-family:Lucida Console;font-size:120;"&gt;&lt;br /&gt;Export the schema but leave two of the big tables out.&lt;br /&gt;&lt;br /&gt;expdp scott/tiger DIRECTORY=DATA_PUMP dumpfile=scott%u.dmp filesize=5G JOB_NAME=SCOTT_J1 SCHEMAS=SCOTT EXCLUDE=TABLE:\"IN \(\'EMPLOYEE\', \'DEPT\'\)\"&lt;br /&gt;&lt;br /&gt;You exported from SCOTT schema and now wanted to import some tables into a different schema (SMITH) and into different tablespaces&lt;br /&gt;&lt;br /&gt;impdp SMITH/PASSWORD directory=data_pump dumpfile=scott%u.dmp REMAP_SCHEMA=SCOTT:SMITH REMAP_TABLESPACE=SCOTT_DATA:SMITH_DATA REMAP_TABLESPACE=SCOTT_IDX:SMITH_IDX TABLES=TABLE1, TABLE2, TABLE3 &lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-3008947076215763822?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/3008947076215763822/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=3008947076215763822' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/3008947076215763822'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/3008947076215763822'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2009/09/datapump-command-to-exclude-some-tables.html' title='DataPump Command EXCLUDE/INCLUDE/REMAP_SCHEMA'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-4771620285890185092</id><published>2009-09-28T16:27:00.001-04:00</published><updated>2009-11-06T11:14:00.321-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='RAC'/><title type='text'>'gcs log flush sync'  resolution</title><content type='html'>&lt;span style="font-family:Lucida Console;font-size:120;"&gt;&lt;br /&gt;1)You fired an update statement on Instance-2. &lt;br /&gt;2)However, the request for desired blocks was gone to Instance-1. So Instance-2 was waiting on 'gc cr request'. &lt;br /&gt;3)Instance-1 had the requested blocks but before it ships the blocks to Instance-2, it need to flush the changes from current block to redo logs on disks. Until this is done Instance-2 waits on event - 'gcs log flush sync'.&lt;br /&gt;&lt;br /&gt;The cause of this wait event 'gcs log flush sync' is mainly - Redo log IO performance.&lt;br /&gt;&lt;br /&gt;To avoid this problem you need to =&lt;br /&gt;1)Improve the Redo log I/o performance.&lt;br /&gt;2) Set undersore parameter "_cr_server_log_flush" =false.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-4771620285890185092?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/4771620285890185092/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=4771620285890185092' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/4771620285890185092'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/4771620285890185092'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2009/09/gcs-log-flush-sync-resolution.html' title='&apos;gcs log flush sync&apos;  resolution'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-7488739969645904327</id><published>2009-09-28T16:24:00.004-04:00</published><updated>2009-11-06T11:13:52.089-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='RAC'/><title type='text'>Performance - Isolating Waits in a RAC environment</title><content type='html'>&lt;span style="font-family:Lucida Console;font-size:120;"&gt;&lt;br /&gt;Performance - Isolating Waits in a RAC environment.&lt;br /&gt;&lt;br /&gt;Determine the snap IDs you are interested in&lt;br /&gt;&lt;br /&gt;For example, to obtain a list of snap IDs from the previous day, execute the following SQL:&lt;br /&gt;&lt;br /&gt;SQL&gt; SELECT snap_id, begin_interval_time FROM dba_hist_snapshot WHERE TRUNC(begin_interval_time) = TRUNC(sysdate-1) ;&lt;br /&gt;&lt;br /&gt;Step 1 :&lt;br /&gt;--------&lt;br /&gt;Identify the Wait Class&lt;br /&gt;&lt;br /&gt;select wait_class_id, wait_class, count(*) cnt&lt;br /&gt;from dba_hist_active_sess_history&lt;br /&gt;where snap_id between &amp;1 and &amp;2&lt;br /&gt;group by wait_class_id, wait_class&lt;br /&gt;order by 3;&lt;br /&gt;2723168908    Idle                        1&lt;br /&gt;3290255840    Configuration               9&lt;br /&gt;3386400367    Commit                      90&lt;br /&gt;4108307767    System I/O                  149&lt;br /&gt;3875070507    Concurrency                 182&lt;br /&gt;1740759767    User I/O                    184&lt;br /&gt;1893977003    Other                       244&lt;br /&gt;4217450380    Application                 365&lt;br /&gt;2000153315    Network                     475&lt;br /&gt;[NULL]  [NULL]                            916&lt;br /&gt;3871361733  Cluster                       1844  &lt;br /&gt;           &lt;br /&gt;Step 2&lt;br /&gt;-------&lt;br /&gt;Identify the event_id associated with above wait class ID&lt;br /&gt;select event_id, event, count(*) cnt from dba_hist_active_sess_history&lt;br /&gt;where snap_id between 18231 and 18232 and wait_class_id=3871361733&lt;br /&gt;group by event_id, event&lt;br /&gt;order by 3;  &lt;br /&gt;EVENT_ID      EVENT                             COUNT(*)&lt;br /&gt;1742950045    gc current retry                  1&lt;br /&gt;3897775868    gc current multi block request    1&lt;br /&gt;512320954     gc cr request                     4&lt;br /&gt;661121159     gc cr multi block request         9&lt;br /&gt;2685450749    gc current grant 2-way            11&lt;br /&gt;3201690383    gc cr grant 2-way                 18&lt;br /&gt;1457266432    gc current split                  27&lt;br /&gt;3046984244    gc cr block 3-way                 41&lt;br /&gt;111015833     gc current block 2-way            62&lt;br /&gt;3570184881    gc current block 3-way            62&lt;br /&gt;737661873     gc cr block 2-way                 67&lt;br /&gt;2277737081    gc current grant busy             95&lt;br /&gt;1520064534    gc cr block busy                  235&lt;br /&gt;2701629120    gc current block busy             396&lt;br /&gt;1478861578    gc buffer busy                    815&lt;br /&gt;&lt;br /&gt;Step 3&lt;br /&gt;-------&lt;br /&gt;Identify the SQL_ID associated with the above event_id&lt;br /&gt;select 'gc buffer busy' ,sql_id, count(*) cnt from dba_hist_active_sess_history&lt;br /&gt;where snap_id between 18231 and 18232&lt;br /&gt;and event_id in (1478861578)&lt;br /&gt;group by sql_id having count(*) &gt; 55&lt;br /&gt;UNION&lt;br /&gt;select 'gc current block busy',sql_id, count(*) cnt from dba_hist_active_sess_history&lt;br /&gt;where snap_id between 18231 and 18232&lt;br /&gt;and event_id in (2701629120)&lt;br /&gt;group by sql_id having count(*) &gt; 55&lt;br /&gt;UNION&lt;br /&gt;select 'gc cr block busy',sql_id, count(*) cnt from dba_hist_active_sess_history&lt;br /&gt;where snap_id between 18231 and 18232&lt;br /&gt;and event_id in (1520064534)&lt;br /&gt;group by sql_id having count(*) &gt; 55&lt;br /&gt;order by 2 ;&lt;br /&gt;&lt;br /&gt;Wait Event                          SQL ID                                waits&lt;br /&gt;--------------------------------------------------------------------------------------&lt;br /&gt;gc buffer busy                      5qwhj3nru2jtq                         765&lt;br /&gt;gc current block busy               5qwhj3nru2jtq                         332     &lt;br /&gt;           &lt;br /&gt;Step 4 :&lt;br /&gt;--------&lt;br /&gt;Identify the SQL statement associated with the above SQL ID&lt;br /&gt;select sql_id,sql_text from dba_hist_sqltext where sql_id in ('5qwhj3nru2jtq')&lt;br /&gt;Output:&lt;br /&gt;INSERT INTO Component_attrMap (Component_id, key, value) VALUES (:1, :2, :3)&lt;br /&gt;Step 5 :&lt;br /&gt;--------&lt;br /&gt;Identify the object associated with the above statement&lt;br /&gt;select current_obj#, count(*) cnt from dba_hist_active_sess_history&lt;br /&gt;where snap_id between  18231 and 18232&lt;br /&gt;and event_id in (1478861578,2701629120)and sql_id='5qwhj3nru2jtq'&lt;br /&gt;group by current_obj#&lt;br /&gt;order by 2;  &lt;br /&gt;&lt;br /&gt;Obj #                         Count(*)&lt;br /&gt;67818                         1&lt;br /&gt;67988                         1096&lt;br /&gt;&lt;br /&gt;Step 6 :&lt;br /&gt;-------&lt;br /&gt;Identify the Object associated with the above Object ID&lt;br /&gt;select object_id, owner, object_name, subobject_name, object_type from dba_objects&lt;br /&gt;where object_id in (67988);&lt;br /&gt;OBJECT_ID         OWNER          OBJECT_NAME           SUBOBJECT_NAME&lt;br /&gt;---------         -----          -------------         --------------&lt;br /&gt;67988             SCOTT          COMP_ID_INDX1         INDEX&lt;br /&gt;&lt;br /&gt;In this case creating a REVERSE KEY index provided the required solution.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-7488739969645904327?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/7488739969645904327/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=7488739969645904327' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/7488739969645904327'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/7488739969645904327'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2009/09/performance-isolating-waits-in-rac.html' title='Performance - Isolating Waits in a RAC environment'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-8751739887008411510</id><published>2009-09-25T15:14:00.005-04:00</published><updated>2009-11-06T11:14:07.443-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='RAC'/><title type='text'>Copy CRS Home from one node to another</title><content type='html'>&lt;span style="font-family:Lucida Console;font-size:120;"&gt;&lt;br /&gt;It for some reason your CRS_HOME is messed up on node node and you unable to bring up the 'crs' then you can copy the CRS_HOME from the working node and copy it onto the node having non-working CRS_HOME.&lt;br /&gt;&lt;br /&gt;tar the CRS_HOME from working node to non-working node, un-tar it and make the following change.&lt;br /&gt;In the file $CRS_HOME/inventory/ContentsXML/oraclehomeproperties.xml&lt;br /&gt;look for LOCAL_NODE NAME and change it to the node name where you have un-tar'ed the CRS_HOME&lt;br /&gt;&lt;br /&gt; CLUSTER_INFO&gt;&lt;br /&gt;      LOCAL_NODE NAME="rklx2"/&gt;&lt;br /&gt;      NODE_LIST&gt;&lt;br /&gt;         NODE NAME="rklx1"/&gt;&lt;br /&gt;         NODE NAME="rklx2"/&gt;&lt;br /&gt;&lt;br /&gt;Also make sure under /etc/init.d the following files have fully qualified CRS and ORACLE Home values, if not, replace the variables with actual values.&lt;br /&gt;&lt;br /&gt;init.cssd&lt;br /&gt;init.evmd&lt;br /&gt;init.crsd&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-8751739887008411510?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/8751739887008411510/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=8751739887008411510' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/8751739887008411510'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/8751739887008411510'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2009/09/copy-crs-home-from-one-node-to-another.html' title='Copy CRS Home from one node to another'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-5027175571853228535</id><published>2009-09-25T11:51:00.003-04:00</published><updated>2009-09-25T13:01:21.772-04:00</updated><title type='text'>How to Manually remove the OEM Agent</title><content type='html'>&lt;span style="font-family:Lucida Console;font-size:120;"&gt;&lt;br /&gt;How to Manually remove the OEM Agent&lt;br /&gt;&lt;br /&gt;Purpose and Scope: You are trying to de-install the old agent and then re-install the newer version of the Agent and running into various issues.&lt;br /&gt;&lt;br /&gt;Best Method:&lt;br /&gt;1) Stop the Agent (all nodes in case of RAC)&lt;br /&gt;2) Go to OEM Grid Control and remove all targets associated with the host/database to be removed, which includes databases, listeners, hosts, agents.&lt;br /&gt;3) Make sure to verify from the OEM Grid Control that the targets you were trying to remove are completely removed. Try looking up from Targets=&gt;All Targets and search for the name and you should NOT see any results.&lt;br /&gt;4) Go to the $AGENT_HOME and remove Agent home from Linux/Unix box.&lt;br /&gt;a) $ rm –rf agent10g&lt;br /&gt;b) $ rm –rf agent10gInventory&lt;br /&gt;c) $ rm –f $TNS_ADMIN/oraInst.agent10g.&lt;SID_OR_CLUSTER_NAME&gt;.loc&lt;br /&gt;&lt;br /&gt;If you want to re-install the agent, the re-install of the agent should work without issues but if for some reason the above does not work, try executing the following steps to manually remove the agent.&lt;br /&gt;&lt;br /&gt;You can also remove the Agent by following the Metalink Note:436679.1 on&lt;br /&gt;How to Remove an Orphaned Target Using the EMDiag Kit 10.2&lt;br /&gt;&lt;br /&gt;The above should do the trick but sometimes it is not completely removed from the repository and when you install the newer version it gives various erros.&lt;br /&gt;&lt;br /&gt;The following method should remove it completely&lt;br /&gt;&lt;br /&gt;1) Login to oemdb as SYS and  -&lt;br /&gt;&lt;br /&gt;select * from sysman.mgmt_targets_delete &lt;br /&gt;where delete_complete_time is NULL &lt;br /&gt;order by target_name&lt;br /&gt;&lt;br /&gt;This lists all target deletions that did not complete for some reason (normally the delet_complete_time would show the timestamp of when the target was removed.&lt;br /&gt;&lt;br /&gt;2) Find all targets that belong to the system you are having issues with &lt;br /&gt;&lt;br /&gt;3) Run the following to complete the deletion –&lt;br /&gt;&lt;br /&gt;exec mgmt_admin.delete_target('rklx1_rk_crs','cluster');&lt;br /&gt;where ‘'rklx1_rk_crs' is the clustername and also is the “target_name column from the earlier query and “cluster” is the target_type&lt;br /&gt;&lt;br /&gt;4) If this doesn’t work then do this –&lt;br /&gt;Log into oemdb and run –&lt;br /&gt;&lt;br /&gt;alter index SYSMAN.MGMT_STRING_METRIC_HISTORY_PK rebuild;&lt;br /&gt;&lt;br /&gt;5) Then remove it using this procedure –&lt;br /&gt;exec mgmt_admin.delete_target_internal('rklx1_rk_crs','cluster');&lt;br /&gt;&lt;br /&gt;For the agent you could try –&lt;br /&gt;&lt;br /&gt;exec mgmt_admin.cleanup_agent(’host.domain:3872’);&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-5027175571853228535?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/5027175571853228535/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=5027175571853228535' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/5027175571853228535'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/5027175571853228535'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2009/09/all-targets-and-search-for-name-and-you.html' title='How to Manually remove the OEM Agent'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-1025092122747110074</id><published>2009-07-29T14:57:00.003-04:00</published><updated>2009-11-06T11:14:26.638-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='RAC'/><title type='text'>Script to find elapsed time based on a SQL_ID from DBA_HIST Tables</title><content type='html'>&lt;span style="font-family:Lucida Console;font-size:120;"&gt;&lt;br /&gt;Script to find execution time based on a SQL_ID&lt;br /&gt;&lt;br /&gt;SET LINESIZE 120&lt;br /&gt;SET PAGESIZE 1000&lt;br /&gt;COL executions FOR 999,999,999&lt;br /&gt;COL elapsed_time FOR 999,999,999,999&lt;br /&gt;COL avg_ms FOR 999999.99&lt;br /&gt;COL min_ms FOR 999999.99&lt;br /&gt;COL max_ms FOR 999999.99&lt;br /&gt;SELECT&lt;br /&gt;       TO_CHAR(TRUNC(snapshot.begin_interval_time + 1/8,'HH24'),'DD-MON-YYYY HH24:MI:SS') || ' EDT' SNAP_BEGIN,&lt;br /&gt;       sqlstat.instance_number,&lt;br /&gt;       SUM(sqlstat.executions_delta) executions,&lt;br /&gt;       MIN(sqlstat.elapsed_time_delta / sqlstat.executions_delta / 1000) min_ms,&lt;br /&gt;       MAX(sqlstat.elapsed_time_delta / sqlstat.executions_delta / 1000) max_ms,&lt;br /&gt;       SUM(sqlstat.elapsed_time_delta) / SUM(sqlstat.executions_delta) / 1000 avg_Ms&lt;br /&gt;  FROM&lt;br /&gt;       dba_hist_sqlstat sqlstat,&lt;br /&gt;       dba_hist_snapshot snapshot&lt;br /&gt; WHERE&lt;br /&gt;       sqlstat.dbid = snapshot.dbid&lt;br /&gt;   AND sqlstat.instance_number = snapshot.instance_number&lt;br /&gt;   AND sqlstat.snap_id = snapshot.snap_id&lt;br /&gt;   AND sqlstat.sql_id = '&amp;1'&lt;br /&gt;   AND snapshot.begin_interval_time &gt;= TO_DATE('27-JUL-2009 21:00:00','DD-MON-YYYY HH24:MI:SS')&lt;br /&gt; GROUP&lt;br /&gt;       BY TO_CHAR(TRUNC(snapshot.begin_interval_time + 1/8,'HH24'),'DD-MON-YYYY HH24:MI:SS') || ' EDT',&lt;br /&gt;          sqlstat.instance_number&lt;br /&gt; ORDER&lt;br /&gt;       BY snap_begin&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-1025092122747110074?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/1025092122747110074/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=1025092122747110074' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/1025092122747110074'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/1025092122747110074'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2009/07/script-to-find.html' title='Script to find elapsed time based on a SQL_ID from DBA_HIST Tables'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-5137547192704687542</id><published>2009-07-01T08:27:00.003-04:00</published><updated>2009-07-01T08:33:43.531-04:00</updated><title type='text'>Hash-Partitioned Reverse-Key Index</title><content type='html'>&lt;span style="font-family:Lucida Console;font-size:120;"&gt;&lt;br /&gt;Hash Paritioned global indexes provides higher throughput for applications with large numbers of concurrent insertions. In some applications, new insertions into the indexes are towards the right side of the index, usually this happends when you  have an index column that is a monotonically increasing sequence number. Hash Partitioned indexes can improve performance in situations where a small number of nonpartitioned index's leaf blocks are experiencing high contention in an OLTP environment. Queries that use with an equality or IN operator in the WHERE clause can benefit significantly from a hash-partitioned global index.&lt;br /&gt;&lt;br /&gt;For monotonically increasing key situatins, reverse keying the index will spread the activity, but only across the highest partition. Hash Partitioning will distribute the workload across all the index partitions, but still with contention at each index's right edge, reverse-key hash partitioning will not only distribute the activity across all the partitions, but also spread it within each partition.&lt;br /&gt;&lt;br /&gt;Create Index CUSTOMER_IDX1 on CUSTOMER(ZIP_CODE)&lt;br /&gt;global partition by hash(ZIP_CODE)&lt;br /&gt;(partition P1 tablespace TBS_INDEX_1,&lt;br /&gt;partition P2 tablespace TBS_INDEX_2,&lt;br /&gt;partition P3 tablespace TBS_INDEX_3,&lt;br /&gt;partition P4 tablespace TBS_INDEX_4)&lt;br /&gt;REVERSE&lt;br /&gt;/&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-5137547192704687542?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/5137547192704687542/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=5137547192704687542' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/5137547192704687542'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/5137547192704687542'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2009/07/hash-partitioned-reverse-key-index.html' title='Hash-Partitioned Reverse-Key Index'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-7373947832823927839</id><published>2009-04-03T09:57:00.005-04:00</published><updated>2009-04-03T11:17:23.857-04:00</updated><title type='text'>Setup LISTENER (listener.ora)</title><content type='html'>&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-7373947832823927839?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/7373947832823927839/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=7373947832823927839' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/7373947832823927839'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/7373947832823927839'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2009/04/setup-listener-listenerora.html' title='Setup LISTENER (listener.ora)'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-5403911077614905437</id><published>2009-02-25T08:34:00.001-05:00</published><updated>2009-02-25T08:36:09.271-05:00</updated><title type='text'>Query to find un-indexed Foreigh Key Constraints</title><content type='html'>&lt;span style="font-family:courier new;font-size:85%;"&gt;SELECT * FROM (SELECT c.table_name, cc.column_name, cc.position column_position   FROM   user_constraints c, user_cons_columns cc   &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;WHERE  c.constraint_name = cc.constraint_name   AND    c.constraint_type = 'R'   MINUS   SELECT i.table_name, ic.column_name, ic.column_position   &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;FROM   user_indexes i, user_ind_columns ic   &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;WHERE  i.index_name = ic.index_name   )&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Lucida Console;font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;ORDER BY table_name, column_position ;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:Lucida Console;font-size:85%;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-5403911077614905437?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/5403911077614905437/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=5403911077614905437' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/5403911077614905437'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/5403911077614905437'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2009/02/query-to-find-un-indexed-foreigh-key.html' title='Query to find un-indexed Foreigh Key Constraints'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-112981919978038454</id><published>2008-11-24T13:30:00.003-05:00</published><updated>2008-11-24T13:42:23.948-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='RAC'/><title type='text'>Oracle Interconnect RAC</title><content type='html'>&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:verdana;"&gt;&lt;strong&gt;Cluster Private Interconnect&lt;/strong&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;The cluster interconnect is a high bandwidth, low latency communication facility that connects each node to other nodes in the cluster and routes messages among the nodes. It is a key component in building the RAC system.&lt;br /&gt;&lt;br /&gt;In case of RAC database, the cluster interconnect is used for the following high-level functions:&lt;br /&gt;&lt;br /&gt;Monitoring Health, Status, and Synchronize messages&lt;br /&gt;Transporting lock management or resource coordination messages&lt;br /&gt;Moving the Cache Buffers (data blocks) from node to node.&lt;br /&gt;&lt;br /&gt;High performance database computing involves distributing the processing across an array of cluster nodes. It requires that the cluster interconnect provide high-data rates and low-latency communication between node processes.&lt;br /&gt;&lt;br /&gt;Here's a few ways to find information about interconnect and troubleshoot any issues...&lt;br /&gt;&lt;br /&gt;1. &lt;span style="font-family:courier new;"&gt;select * from gv$cluster_interconnects ;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;2. Using the clusterware command oifcfg:&lt;br /&gt;   &lt;span style="font-family:courier new;"&gt;$ oifcfg getif&lt;br /&gt;  eth2 100.100.90.0 global public&lt;br /&gt;  eth0 192.168.10.0 global cluster_interconnect&lt;br /&gt;  eth1 192.168.11.0 global cluster_interconnect&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;3. Using oradebug ipc:&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  sqlplus “/ as sysdba”&lt;br /&gt;  SQL&gt; oradebug setmypid&lt;br /&gt;  SQL&gt; oradebug ipc Information written to trace file.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;The above command would dump a trace to user_dump_dest. The last few lines of the trace would indicate the IP of the cluster interconnect. Below is a sample output.&lt;br /&gt;From the trace file on node1:&lt;br /&gt;&lt;br /&gt;SSKGXPT 0×5edf558 flags SSKGXPT_READPENDING socket no 9 IP 192.168.11.1 UDP 18852&lt;br /&gt;From the trace file on node2:&lt;br /&gt;&lt;br /&gt;SSKGXPT 0×5edf558 flags SSKGXPT_READPENDING socket no 9 IP 192.168.10.2 UDP 38967&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt; &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-112981919978038454?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/112981919978038454/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=112981919978038454' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/112981919978038454'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/112981919978038454'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2008/11/oracle-interconnect-rac.html' title='Oracle Interconnect RAC'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-1444769825113240938</id><published>2008-09-03T11:10:00.001-04:00</published><updated>2008-09-03T11:13:04.311-04:00</updated><title type='text'>Who is Locking my Object ?</title><content type='html'>&lt;span style="font-family:Lucida Console;font-size:120;"&gt;Find out using this script....&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Lucida Console;font-size:12;"&gt;&lt;br /&gt;SELECT a.sid,a.serial#, a.username,c.os_user_name,a.terminal,c.process,&lt;br /&gt;b.object_id,substr(b.object_name,1,40) object_name&lt;br /&gt;from v$session a, dba_objects b, v$locked_object c&lt;br /&gt;where a.sid = c.session_id&lt;br /&gt;and b.object_id = c.object_id&lt;br /&gt;/&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:Lucida Console;font-size:12;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-1444769825113240938?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/1444769825113240938/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=1444769825113240938' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/1444769825113240938'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/1444769825113240938'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2008/09/who-is-locking-my-object.html' title='Who is Locking my Object ?'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-5155471714167080819</id><published>2008-06-20T15:33:00.002-04:00</published><updated>2008-09-03T11:13:42.592-04:00</updated><title type='text'>How to find Database Import Speed</title><content type='html'>&lt;span style="font-family:Lucida Console;font-size:120;"&gt;&lt;br /&gt;SELECT&lt;br /&gt;SUBSTR(sql_text, INSTR(sql_text,'INTO "'),30) table_name&lt;br /&gt;, rows_processed&lt;br /&gt;, ROUND( (sysdate-TO_DATE(first_load_time,'yyyy-mm-dd hh24:mi:ss'))*24*60,1) minutes&lt;br /&gt;, TRUNC(rows_processed/((sysdate-to_date(first_load_time,'yyyy-mm-dd hh24:mi:ss'))*24*60)) rows_per_minute&lt;br /&gt;FROM&lt;br /&gt;sys.v_$sqlarea&lt;br /&gt;WHERE&lt;br /&gt;sql_text like 'INSERT %INTO "%'&lt;br /&gt;AND command_type = 2&lt;br /&gt;AND open_versions &gt; 0;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-5155471714167080819?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/5155471714167080819/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=5155471714167080819' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/5155471714167080819'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/5155471714167080819'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2008/06/how-to-find-import-speed.html' title='How to find Database Import Speed'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-8032263283788652084</id><published>2008-06-11T13:51:00.001-04:00</published><updated>2008-06-11T13:54:06.216-04:00</updated><title type='text'>Oracle Security White Papers</title><content type='html'>&lt;span style="font-family:Lucida Console;font-size:120;"&gt;Nice Reading about Oracle Security &lt;/span&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="font-family:Lucida Console;font-size:120;"&gt;www.ngssoftware.com/research/papers&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-8032263283788652084?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.ngssoftware.com/research/papers/' title='Oracle Security White Papers'/><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/8032263283788652084/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=8032263283788652084' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/8032263283788652084'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/8032263283788652084'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2008/06/oracle-security-white-papers.html' title='Oracle Security White Papers'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-9111846281630942641</id><published>2008-05-07T07:48:00.000-04:00</published><updated>2008-05-07T08:35:48.582-04:00</updated><title type='text'>How to find "user commits" during a user session</title><content type='html'>&lt;span style="font:normal 12pt Trebuchet MS:[color=#696969]"&gt;&lt;br /&gt;You can find number of "user commits" during a particular user session. Just get the SID of the user for which you want to track the number of commits.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Lucida Console;font-size:120;"&gt;&lt;br /&gt;set lines 120&lt;br /&gt;set pages 1000&lt;br /&gt;col name format a25&lt;br /&gt;select a.*,b.* from sys.v_$sesstat a, sys.v_$statname b&lt;br /&gt;where a.STATISTIC#=b.STATISTIC#&lt;br /&gt;and b.name like '%user%'&lt;br /&gt;and a.sid=&amp;amp;input_sid&lt;br /&gt;/&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-9111846281630942641?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/9111846281630942641/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=9111846281630942641' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/9111846281630942641'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/9111846281630942641'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2008/05/how-to-find-user-commits-during-user.html' title='How to find &quot;user commits&quot; during a user session'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-7002643816025357148</id><published>2008-02-29T22:51:00.002-05:00</published><updated>2009-07-01T08:35:13.389-04:00</updated><title type='text'>Basic VCS Commands</title><content type='html'>&lt;div&gt;&lt;font face="Verdana" size="1"&gt;BASIC VCS COMMANDS&lt;br /&gt;&lt;br /&gt;SERVICE GROUPS AND RESOURCE OPERATIONS&lt;br /&gt;&lt;br /&gt;Configuring service groups hagrp –add|-delete|-online|-offline group_name&lt;br /&gt;Modifying resources hares –add|-delete res_name type group&lt;br /&gt;hares –online|-offline res_name –sys system_name&lt;br /&gt;Modifying agents haagent –start|-stop agent_name –sys system_name&lt;br /&gt;BASIC CONFIGURATION OPERATIONS&lt;br /&gt;Service Goups hagrp -modify group_name attribute_name value&lt;br /&gt;hagrp –list group_name&lt;br /&gt;hagrp –value attribute_name&lt;br /&gt;hares -modify res_name attribute_name value&lt;br /&gt;hares -link res_name res_name&lt;br /&gt;Agents haagent -display agent_name –sys system_name&lt;br /&gt;hatype –modify&lt;br /&gt;VCS ENGINE OPERATIONS&lt;br /&gt;Starting had hastart –force|–stale system_name&lt;br /&gt;hasys –force system_name&lt;br /&gt;Stopping had hastop –local|-all|-force|-evacuate&lt;br /&gt;hastop –sys system_name&lt;br /&gt;Adding Users hauser –add user_name&lt;br /&gt;STATUS AND VERIFICATION&lt;br /&gt;Group Status/Verification hagrp -display group_name|–state|–resource group_name&lt;br /&gt;Resources Status/Verification hares -display res_name&lt;br /&gt;hares –list&lt;br /&gt;hares -probe res_name –sys system_name&lt;br /&gt;Agents Status/Verification haagent –list&lt;br /&gt;haagent -display agent_name –sys system_name&lt;br /&gt;ps –ef|grep agent_name&lt;br /&gt;VCS Status hastatus –group&lt;br /&gt;LLT Status/Verification lltconfig –a list&lt;br /&gt;lltstat|lltshow|lltdump&lt;br /&gt;GAB Status/Verification gabconfig –a&lt;br /&gt;gabdiskhb –l&lt;br /&gt;COMMUNICATION&lt;br /&gt;Starting and Stopping LLT lltconfig –c|U&lt;br /&gt;Starting and Stopping GAB gabconfig –c –n #seed number&lt;br /&gt;gabconfig –U&lt;br /&gt;ADMINISTERATION&lt;br /&gt;Administering Group Services hagrp –clear|-flush|-switch group_name –sys system_name&lt;br /&gt;Administering Resources hares –clear|-probe res_name –sys system_name&lt;br /&gt;Administering Agents haagent -list&lt;br /&gt;haagent -display agent_name –sys system_name&lt;br /&gt;Verify Configuration hacf –verify &lt;/font&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-7002643816025357148?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/7002643816025357148/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=7002643816025357148' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/7002643816025357148'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/7002643816025357148'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2008/02/basic-vcs-commands.html' title='Basic VCS Commands'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-2171706039649374523</id><published>2008-01-28T09:56:00.001-05:00</published><updated>2009-10-07T15:10:36.617-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='RAC'/><title type='text'>How to find name of your cluster in RAC environment</title><content type='html'>To find out the value of your CLUSTER_NAME from CRS (OCR), do the following from the CRS_HOME:&lt;br /&gt;&lt;br /&gt;$CRS_HOME/bin/cemutlo -n&lt;br /&gt;&lt;br /&gt;==&gt;&gt; OR&lt;br /&gt;&lt;br /&gt;cd $CRS_HOME/bin&lt;br /&gt;./ocrdump&lt;br /&gt;&lt;br /&gt;=&gt; this will create a text file called OCRDUMPFILE&lt;br /&gt;open that file and look for this entry&lt;br /&gt;[SYSTEM.css.clustername]&lt;br /&gt;ORATEXT : crs_cluster&lt;br /&gt;&lt;br /&gt;In this case, "crs_cluster" is the cluster name.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-2171706039649374523?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/2171706039649374523/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=2171706039649374523' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/2171706039649374523'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/2171706039649374523'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2008/01/how-to-find-name-of-your-cluster-in-rac.html' title='How to find name of your cluster in RAC environment'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-4184905011221208716</id><published>2007-12-19T13:54:00.001-05:00</published><updated>2009-07-01T08:44:26.740-04:00</updated><title type='text'>Foreign Key Constraint Error ORA-02298</title><content type='html'>While trying to create FK on cust_status got the following error.&lt;br /&gt;&lt;span style="font-family:Courier New;font-size:120;"&gt;&lt;br /&gt;ALTER TABLE CUST_STATUS ADD (CONSTRAINT CUST_STATUS_FK FOREIGN KEY (LOGIN) REFERENCES USERS(LOGIN))&lt;br /&gt;                                      *&lt;br /&gt;ERROR at line 1:&lt;br /&gt;ORA-02298: cannot validate (SCOTT.CUST_STATUS_FK) - parent keys not found&lt;br /&gt;&lt;br /&gt;SQL&gt; desc cust_status&lt;br /&gt; Name                                      Null?    Type&lt;br /&gt; ----------------------------------------- -------- ----------------------------&lt;br /&gt; CUSTID                                    NOT NULL NUMBER(8)&lt;br /&gt; TIMESTAMP                                 NOT NULL DATE&lt;br /&gt; STATUS                                    NOT NULL VARCHAR2(35)&lt;br /&gt;&lt;strong&gt; LOGIN                                              VARCHAR2(20)&lt;/strong&gt; ID                                                 NUMBER&lt;br /&gt;&lt;br /&gt;SQL&gt; desc users&lt;br /&gt; Name                                      Null?    Type&lt;br /&gt; ----------------------------------------- -------- ----------------------------&lt;br /&gt;&lt;strong&gt; LOGIN                                     NOT NULL VARCHAR2(20)&lt;/strong&gt; PASSWORD                                           VARCHAR2(30)&lt;br /&gt; LAST_NAME                                          VARCHAR2(50)&lt;br /&gt; FIRST_NAME                                         VARCHAR2(50)&lt;br /&gt; EMAIL                                              VARCHAR2(100)&lt;br /&gt; ACTIVE                                             CHAR(1)&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;To find out which rows are the problem rows,&lt;br /&gt;&lt;span style="font-family:Lucida Console;font-size:120;"&gt;&lt;br /&gt;SQL&gt; select custid,login from cust_status a &lt;br /&gt;     where not exists (select 'x' from users where login = a.login);&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;You can delete the data using...&lt;br /&gt;&lt;span style="font-family:Lucida Console;font-size:120;"&gt;&lt;br /&gt;SQL&gt; delete from cust_status &lt;br /&gt;     where login is null or login not in ( select login from users )&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Now you should be able to create the FK constraint.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-4184905011221208716?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/4184905011221208716/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=4184905011221208716' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/4184905011221208716'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/4184905011221208716'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2007/12/foreign-key-constraint.html' title='Foreign Key Constraint Error ORA-02298'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-3543933764281484659</id><published>2007-12-07T15:03:00.000-05:00</published><updated>2007-12-07T15:09:19.058-05:00</updated><title type='text'>How to test Oracle Apps after a patch</title><content type='html'>How to test Oracle Applications after any maintenance, for example patch&lt;br /&gt;&lt;br /&gt;Access the Application Home Page (http://host_name:port)&lt;br /&gt;This verifies Oracle HTTP Server is up and running.&lt;br /&gt;&lt;br /&gt;Login to Apps as "SYSADMIN"&lt;br /&gt;If you can get to that page, it verifies JSERV is up and running as this page is served by JServ&lt;br /&gt;&lt;br /&gt;Once you are able to login to the Apps, this verifies your connection to the database is working.&lt;br /&gt;&lt;br /&gt;Click on Help button on the top right portion, if you can access the help page, it verifies you connection from the front end to the database is working as that page is served by the database.&lt;br /&gt;&lt;br /&gt;Click on the Concurrent Manager, if you get to the page where it shows all the jobs, it verifies Forms is up and running. Try submitting a job and see if it runs successfully, it proves Concurrent Manager is up and running.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-3543933764281484659?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/3543933764281484659/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=3543933764281484659' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/3543933764281484659'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/3543933764281484659'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2007/12/how-to-test-oracle-apps-after-patch.html' title='How to test Oracle Apps after a patch'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-1852899147792313128</id><published>2007-12-06T15:10:00.000-05:00</published><updated>2007-12-06T15:23:20.236-05:00</updated><title type='text'>DG Failover Steps</title><content type='html'>Purpose : Failover to standby database in case the primary database server crashes.&lt;br /&gt;Assumptions : Primary Database SID : CHDP1&lt;br /&gt;              Standby Database SID : CHDS1&lt;br /&gt;flashback is on&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Now the Primary datbase server crashes and no longer accessible.&lt;br /&gt;&lt;br /&gt;Step by Step Instructions.&lt;br /&gt;&lt;br /&gt;Login to standby database (CHDS1)&lt;br /&gt;SQL&gt; alter database recover managed standby database finish force;&lt;br /&gt;SQL&gt; alter database commit to switchover to primary;&lt;br /&gt;&lt;br /&gt;In very urgent situations when you can not wait for some of the logs to be applied.&lt;br /&gt;SQL&gt; alter database activate standby database;&lt;br /&gt;&lt;br /&gt;Now at this point in time your standby database (CHDS1) becomes primary databse.&lt;br /&gt;&lt;br /&gt;After few hours, your original primary database server (which has CHDP1 database) comes back up and you wanted to make it (CHDP1) a standby database.&lt;br /&gt;&lt;br /&gt;Login to CHDS1&lt;br /&gt;&lt;br /&gt;SQL&gt; select to_char(standby_became_primary_scn) from v$database;&lt;br /&gt;TO_CHAR(STANDBY_BECAME_PRIMARY_SCN)&lt;br /&gt;--------------------------------------------------&lt;br /&gt;1234567&lt;br /&gt;&lt;br /&gt;Login to CHDP1&lt;br /&gt;SQL&gt; startup mount;&lt;br /&gt;SQL&gt; flashback database to scn 1234567;&lt;br /&gt;SQL&gt; alter database convert to physical standby;&lt;br /&gt;SQL&gt; shutdown immediate;&lt;br /&gt;SQL&gt; startup mount;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-1852899147792313128?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/1852899147792313128/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=1852899147792313128' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/1852899147792313128'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/1852899147792313128'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2007/12/dg-failover-steps.html' title='DG Failover Steps'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-4490412446627246043</id><published>2007-12-05T10:37:00.000-05:00</published><updated>2007-12-05T10:40:58.248-05:00</updated><title type='text'>Check Kernel Parameters before installing software</title><content type='html'>&lt;strong&gt;To check Kernel parameter for Linux before installing oracle&lt;/strong&gt;(you can add additional stuff as needed)&lt;br /&gt;----- start check_OS_linux.sh -----------&lt;br /&gt;echo "Checking kernel parameters..."&lt;br /&gt;/sbin/sysctl -a 2&gt;&amp;1 | grep sem | grep -v error&lt;br /&gt;/sbin/sysctl -a 2&gt;&amp;1 | grep shm | grep -v error&lt;br /&gt;/sbin/sysctl -a 2&gt;&amp;1 | grep file-max | grep -v error&lt;br /&gt;/sbin/sysctl -a 2&gt;&amp;1 | grep ip_local_port_range | grep -v error&lt;br /&gt;/sbin/sysctl -a 2&gt;&amp;1 | grep rmem_ | grep -v error&lt;br /&gt;/sbin/sysctl -a 2&gt;&amp;1 | grep wmem_ | grep -v error&lt;br /&gt;&lt;br /&gt;echo "Checking OS components ..."&lt;br /&gt;rpm -q binutils&lt;br /&gt;rpm -q libaio&lt;br /&gt;rpm -q gcc&lt;br /&gt;rpm -q libstdc++&lt;br /&gt;rpm -q libstdc++-devel&lt;br /&gt;rpm -q gcc-c++&lt;br /&gt;rpm -q glibc&lt;br /&gt;rpm -q gnome-libs&lt;br /&gt;rpm -q make&lt;br /&gt;rpm -q pdksh&lt;br /&gt;rpm -q sysstat&lt;br /&gt;----------------- end script check_OS_linux.sh -----------------&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;To check kernel parameters for Solaris&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;---------------- start script check_OS_solaris.sh ----------------&lt;br /&gt;/sbin/sysctl -a 2&gt;&amp;1 | grep sem | grep -v error&lt;br /&gt;&lt;br /&gt;/sbin/sysctl -a 2&gt;&amp;1 | grep shm | grep -v error&lt;br /&gt;&lt;br /&gt;/sbin/sysctl -a 2&gt;&amp;1 | grep file-max | grep -v error&lt;br /&gt;&lt;br /&gt;/sbin/sysctl -a 2&gt;&amp;1 | grep ip_local_port_range | grep -v error&lt;br /&gt;&lt;br /&gt;/sbin/sysctl -a 2&gt;&amp;1 | grep rmem_ | grep -v error&lt;br /&gt;&lt;br /&gt;/sbin/sysctl -a 2&gt;&amp;1 | grep wmem_ | grep -v error&lt;br /&gt;----------------- end script check_OS_solaris.sh ----------------&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-4490412446627246043?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/4490412446627246043/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=4490412446627246043' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/4490412446627246043'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/4490412446627246043'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2007/12/check-kernel-parameters-before.html' title='Check Kernel Parameters before installing software'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-8029185409993537431</id><published>2007-12-05T08:34:00.000-05:00</published><updated>2007-12-05T08:36:27.043-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='RMAN'/><title type='text'>RMAN Backup types</title><content type='html'>&lt;strong&gt;Full&lt;/strong&gt;&lt;br /&gt;A backup of a datafile that includes every allocated block in the file being backed up. A full backup of a datafile can be an image copy, in which case every data block is backed up. It can also be stored in a backup set, in which case datafile blocks not in use may be skipped, according to certain rules.&lt;br /&gt;&lt;br /&gt;A full backup cannot be part of an incremental backup strategy; that is, it cannot be the parent for a subsequent incremental backup.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Incremental&lt;/strong&gt;&lt;br /&gt;An incremental backup is either a level 0 backup, which includes every block in the file except blocks compressed out because they have never been used, or a level 1 backup, which includes only those blocks that have been changed since the parent backup was taken.&lt;br /&gt;&lt;br /&gt;A level 0 incremental backup is physically identical to a full backup. The only difference is that the level 0 backup is recorded as an incremental backup in the RMAN repository, so it can be used as the parent for a level 1 backup.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-8029185409993537431?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/8029185409993537431/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=8029185409993537431' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/8029185409993537431'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/8029185409993537431'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2007/12/rman-backup-types.html' title='RMAN Backup types'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-1817676958800936962</id><published>2007-11-17T06:24:00.001-05:00</published><updated>2007-11-17T06:25:25.991-05:00</updated><title type='text'>How to setup VIP (Virtual IP) in a DG setup</title><content type='html'>I will write soon...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-1817676958800936962?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/1817676958800936962/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=1817676958800936962' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/1817676958800936962'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/1817676958800936962'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2007/11/how-to-setup-vip-in-dg-setup.html' title='How to setup VIP (Virtual IP) in a DG setup'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-1398372264234867306</id><published>2007-11-17T06:06:00.000-05:00</published><updated>2007-11-17T06:13:33.880-05:00</updated><title type='text'>How to start databases in a DG setup</title><content type='html'>Scenario : Power outage at your data center brought down the databases in the DG configuration.&lt;br /&gt;&lt;br /&gt;Solution : Start up the primary database&lt;br /&gt;           SQL&gt; startup&lt;br /&gt;         : startup mount the standby database&lt;br /&gt;           SQL&gt; startup mount&lt;br /&gt;&lt;br /&gt;Login to Primary node and start dgmgrl&lt;br /&gt;           DGMGRL&gt; connect sys/password&lt;br /&gt;           DGMGRL&gt; enable configuration;&lt;br /&gt;           DGMGRL&gt; enable fast_start failover;&lt;br /&gt;           DGMGRL&gt; show configuration;&lt;br /&gt;&lt;br /&gt;It should show you the primary database and physical standby database&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-1398372264234867306?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/1398372264234867306/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=1398372264234867306' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/1398372264234867306'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/1398372264234867306'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2007/11/how-to-start-databases-in-dg-setup.html' title='How to start databases in a DG setup'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-6171977560638058292</id><published>2007-11-01T14:29:00.000-04:00</published><updated>2007-11-01T14:31:08.131-04:00</updated><title type='text'>Some Important Linux/Unix Commands</title><content type='html'>&lt;P&gt; &lt;/P&gt; &lt;P&gt;&lt;b&gt;How to find bit level in Unix&lt;BR&gt;&lt;/b&gt;$ isainfo -kv&lt;BR&gt;&lt;BR&gt;In Linux&lt;BR&gt;$ uname -a &lt;BR&gt;gives you OS, version and bit level.&lt;BR&gt;&lt;BR&gt;&lt;b&gt;Find out KDE Desktop version:&lt;BR&gt;&lt;/b&gt;konqueror --version&lt;BR&gt;&lt;BR&gt;&lt;b&gt;Find out Gnome Desktop version:&lt;BR&gt;&lt;/b&gt;gnome-panel --version&lt;BR&gt;&lt;BR&gt;&lt;b&gt;Find out Mozilla browser version:&lt;BR&gt;&lt;/b&gt;mozilla --version&lt;BR&gt;&lt;BR&gt;&lt;b&gt;Find out Firefox browser version:&lt;BR&gt;&lt;/b&gt;firefox --version&lt;BR&gt;&lt;BR&gt;&lt;b&gt;Find out current Language:&lt;BR&gt;&lt;/b&gt;set | egrep '^(LANG|LC_)'&lt;BR&gt;&lt;BR&gt;&lt;b&gt;Find out disk space usage:&lt;BR&gt;&lt;/b&gt;df -h&lt;BR&gt;&lt;BR&gt;&lt;b&gt;Find/Estimate file space usage:&lt;BR&gt;&lt;/b&gt;du -h&lt;BR&gt;&lt;BR&gt;&lt;b&gt;Find out version of Linux glibc:&lt;BR&gt;&lt;/b&gt;ls -l /lib/libc-*.so /lib/libc.so*&lt;BR&gt;&lt;BR&gt;&lt;b&gt;Find out user limits:&lt;BR&gt;&lt;/b&gt;ulimit -a&lt;BR&gt;&lt;BR&gt;&lt;b&gt;Find out installed device drivers (modules)&lt;BR&gt;&lt;/b&gt;lsmod&lt;BR&gt;&lt;BR&gt;&lt;b&gt;Find out information about an X server:&lt;BR&gt;&lt;/b&gt;xdpyinfo&lt;BR&gt;It can find out:&lt;BR&gt;• Name of display: &lt;BR&gt;• Version number &lt;BR&gt;• Vendor name (such as The XFree86 Project) &lt;BR&gt;• Vendor release number &lt;BR&gt;• And XFree86 version number &lt;BR&gt;&lt;BR&gt;&lt;b&gt;Find out information about Linux CPU&lt;BR&gt;&lt;/b&gt;cat /proc/cpuinfo&lt;BR&gt;&lt;BR&gt;&lt;b&gt;Find out information about Linux Memory&lt;BR&gt;&lt;/b&gt;cat /proc/meminfo&lt;BR&gt;OR&lt;BR&gt;free -m&lt;BR&gt;OR&lt;BR&gt;free -g&lt;BR&gt;&lt;BR&gt;&lt;b&gt;Find out user shell name:&lt;BR&gt;&lt;/b&gt;ps -p $$ | tail -1 | awk '{ print $4 }'&lt;BR&gt;&lt;BR&gt;&lt;b&gt;Dump Linux kernel variables&lt;BR&gt;&lt;/b&gt;/sbin/sysctl -a&lt;BR&gt;&lt;BR&gt;&lt;b&gt;Find out running Linux kernel version:&lt;BR&gt;&lt;/b&gt;uname -mrs&lt;BR&gt;uname -a&lt;BR&gt;cat /proc/version&lt;BR&gt;&lt;BR&gt;&lt;b&gt;Dump or display memory information and swap information:&lt;BR&gt;&lt;/b&gt;free -m&lt;BR&gt;&lt;BR&gt;&lt;b&gt;Network card and IP address information:&lt;BR&gt;&lt;/b&gt;ifconfig -a&lt;BR&gt;ifconfig -a|less&lt;BR&gt;&lt;BR&gt;Debian / Ubuntu Linux network configuration file (all interface eth0,eth1,…ethN)&lt;BR&gt;more /etc/network/interfaces&lt;BR&gt;Redhat / CentOS / Fedora Linux network configuration file (eth0)&lt;BR&gt;more /etc/sysconfig/network-scripts/ifcfg-eth0&lt;BR&gt;Note replace eth1 for 2nd network card and so on.&lt;BR&gt;&lt;BR&gt;&lt;b&gt;Display routing information&lt;BR&gt;&lt;/b&gt;route -n&lt;BR&gt;route&lt;BR&gt;&lt;BR&gt;&lt;b&gt;Display list of all open ports&lt;BR&gt;&lt;/b&gt;netstat -tulpn&lt;BR&gt;&lt;BR&gt;&lt;b&gt;View login related logs&lt;BR&gt;&lt;/b&gt;tail -f /var/log/secure&lt;BR&gt;vi /var/log/secure&lt;BR&gt;grep 'something' /var/log/secure&lt;BR&gt;View mail server related logs&lt;BR&gt;tail -f /var/log/maillog&lt;BR&gt;vi /var/log/maillog&lt;BR&gt;grep 'something' /var/log/maillog&lt;BR&gt;&lt;BR&gt;&lt;b&gt;Find how long the system has been running&lt;BR&gt;&lt;/b&gt;uname&lt;BR&gt;w&lt;BR&gt;&lt;BR&gt;&lt;b&gt;Show who is logged on and what they are doing&lt;BR&gt;&lt;/b&gt;w&lt;BR&gt;who&lt;/P&gt; &lt;P&gt;&lt;BR&gt;&lt;b&gt;Display list of tasks&lt;BR&gt;&lt;/b&gt;top&lt;BR&gt;&lt;/P&gt; &lt;P&gt;&lt;b&gt;Display all running process&lt;BR&gt;&lt;/b&gt;ps aux&lt;BR&gt;ps aux | grep process-name&lt;BR&gt;&lt;BR&gt;&lt;b&gt;Display list of all installed software on Redhat / CentOS / Fedora &lt;BR&gt;&lt;/b&gt;rpm -qa&lt;BR&gt;rpm -qa | grep 'software-name'&lt;BR&gt;rpm -qa | less&lt;BR&gt;&lt;BR&gt;&lt;b&gt;Display list of all installed software on Debian / Ubuntu&lt;BR&gt;&lt;/b&gt;dpkg --list&lt;BR&gt;&lt;BR&gt;Once information collected it can be easily send as an email to help desk. You can use all above command to gathers information about a remote Linux system over secure ssh session (see related functions that gathers up information about a Linux and FreeBSD system). Best part is all above commands runs in non privileged &lt;/P&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-6171977560638058292?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/6171977560638058292/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=6171977560638058292' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/6171977560638058292'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/6171977560638058292'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2007/11/some-important-linuxunix-commands-how.html' title='Some Important Linux/Unix Commands'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-3319225352574963525</id><published>2007-10-31T14:16:00.000-04:00</published><updated>2007-10-31T14:22:17.236-04:00</updated><title type='text'>Update rows using replace in SQL*Plus</title><content type='html'>For Example&lt;br /&gt;&lt;br /&gt;SQL&gt; desc rk&lt;br /&gt; Name                                      Null?    Type&lt;br /&gt; ----------------------------------------- -------- ----------------------------&lt;br /&gt; CONTENT_VALUE_SMALL                                VARCHAR2(512 CHAR)&lt;br /&gt;&lt;br /&gt;SQL&gt; select * from rk;&lt;br /&gt;&lt;br /&gt;http://i.a.rk.net/v5cache/TBS/veryf/images/i0/3telecom_expo_400_304.jpg&lt;br /&gt;&lt;br /&gt;Now you want to replace rk.net with xyz.net&lt;br /&gt;&lt;br /&gt;SQL&gt; update rk set CONTENT_VALUE_SMALL=replace(CONTENT_VALUE_SMALL,'http://i.a.rk','http://i.a.xyz');&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-3319225352574963525?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/3319225352574963525/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=3319225352574963525' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/3319225352574963525'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/3319225352574963525'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2007/10/update-rows-using-replace-in-sqlplus.html' title='Update rows using replace in SQL*Plus'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-2346932260176584908</id><published>2007-10-31T14:12:00.000-04:00</published><updated>2007-10-31T14:16:35.856-04:00</updated><title type='text'>Manual installation of Oracle Text 10g</title><content type='html'>Manual installation of Text 10gR1 (10.1.0.x) and (10.2.0.x)&lt;br /&gt;&lt;br /&gt;1. Text dictionary, schema name CTXSYS, is created by calling following script from SQL*Plus connected as SYSDBA:&lt;br /&gt;&lt;br /&gt;SQL&gt; connect SYS/password as SYSDBA&lt;br /&gt;SQL&gt;@?/ctx/admin/catctx.sql CTXSYS SYSAUX TEMP NOLOCK&lt;br /&gt;&lt;br /&gt;Where:CTXSYS - is the ctxsys user password&lt;br /&gt;SYSAUX - is the default tablespace for ctxsys&lt;br /&gt;TEMP - is the temporary tablespace for ctxsys&lt;br /&gt;LOCK|NOLOCK - ctxsys user account will be locked or not&lt;br /&gt;&lt;br /&gt;2. The next step is to install appropriate language-specific default preferences.To manually install US default preferences, for example, log into sqlplus as CTXSYS, and run 'drdefus.sql' as described below:&lt;br /&gt;&lt;br /&gt;SQL&gt; connect CTXSYS/password&lt;br /&gt;SQL&gt;@?/ctx/admin/defaults/drdefus.sql&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-2346932260176584908?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/2346932260176584908/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=2346932260176584908' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/2346932260176584908'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/2346932260176584908'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2007/10/manual-installation-of-oracle-text-10g.html' title='Manual installation of Oracle Text 10g'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-3919309807848779008</id><published>2007-10-30T12:45:00.001-04:00</published><updated>2007-10-30T12:48:00.052-04:00</updated><title type='text'>CPIO Command</title><content type='html'>Extract the file:&lt;br /&gt;cpio -idmv &lt; file_name&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-3919309807848779008?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/3919309807848779008/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=3919309807848779008' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/3919309807848779008'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/3919309807848779008'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2007/10/cpio-command.html' title='CPIO Command'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-6697455445258229252</id><published>2007-10-25T12:44:00.000-04:00</published><updated>2007-10-25T12:47:53.773-04:00</updated><title type='text'>Find out last sql statement issued from the same session</title><content type='html'>select sql_text from v$sql&lt;br /&gt;where hash_value = ( select prev_hash_value from v$session&lt;br /&gt;where sid = (select sid from v$mystat where rownum = 1))&lt;br /&gt;/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-6697455445258229252?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/6697455445258229252/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=6697455445258229252' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/6697455445258229252'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/6697455445258229252'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2007/10/find-out-last-sql-statement-issued-from.html' title='Find out last sql statement issued from the same session'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-6748904382938948555</id><published>2007-09-27T11:39:00.002-04:00</published><updated>2009-01-07T09:24:53.336-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Scripts'/><title type='text'>How to find object/schema size</title><content type='html'>Find SCHEMA SIZE or USER SIZE&lt;br /&gt;&lt;br /&gt;SELECT tablespace_name,&lt;br /&gt;Sum(bytes)/1024/1024 AS total_size_mb&lt;br /&gt;FROM dba_segments&lt;br /&gt;WHERE owner = Upper('&amp;amp;User_Name')&lt;br /&gt;GROUP BY owner, rollup(tablespace_name)&lt;br /&gt;&lt;br /&gt;Find OBJECT Size&lt;br /&gt;&lt;br /&gt;select segment_name, sum(bytes/(1024*1024)) size_mb from user_segments&lt;br /&gt;where segment_type = 'TABLE' and segment_name='&amp;amp;SEGMENT_NAME'&lt;br /&gt;group by segment_name&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-6748904382938948555?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/6748904382938948555/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=6748904382938948555' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/6748904382938948555'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/6748904382938948555'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2007/09/oracle-scripts.html' title='How to find object/schema size'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-2543392919539677280</id><published>2007-09-27T11:07:00.000-04:00</published><updated>2007-09-27T17:13:37.153-04:00</updated><title type='text'>Simple Unix Commands AWK, SED etc....</title><content type='html'>&lt;p&gt;&lt;b&gt;Find files greater than 1M&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;$&amp;gt; find . -depth -xdev -size +1000000c -print&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Delete files older than 3 days&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;$&amp;gt; find . -mtime +3 -print -exec rm * {} ;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;To find out what is running on a port&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;$&amp;gt; lsof -i tcp  grep port number&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Change contents of file from lower case to upper case&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;$&amp;gt; cat x.lst  tr [a-z] [A-Z] &amp;gt; x.sql&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;AWK COMMANDS&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;To print the first two fields in opposite order, enter:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;$&amp;gt; awk '{ print $2, $1 }' chapter1&lt;br /&gt;&lt;br /&gt;&lt;b&gt;To display all lines between the words start and stop, including "start" and "stop", enter:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;$&amp;gt; awk '/start/,/stop/' chapter1&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;To run an awk command program, sum2.awk, that processes the file, abc1, enter:&lt;/b&gt; &lt;/p&gt;&lt;p&gt;&lt;br /&gt;$&amp;gt; awk -f sum2.awk abc1&lt;br /&gt;&lt;br /&gt;contents of file ‘abc1’&lt;br /&gt;2 2 2 2&lt;br /&gt;3 3 3 3&lt;br /&gt;4 4 4 4&lt;br /&gt;5 5 5 5&lt;br /&gt;------- Start of Program sum2.awk ------&lt;br /&gt;{&lt;br /&gt;sum += $2&lt;br /&gt;}&lt;br /&gt;END {&lt;br /&gt;print "Sum: ", sum;&lt;br /&gt;print "Average:", sum/NR;&lt;br /&gt;}&lt;br /&gt;------- End of Program sum2.awk ------&lt;br /&gt;&lt;u&gt;Explanation:&lt;/u&gt; The first action adds the value of the second field of each line to the variable sum. All variables are initialized to the numeric value of 0 (zero) when first referenced. The pattern END before the second action causes those actions to be performed after all of the input file has been read. The NR special variable, which is used to calculate the average, is a special variable specifying the number of records that have been read.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;****************************************************************************************&lt;br /&gt;&lt;b&gt;Repeat everyline in the file and prefix it with some word&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;Example :&lt;br /&gt;&lt;br /&gt;Source : a.sh&lt;br /&gt;&lt;br /&gt;abc&lt;br /&gt;def&lt;br /&gt;ghi&lt;br /&gt;&lt;br /&gt;Output : b.sh&lt;br /&gt;&lt;br /&gt;echo abc&lt;br /&gt;tnsping abc&lt;br /&gt;echo def&lt;br /&gt;tnsping def&lt;br /&gt;echo ghi&lt;br /&gt;tnsping ghi&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Solution&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;for line in `cat a.sh`&lt;br /&gt;do&lt;br /&gt;echo echo "$line"&lt;br /&gt;echo tnsping $line&lt;br /&gt;done &amp;gt;&amp;gt; b.sh&lt;br /&gt;&lt;br /&gt;*********************************************************************************&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Bring the 1st line at the end of 2nd line and then 3rd line at the end of 4th line and so on…..&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;Example :&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Input&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;ADMINDB1&lt;br /&gt;SYSTEM/manager@&lt;br /&gt;ADSERVD1&lt;br /&gt;SYSTEM/manager@&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Output&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;SYSTEM/manager@ADMINDB1&lt;br /&gt;SYSTEM/manager@ADSERVD1&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;Solution&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;awk 'NR % 2 == 0' testfile &amp;gt; file1&lt;br /&gt;awk 'NR % 2 ' testfile &amp;gt; file2&lt;br /&gt;paste file1 file2  tr -d 't'&lt;br /&gt;&lt;br /&gt;******************************************************&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-2543392919539677280?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/2543392919539677280/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=2543392919539677280' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/2543392919539677280'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/2543392919539677280'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2007/09/simple-unix-commands-awk-sed-etc.html' title='Simple Unix Commands AWK, SED etc....'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-2586123246150079669</id><published>2007-09-26T11:02:00.000-04:00</published><updated>2007-09-26T11:32:42.565-04:00</updated><title type='text'>DBMS_JOB</title><content type='html'>Here's few examples of how to submit the jobs.&lt;br /&gt;&lt;br /&gt;The following would create a job to refresh a MV everyday at Midnight starting from tomorrow&lt;br /&gt;&lt;br /&gt;SQL&gt; variable jno number;&lt;br /&gt;SQL&gt; exec dbms_job.submit(:jno,'DBMS_MVIEW.REFRESH(''MV_TESTING'',''C'');',trunc(sysdate)+1,'sysdate+1');&lt;br /&gt;&lt;br /&gt;Here's another example&lt;br /&gt;&lt;br /&gt;declare&lt;br /&gt;jno number;&lt;br /&gt;begin&lt;br /&gt;dbms_job.submit(job =&gt; jno,&lt;br /&gt;what =&gt; 'my_proc(abc);'&lt;br /&gt;next_date =&gt; sysdate+1,&lt;br /&gt;interval =&gt; 'sysdate+1');&lt;br /&gt;end;&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;next_date = &gt; next date/time you want to run the job to run. An argument of DATE datatype must be passed in.&lt;br /&gt;&lt;br /&gt;Example : to_date('09/30/2007 11:24 AM','MM/DD/YYYY HH:MI AM');&lt;br /&gt;OR&lt;br /&gt;sysdate+1                           Same time tomorrow&lt;br /&gt;trunc(sysdate)+1              Midnight tomorrow&lt;br /&gt;trunc(sysdate)+19/24     7 pm (1900 Hrs) today&lt;br /&gt;&lt;br /&gt;interval =&gt; at which frequency the job should be run . The argument passed is in varchar2.&lt;br /&gt;Example&lt;br /&gt;'sysdate+1'                          24 hours after the job's current run time&lt;br /&gt;'trunc(sysdate)+1'              Midnight after the day the job is run&lt;br /&gt;'trunc(sysdate)+19/24'     7 PM on the day the job is run&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-2586123246150079669?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/2586123246150079669/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=2586123246150079669' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/2586123246150079669'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/2586123246150079669'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2007/09/dbmsjob.html' title='DBMS_JOB'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-1689686214926872044</id><published>2007-09-24T11:35:00.001-04:00</published><updated>2007-09-24T11:52:16.048-04:00</updated><title type='text'>Data Guard Tips</title><content type='html'>&lt;strong&gt;Shutting Down a Physical Standby Database&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;To shut down a physical standby database, use the SQL*Plus SHUTDOWN command. If the database is performing managed recovery, you must cancel managed recovery operations before issuing the SHUTDOWN command. &lt;br /&gt;&lt;br /&gt;If the primary database is up and running, defer the archive log destination on the primary database and perform a log switch operation (to make the defer operation take effect) before shutting down the standby database. Otherwise, log transport services will not be able to transmit redo data to this standby site.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;The following steps show you how to shut down a standby database:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Find out if the standby database is performing managed recovery. If the MRP0 or MRP process exists, then the standby database is performing managed recovery. &lt;br /&gt;&lt;br /&gt;You can find out which instance is the apply-instance from the &lt;strong&gt;ps -eaf | grep mrp &lt;/strong&gt;command at the OS Level OR using SQL*Plus at the standby database&lt;br /&gt;&lt;br /&gt;SQL&gt; select b.host_name,b.INSTANCE_NAME,a.PROCESS,a.STATUS &lt;br /&gt;     from gv$managed_standby a, gv$instance b where a.inst_id=b.inst_id&lt;br /&gt;&lt;br /&gt;Cancel managed recovery operations. &lt;br /&gt;SQL&gt; ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;&lt;br /&gt;&lt;br /&gt;Shut down the standby database. &lt;br /&gt;SQL&gt; SHUTDOWN IMMEDIATE;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-1689686214926872044?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/1689686214926872044/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=1689686214926872044' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/1689686214926872044'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/1689686214926872044'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2007/09/data-guard-tips.html' title='Data Guard Tips'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-3762177155699948844</id><published>2007-09-10T14:54:00.000-04:00</published><updated>2007-09-10T14:59:47.743-04:00</updated><title type='text'>Generate Test Data</title><content type='html'>Came across this website for generating test data.&lt;br /&gt;&lt;br /&gt;http://www.generatedata.com/#about&lt;br /&gt;&lt;br /&gt;http://www.sqledit.com/dg/&lt;br /&gt;&lt;br /&gt;http://www.igs-edv.de/tdg_e/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-3762177155699948844?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/3762177155699948844/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=3762177155699948844' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/3762177155699948844'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/3762177155699948844'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2007/09/generate-test-data.html' title='Generate Test Data'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-4188759616550651647</id><published>2007-09-10T10:51:00.000-04:00</published><updated>2007-09-10T15:07:16.717-04:00</updated><title type='text'>Where is your Query stuck</title><content type='html'>If you know the process ID you can find the SID, SERIAL#, SQL_ID and other details using the following query: (process id can be taken from the unix TOP command)&lt;br /&gt;&lt;br /&gt;-- To find the SID, username and SQL_ID associated with a process id taken from unix&lt;br /&gt;select a.sid,a.serial#,a.username,a.status,a.sql_id&lt;br /&gt;from v$session a,v$process b&lt;br /&gt;where b.spid='&amp;PROCESS_ID'&lt;br /&gt;and a.paddr=b.addr&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;You can take a look at the actual explain_plan by executing the following&lt;br /&gt;&lt;br /&gt;select operation,options,object_name,object_alias,object_type &lt;br /&gt;from v$sql_plan where sql_id='&lt;sql_id taken from above&gt;'&lt;br /&gt;&lt;br /&gt;Select from &lt;strong&gt;v$session_longops&lt;/strong&gt; to find out where your query is&lt;br /&gt;&lt;br /&gt;select qcsid,sid,username,opname,target,sofar,totalwork,units,start_time,&lt;br /&gt;time_remaining,elapsed_seconds,message&lt;br /&gt;from   v$session_longops&lt;br /&gt;order by qcsid&lt;br /&gt;/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-4188759616550651647?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/4188759616550651647/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=4188759616550651647' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/4188759616550651647'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/4188759616550651647'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2007/09/where-is-your-query-stuck.html' title='Where is your Query stuck'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-1255428846457383649</id><published>2007-09-06T15:02:00.000-04:00</published><updated>2007-09-06T15:18:01.268-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MV'/><title type='text'>Refreshing a Materialized View owned by other user</title><content type='html'>Suppost USER_A owns the MV and USER_B wants the privileges to execute it.&lt;br /&gt;&lt;br /&gt;While trying to refresh a materialized view owned by other users you might get&lt;br /&gt;&lt;br /&gt;SQL&gt; EXECUTE DBMS_MVIEW.REFRESH('SALES_SUMMARY','F');&lt;br /&gt;ORA-01031: insufficient privileges&lt;br /&gt;ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2255&lt;br /&gt;ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2461&lt;br /&gt;ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2430&lt;br /&gt;ORA-06512: at line 2&lt;br /&gt;&lt;br /&gt;In order to refresh a materialized view owned by other user, you must have the following privileges in addition to privileges on objects owned by USER_A which are being used in the MV.&lt;br /&gt;&lt;br /&gt;SQL&gt; &lt;strong&gt;GRANT ALTER ANY MATERIALIZED VIEW TO &amp;USER_B&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;The DBMS_MVIEW package can manually invoke either a fast refresh or a complete refresh. F means Fast Refresh and C means Complete Refresh:&lt;br /&gt;&lt;br /&gt;EXECUTE DBMS_MVIEW.REFRESH('SALES_SUMMARY','F');&lt;br /&gt;&lt;br /&gt;**********&lt;br /&gt;The privileges required to create a materialized view log directly relate to the privileges necessary to create the underlying objects associated with a materialized view log.&lt;br /&gt;&lt;br /&gt;If you own the master table, you can create an associated materialized view log if you have the &lt;strong&gt;CREATE TABLE &lt;/strong&gt;privilege.&lt;br /&gt;&lt;br /&gt;If you are creating a materialized view log for a table in another user's schema, you must have the &lt;strong&gt;CREATE ANY TABLE &lt;/strong&gt;and &lt;strong&gt;COMMENT ANY TABLE &lt;/strong&gt;system privileges, as well as either the &lt;strong&gt;SELECT&lt;/strong&gt; object privilege on the master table or the &lt;strong&gt;SELECT ANY TABLE &lt;/strong&gt;system privilege.&lt;br /&gt;&lt;br /&gt;In either case, the owner of the materialized view log must have sufficient quota in the tablespace intended to hold the materialized view log or must have the UNLIMITED TABLESPACE system privilege.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-1255428846457383649?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/1255428846457383649/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=1255428846457383649' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/1255428846457383649'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/1255428846457383649'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2007/09/refreshing-materialized-view-owned-by.html' title='Refreshing a Materialized View owned by other user'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-8641050582835414027</id><published>2007-09-04T16:46:00.000-04:00</published><updated>2007-11-17T06:29:21.141-05:00</updated><title type='text'>How does one clone database with RMAN</title><content type='html'>&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Verdana"&gt;&lt;STRONG&gt;How does one clone/duplicate a database with RMAN?&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Verdana"&gt;&lt;/SPAN&gt; &lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Verdana"&gt;The first step to clone or duplicate a database with RMAN is to create a new INIT.ORA and password file (use the orapwd utility) on the machine you need to clone the database to. Review all parameters and make the required changed. For example, set the DB_NAME parameter to the new database's name.&lt;/SPAN&gt; &lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Verdana"&gt;&lt;/SPAN&gt; &lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Verdana"&gt;Secondly, you need to change your environment variables, and do a STARTUP NOMOUNT from sqlplus. This database is referred to as the AUXILIARY in the script below.&lt;/SPAN&gt; &lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Verdana"&gt;&lt;/SPAN&gt; &lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Verdana"&gt;Lastly, write a RMAN script like this to do the cloning, and call it with "rman cmdfile dupdb.rcv":&lt;/SPAN&gt; &lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Verdana"&gt;&lt;/SPAN&gt; &lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Courier New'"&gt;    connect target sys/secure@origdb&lt;/SPAN&gt; &lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Courier New'"&gt;    connect catalog rman/rman@catdb&lt;/SPAN&gt; &lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Courier New'"&gt;    connect auxiliary /&lt;/SPAN&gt; &lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Courier New'"&gt;&lt;/SPAN&gt; &lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Courier New'"&gt;    run {&lt;/SPAN&gt; &lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Courier New'"&gt;    set newname for datafile 1 to '/ORADATA/u01/system01.dbf';&lt;/SPAN&gt; &lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Courier New'"&gt;    set newname for datafile 2 to '/ORADATA/u02/undotbs01.dbf';&lt;/SPAN&gt; &lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Courier New'"&gt;    set newname for datafile 3 to '/ORADATA/u03/users01.dbf';&lt;/SPAN&gt; &lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Courier New'"&gt;    set newname for datafile 4 to '/ORADATA/u03/indx01.dbf';&lt;/SPAN&gt; &lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Courier New'"&gt;    set newname for datafile 5 to '/ORADATA/u02/example01.dbf';&lt;/SPAN&gt; &lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Courier New'"&gt;&lt;/SPAN&gt; &lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Courier New'"&gt;    allocate auxiliary channel dupdb1 type disk;&lt;/SPAN&gt; &lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Courier New'"&gt;    set until sequence 2 thread 1;&lt;/SPAN&gt; &lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Courier New'"&gt;&lt;/SPAN&gt; &lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Courier New'"&gt;    duplicate target database to dupdb&lt;/SPAN&gt; &lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Courier New'"&gt;    logfile&lt;/SPAN&gt; &lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Courier New'"&gt;&lt;SPAN&gt;      &lt;/SPAN&gt;GROUP 1 ('/ORADATA/u02/redo01.log') SIZE 200k REUSE,&lt;/SPAN&gt; &lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Courier New'"&gt;&lt;SPAN&gt;      &lt;/SPAN&gt;GROUP 2 ('/ORADATA/u03/redo02.log') SIZE 200k REUSE;&lt;/SPAN&gt; &lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Courier New'"&gt;    }&lt;/SPAN&gt; &lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Verdana"&gt;&lt;/SPAN&gt; &lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Verdana"&gt;The above script will connect to the "target" (database that will be cloned), the recovery catalog (to get backup info), and the auxiliary database (new duplicate DB). Previous backups will be restored and the database recovered to the "set until time" specified in the script.&lt;/SPAN&gt; &lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Verdana"&gt;&lt;/SPAN&gt; &lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Verdana"&gt;Notes: the "set newname" commands are only required if your datafile names will different from the target database. &lt;/SPAN&gt;&lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Verdana"&gt;&lt;/SPAN&gt; &lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Verdana"&gt;The newly cloned DB will have its own unique DBID.&lt;/SPAN&gt; &lt;/P&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-8641050582835414027?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/8641050582835414027/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=8641050582835414027' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/8641050582835414027'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/8641050582835414027'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2007/09/how-does-one-cloneduplicate-database.html' title='How does one clone database with RMAN'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-756350084658248431</id><published>2007-09-04T16:06:00.000-04:00</published><updated>2007-09-04T16:35:02.851-04:00</updated><title type='text'>PL/SQL Procedure to update values</title><content type='html'>PL/SQL Procedure to update values in a table based on values taken from another table.&lt;br /&gt;&lt;br /&gt;EXAMPLE : &lt;br /&gt;SQL&gt; desc change_log&lt;br /&gt;&lt;br /&gt; Name                                      Null?    Type&lt;br /&gt; ----------------------------------------- -------- ----------------------------&lt;br /&gt; LOG_ID                                    NOT NULL NUMBER(11)&lt;br /&gt; POLL_ID                                   NOT NULL NUMBER(11)&lt;br /&gt; QUESTION_ID                               NOT NULL NUMBER(11)&lt;br /&gt; ANSWER_ID                                 NOT NULL NUMBER(11)&lt;br /&gt; COUNT                                     NOT NULL NUMBER(11)&lt;br /&gt; TIME                                      NOT NULL DATE&lt;br /&gt;&lt;br /&gt;SQL&gt; desc answers&lt;br /&gt;&lt;br /&gt; Name                                      Null?    Type&lt;br /&gt; ----------------------------------------- -------- ----------------------------&lt;br /&gt; ANSWER_ID                                 NOT NULL NUMBER(11)&lt;br /&gt; QUESTION_ID                               NOT NULL NUMBER(11)&lt;br /&gt; POLL_ID                                   NOT NULL NUMBER(11)&lt;br /&gt; ANSWER_TEXT                               NOT NULL VARCHAR2(512)&lt;br /&gt; ANSWER_VOTES                              NOT NULL NUMBER(11)&lt;br /&gt;&lt;br /&gt;## Update answers table based on certain conditons on the change_log table.&lt;br /&gt;&lt;br /&gt;EXECUTE DBMS_SESSION.SET_NLS('NLS_DATE_FORMAT','''DD-MON-YYYY HH24:MI:SS''');&lt;br /&gt;SET SERVEROUTPUT ON;&lt;br /&gt;execute dbms_output.enable(1000000000);&lt;br /&gt;&lt;br /&gt;Declare&lt;br /&gt;Begin&lt;br /&gt;   for rec in (&lt;br /&gt;   select sum(NVL(change_log.count,0)) as count_total , POLL_ID,QUESTION_ID,ANSWER_ID&lt;br /&gt;   from change_log&lt;br /&gt;   group by POLL_ID,QUESTION_ID,ANSWER_ID&lt;br /&gt;   )&lt;br /&gt;LOOP&lt;br /&gt;begin&lt;br /&gt;   update answers&lt;br /&gt;   set answers.ANSWER_VOTES= NVL(rec.count_total,0)&lt;br /&gt;   where answers.ANSWER_ID=rec.ANSWER_ID&lt;br /&gt;   and answers.QUESTION_ID=rec.QUESTION_ID&lt;br /&gt;   and answers.POLL_ID=rec.POLL_ID&lt;br /&gt;   and answers.answer_id=3;&lt;br /&gt;  exception when Others then&lt;br /&gt;   dbms_output.put_line ( rec.ANSWER_ID || ' - ' ||rec.ANSWER_ID||' - '||rec.POLL_ID);&lt;br /&gt;end;&lt;br /&gt;END LOOP;&lt;br /&gt;End;&lt;br /&gt;/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-756350084658248431?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/756350084658248431/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=756350084658248431' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/756350084658248431'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/756350084658248431'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2007/09/plsql-procedure-to-update-values.html' title='PL/SQL Procedure to update values'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-142785038802556012</id><published>2007-09-04T12:00:00.000-04:00</published><updated>2007-09-04T16:06:20.178-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='load test data'/><title type='text'>Load Test Data</title><content type='html'>Many times development teams asks DBAs to populate test data so that they can perform some performance test.&lt;br /&gt;&lt;br /&gt;Below you will find some examples to load test data.&lt;br /&gt;&lt;br /&gt;SQL&gt; create table sales&lt;br /&gt;     (trans_date date, cust_id int, sales_amount number );&lt;br /&gt;&lt;br /&gt;SQL&gt; insert /*+ APPEND */ into sales&lt;br /&gt;     select trunc(sysdate,'year')+mod(rownum,366) TRANS_DATE,&lt;br /&gt;            mod(rownum,100) CUST_ID,&lt;br /&gt;            abs(dbms_random.random)/100 SALES_AMOUNT&lt;br /&gt;       from all_objects;&lt;br /&gt;SQL&gt; commit;&lt;br /&gt;&lt;br /&gt;SQL&gt; begin&lt;br /&gt;         for i in 1 .. 4&lt;br /&gt;         loop&lt;br /&gt;             insert /*+ APPEND */ into sales&lt;br /&gt;             select trans_date, cust_id, abs(dbms_random.random)/100 &lt;br /&gt;               from sales;&lt;br /&gt;             commit;&lt;br /&gt;         end loop;&lt;br /&gt;     end;&lt;br /&gt;     /&lt;br /&gt;PL/SQL procedure successfully completed.&lt;br /&gt;&lt;br /&gt;SQL&gt; commit;&lt;br /&gt;&lt;br /&gt;## SELECT A RANDOM VALUE ##&lt;br /&gt;select cust_id from (select cust_id from sales order by dbms_random.value) where rownum=1;&lt;br /&gt;&lt;br /&gt;Some other commands using DBMS_RANDOM to generate and populate values&lt;br /&gt;&lt;br /&gt;SELECT dbms_random.normal FROM dual;&lt;br /&gt;SELECT ABS(dbms_random.normal) FROM dual;&lt;br /&gt;SELECT (1+ABS(MOD(dbms_random.random,100000))) FROM dual; ==&gt;&gt; force output to +ve values only&lt;br /&gt;SELECT dbms_random.value(2, 3) FROM dual;   ==&gt;&gt; Get a value between 2 and 3&lt;br /&gt;## Random String ##&lt;br /&gt;dbms_random.string(opt IN CHAR, len IN NUMBER)&lt;br /&gt;RETURN VARCHAR2;&lt;br /&gt;&lt;br /&gt;select dbms_random.string('A', 12) from dual; ==&gt;&gt; random alphanumeric values&lt;br /&gt;&lt;br /&gt;opt seed values:&lt;br /&gt;'a','A'  alpha characters only (mixed case)&lt;br /&gt;'l','L'  lower case alpha characters only&lt;br /&gt;'p','P'  any printable characters&lt;br /&gt;'u','U'  upper case alpha characters only&lt;br /&gt;'x','X'  any alpha-numeric characters (upper)&lt;br /&gt;&lt;br /&gt;-- create test data == another example ==&lt;br /&gt;CREATE TABLE test (&lt;br /&gt;col1 VARCHAR2(20),&lt;br /&gt;col2 VARCHAR2(20));&lt;br /&gt;&lt;br /&gt;DECLARE&lt;br /&gt; x VARCHAR2(20);&lt;br /&gt; y VARCHAR2(20);&lt;br /&gt;BEGIN&lt;br /&gt;  FOR i IN 1..100&lt;br /&gt;  LOOP&lt;br /&gt;    x := dbms_random.string('A', 20);&lt;br /&gt;    y := dbms_random.string('A', 20);&lt;br /&gt;&lt;br /&gt;    INSERT INTO test&lt;br /&gt;    (col1, col2)&lt;br /&gt;    VALUES&lt;br /&gt;    (x,y);&lt;br /&gt;  END LOOP; &lt;br /&gt;  COMMIT;&lt;br /&gt;END;&lt;br /&gt;/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-142785038802556012?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/142785038802556012/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=142785038802556012' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/142785038802556012'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/142785038802556012'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2007/09/load-test-data.html' title='Load Test Data'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7125731310934907247.post-5377982239550907785</id><published>2007-07-30T10:58:00.002-04:00</published><updated>2008-11-24T13:56:39.937-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='RAC'/><title type='text'>RAC Architecture Overview</title><content type='html'>&lt;span style="font-family:trebuchet ms;"&gt;&lt;strong&gt;RAC Architecture Overview&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Let's begin with a brief overview of RAC architecture.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;A cluster is a set of 2 or more machines (nodes) that share or coordinate resources to perform the same task.&lt;br /&gt;&lt;br /&gt;A RAC database is 2 or more instances running on a set of clustered nodes, with all instances accessing a shared set of database files.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;Depending on the O/S platform, a RAC database may be deployed on a cluster that uses vendor clusterware plus Oracle's own clusterware (Cluster Ready Services), or on a cluster that solely uses Oracle's own clusterware.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;Thus, every RAC sits on a cluster that is running Cluster Ready Services. &lt;strong&gt;&lt;em&gt;&lt;span style="color:#ff6600;"&gt;srvctl&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt; is the primary tool DBAs use to configure CRS for their RAC database and processes.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;Cluster Ready Services and the OCR&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;Cluster Ready Services, or CRS, is a new feature for 10g RAC. Essentially, it is Oracle's own clusterware. On most platforms, Oracle supports vendor clusterware; in these cases, CRS interoperates with the vendor clusterware, providing high availability support and service and workload management. On Linux and Windows clusters, CRS serves as the sole clusterware. In all cases, CRS provides a standard cluster interface that is consistent across all platforms.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;CRS consists of four processes (crsd, occsd, evmd, and evmlogger) and two disks: &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;the Oracle Cluster Registry (OCR), and the voting disk.&lt;br /&gt;CRS manages the following resources:&lt;br /&gt;The ASM instances on each node&lt;br /&gt;Databases&lt;br /&gt;The instances on each node&lt;br /&gt;Oracle Services on each node&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;The cluster nodes themselves, including the following processes, or "nodeapps":&lt;br /&gt;VIP&lt;br /&gt;GSD&lt;br /&gt;The listener&lt;br /&gt;The ONS daemon&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;CRS stores information about these resources in the OCR. If the information in the OCR for one of these resources becomes damaged or inconsistent, then CRS is no longer able to manage that resource. Fortunately, the OCR automatically backs itself up regularly and frequently.&lt;br /&gt;Interacting with CRS and the OCR: srvctl&lt;br /&gt;srvctl is the tool Oracle recommends that DBAs use to interact with CRS and the cluster registry. Oracle does provide several tools to interface with the cluster registry and CRS more directly, at a lower level, but these tools are deliberately undocumented and intended only for use by Oracle Support. srvctl, in contrast, is well documented and easy to use. Using other tools to modify the OCR or manage CRS without the assistance of Oracle Support runs the risk of damaging the OCR.&lt;br /&gt;Using srvctl&lt;br /&gt;Even if you are experienced with 9i srvctl, it's worth taking a look at this section; 9i and 10g srvctl commands are slightly different.&lt;br /&gt;srvctl must be run from the $ORACLE_HOME of the RAC you are administering. The basic format of a srvctl command is&lt;br /&gt;srvctl &lt;command&gt;&lt;target&gt;[options]&lt;br /&gt;where command is one of&lt;br /&gt;enabledisablestartstoprelocatestatusaddremovemodifygetenvsetenvunsetenvconfig&lt;br /&gt;and the target, or object, can be a database, instance, service, ASM instance, or the nodeapps.&lt;br /&gt;The srvctl commands are summarized in this table:&lt;br /&gt;Table 1. Summary of srvctl commands.&lt;br /&gt;Command&lt;br /&gt;Targets&lt;br /&gt;Description&lt;br /&gt;srvctl addsrvctl modifysrvctl remove&lt;br /&gt;databaseinstanceservicenodeapps&lt;br /&gt;srvctl add / remove adds/removes target's configuration information to/from the OCR.&lt;br /&gt;srvctl modify allows you to change some of target's configuration information in the OCR without wiping out the rest.&lt;br /&gt;srvctl relocate&lt;br /&gt;service&lt;br /&gt;Allows you to reallocate a service from one named instance to another named instance.&lt;br /&gt;srvctl config&lt;br /&gt;databaseservicenodeappsasm&lt;br /&gt;Lists configuration information for target from the OCR.&lt;br /&gt;srvctl disablesrvctl enable&lt;br /&gt;databaseinstanceserviceasm&lt;br /&gt;srvctl disable disables target, meaning CRS will not consider it for automatic startup, failover, or restart. This option is useful to ensure an object that is down for maintenance is not accidentally automatically restarted.&lt;br /&gt;srvctl enable reenables the specified object.&lt;br /&gt;srvctl getenvsrvctl setenvsrvctl unsetenv&lt;br /&gt;databaseinstanceservicenodeapps&lt;br /&gt;srvctl getenv displays the environment variables stored in the OCR for target.&lt;br /&gt;srvctl setenv allows these variables to be set, and unsetenv unsets them.&lt;br /&gt;srvctl startsrvctl statussrvctl stop&lt;br /&gt;databaseinstanceservicenodeappsasm&lt;br /&gt;Start, stop, or display status (started or stopped) of target.&lt;br /&gt;As you can see, srvctl is a powerful utility with a lot of syntax to remember. Fortunately, there are only really two commands to memorize: srvctl -help displays a basic usage message, and srvctl -h displays full usage information for every possible srvctl command.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;Examples for using srvctl&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;Example 1. &lt;/span&gt;&lt;span style="font-family:courier new;"&gt;Bring up the MYSID1 instance of the MYSID database.&lt;br /&gt;[oracle@myserver oracle]$ srvctl start instance -d MYSID -i MYSID1&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;Example 2. Stop the MYSID database: all its instances and all its services, on all nodes.&lt;br /&gt;[oracle@myserver oracle]$ srvctl stop database -d MYSID&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;Example 3. Stop the nodeapps on the myserver node. NB: Instances and services also stop.&lt;br /&gt;[oracle@myserver oracle]$ srvctl stop nodeapps -n myserver&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;Example 4. Add the MYSID3 instance, which runs on the myserver node, to the MYSID clustered database.&lt;br /&gt;[oracle@myserver oracle]$ srvctl add instance -d MYSID -i MYSID3 -n myserver&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;Example 5. Add a new node, the mynewserver node, to a cluster.[oracle@myserver oracle]$ srvctl add nodeapps -n mynewserver -o $ORACLE_HOME -A 149.181.201.1/255.255.255.0/eth1&lt;br /&gt;(The -A flag precedes an address specification.)&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;Example 6. To change the VIP (virtual IP) on a RAC node, use the command&lt;br /&gt;[oracle@myserver oracle]$ srvctl modify nodeapps -A new_address&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;Example 7. Find out whether the nodeapps on mynewserver are up.[oracle@myserver oracle]$ srvctl status nodeapps -n mynewserverVIP is running on node: mynewserverGSD is running on node: mynewserverListener is not running on node: mynewserverONS daemon is running on node: mynewserver&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;Example 8. Disable the ASM instance on myserver for maintenance.&lt;br /&gt;[oracle@myserver oracle]$ srvctl disable asm -n myserver&lt;br /&gt;Debugging srvctl&lt;br /&gt;Debugging srvctl in 10g couldn't be easier. Simply set the SRVM_TRACE environment variable.&lt;br /&gt;[oracle@myserver bin]$ export SRVM_TRACE=true&lt;br /&gt;Let's repeat Example 6 with SRVM_TRACE set to true:[oracle@myserver oracle]$ srvctl status nodeapps -n mynewserver/u01/app/oracle/product/10.1.0/jdk/jre//bin/java -classpath /u01/app/oracle/product/10.1.0/jlib/netcfg.jar:/u01/app/oracle/product/10.1.0/jdk/jre//lib/rt.jar:/u01/app/oracle/product/10.1.0/jdk/jre//lib/i18n.jar:/u01/app/oracle/product/10.1.0/jlib/srvm.jar:/u01/app/oracle/product/10.1.0/jlib/srvmhas.jar:/u01/app/oracle/product/10.1.0/jlib/srvmasm.jar:/u01/app/oracle/product/10.1.0/srvm/jlib/srvctl.jar -DTRACING.ENABLED=true -DTRACING.LEVEL=2 oracle.ops.opsctl.OPSCTLDriver status nodeapps -n mynewserver[main] [19:53:31:778] [OPSCTLDriver.setInternalDebugLevel:165] tracing is true at level 2 to file null[main] [19:53:31:825] [OPSCTLDriver.&lt;init&gt;:94] Security manager is set[main] [19:53:31:843] [CommandLineParser.parse:157] parsing cmdline args[main] [19:53:31:844] [CommandLineParser.parse2WordCommandOptions:900] parsing 2-word cmdline[main] [19:53:31:866] [GetActiveNodes.create:212] Going into GetActiveNodes constructor...[main] [19:53:31:875] [HASContext.getInstance:191] Module init : 16[main] [19:53:31:875] [HASContext.getInstance:216] Local Module init : 19...[main] [19:53:32:285] [ONS.isRunning:186] Status of ora.ganges.ons on mynewserver is trueONS daemon is running on node: mynewserver[oracle@myserver oracle]$&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;Pitfalls&lt;br /&gt;&lt;br /&gt;A little impatience when dealing with srvctl can corrupt your OCR, ie, put it into a state where the information for a given object is inconsistent or partially missing. Specifically, the srvctl remove command provides the -f option, to allow you to force removal of an object from the OCR. Use this option judiciously, as it can easily put the OCR into an inconsistent state.&lt;br /&gt;&lt;br /&gt;Restoring the OCR from an inconsistent state is best done with the assistance of Oracle Support, who will guide you in using the undocumented $CRS_HOME/bin/crs_* tools to repair it. The OCR can also be restored from backup.&lt;br /&gt;&lt;br /&gt;Error messages&lt;br /&gt;&lt;br /&gt;srvctl errors are PRK% errors, which are not documented in the 10gR1 error messages manual. However, for those with a &lt;/span&gt;&lt;a href="http://metalink.oracle.com/"&gt;&lt;span style="font-family:trebuchet ms;"&gt;Metalink&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:trebuchet ms;"&gt; account, they are documented on Metalink &lt;/span&gt;&lt;a href="http://metalink.oracle.com/metalink/plsql/ml2_documents.showFrameDocument?p_database_id=NOT&amp;amp;p_id=178435.1"&gt;&lt;span style="font-family:trebuchet ms;"&gt;here&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:trebuchet ms;"&gt;.&lt;br /&gt;Conclusion&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:trebuchet ms;"&gt;srvctl is a powerful tool that will allow you to administer your RAC easily and effectively. In addition, it provides a valuable buffer between the DBA and the OCR, making it more difficult to corrupt the OCR.&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;Global Cache Service GCS and Global Enqueue Service GES together manage the Cache Fusion processes, resource transfer and resource escalation among the instances. Enqueues are internal oracle locks; GCS to handle the buffer cache across all instances.&lt;br /&gt;&lt;br /&gt;GCS and GES together maintain Global Resource Directory (GRD). GRD remains in the memory and is stored on all instances. GRD records current status of the data blocks.&lt;br /&gt;It is distributed across all instances in a cluster and is located in the variable or shared pool section of the SGA.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;RAC Processes : LMON – Global Enqueue Service Monitor (LMON) monitors the entire cluster. It manages instance and process failures and associated recovery for GCS and GES.&lt;br /&gt;&lt;br /&gt;LMDx – Global Enqueue Service Daemon (LMD) is the lock agent. It also handles dead lock detection and remote enqueue requests.&lt;br /&gt;&lt;br /&gt;LMSx – Global Cache Service Processes are the processes that handle remote GCS messages. Can have upto 10 in number. LMS is interconnect process and monitors the block transfer between instances.&lt;br /&gt;&lt;br /&gt;LCKx – It manages Global Enqueue requests and the cross-instance broadcast.&lt;br /&gt;&lt;br /&gt;DIAG – Diagnosability Daemon – Monitors the health of the instance and captures the data for instance process failures. Can be in non-rac database too after 9i.&lt;br /&gt;&lt;br /&gt;The use of single SPFILE provide administrative ease and SPFILE has to be located on a clustered file system.&lt;br /&gt;&lt;br /&gt;OCR contains cluster and database configuration information for RAC and CRS, instance and&lt;br /&gt;&lt;br /&gt;Voting Disk is a file on a shared cluster system; used to maintain cluster integrity or cluster membership.&lt;br /&gt;&lt;br /&gt;CRS starts up first and at that time ASM is not up, so we can not have OCR and voting disk on ASM.&lt;br /&gt;$CRS_HOME/log contains the alert log and&lt;br /&gt;&lt;br /&gt;ASM – has its init.ora file which tells which instances it has.&lt;br /&gt;&lt;br /&gt;Nodeapps : VIP/GSD/Listener/Oracle Notification Service (ONS).&lt;br /&gt;&lt;br /&gt;VIP (virtual IP) – CRS resource associated with an ip address.&lt;br /&gt;&lt;br /&gt;TAF – Transparent Application Failover&lt;br /&gt;&lt;br /&gt;ASM&lt;br /&gt;&lt;br /&gt;ASM stores the metadata that is required to make available the files stored within the ASM storage system to non-ASM oracle databases.&lt;br /&gt;&lt;br /&gt;Two additional Processes : RBAL – Rebalancer Process to rebalance activity for ASM disk groups and ARBn – Actual rebalancer process to rebalance of data extent movements.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;wmos=&lt;br /&gt;(DESCRIPTION=&lt;br /&gt;(LOAD_BALANCE=yes)&lt;br /&gt;(FAILOVER=on)&lt;br /&gt;(ADDRESS= (PROTOCOL=tcp)(HOST=wmsdevrac1-vip.acme.com)(PORT=1526))&lt;br /&gt;(ADDRESS= (PROTOCOL=tcp)(HOST=wmsdevrac2-vip.acme.com)(PORT=1526))&lt;br /&gt;(CONNECT_DATA=&lt;br /&gt;(SERVICE_NAME=wmos)&lt;br /&gt;(FAILOVER_MODE=&lt;br /&gt;(TYPE=select)&lt;br /&gt;(METHOD=basic))))&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Overview of Transparent Application Failover&lt;br /&gt;Uncommitted insert, update, and delete commands are rolled-back and must be resubmitted after reconnection. Again, use of the OCI packages should be utilized to have the DML operations reissued. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;br /&gt;The Oracle Net process carries out TAF functionality. The failover is configured in the tnsnames file. The TAF settings are placed in the net service name area, within the connect_data section of the tnsnames, using the failover_mode and instance_role parameters.&lt;br /&gt;&lt;br /&gt;Load Balancing&lt;br /&gt;&lt;br /&gt;The listener connection load-balancing feature improves connection performance by balancing the number of active connections among multiple dispatchers and instances. In a single-instance environment, the listener selects the least-loaded dispatcher to handle the incoming client requests. In an Oracle Database 10g Real Application Clusters environment, connection load balancing also has the capability to balance the number of active connections among multiple instances. Due to dynamic service registration, a listener is always aware of all instances, and in the case of the multi-threaded server (MTS), a listener is aware of the dispatchers, regardless of their locations. Depending on the load information, a listener decides which instance, and if the multi-threaded server (shared server) is configured, it decides which dispatcher to send the incoming client request. In a MTS configuration, a listener selects a dispatcher in the following order:&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7125731310934907247-5377982239550907785?l=rkdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkdba.blogspot.com/feeds/5377982239550907785/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7125731310934907247&amp;postID=5377982239550907785' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/5377982239550907785'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7125731310934907247/posts/default/5377982239550907785'/><link rel='alternate' type='text/html' href='http://rkdba.blogspot.com/2007/07/rac-architecture-overview.html' title='RAC Architecture Overview'/><author><name>rkhanna</name><uri>http://www.blogger.com/profile/12645632243555221684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
