I do not like shutdown abort (see this post). I always use shutdown immediate and it always work… well almost always.
Today I discovered a 9iR2 new feature : shutdown timeout !
If all events blocking the shutdown do not occur within one hour, the shutdown operation aborts with the following message: ORA-01013: user requested cancel of current operation.
Ok, if and only if I am getting this ORA-1013, I shutdown abort, startup, shutdown immediate.
It is very unusual that a shutdown immediate does not terminate in 1 hour, and hard to reproduce. For this test case, I am doing a shutdown normal
1) make sure you have at least one other session open
2) shutdown normal
3) wait about 60 minutes (defined in _shutdown_completion_timeout_mins, not a supported parameter to change)
SQL> shutdown normal ORA-01013: user requested cancel of current operation SQL>
Now we received a ORA-1013 (but I did not use CTRL-C). The instance is now half-stopped, most sessions and background processes like MMON, CJQ, SMCO are already dead and it is probably a good idea to restart it properly. Maybe with startup force and shutdown immediate.
SQL> startup force ORACLE instance started. Total System Global Area 1069252608 bytes Fixed Size 2166160 bytes Variable Size 658510448 bytes Database Buffers 402653184 bytes Redo Buffers 5922816 bytes Database mounted. Database opened. SQL> shutdown immediate Database closed. Database dismounted. ORACLE instance shut down.
This is all documented :
After ORA-01013 occurs, you must consider the instance to be in an unpredictable state…If subsequent SHUTDOWN commands continue to fail, you must submit a SHUTDOWN ABORT
I am extremly happy to have discovered this, because it will still allow a shutdown abort after one hour of shutdown immediate, which is an extremly rare case, but it is an enhancement for my backup scripts.