cancel
Showing results for 
Search instead for 
Did you mean: 

Question on BRRESTORE with RMAN...

symon_braunbaer
Participant
0 Kudos

Dear experts,

we are moving towards integrating RMAN in BRBACKUP for all the systems in our environment.

We have also decided to take Full (level 0) backups twice per week and cumulative backups

each evening.

I would like to ask on 2 details in case I would need to restore such a cumulative backup:

I. How is the restore exactly done ? This is how I currently picture it for myself:

1. The full backup would need to be restored first.

2. Apply the offline redologs that were generated during this full level 0 backup

3. Then restore the last available cumulative backup

4. In the end, apply the offline redollogs generated during this cumulative backup

Or perhaps step 2. is not necessary ?

II. I have come across the following document:

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a8910c3a-0d01-0010-a6a9-f4a8aae14...

I am a bit confused by the following statement on page 6:

In contrast to the BRRESTORE restore process without RMAN, which requires a closed database, restoring with RMAN requires the database to be mounted

What exactly does that mean ? Do I imagine the restore process wrongly, as I depicted it in I. ??? Kindly advise and let me know

in a clear and understandable form, not in the common fuzzy SAP language 🙂 Many thanks in advance!

Accepted Solutions (1)

Accepted Solutions (1)

Reagan
Advisor
Advisor
0 Kudos

Hello Symon

Let's say you have two backups taken.

1 - Full online taken on Monday (9:00 AM CET - 11:00 AM CET)

2 - Incremental backup taken on Wednesday (9:00 AM CET - 10:00 AM CET)

On Thursday you want to do a restore to get the data until the end of the Wednesday backup time (10:00 AM CET). In this case you will first need to restore the full backup taken on Monday and then apply the incremental backup taken on Wednesday OR apply the archived logs created from Monday (11:00 AM CET) until Wednesday (10:00 AM CET). Check this link 4.4 RMAN Incremental Backups to understand what the RMAN incremental backup is all about.

Regarding the restore part, yes you will need to restore the control files and put the DB into mount status before you start the restore.

RB

symon_braunbaer
Participant
0 Kudos

Hi Reagan,

is it possible to start the database in mount mode just having a control file and no datafiles ? This is quite confusing...

former_member206552
Active Contributor
0 Kudos

hi symon

How a Database Is Mounted

The instance mounts a database to associate the database with this instance. To mount the database, the instance obtains the names of the database control files specified in the CONTROL_FILES initialization parameter and opens the files. Oracle Database reads the control files to find the names of the data files and the online redo log files that it will attempt to access when opening the database.

In a mounted database, the database is closed and accessible only to database administrators. Administrators can keep the database closed while completing specific maintenance operations. However, the database is not available for normal operations.

If Oracle Database allows multiple instances to mount the same database concurrently, then the CLUSTER_DATABASE initialization parameter setting can make the database available to multiple instances. Database behavior depends on the setting:

Reagan
Advisor
Advisor
0 Kudos

Hello Symon

>> is it possible to start the database in mount mode just having a control file and no datafiles ? This is quite confusing...

Yes it is possible.

Reagan

symon_braunbaer
Participant
0 Kudos

Thanks to all of you !! I will make some experiments in a test system and then I will either come back with more questions or I will nominate the correct answer. Thanks!

symon_braunbaer
Participant
0 Kudos

Hello Reagan,

this was a little bit messy for me - YES, it is possible to mount the database when only a control file is present, but unfortunately it is not possible to create a new control file if the data files are not there.

So, a simple restore to the same system worked flawlessly.

Though I have now decided to try a refresh and I am facing a situation during the restore.

Here is what I have done thus far:

1) Stopped the database and deleted all the data files and control file copies

2) Restored an old control file of the original DB

3) Started brrestore:

brrestore -p init<SID>.sap -b bepjdvtp.anr -c force -m full

Unfortunately this is failing with the following error:

RMAN>

RMAN> connect target *

connected to target database: Z07 (DBID=1834503450, not open)

using target database control file instead of recovery catalog

RMAN> **end-of-file**

RMAN>

host command complete

RMAN>

sql statement: alter session set optimizer_mode=RULE

RMAN> 2> 3> 4> 5> 6> 7> 8> 9> 10> 11> 12> 13> 14> 15> 16> 17> 18> 19> 20> 21> 22> 23> 24> 25> 26> 27> 28> 29> 30> 31>

allocated channel: sbt_1

channel sbt_1: SID=147 device type=SBT_TAPE

channel sbt_1: Data Domain Boost API

allocated channel: sbt_2

channel sbt_2: SID=195 device type=SBT_TAPE

channel sbt_2: Data Domain Boost API

allocated channel: sbt_3

channel sbt_3: SID=241 device type=SBT_TAPE

channel sbt_3: Data Domain Boost API

allocated channel: sbt_4

channel sbt_4: SID=291 device type=SBT_TAPE

channel sbt_4: Data Domain Boost API

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 09-DEC-14

released channel: sbt_1

released channel: sbt_2

released channel: sbt_3

released channel: sbt_4

RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-03002: failure of restore command at 12/09/2014 17:03:34

RMAN-06026: some targets not found - aborting restore

RMAN-06023: no backup or copy of datafile 19 found to restore

RMAN-06023: no backup or copy of datafile 18 found to restore

RMAN-06023: no backup or copy of datafile 12 found to restore

RMAN-06023: no backup or copy of datafile 8 found to restore

RMAN-06023: no backup or copy of datafile 4 found to restore

RMAN-06023: no backup or copy of datafile 2 found to restore

RMAN-06023: no backup or copy of datafile 21 found to restore

RMAN-06023: no backup or copy of datafile 20 found to restore

RMAN-06023: no backup or copy of datafile 9 found to restore

RMAN-06023: no backup or copy of datafile 5 found to restore

RMAN-06023: no backup or copy of datafile 1 found to restore

RMAN-06023: no backup or copy of datafile 17 found to restore

RMAN-06023: no backup or copy of datafile 3 found to restore

RMAN-06023: no backup or copy of datafile 10 found to restore

RMAN-06023: no backup or copy of datafile 6 found to restore

RMAN-06023: no backup or copy of datafile 16 found to restore

RMAN-06023: no backup or copy of datafile 11 found to restore

RMAN-06023: no backup or copy of datafile 7 found to restore

I have googled and found descriptions of this problem only for pure oracle installations. At one

site they recommend creating the same directory structure, which I have reproduced by creating a soft link:

oraSID> cd /oracle

oraSID> ln -s <targetSID> <sourceSID>

I verified that cd /oracle/<sourceSID>/sapdata1 works and is sending me where it is supposed to, but the restore keeps failing with the same error RMAN-06023. Please kindly advise on how to circumvent this error.

Many thanks!

Reagan
Advisor
Advisor
0 Kudos

Hello Symon

If you are restoring the production system backup to the test system then first restore the control files of the source system (production) on the target system. Mount the database with those control files as source system and finally start the restore.

RB

symon_braunbaer
Participant
0 Kudos

Hi Reagan,

unfortunately it seems to be more difficult than anticipated! While I didn't have problems to do a simple restore, with refresh it is quite tricky...

I thought of restoring the control files of the source system even before I have read your post, as rman writes its info to the control files! I also had to rename them from cntrl<sourceSID>.dbf to cntrl<targetSID>.dbf. But then I could still not mount the DB, because it sees the sourceSID in the control files! So, there is something additional, that I am missing...

The is the error I am getting:

SQL> alter database mount;

alter database mount

*

ERROR at line 1:

ORA-01103: database name 'sourceSID' in control file is not 'targetSID'

Reagan
Advisor
Advisor
0 Kudos

Hello Symon

Create a pfile on the production system and move it to the quality system $ORACLE_HOME/dbs

Restore the production control files on the target system.

Start the database into mount using the pfile

startup mount pfile='$ORACLE_HOME/dbs/initSID.ora'

Start the restore.

Reagan

symon_braunbaer
Participant
0 Kudos

Hi Reagan,

of course I thought of this and I will try it, when you are suggesting it now as well, but this is getting too complex just for a refresh...

Many thanks and I will report back!

symon_braunbaer
Participant
0 Kudos

Hi Reagan,

many many thanks !!! It worked !!! Just with rman the refresh procedure is becoming more complicated, but what to do... Anyway, you are winning all the points

symon_braunbaer
Participant
0 Kudos

Hello,

sorry, but I have one more question... I am now testing also how to restore an incremental backup.

I am launching the following command:

brrestore -p init<SID>.sap -b bepjrwiq.inr -c force -m incr

It works fine, just unfortunately it doesn't restore any redolog file(s), that were taken during the incremental backup:

BR0280I BRRESTORE time stamp: 2014-12-12 13.56.33

BR0560I Restoring save set piece - piece handle=<SID>_bepjrwiq.6174_1 tag=BEPJRWIQ

BR0280I BRRESTORE time stamp: 2014-12-12 13.56.33

BR0560I Restoring save set piece - piece handle=<SID>_bepjrwiq.6173_1 tag=BEPJRWIQ

#INCR..... BEPJRWIQ.INCR

#RESTORED. bepjrwiq  5894-5899/6172-6175

BR0522I 18 of 18 files / save sets processed by RMAN

BR0280I BRRESTORE time stamp: 2014-12-12 13.56.46

BR0558I Restore of incremental database backup using RMAN successful

BR0406I End of file restore: repjwioi.rsb 2014-12-12 13.56.46

BR0280I BRRESTORE time stamp: 2014-12-12 13.56.46

BR0403I BRRESTORE completed successfully with warnings

while there was really 1 redolog file, taken with that incremental backup:

BR0280I BRBACKUP time stamp: 2014-12-11 16.07.55

BR0544I Saving offline redolog file save set piece - piece handle=<SID>_bepjrwiq.6178_1 tag=BEPJRWIQ comment=API Version 2.0,MMS Version 1.1.1.3

#ARCHIVE.. /oracle/<SID>/oraarch/<SID>arch1_16958_839346840.dbf

#SAVED.... bepjrwiq  5900/6178

BR0522I 1 of 1 file / save set processed by RMAN

Please kindly advise how to restore that redolog file as well...

Reagan
Advisor
Advisor
0 Kudos

I basically restore the offline redo logs like this

Eg: For a single file:

brrestore -u / -p /oracle/SID/112_64/dbs/initSID_redologs.sap -d util_file -a 16958

Eg: For files from N1 to N10:

brrestore -u / -p /oracle/SID/112_64/dbs/initSID_redologs.sap -d util_file -a 16958-16960

Cheers

RB

symon_braunbaer
Participant
0 Kudos

Reagan, man, I thought about this on the way when I was leaving from work!

In the past I have been doing that on other Customers as well.

For this Customer, when restoring a full backup, the offline redologs are being automatically put in /oracle/<SID>/oraarch as well, which is quite convenient!

Just for me it is a riddle, why it is not the same with restoring an incremental backup...

I will check your suggestion on monday and I'll report back!

Many thanks!!

symon_braunbaer
Participant
0 Kudos

Hello Reagan,

there is a small problem - I can restore the offline redolog (1 file) on the source system,

but I am unable to restore it on the target system:

ora<targetSID>> brrestore -u / -c force -p init<sourceSID>.sap -a 16958

...

RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-03002: failure of restore command at 12/15/2014 13:40:24

RMAN-06026: some targets not found - aborting restore

RMAN-06025: no backup of archived log for thread 1 with sequence 16958 and starting SCN of 209962856 found to restore

...

Do you have an idea ? Do I have some wrong settings in the init<sourceSID>.sap file ?

Btw. I was able to restore the archivelog successfully using RMAN directly:

RMAN> restore archivelog sequence 16958;

Reagan
Advisor
Advisor
0 Kudos

Hello Symon

It appears to me that BR*Tools is unable to find the offline redo logs with the .sap profile you have supplied. This could possibly be due to the files were saved with a different .sap profile. I would check the archiving logs present at /oracle/SID/saparch and find out which .sap profile was used to backup those archive logs.

Reagan

symon_braunbaer
Participant
0 Kudos

Hi Reagan,

I am attempting to restore using the init<sourceSID>.sap profile. It is identical with the original profile from the source system, I have just modified the paths to the DD libraries, in order for RMAN to work. All the other paths are available with the old SID by means of a soft link which I have created (see above, I mentioned it somewhere). There must be something else being missed. I found one more thread on SCN, where somebody complains that he can only restore old redologs, all the symptoms are very similar to mine, though unfortunately this thread is unanswered.

Thank you!

Answers (3)

Answers (3)

Former Member
0 Kudos

I would like to ask on 2 details in case I would need to restore such a cumulative backup:

I. How is the restore exactly done ? This is how I currently picture it for myself:

The restore will be done using brtools only. You can either use the brtools menu or the corresponding brrecover/brrestore commands. Commands will be same. It doesn't matter if backup is being done using brtools with RMAN or brtools alone. Commands don't change

1. The full backup would need to be restored first.

Yes you will have to restore full backup ( either taken online or offline level 0 backup) for point in time recovery of complete recovery from crash.

2. Apply the offline redologs that were generated during this full level 0 backup

   Depends, if your backup was taken offline or online. For online you definitely have to restore redologs as well for consistent recovery. For offline line backup if you want to roll forward the database to a particular point , then you can restore the offline redologs.

3. Then restore the last available cumulative backup

  You can either restore the incremental backups or you can restore the redo log files. But if you are using the brtools menu options to restore the backups  this will be the first option.( restore incremental backups)

4. In the end, apply the offline redollogs generated during this cumulative backup


You can either restore the incremental backups or you can restore the redo log files.

The mounting and un-mounting  start/stop of database will be controlled by brtools/brrecover itself while doing the restore.

Thanks

Amit

symon_braunbaer
Participant
0 Kudos

Hello and thanks to everybody for your answers! Amit, your answer is the one mostly

oriented towards my questions.

I just do not understand this sentence of yours: "You can either restore the incremental backups or you can restore the redo log files."

If I will only be restoring and applying redo log files, then I do not understand why do I need incremental backups ? Also, how exactly is an incremental backup "connected" to a level 0 backup ? Does it include the changes made during the level 0 backup ? (which are usually kept in the offline redologs being created during the backup) or it includes everything since the point of restoring the level 0 backup and its redologs...

@Fidel - I will read all the links you supplied, many thanks!

Former Member
0 Kudos

Hi Symon,

If I will only be restoring and applying redo log files, then I do not understand why do I need incremental backups ?


What I mean is , you can either apply the incremental backups or the redologs since the last full full online (level 0) backup. Incremental will be easier to restore, it might take long time to restore all redologs since the last full incremental backup.


Also, how exactly is an incremental backup "connected" to a level 0 backup ? Does it include the changes made during the level 0 backup ?

No, incremental backup contains the changes which are made to the database after the full online(level 0) backup, same as redologs. Normally the incremental backup is done with the redologs (incremental online+redologs option) , otherwise it can't be consistently restored.


(which are usually kept in the offline redologs being created during the backup) or it includes everything since the point of restoring the level 0 backup and its redologs...


Offline redologs contain all the changes being made to the database, ( for eg after a full online backup). Same are also contained in the incremental backup which is taken after the full online backup.


So you can restore either the redologs or the incremental backups. Incremental backups would be easier to restore and I think will take less time, but you can test such a scenario on one of your test system and check which approach takes is faster.

With brtools, restoring incremental backup is the first option.

Thanks

Amit

0 Kudos

Ok,

First of all, probably you should learn about BRRECOVER, which is the tool you should use, not BRRESTORE, therefore, I strongly recommend you to read the BR*Tools documentation, for example "Getting Started with BR*Tools". If you are confusing tools at this level you can make big, big mistakes.

Then, I recommend you to read the RMAN documentation (instead of going to "other" websites where they talk about "other" things) where you can learn about incremental backups (as it seems you do not understand them properly) for example "Recovery with incremental Backups"

Nevertheless, if you use BRRECOVER, it will be guiding you on what has to be done and what backups/archives are needed depending on what you want to do as the procedure might be different if you want to recover from a missing file, missing database, point in time recovery ...

Former Member
0 Kudos

Hi Symon,

You can follow below link you will get information about RMAN Restore and RMAN DB refresh Activity.

System refresh using RMAN backup

http://basissap.blogspot.in/2012/05/system-refresh-using-rman-backup.html

But all the scenarios first we have to generate the Control file ----

After restore with last successful backup ----

Then Database mount state we recover redo log files.

RECOVER DATABASE USING BACKUP CONTROLFILE UNTIL CANCEL---command


Regards,

Pravin

symon_braunbaer
Participant
0 Kudos

Thank you, Pravin, but this blog doesn't explain it well 😕 For example, on point

6.

Restore the DB control files saved with the Level 1 backup (This is the .inr file)

   brrestore -b <.inr file> -m 0 -d rman_util

which control file is being restored ? The one of the source system or the one of the target system ? Please also refer to my last post in reply to Reagan...