cancel
Showing results for 
Search instead for 
Did you mean: 

Database restore problem with BRTOOLS

former_member459694
Participant
0 Kudos

Hi Experts,

I am tring to migrate an SAP system from host A to host B.

OS: windows server 2003 DB: oracle 10g

Homogeneous migration.

The database were backed up with BRTOOLS (whole database offline backup) to Location L:\QCO_BCK @hostA

After that I moved folder QCO_BCK together with folder "sapbackup" from hostA to hostB, placed under F:\QCO_BCK

And then start to perform "whole database reset" with BRTOOLS, but BRTOOLS can not verify the datafile/control files since they are under different location(hostA and hostB), So, I modified initQCO.ora and the BRTOOLS log file begprhrg.afd, all the relevant directories were changed from L:\ to F:\, after trying again, BRTOOLS performed well, all datafiles, redo logs, control files were copied to the right location, but problems encountered at step 7 - "open database and post-processing", BRTOOLS returns oracle error message:

ORA-01157: cannot identify/lock data file 1 - see DBWR trace file

ORA-01110: data file 1: 'H:\oracle\QCO\sapdata5\system_1\SYSTEM.DATA1'

database can be mounted but can not be open.

I think this is because the control file is the old one which records the old file locations in hostA, in hostA, file SYSTEM.DATA1 actually located under H:\ but in hostB, it is copied under D:\

My question is:

1. Is it obligatory by BRTOOLS that the file structure on hostB(new) must be totally the same as hostA(old)? if the file (for example) SYSTEM.DATA1 is located at H:\ of hostA, then, in new hostB, it must be located at the same directory H:\?

2. Is there any workaround to open the database in this situation? like modifing the control file?

Thank you in advance.

Freshman

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

What is the backup that you have taken (to restore into B)?

If offline - Just take a backup of controlfile and edit the same with new location of datafiles and open the database (Here no need to apply the archive logs)

If online+archive log - Just take a backup of controlfile and edit the same with new location of data files and open the database with archive logs (Here recovery is required)

Both the cases you need controlfile with exact locations.

*I suggest offline backup/restore

Regards,

Nick Loy

JPReyes
Active Contributor
0 Kudos

I have to add that even if you change the location of the datafile in the .af* file you still need to update the controlfile with the new location otherwise the DB won't find it.

Regards

Juan

former_member459694
Participant
0 Kudos

Hi Sunny and Juan,

Thanks so much for your valuable information for me.

Yes, before restoring the DB, I used oraBRCopy tool to generate CONTROL.SQL and CONTROL.TRC file. But I didn't execute CONTROL.SQL after that. I'd like to know which timepoint should I execute it to generate the new control file? (file directory had already been corrected within CONTROL.SQL). is it before doing step 7: open database and post-processing, I should open a new command windows to enter SQLPlus to execute CONTROL.SQL? I tried to do this:


SQL>conn / as sysdba
Connected to an idle instance.
SQL>@C:\CONTROL.SQL
Oracle instance started
Total system global area xxx bytes
Fixed size xxx
varianble size xxx
...
Control file created.

SQL>alter database open;
alter database open
Error at line 1
ORA-01589 must use RESETLOGS or NORESETLOGS option for database open.

SQL>alter databse open resetlogs;
Error at line 1
ORA-01092: oracle instance terminated.Disconnected forced.

Strange thing is, in my last trial, when I execute step 7: open database and post processing, BRRECOVER gives me two sub options:


1 ~ Reset logs option (reset_logs) ..[resetlogs]
2 * Open databse command (command) .[alter database open resetlogs]

the final result is:

ORA-01139: Resetlogs option only valid after and incomplete database recovery.

I am not familiar with oracle db and is totally confused/frastrated now... Please kindly help.

Thank you very much

Freshman

former_member459694
Participant
0 Kudos

Hi Juan,

Sorry I still can not open the database after several trial.

Could you kindly tell me when should I execute the revised "CONTROL.SQL" file? after all the datafile/redo log file/old control file have been copied to the new location?

Really appreciate your kind help.

Thank you very much.

Freshman

Former Member
0 Kudos

Hi,

Probably you need to perform recovery in order to open the database ...

Try as below:

sqlplus / as sysdba
SQL> startup mount
SQL> recover database using backup controlfile until cancel;

When it ask for archive logs, provide the available logs or enter CANCEL to cancel the recovery.
It should say that recovery completed.

After that attempt to open the database

SQL> ALTER DATABASE OPEN RESETLOGS;

It will open the database.

Regards.

Rajesh Narkhede

sunny_pahuja2
Active Contributor
0 Kudos

Hi,

No, it is not necessary that file system structure should be same. But if your file system structure is different then you need to change same in backup log file so that brtools should know the target location where to store. I think error you are facing because you have not updated backup log file with correct target file system structure.

You cannot modify control files. You should check backup log file and make sure that file system structure should be as per new system. Also, have you run control.sql after changing it as per new structure ???? I think you have either missed to run control.sql or you have not changed control file of your source system as per new structure and ran the same old control file. Please check.

Thanks

Sunny

former_member459694
Participant
0 Kudos

Hi Sunny,

Sorry I still can not open the database after several trial.

Could you kindly tell me when should I execute the revised "CONTROL.SQL" file? after all the datafile/redo log file/old control file have been copied to the new location?

Really appreciate your kind help.

Thank you very much.

Freshman