Friday, 30 September 2011

To find missing value from sequence or sequence like fields


select (a.id + 1)
from tab_name a
where not exists
(select 1
from tab_name b
where b.id = (a.id + 1))
and a.id not in
(select max(c.id)
from tab_namec)
order by 1

Monday, 26 September 2011

Execution of root.sh for oracle installation


root.sh script performs many things, namely
It changes or correctly sets the environment variables
copying of few files into /usr/local/bin , the files are dbhome,oraenv,coraenv etc.
creation of /etc/oratab file or adding database home and SID's entry into /etc/oratab file.

root.sh script is located in $ORACLE_HOME directory.