When shutdown immediate hanged for long I found in user dump a trace file containing messgaes
ksukia: Attempt 1 to re-
ksukia: Attempt 1 to re-
kill
process OS PID=7427.
ksukia: Attempt 2 to re-kill
process OS PID=7427.
.
.
.
.
$
ps
-ef grep 7427
...
oracle 7426 11402 0 09:34 pts
/1
00:00:00 sqlplus @a.sql
oracle 7427 7426 0 09:34 ? 00:00:00 [oracle] defunct
This process 7427 was defunct (dead) as it appeared defunct. So this could not be killed directly with kill -9, instead its parent process sqlplus was killed and shutdown immediate proceeded
Many guys on interent suggested shutdown abort but that must be avoided.