Steps for a Clean Startup after an Instance Crash
Sometimes the instance will not start if the previous shutdown was not complete (leaving some shared memory segments or processes). In such cases you can retry a fresh startup after cleaning up the old shared memory segments / semaphores:
a. check if the background processes are running
$ ps -ef | grep $ORACLE_SID
b. If background processes are running remove the background processes:
$ kill -9 <pid>
c. Check if the shared memory and semaphore are running for your SID:
$ ipcs –a
d. If shared memory and semaphore are in use then remove the shared memory and semaphore:
$ ipcrm -m <####>-- for shared memory
$ ipcrm -s <####> -- for semaphore
e. Change directory to the "oracle_home/dbs":
$ cd $ORACLE_HOME/dbs
f. Check for the file "lk" and "sgadef.dbf".
g. If files are there, then remove the "lk<SID>" and "sgadef<sid>.dbf" files:
$ rm lk<SID> sgadef<sid>.dbf
A server reboot will do this cleanup except for the lk<SID> files.