Question : ORA-00157:Cannot identfiy /lock datafile18 -see DBWR trace file.

Hi All,

We are having an Oracle 8.1.7.4.1 database server.

One database is there in it namely KHCG.We created another databse imindia1 using the Database configuration Assistant in the DBA studio.In this database i created two tablespace namely

create tablespace  worksmart_tbs datafile 'c:\oracle\oradata\worksmart\worksmart_data.dbf' size 100M default storage  (initial 25K 50K minextents 1 maxextents 999 pctincrease 0);

Also another temp tablsespace,

create tablespace temp_tbs datafile 'c:\oracle\oradata\worksmart\temp_data.dbf' size 50M default storage (initial 25K next 50K minextents 1 maxextents 999 pctincrease 0) temporary;

And i created a user worksmart

create user worksmart identified by worksmart default worksmart_tbs temporary tablespace temp_tbs;

The problem is that the database imindia1  is coming up.We can log into the imindia1 but the first one khcg is not opening.Its only getting mounted.The oracle service for both the database is getting started.When i checked through DBA studio and tried to start the first database khcg its only getting mounted.When i tried to open it the following error was shown

ORA-00157:Cannot identfiy /lock datafile18 -see DBWR trace file.

ORA-01110:data file 18:c\oracle\oradata\worksmart\worksmart_data.dbf.

Any quick response will be appreciated , since our apps is running on the first database khcg which is now down.


Regards,

Prasanth.
[email protected]

Answer : ORA-00157:Cannot identfiy /lock datafile18 -see DBWR trace file.


The cause of this error is that the Oracle background process was either
unable to find one of the data files or failed to lock it because the file was
already in use. When opening the database, all data files need to be
available.

- Use operating system commands to check if the file exists and can be
  accessed by Oracle (check the file privileges)
- Run a sql command to check the databfiles:
    ALTER SYSTEM CHECK DATAFILES

Commen causes of this error:

1. The datafile does exist, but Oracle cannot find it.

    The datafile may have been renamed at the operating system level, moved
    to a different directory, disk drive, etc, either intentionally
    or unintentionally.

    In this case, simply restoring the datafile to its original name and
    location or renaming the datafile to the new location/directory will
    solve the problem.  

2. The datafile does not exist or unsuable by Oracle.

    The datafile has been physically removed or damaged to an extent that
    Oracle cannot recognize it anymore.  

    Recreate the tablespace that the datafile belongs to.

        1. If the database is down, mount it.    
               
            SQL> STARTUP MOUNT PFILE='';  
                   
        2. Offline drop the datafile.    
               
            SQL> ALTER DATABASE DATAFILE '' OFFLINE DROP;  
                      
        3. If the database is at mount point, open it.    
   
            SQL> ALTER DATABASE OPEN;
 
        4. Drop the user tablespace.    
 
            SQL> DROP TABLESPACE INCLUDING CONTENTS;    
     
        5. Recreate the tablespace.    
          
            SQL> CREATE TABLESPACE DATAFILE  
                    '> SIZE ;
 
Random Solutions  
 
programming4us programming4us