Monday, August 18, 2014

ORA-01187: cannot read from file nnn because it failed verification tests

Problem:
After RMAN duplicate/clone of an Oracle database you are getting ORA-01187:
boris@testdb> select file_name from dba_temp_files    
select file_name  from dba_temp_files
*
ERROR at line 1:        
ORA-01187: cannot read from file 1043 because it failed verification tests
ORA-01110: data file 501: '/oradata/testdb/temp01.dbf'
There are no problems with the clone based on the log files and all data files seem to be ok.



Solution:
I would simply drop and recreate the TEMP temporary tablespace:
--Create Temporary Tablespace Temp
CREATE TEMPORARY TABLESPACE TEMP2 TEMPFILE  
'/oradata/testdb/temp02.dbf' SIZE 500M;

--Move Default Database temp tablespace
ALTER DATABASE DEFAULT TEMPORARY TABLESPACE temp2;

--Drop temp tablespace
DROP TABLESPACE temp INCLUDING CONTENTS AND DATAFILES;

--Recreate Tablespace Temp
CREATE TEMPORARY TABLESPACE TEMP TEMPFILE  
'/oradata/testdb/temp01.dbf' SIZE 500M;

--Move Tablespace Temp, back to new temp tablespace
ALTER DATABASE DEFAULT TEMPORARY TABLESPACE temp;

--Drop temporary for tablespace temp
DROP TABLESPACE temp2 INCLUDING CONTENTS AND DATAFILES;



I hope this helps.

Please feel free to leave your questions or suggest improvements to this section.

3 comments:

  1. Great post. This occurred to me after 12c duplication. Your information was clear and concise. I had to manually remove the temp01.dbf file after dropping temp file in SQL. The INCLUDING CONTENTS AND DATAFILES clause did not delete the physical file. Simple rm and all was well. Several post on this error, yours was the best.

    Thank you,
    Howard

    ReplyDelete
  2. This simple solution was a real time saver! Thank you.

    ReplyDelete