cancel
Showing results for 
Search instead for 
Did you mean: 

BRTOOLS - guide to RESTORE

Former Member
0 Kudos

Hi all,

we have an PRD Backup with BRTolls, and a SAP DEV working, how can we restore this backup to DEV System with BRRestore?

Is this an Disaster Recovery or an Reset Database path that should be taken?

Thanks all ..

Best Regards,

Pedro Rodrigues

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

hi Pedro Rodrigues ,

Follow the following procedure :

Procedure

1. Data and Log directories on target system must be cleaned before restoring source database.

Here below are the commands to clean directories. Before this, you have to stop all SAP and

Oracle processes.

  1. su - <targetsid>adm

  2. stopsap all

  3. exit

  4. su – ora<targetsid>

  5. lsnrctl stop

  6. exit

  7. cd /oracle/<SID>/

  8. rm –rf sapdata?/*

  9. rm –rf origlog?/*

  10. rm –rf mirrlog?

  11. rm –rf sapreorg/*

  12. rm –rf saparch/*

  13. rm –rf saptrace/usertrace/*

  14. rm –rf saptrace/background/*

  15. rm –rf sapbackup/*

  16. rm –rf sapcheck/*

On Windows systems, SAP and Oracle services can be stopped via the following commandline

program after logging as <sid>adm:

ntscmgr stop SAP<SID>_<SYSNO>

ntscmgr stop SAPOSCOL

ntscmgr stop OracleService<SID>

2. You have to resize the following file systems before restore process. Take into account sizes of

source system.

/oracle/<SID>/sapdata1

/oracle/<SID>/sapdata2

/oracle/<SID>/sapdata3

/oracle/<SID>/sapdata4

/oracle/<SID>/sapdata5

/oracle/<SID>/sapdata6

/oracle/<SID>/saparch

3. After cleaning necessary file systems/directories, you have to restore most current database

backup to target system. For this, find the detail backup log (e.g. bdkxxsrh.anf) for that backup on

source system. You can determine this from back<SID>.log summary backup log file or using

DB12.

Type Handbook Document

Area SAP Basis

Topic Homogeneous System Copy using Online/Offline Database Backup

Author Huseyin Bilgen

All Rights Reserved.

Copyright 2001-2003.basisconsultant.com Page 4 of 9

DB12 - Backup Logs

back<SID>.log File

Copy this detailed backup log file into /oracle/<TSID>/sapbackup directory on target system. Use

BRRESTORE command below to restore the source database on target system. You can also

restore datafiles and online redolog files (if you are using offline backup) using backup tools such

as BACKFM tool of IBM TSM.

On Windows systems, while restoring source database on target system, you have to keep

same mount points for Oracle Data Directories.

For example if all of your source data directories resides on "d:>" disk

(d:\oracle\<SSID>\sapdatax), then you have to create data dirs. at target system on "d:>" disk.

After restore process, you can change the directories. For example you can distribute sapdatax

directories on many disks. This will be mentioned in CONTROLFILE creation step later.

3.a. Mount the necessary backup volume on target system.

3.b. Use the following command to begin restore:

  1. su - ora<tsid>

  2. cd sapbackup

  3. brrestore -m full -b <det_log_file> -c

As a result of this command, a trace file (e.g. ora_54764_hvd.trc ) will be created under

/oracle/<SSID>/saptace/usertrace directory. File can be determined by sorting according to

modification/creation dates (UNIX: # ls –ltr). Most current file must be cheched.

You have to edit this file to be able to use for CONTROLFILE creation on target system.

Rename file name as CONTROL.SQL

Open file to edit using VI (UNIX) or NOTEPAD (WIN).

Remove all lines before "STARTUP MOUNT" line. Delete all commented "#" lines. Also

remove all lines after CHARACTER SET WE8DEC;" line.

Change all Source SID's to Target SID via following commands.

UNIX (VI): :%s/<SSID>/<TSID>/g

WIN (NOTEPAD): CTRL+H

Change the line

CREATE CONTROLFILE REUSE DATABASE ‘SSID’ NORESETLOGS ARCHIVELOG;

as follow

CREATE CONTROLFILE REUSE SET DATABASE ‘TSID’ RESETLOGS ARCHIVELOG;

If you want to change datafile or redolog file destinations, first move the files on target

destination at OS level, then edit CONTROL.SQL file for new destinations.

If structural changes made in database on source system just after the backup restored on

target machine, differences will exists between datafiles in sapdata directories and datafiles

referenced in CONTROL.SQL file. Because CONTROL.SQL file is created for the current

status of source system, but later added files doen't exists in backup so in target system. To

overcome this problem, just delete the datafiles from CONTROL.SQL file.

If you don't know which files are created after the backup, let the problems arise during

CONTROLFILE creation command, and delete the files mentioned as error from

CONTROL.SQL and re-run creation command.

After deletion and successful creation of CONTROLFILE's on target system, you have to take

into account the following subjects:

If you are not going to recover database to the most current status using archive files, then

there is no problem.

But if you are planning to recover database to the most current status using archive files,

then deleted datafiles will be problem later while application of archive files. At this

moment, we offer you to keep datafile names you deleted during CONTROLFILE creation

and add those datafiles with the same sizes on source system after CONTROLFILE

creation.

5. After CONTROL.SQL script preparation, following commands must be run to create

CONTROLFILE of target system:

  1. su – ora<targetsid>

Type Handbook Document

Area SAP Basis

Topic Homogeneous System Copy using Online/Offline Database Backup

Author Huseyin Bilgen

All Rights Reserved.

Copyright 2001-2003.basisconsultant.com Page 7 of 9

  1. svrmgrl

SVRMGR> connect internal

SVRMGR> @/<path_to_file>/control.sql

You have to guarantee the successful completion of this command as follow:

SVRMGR> @control.sql

Statement processed.

SVRMGR>

6. Database will be in inconsistent status after creation of CONTROLFILE. This can be viewed by

trying to open the database.

SVRMGR> alter database open;

alter database open

*

ORA-01589: must use RESETLOGS or NORESETLOGS option for database open

SVRMGR> alter database open resetlogs;

alter database open resetlogs

*

ORA-01195: online backup of file 1 needs more recovery to be consistent

ORA-01110: data file 1: '/oracle/<hedefSID>/sapdata1/system_1/system.data1'

At this step, a recovery must be made in order to be able to use the database.

7. 3 type of recovery can be made, according to your status mentioned at the end of STEP-3. all the

recovery types must be used by "USING BACKUP CONTROLFILE" as CONTROLFILE is created

manually.

7.a. If your source system is runnig in NOARCHIVELOG mode, then you have to use the

following command to recover database.

SVRMGR> recover database using backup controlfile until cancel;

7.b. If you restored an online backup on target system and put all the archive files created since

online backup start time, use the following commands.

SVRMGR> recover database using backup controlfile;

After execution of this command, Oracle will ask for archive files to be consistent. As archive

files contains only database changes commands, you will use source system archive file on

new systems database recovery. Copy all archive files created since online backup on source

system to archive directory of target system. Archive file names are different from asked

during recovery session. You can change archive file names for target system via the

following script.

cd /oracle/<TSID>/saparch

for i in `ls|grep <SSID>`;

do

file_name=`echo $i |cut -dD -f2`;

mv $i <TSID>$;

done

Alternatively you can enter file names manually as required by recovery session as follow:

SVRMGR> recover database using backup controlfile;

ORA-00279: change 44138924 generated at 03/26/2003 00:00:24 needed for thread 1

ORA-00289: suggestion : /oracle/HVS/saparch/HVSarch1_22746.dbf

ORA-00280: change 44138924 for thread 1 is in sequence #22746

Specify log: {<RET>=suggested | filename | AUTO | CANCEL}

/oracle/HVS/saparch/HVDarch1_22746.dbf

Log applied.

After application of all necessary archives (at least all the archives created during online

backup must be applied. Archives from this point can be applied to make database current),

next request for archive is cancelled via CANCEL command.

ORA-00279: change 44164157 generated at 03/26/2003 01:58:29 needed for thread 1

ORA-00289: suggestion : /oracle/HVS/saparch/HVSarch1_22754.dbf

ORA-00280: change 44164157 for thread 1 is in sequence #22754

Specify log: {<RET>=suggested | filename | AUTO | CANCEL}

CANCEL

Media recovery cancelled.

SVRMGR>

But recovery session must be started with the following command and cancelled again to ba

able to start database.

SVRMGR> recover database using backup controlfile until cancel;

ORA-00279: change 44164157 generated at 03/26/2003 01:58:29 needed for thread 1

ORA-00289: suggestion : /oracle/HVS/saparch/HVSarch1_22754.dbf

ORA-00280: change 44164157 for thread 1 is in sequence #22754

Specify log: {<RET>=suggested | filename | AUTO | CANCEL}

CANCEL

Media recovery cancelled.

SVRMGR>

Otherwise following error will arise during database opening.

SVRMGR> alter database open resetlogs;

alter database open resetlogs

*

ORA-01113: file 1 needs media recovery

ORA-01110: data file 1: '/oracle/HVS/sapdata1/system_1/system.data1'

To open database, use the following command:

SVRMGR> alter database open resetlogs;

Statement processed.

SVRMGR>

7.c. If you restored an offline backup on target system, you can recover database to the time of

backup completed or you can recover database to the most current status using archive files.

The archive application and statup of database is same as an online backed up database

copy in "7.b".

8. after opening database, LISTENER process must be started.

  1. su – ora<targetsid>

  2. lsnrctl start

On Windows systems, Oracle Listener is started as below:

ntscmgr start OracleOraHome817TNSListener

9. To open SAP system, use the following commands.

  1. su - <targetsid>adm

  2. startsap

On Windows systems, Oracle

Regards,

Jitendra Tiwari

former_member204746
Active Contributor
0 Kudos
Former Member
0 Kudos

Hi Eric,

thanks for your quick and helpfull answer

this helps me pretty much but now i'm with another issue regarding the same restore.

in this step, i have this:

SQL> recover database using backup controlfile until cancel;

ORA-00279: change 668413540 generated at 09/04/2007 23:05:02 needed for

1

ORA-00289: suggestion : F:\ORACLE\SL4\ORAARCH\SL4ARCHARC00001.001

ORA-00280: change 668413540 for thread 1 is in sequence #1

the question is that I didn't have this SL4ARCHARC00001.001 file and in original database it is not an file with this sequence number... why this happen if it is an offline backup ?

i've the datafiles and mirrlog/origlog from the backup... and some archives, how should i procede in this case ???

Thanks and best regards to all.

Pedro Rodrigues

Former Member
0 Kudos

UP

Help please.

Thanks!

former_member204746
Active Contributor
0 Kudos

Pedro, you started 2 topics with the same problem, please only post your problem once.