No question at this time
DBA Top 10
1 M. Cadot 10800
2 A. Kavsek 10100
3 B. Vroman 4800
4 P. Wisse 4200
5 J. Schnackenberg 2900
6 J. Péran 2000
7 . Lauri 1000
8 F. Pachot 500
9 Z. Hudec 400
9 G. Lambregts 400
9 N. Havard 400
9 T. Boles 400
About
DBA-Village
The DBA-Village forum
Forum as RSS
as RSS feed
Site Statistics
Ever registered users48518
Total active users1427
Act. users last 24h3
Act. users last hour0
Registered user hits last week177
Registered user hits last month765
Go up

restore question
Next thread: restore-recovery of old database
Prev thread: restore possibilities - until time before backup end

Message Score Author Date
I will restore an database on another system, wher...... Alain Bourgeois Jun 18, 2020, 10:39
Hi Alain, after the recovery, before the OPEN R...... Score: 400 PtsScore: 400 PtsScore: 400 PtsScore: 400 PtsScore: 400 Pts Jan Schnackenberg Jun 18, 2020, 12:03
Hi Alain, You could use such a script : <p...... Joël Péran Jun 18, 2020, 14:08

Follow up by mail Click here


Subject: restore question
Author: Alain Bourgeois, Belgium
Date: Jun 18, 2020, 10:39, 21 days ago
Os info: oracle linux 6
Oracle info: 11.2.0.4 / 12.2.0.1
Message: I will restore an database on another system, where original diskgroup name will not exists.
There is a set newname for datafile and tempfile.
Archivelogs are not in backup but are available and will be registered using "catalog start..."


I will have to rename redolog group files
alter database rename file '+OLDGROUP/cnamcs/onlinelog/group_30.2891.959080129' to '+NEWGROUP/cnamcs/onlinelog/group_30.2891.959080129';

The question is: when does this rename have to take place? Do I have to do it before restore? Before "catalog start"? before recover ? after open resetlogs?

Thanks.
Goto: Reply - Top of page 
If you think this item violates copyrights, please click here

Subject: Re: restore question
Author: Jan Schnackenberg, Germany
Date: Jun 18, 2020, 12:03, 21 days ago
Score:   Score: 400 PtsScore: 400 PtsScore: 400 PtsScore: 400 PtsScore: 400 Pts
Message: Hi Alain,

after the recovery, before the OPEN RESETLOGS.

Regards,
Jan
Your rating?: This reply is Good Excellent
Goto: Reply - Top of page 
If you think this item violates copyrights, please click here

Subject: Re: restore question
Author: Joël Péran, France
Date: Jun 18, 2020, 14:08, 21 days ago
Message: Hi Alain,

You could use such a script :

SET DBID=xxx - DB ID of the database
RUN
{
ALLOCATE CHANNEL CH1 DEVICE TYPE DISK;
RESTORE CONTROLFILE FROM 'x:\xxx\xxx\xxx_CF'; -- RMAN controlfile backed up
ALTER DATABASE MOUNT;
SET NEWNAME FOR DATAFILE 1 TO 'x:\xxx\xxx\O1_MF_SYSTEM_9RVT0T5Y_.DBF';
SET NEWNAME FOR DATAFILE 2 TO 'x:\xxx\xxx\O1_MF_UNDOTBS1_9RVT0T3C_.DBF';
SET NEWNAME FOR DATAFILE 3 TO ''x:\xxx\xxx\O1_MF_SYSAUX_9RVT0T5V_.DBF';
...
SET NEWNAME FOR DATAFILE 10 TO 'x:\xxx\xxx\O1_MF_9RVT0T7X_.DBF';
SET NEWNAME FOR DATAFILE 11 TO 'x:\xxx\xxx\O1_MF_P9RVT0T38_.DBF';
SET UNTIL SEQUENCE xxxxx;
RESTORE DATABASE;
SWITCH DATAFILE ALL;
RECOVER DATABASE;
RELEASE CHANNEL CH1;
}

/* And then, tempfile, redofile renaming part */
ALTER DATABASE RENAME FILE 'y:\yyy\O1_MF_1_FNG8HFBQ_.LOG' TO 'x:\xxx\ONLINELOG\O1_MF_1_FNG8HFBQ_.LOG';
ALTER DATABASE RENAME FILE 'y:\yyy\O1_MF_1_FNG8HFBQ_.LOG' TO 'x:\xxx\ONLINELOG\O1_MF_1_FNG8HFBQ_.LOG';

ALTER DATABASE RENAME FILE 'y:\yyy\DATAFILE\TEMPORARY_01.DBF' TO 'x:\xxx\DATAFILE\TEMPORARY_01.DBF';



Of course, you can generate this script by using a query like ...

SELECT 'ALTER DATABASE RENAME FILE '''||member||''' TO '''||replace(member,'Y:\YYY\','X:\XXX\')||''';' from v$logfile;
SELECT 'ALTER DATABASE RENAME FILE '''||name||''' TO '''||replace(name,'Y:\YYY\','X:\XXX\')||''';' from v$tempfile;

select 'SET NEWNAME FOR DATAFILE '||d.file_id||''''||replace(d.file_name,'Y:\YYY`\YYY','X:\XXX\XXX')||''';'
from dba_data_files d order by d.file_id;



If the recover doesn't complete, you can do a "recover un til cancel using backup controlfile;" and then answer cancel when asked.

Regards,
Joel
Your rating?: This reply is Good Excellent
Goto: Reply - Top of page 
If you think this item violates copyrights, please click here