Small change make difference.
How small , small things make difference , here is one live example
One of my friend want to learn 11g, so she downloaded 11g and started installing on
Linux Box and created Database manually. Next time when she logged in, she did not know where she installed 11g , since she created database manually , so there was no entry in “oratab”
I remember command “pwdx” on Unix Solaris , which give current working directory of processes
$ uname -a SunOS mysun 5.8 Generic_xyz sun4u sparc SUNW,Ultra-Enterprise $ ps -aef grep pmon oracle 2424 1 0 Jan 18 ? 13:39 ora_pmon_test mysun:oracle> (10.1.0.4) /usr/proc/bin $ pwdx 2424 < |
But on Linux(RHEL 4 ) there is no command like “pwdx” . In linux you can check current working directory of processes ( ORACLE_HOME/dbs i.e lock file location ) in /proc/
[root@apps001 proc]# ps -aef grep pmon oracle 2826 1 0 20:55 ? 00:00:00 xe_pmon_XE [root@apps001 proc]# ls -l /proc/8268 total 0 |
>
< [oracle@apps001 oracle]$ cd /u01/app/oracle/11.1.0/dbs [oracle@apps001 dbs]$ ls [oracle@apps001 dbs]$ /sbin/fuser * hc_orcl11g.dat: 8268 8268m 8270 8270m 8274 8274m 8276 8276m 8278 8278m 8282 8282m 8284 8284m 8286 8286m 8288 8288m 8290 8290m 8292 8292m 8294 8294m 8296 8296m 8298 8298m 8300 8302 8312 8312m 8314 8314m 8316 8316m 8320 8322 8394 8394m 22755 25372 lkORCL11G: 8268 8276 8278 8284 8286 8288 8290 8292 8294 8296 8298 8312 8314 8316 8320 8322 8394 22755 25372 |
I asked her to create one small shell script to source oracle 11g environment variable ,
she wrote following script
ORACLE_HOME=/u01/app/oracle/11.1.0/ ~ "11g.env" 7L, 136C written [oracle@apps001 ~]$chmod 755 11g.env |
She called me after some time and said , after sourcing 11g environment variable , when she try to connect oracle 11g as sysdba , it says “connect to ideal instance”
[oracle@apps001 ~]$ . ./11g.env [oracle@apps001 ~]$ sqlplus “/ as sysdba” Ctl-d [oracle@apps001 ~]$ ps -aef grep pmon [oracle@apps001 8268]$ cd /u01/app/oracle/11.1.0/dbs [oracle@apps001 dbs]$ /sbin/fuser * hc_orcl11g.dat: 8268 8268m 8270 8270m 8274 8274m 8276 8276m 8278 8278m 8282 8282m 8284 8284m 8286 8286m 8288 8288m 8290 8290m 8292 8292m 8294 8294m 8296 8296m 8298 8298m 8300 8302 8312 8312m 8314 8314m 8316 8316m 8320 8322 8394 8394m 22755 25372 lkORCL11G: 8268 8276 8278 8284 8286 8288 8290 8292 8294 8296 8298 8312 8314 8316 8320 8322 8394 22755 25372 # It means database is up (may be nomount , mount or open mode ) |
When ran “fuser” on lock file oracle BG processes are connected to lock file, It means database is up (may be nomount , mount or open mode )
Checked alert.log , to make sure things are fine. It shows database is OPEN
[oracle@apps001 oracle]$ adrci ADR base = "/u01/app/oracle" Choose the alert log from the following homes to view: 1: diag/tnslsnr/apps001/listener Please select option:4 space available in the underlying filesystem or ASM diskgroup. |
Finally decided to check shell script , which source 11g environment variable. There suppose to be no issue at script because we able to run “adrci” and able to see alert.log
[oracle@apps001 ~]$vi 11g.env ~
~ |
After I removed last “/” from ORACLE_HOME , she able to connect to database J
[oracle@apps001 ~]$ . ./11g.env [oracle@apps001 ~]$ sys SQL*Plus: Release 11.1.0.6.0 - Production on Mon Jan 28 00:00:54 2008 SQL> |
So small change make difference.