When we try to duplicate the oracle 12.1.0.2 database using RMAN , its corrupting temp files. The error is as below

SQL> select FILE_NAME,FILE_ID,TABLESPACE_NAME from dba_temp_files;
select FILE_NAME,FILE_ID,TABLESPACE_NAME from dba_temp_files
*
ERROR at line 1:
ORA-01187: cannot read from file because it failed verification tests
ORA-01110: data file 203: ‘/d01/oradata/CDB/temp01.dbf’

Lots of changes have taken place in 11.2.0.4 version so you might see this issues in 11.2.0.4 and 12c database. If the previous version of tempfile exist from your previous duplicate for same database in same location, the physical copy of tempfile which exist will have different dbid compared to the one created by new , it will try to read the header of those tempfiles while open and give these error. So before doing RMAN duplicate you need to ensure the tempfiles from previous duplicate with same tempfile name in the same server should not be present.

RMAN Duplicate Fails To Create Tempfiles With Errors ORA-01186/ORA-01122/ORA-01206/ORA-01203 ( Doc ID 374934.1 ).
Similar issue reported in bug 9433546 where development team closed the bug saying “Not Feasible to fix” .
BUG 9433546 – NOT CREATE THE TEMPFILE AUTOMATICALLY

So workaround is to create a new tempfile.
or
Before doing duplicate you can drop the Old duplicate database using RMAN/Sqlplus Drop database command.
or
Remove the tempfiles which are present in the location where the tempfiles of new duplicate database would be created.

Drop Database command as explained below.

SQL> drop database;
drop database
*
ERROR at line 1:
ORA-01586: database must be mounted EXCLUSIVE and not open for this operation

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.

SQL> startup mount exclusive restrict
ORACLE instance started.
Total System Global Area 2147483648 bytes
Fixed Size                  2926472 bytes
Variable Size             587204728 bytes
Database Buffers         1543503872 bytes
Redo Buffers               13848576 bytes
Database mounted.

SQL> drop database;
Database dropped.

Following four syntaxs are available for drop database command.

1. DROP DATABASE;
2. DROP DATABASE NOPROMPT;
3. DROP DATABASE INCLUDING BACKUPS;
4. DROP DATABASE INCLUDING BACKUPS NOPROMPT;

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s