This morning I was working on an Oracle Management Repository (OMR) for a test Enterprise Manager that is used by a few consultants I work with. When I logged into the box, I found that the OMR was down. When I went to start the database, I was greeted with ORA-01172 and ORA-01151.
These errors basically say:
ORA-01172 – recovery of thread % stuck at block % of file %
ORA-01151 – use media recovery to recover block, restore backup if needed
So how do I recover from this. The solution is simple, I just needed to perform the following steps:
1. Shutdown the database
SQL> shutdown immediate;
ORA-01109: database not open
ORACLE instance shut down.
2. Mount the database
SQL> startup mount;
ORACLE instance started.
Total System Global Area 1.0033E+10 bytes
Fixed Size 2934696 bytes
Variable Size 1677723736 bytes
Database Buffers 8321499136 bytes
Redo Buffers 30617600 bytes
3. Recover the database
SQL> recover database;
Media recovery complete.
4. Open the database with “alter database”
SQL> alter database open;
At this point, you should be able to access the database (OMR) and then have the EM environment up and running.