database not open

usermma picture usermma · Aug 4, 2011 · Viewed 34.7k times · Source

I am trying to create database using Oracle 11g R2 on windows 2008 server, when I run script to create database instance I will get the following error message

ERROR at line 1: ORA-01109: database not open

grant select on ALL_MVIEW_DETAIL_PARTITION to public with grant option *

ERROR at line 1: ORA-01109: database not open

logged on as administrator.`

Thanks, usermma

Answer

Ankam Shyamsundar picture Ankam Shyamsundar · Apr 14, 2012

Login to Oracle with root

su - oracle
sqlplus / as sysdba
create user username identified by password;
Exception : ORA-01109 Database not open

To resolve this i trie below steps and succesfully created the schema.

  1. Please verify the ORA_HOMEPATH/dbs/sgadef.dbf
  2. Make ensure that after shutting down the Oracle server,if you find any services running on machine by entering below command

    ps -ef | grep ora_ | grep DBName(sid)
    
  3. Kill the processes if you find any by using kill command

    kill -9 PID
    
  4. Please check below file exists in mentioned path; if not please create.

    ORACLE_HOMEPATH/dbs/lk<sid>
    
  5. start mount; If the server is started use close immediate

    SQL> alter database close;
    
    Database altered.
    
    SQL> shutdown immediate
    ORA-01109: database not open
    
    Database dismounted.
    ORACLE instance shut down
    
    SQL> startup mount
    ORACLE instance started.
    
    Total System Global Area  126951228 bytes
    Fixed Size                   454460 bytes
    Variable Size             109051904 bytes
    Database Buffers           16777216 bytes
    Redo Buffers                 667648 bytes
    Database mounted.
    
    SQL> select open_mode from v$database;
    
    OPEN_MODE
    ----------
    MOUNTED
    
    SQL> alter database open;
    
    Database altered.
    
  6. Now you can create your own schema as the database is open

    SQL> create user schemaname identified by password;
    
    SQL> grant resource,connect to schema name;
    
    grant permission succeded.
    

I have done above steps to create a schema when database is not open.