Script creation(How to validate SID?)
I was going write a script from following site.
http://www.thegeekstuff.com/2010/07/...cle-sql-query/ My configuration setting for oracle XE. Quote:
I doubt there is a wrong command to validate the sid. i.e. Quote:
Quote:
Quote:
|
Did you actually try to run these two outside a script?
Code:
export ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server This actually gives sid_dir=/usr There's no oradata under /usr |
Quote:
Means how would i come to the conclusion that the ORACLE_SID is correct or not? |
Haven't actually installed/used Oracle in over 5 years, so
am rather rusty. If I remember correctly the sid isn't necessarily part of the directory structure, so the only way to test for it would be to try and connect; evaluate the result, and complain if it fails. Cheers, Tink |
Hi all I got this nice suggestion from other forum so i thought of sharing it here for others.
Little Drawback of below script: You will need to have a different for different oracle product. This is because they maintain different naming convention for the process. in case of xe they reffer it as xe_smon_<ORACLE_SID> where as other distribution reffer it as ora_smon_<ORACLE_SID> For Oracle XE installation.(Tested and working fine) Code:
SID=`ps -ef|grep smon|grep -v grep|awk '{print $8}'` Code:
SID=`ps -ef|grep smon|grep -v grep|awk '{print $8}'` |
All times are GMT -5. The time now is 02:48 PM. |