0

Gave command: "SQL> shutdown immediate" to shutdown DB. But it is hung. Also I am not able to connect to DB via PL/SQL Developer. Its throwing error: "ORA 12537: TNS Connection closed

0

2 Answers 2

4

shutdown immediate will end idle sessions, but my understanding is that it will not kill of any statements which are in the middle of processing. But once issued, it will stop any new sessions from starting (thus you cannot connect any more).

So you can either wait for the operations to finish, or try shutdown abort.

3
  • 1
    From the docs, with immediate: "Current client SQL statements being processed by the database are allowed to complete". I don't know if there's any real basis for this, but if I ever have to shutdown abort, I tend to do a startup followed by ` shutdown immediate` - gives me a bit more confidence that everything is OK, even if it doesn't really add anything...
    – Alex Poole
    Jan 29, 2014 at 9:33
  • You shouldn't need to do this. When you do a startup after a shutdown abort, the instance will be recovered using the redo logs and won't be completely opened until the database is in a consistent state. Jan 29, 2014 at 11:36
  • @PhilSumner - yeah, it's just habit, not sure if it was ever advised but I've been doing it since at least 7. I don't do it often enough to have investigated if there was actually any benefit - I suspected not!
    – Alex Poole
    Jan 29, 2014 at 12:15
0

What does alert log says at that moment?

From my experience - in almost all of the cases when Oracle's shutdown immediate takes very long time (10+ minutes) or does not finish in reasonable time running DBMS_JOBS jobs are the problem. Don't know if DBMS_SCHEDULER jobs would also inflict such behaviour.

So the best thing before reboot is to disable jobs and kill running jobs. No problems with shutdown then.

ALTER SYSTEM set job_queue_processes=0 SCOPE=MEMORY;
select 'ALTER SYSTEM KILL SESSION '''||s.sid||','||s.serial#||''';'
  FROM dba_jobs_running d, v$session s
  WHERE d.sid=s.sid;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.