ORACLE initialization or shutdown in progress

Error “ORA-01033 ORACLE initialization or shutdown in progress” plagued me twice, not a third, unprepared!

Since this was the second time this happened to me so I decided I should get all my ducks in a row cause if it happened twice, it will most likely happen a third time, if not to me, then to someone else.

The reason this happened was because my automated script that restores two databases and does everything to shut down and restart the instance got fowled up. It fowled up when I accidentally ran both scripts simultaneously. The first script did the shutdown operations, and the second script did the same. … which then barfed everything up and locked the files and considered everything in a shutdown state.This is what I did to get out of it. Parts of this came from the following weblog (http://www.orafaq.com/forum/t/38120/0/), but it was too convoluted, and got me in the mood to put down exactly what I did. (’cause that’s my real job, Systems Analysis and Design)

Execute the following commands to get things started.

  • VNC to or access the oracle server in some way
  • go to a command prompt (cmd at the Start | Run dialog)

In the command window execute the following

  • sqlplus /nolog
  • connect sys/change_on_install as sysdba;
  • shutdown abort;
  • startup nomount;
  • alter database mount;
  • alter database open;

If an error appears like…

cannot identify/lock data file 5
data file 5: ‘<filename>’

… then execute the following

  • alter database datafile ‘<filename>’ offline drop;
  • alter database open;

If another error occurs, because another file is locked, then repeat the same command. Do these two commands until you see a “database is altered” response, and no errors. If there are other errors, they are not covered here. For me I have three database files, so it took doing those two commands three times.

Successful Response

Finally execute this last command

  • shutdown immediate;

And you should see this response.

Database closed.
Database dismounted.
ORACLE instance shut down.

Test

To prepare for the test make sure these commands are executed to ensure the instance is properly started.

  • cmd prompt
  • sqlplus /nolog
  • connect sys/change_on_install as sysdba;
  • startup;

Everything should come online.

Now test the connection with the following steps.

  • get to a command prompt
  • sqlplus
  • username: “sys as sysdba” (without the double-quotes)
  • password: “change_on_install” (without the double-quotes)

You should now be connected to the database without any errors.

Leave a Reply

%d bloggers like this: