Thursday, March 14, 2019

 Facing problem: ORA-011033: ORACLE initialization or shutdown in progress

SQL> connect sys/manager as sysdba
Connected.
SQL> shutdown immediate;
ORA-01109: database not open


Database dismounted.
ORACLE instance shut down.

SQL> startup
ORACLE instance started.

Total System Global Area 171966464 bytes
Fixed Size 787988 bytes
Variable Size 145750508 bytes
Database Buffers 25165824 bytes
Redo Buffers 262144 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 6 - see DBWR trace file
ORA-01110: data file 6: 'C:\ORADATA\PRODUCT_DAT1.DBF'

 Solution 1:


shutdown immediate; -- if you have trouble with that, run shutdown abort;
startup mount;
alter database datafile 6 offline;
alter database open;

Further if u get this problem:
While making a datafile offline, got below error.

SQL> ALTER database datafile ‘/export/home/oracle/user02.dbf’ offline;
ALTER database datafile ‘/export/home/oracle/user02.dbf’ offline
*
ERROR at line 1:
ORA-01145: offline immediate disallowed unless media recovery enabled


Solution 2:

To make a datafile offline, archive mode need to be enabled.

SQL> archive log list
Database log mode No Archive Mode
Automatic archival Disabled
Archive destination /oracle/app/oracle/product/12.1.0.2/dbhome_1/dbs/arch
Oldest online log sequence 84
Current log sequence 85
 
Below are steps for enabling archive mode:
 
shutdown immediate;
 
startup mount
 
alter database archivelog;
 
alter database open;
 
SQL> archive log list
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /oracle/app/oracle/product/12.1.0.2/dbhome_1/dbs/arch
Oldest online log sequence     84
Next log sequence to archive   85
Current log sequence           85
SQL>
 
Now try to make the datafile offline.
 
SQL> ALTER database datafile '/export/home/oracle/user02.dbf' offline;
 
Database altered.