cancel
Showing results for 
Search instead for 
Did you mean: 

Restore Oracle with brtools to a Windows server with different disk structure

yrk_tkm
Explorer
0 Kudos

Hello gurus,

Is it possible to restore Oracle to a Windows machine that has different disk structure than a source machine?

E.g. source machine had disks C:, D:, E: (on which Oracle data files were distributed), but a target machine has only disk C:

Database is backuped with brtools.

Accepted Solutions (1)

Accepted Solutions (1)

ACE-SAP
Active Contributor
0 Kudos

Hi

This should be possible by adapting the brbackup control file (.ffd or .afd)

Change all the drive (c, d, e) to c and restore with brrestore using that files.

brrestore -u / -b bebzrlkf.afd -d disk -c force -m full -e 5

Regards

yrk_tkm
Explorer
0 Kudos

Dear Yves,

Could you kindly navigate me how to adapt it?

ACE-SAP
Active Contributor
0 Kudos

Hi

I did some mass changes using a script... to be honest I'm not sure if I did it to restore FROM a different location, or TO a different location.

You could also use Brrestore option -m|-mode to restore the datafiles to a new location.

Check online help   -m|-mode - SAP Database Guide: Oracle (BC-DB-ORA-DBA) - SAP Library

For instance the here under command will restore datafiles #10 to #20 to the /tmp directory

brrestore -u / -b beokfyeu.pnd -c -m 10-20=/tmp

You could find datafile ID by querying view dba_data_files

select FILE_ID, FILE_NAME, TABLESPACE_NAME from DBA_DATA_FILES;

Regards

yrk_tkm
Explorer
0 Kudos

Thanks Yves.

But will the database open with a new structure? I guess the Oracle control file will be storing old locations of data files.

former_member188883
Active Contributor
0 Kudos

Hi Yerk,

You need to create new controlfiles with the new layout and then open the database.

From source database, generate a trace file using

SQL> alter database backup controlfile to trace;

Modify this trace file and adapt all the paths matching to your target environment,

Change "REUSE" to "SET" in trace file.

Rename this trace file to CONTROL.SQL

Then on target system copy this CONTROL.SQL under oracle home

SQL> @CONTROL.SQL

This will create new control file at desired location and open the database.

Regards,

Deepak Kori

ACE-SAP
Active Contributor
0 Kudos

Hi

Yes you will have to create new control files based on the new location.

Create a text backup of the control file on source server

alter database backup controlfile to trace as 'd:\arbitrary_path\CTL.sql';

and adapt it for creating new control files on the target server (change datafiles paths to the restored ones, change SID if needed... )

delete the control files on target, an run the script.

You can find more detail on how adapting the script

1889854 - Recreation of the Control file

Regards

yrk_tkm
Explorer
0 Kudos

So it's not possible to restore, if the source machine dies completely?

Answers (2)

Answers (2)

yrk_tkm
Explorer
0 Kudos

Yves, Deepak, thank you, guys. Worked like a charm!

Former Member
0 Kudos

Hi Yerkebulan,

You can change the data files path using this SQL command in the old control file itself.


alter database rename file '<source_path>' to '<destination_path>';


Thanks,

Pavan

Former Member
0 Kudos
alter database rename file '<source_path>' to '<destination_path>';

Hi Pavan,

It not only changes the path in control file but also in the current database structure!

Regards,

Nick Loy

Former Member
0 Kudos

Hi Nick,

How does it impact the current database structure.. ?

Could you please elaborate .

Thanks,

Pavan