Home » RDBMS Server » Backup & Recovery » How to force tempfile reuse when duplicating database (rman 10.2.0.4.0)
How to force tempfile reuse when duplicating database [message #474988] Fri, 10 September 2010 11:10 Go to next message
metabaron
Messages: 13
Registered: September 2010
Junior Member
Hi all
I can successfully duplicate a database(10gr2) when there is no already existing 'auxiliary' tempfile. Tempfile is created and available.

RMAN>RUN
{
SET NEWNAME FOR DATAFILE 1 TO '/db2/dbs/system01.dbf';
...
SET NEWNAME FOR TEMPFILE 1 TO '/db2/dbs/temp01.dbf';

  DUPLICATE TARGET DATABASE TO db2;
}


But if I duplicate without deleting the tempfile, database is successfully created, but tempfile is not available:

SQL> select * from dba_temp_files ;
select * from dba_temp_files
              *
ERREUR à la ligne 1 :
ORA-01187: impossible de lire le fichier 201 car les tests de vérification ont échoué
ORA-01110: fichier de données 201 : '/db2/dbs/temp01.dbf'


I have read that locally managed tempfile should be manually recreated after a duplicate. But as duplicate is able to create tempfile if there is no already existing one when duplicating to a new database, is there a way to force a 'REUSE' if tempfile already exist when refreshing?

Tanks for help

Re: How to force tempfile reuse when duplicating database [message #474990 is a reply to message #474988] Fri, 10 September 2010 11:39 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10708
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
>>I have read that locally managed tempfile should be manually recreated after a duplicate.
That was with pre-10g Oracle version. With 10g and above,
the tempfiles are automatically included.
You can use a "set newname"
or
DB_FILE_NAME_CONVERT

I usually "drop" the database (aux) using RMAN before duplicate and would not bother with re-using.
Re: How to force tempfile reuse when duplicating database [message #475139 is a reply to message #474990] Mon, 13 September 2010 05:01 Go to previous messageGo to next message
metabaron
Messages: 13
Registered: September 2010
Junior Member
I tried with DB_FILE_NAME_CONVERT but it's the same behaviours than "set newname": if tempfile does not exist it's successfully created. But if it already exist, it's not reused: there is a ORA-01187.
Sure i could drop the database before, I also have some other alternative solutions, but I was really curious to know if it was a bug or if this was a wanted behaviour of not reusing existing tempfile.
Re: How to force tempfile reuse when duplicating database [message #475146 is a reply to message #475139] Mon, 13 September 2010 06:04 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10708
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
Not a bug. It is the intended behavior.
Re: How to force tempfile reuse when duplicating database [message #475166 is a reply to message #475146] Mon, 13 September 2010 07:06 Go to previous message
metabaron
Messages: 13
Registered: September 2010
Junior Member
Ok, then it's a strange behavior Smile
Thanks for help.
Previous Topic: About MAXSETSIZE
Next Topic: How to duplicate from an obsolete backupset?
Goto Forum:
  


Current Time: Thu Nov 21 19:26:06 CST 2024