Thursday, May 08, 2014

brrestore backup restoration options




To restore only Online redo log and control files.

If you see offline database backup log file, will show entry similar to below

--------------------------------------------------------------------------------------------------------------------------------------------------
BRBACKUP Action Log for Database PIP

From:          01.05.2014 00:13:07
LogFile:       benteodf.aft
Return Code:   0000 Success
Database Host: XXXXX

--------------------------------------------------------------------------------------------------------------------------------------------------
|Tape  |Position|Backup Time        |Compressn|DF ID|Back. ID|Redo No.|Tablespace |TS Stat.|DF Stat.|File Name                                   |
--------------------------------------------------------------------------------------------------------------------------------------------------
|010514|      4 |01.05.2014 00:15:11|         |   4 |        | 41,852 |PSAPSR3    |ONLINE  |ONLINE  |/oracle/PIP/sapdata1/sr3_1/sr3.data1        |
|010514|      5 |01.05.2014 00:16:27|         |   5 |        | 41,852 |PSAPSR3    |ONLINE  |ONLINE  |/oracle/PIP/sapdata2/sr3_2/sr3.data2        |
--
--
--
--
|010514|    158 |01.05.2014 04:13:00|         |   1 |        | 41,852 |           |        |        |/oracle/PIP/origlogA/log_g11m1.dbf          |
|010514|    159 |01.05.2014 04:13:12|         |   2 |        | 41,852 |           |        |        |/oracle/PIP/origlogB/log_g12m1.dbf          |
|010514|    160 |01.05.2014 04:13:23|         |   3 |        | 41,852 |           |        |        |/oracle/PIP/origlogA/log_g13m1.dbf          |
|010514|    161 |01.05.2014 04:13:33|         |   4 |        | 41,852 |           |        |        |/oracle/PIP/origlogB/log_g14m1.dbf          |
|010514|    162 |01.05.2014 04:13:42|         |   0 |        | 41,852 |           |        |        |/oracle/PIP/origlogA/cntrl/cntrlPIP.dbf     |
--------------------------------------------------------------------------------------------------------------------------------------------------


Based on above can able to idenfity online log file starting from position (DF ID) 1 to 4 while control file position (DF ID) 0

Execute brrestore command i.e. brrestore -b <backuplogfile name> -m <starting position DF ID>-<ending posistion DF ID>,<0 for control file DF ID>

ipldia10:orapip 20> brrestore -b benteodf.aft -m 01-04,0
BR0401I BRRESTORE 7.20 (29)
BR0405I Start of file restore: rentklfs.rsb 2014-05-02 04.58.00
BR0484I BRRESTORE log file: /oracle/PIP/sapbackup/rentklfs.rsb

BR0280I BRRESTORE time stamp: 2014-05-02 04.58.00
BR0407I Restore of database: PIP
BR0408I BRRESTORE action ID: rentklfs
BR0409I BRRESTORE function ID: rsb
BR0449I Restore mode: partial
BR0411I Database files for restore:
/oracle/PIP/origlogA/log_g11m1.dbf
/oracle/PIP/mirrlogA/log_g11m2.dbf
/oracle/PIP/origlogB/log_g12m1.dbf
/oracle/PIP/mirrlogB/log_g12m2.dbf
/oracle/PIP/origlogA/log_g13m1.dbf
/oracle/PIP/mirrlogA/log_g13m2.dbf
/oracle/PIP/origlogB/log_g14m1.dbf
/oracle/PIP/mirrlogB/log_g14m2.dbf
/oracle/PIP/origlogA/cntrl/cntrlPIP.dbf
/oracle/PIP/origlogB/cntrl/cntrlPIP.dbf
/oracle/PIP/sapdata1/cntrl/cntrlPIP.dbf
BR0419I Files will be restored from backup: benteodf.aft 2014-05-01 00.13.07
BR0416I 5 files found to restore, total size 824.988 MB
BR0424I Files will not be decompressed
BR0421I Restore device type: tape
BR0102I Following backup device will be used: /dev/rmt/3mn
BR0103I Following backup volume will be used: 010514 (2014-05-01 00.13.07)

BR0280I BRRESTORE time stamp: 2014-05-02 04.58.00
BR0256I Enter 'c[ont]' to continue, 's[top]' to cancel BRRESTORE:
c
BR0280I BRRESTORE time stamp: 2014-05-02 04.58.11
BR0257I Your reply: 'c'
BR0259I Program execution will be continued...

BR0208I Volume with name 010514 (2014-05-01 00.13.07) required in device /dev/rmt/3mn
BR0210I Please mount BRBACKUP volume, if you have not already done so

BR0280I BRRESTORE time stamp: 2014-05-02 04.58.11
BR0256I Enter 'c[ont]' to continue, 's[top]' to cancel BRRESTORE:
c
BR0280I BRRESTORE time stamp: 2014-05-02 04.58.14
BR0257I Your reply: 'c'
BR0259I Program execution will be continued...

BR0280I BRRESTORE time stamp: 2014-05-02 04.58.14
BR0226I Rewinding tape volume in device /dev/rmt/3m ...

BR0351I Restoring /oracle/PIP/sapreorg/.tape.hdr0
BR0355I from /dev/rmt/3mn ...

BR0241I Checking label on volume in device /dev/rmt/3mn

BR0209I Volume in device /dev/rmt/3mn has name 010514 (2014-05-01 00.13.07)

BR0280I BRRESTORE time stamp: 2014-05-02 04.59.46
BR0199I Volume label checked successfully

BR0351I Restoring /oracle/PIP/origlogA/log_g11m1.dbf
BR0355I from /dev/rmt/3mn ...

#FILE..... /oracle/PIP/origlogA/log_g11m1.dbf
#RESTORED. log_g11m1.dbf  010514/158

BR0280I BRRESTORE time stamp: 2014-05-02 05.01.23
BR0418I 1 of 5 files restored - 200.001 of 824.988 MB done
BR0204I Percentage done: 24.24%, estimated end time: 5:11
BR0001I ************______________________________________

BR0351I Restoring /oracle/PIP/origlogB/log_g12m1.dbf
BR0355I from /dev/rmt/3mn ...

#FILE..... /oracle/PIP/origlogB/log_g12m1.dbf
#RESTORED. log_g12m1.dbf  010514/159

BR0280I BRRESTORE time stamp: 2014-05-02 05.01.25
BR0418I 2 of 5 files restored - 400.002 of 824.988 MB done
BR0204I Percentage done: 48.49%, estimated end time: 5:04
BR0001I ************************__________________________

BR0351I Restoring /oracle/PIP/origlogA/log_g13m1.dbf
BR0355I from /dev/rmt/3mn ...

#FILE..... /oracle/PIP/origlogA/log_g13m1.dbf
#RESTORED. log_g13m1.dbf  010514/160

BR0280I BRRESTORE time stamp: 2014-05-02 05.01.26
BR0418I 3 of 5 files restored - 600.003 of 824.988 MB done
BR0204I Percentage done: 72.73%, estimated end time: 5:02
BR0001I ************************************______________

BR0351I Restoring /oracle/PIP/origlogB/log_g14m1.dbf
BR0355I from /dev/rmt/3mn ...

#FILE..... /oracle/PIP/origlogB/log_g14m1.dbf
#RESTORED. log_g14m1.dbf  010514/161

BR0280I BRRESTORE time stamp: 2014-05-02 05.01.27
BR0418I 4 of 5 files restored - 800.004 of 824.988 MB done
BR0204I Percentage done: 96.97%, estimated end time: 5:01
BR0001I ************************************************__

BR0351I Restoring /oracle/PIP/origlogA/cntrl/cntrlPIP.dbf
BR0355I from /dev/rmt/3mn ...

#FILE..... /oracle/PIP/origlogA/cntrl/cntrlPIP.dbf
#RESTORED. cntrlPIP.dbf  010514/162

BR0280I BRRESTORE time stamp: 2014-05-02 05.01.27
BR0418I 5 of 5 files restored - 824.988 of 824.988 MB done
BR0204I Percentage done: 100.00%, estimated end time: 5:01
BR0001I **************************************************

BR0351I Restoring /oracle/PIP/mirrlogA/log_g11m2.dbf
BR0355I from /oracle/PIP/origlogA/log_g11m1.dbf ...

BR0351I Restoring /oracle/PIP/mirrlogB/log_g12m2.dbf
BR0355I from /oracle/PIP/origlogB/log_g12m1.dbf ...

BR0351I Restoring /oracle/PIP/mirrlogA/log_g13m2.dbf
BR0355I from /oracle/PIP/origlogA/log_g13m1.dbf ...

BR0351I Restoring /oracle/PIP/mirrlogB/log_g14m2.dbf
BR0355I from /oracle/PIP/origlogB/log_g14m1.dbf ...

BR0351I Restoring /oracle/PIP/origlogB/cntrl/cntrlPIP.dbf
BR0355I from /oracle/PIP/origlogA/cntrl/cntrlPIP.dbf ...

BR0351I Restoring /oracle/PIP/sapdata1/cntrl/cntrlPIP.dbf
BR0355I from /oracle/PIP/origlogA/cntrl/cntrlPIP.dbf ...

BR0280I BRRESTORE time stamp: 2014-05-02 05.01.39
BR0226I Rewinding tape volume in device /dev/rmt/3m ...

BR0406I End of file restore: rentklfs.rsb 2014-05-02 05.03.20
BR0280I BRRESTORE time stamp: 2014-05-02 05.03.20
BR0402I BRRESTORE completed successfully
ipldia10:orapip 21>

To restore selecting data file, online redo log and control files.

Execute brrestore command i.e. brrestore -b <backuplogfile name> -m <staring position DF ID of datafile>,<ending position DF ID of data file> <starting position DF ID>-<ending posistion DF ID>,<0 for control file DF ID>

Restoring data file from DF ID 1 to 15 with online redo log 4 files and control file.
ipldia10:orapip 20> brrestore -b benteodf.aft -m 1,15 01-04,0

To restore only data file.

Execute brrestore command i.e. brrestore -b <backuplogfile name> -m all

Restoring data file from DF ID 1 to 15 with online redo log 4 files and control file.
ipldia10:orapip 20> brrestore -b benteodf.aft -m all

Restore full backup including data, online log and control file

Execute brrestore command i.e. brrestore -b <backuplogfile name> -m full
ipldia10:orapip 20> brrestore -b benteodf.aft -m full


Examples of BRRESTORE Runs

1.       brrestore -b last -m all
Restore all tablespaces without the control file and online redo log files from the last successful backup

2.       brrestore -b bcnmhluz.aft -m full
Restores all the files from backup bcnmhluz.aft, including the control file and the online redo log files
Restores the mirror copies of the control file and the online redo log files

3.       brrestore -m /usr/sap/C11/SYS/profile
Restores the SAP profiles

4.       brrestore -m /oracle/C11/sapdata1=/oracle/C11/sapdata5
Restores all the database data files that were originally stored in the subdirectories of /oracle/C11/sapdata1 in directory /oracle/C11/sapdata5
brrestore -b last -m 1-10,01-04,0

Restores all the database data files with Oracle file IDs from 1 through 10, the four online redo log files, and the control file starting from the last successful backup
Restores the mirror copies of the control file and the online redo log files

5.       brrestore -m 0
Restores the control file. Restore the mirror copies of the control file

6.       brrestore -b last -m /oracle/C11/sapdata2/ddicd_5/ddicd.data5
Restores a database data file starting from the last successful backup

7.       brrestore -a 200-220
Restores the archived redo log files with the log sequence numbers from 200 through 220 into the archiving directory

8.       brrestore -a 40-70=/oracle/C11/sapbackup 71-90=/oracle/C11/sapreorg
Restores the archived redo log files with the log sequence numbers from 40 through 70 in directory sapbackup and those with the log sequence numbers from 71
through 90 in directory /oracle/C11/sapreorg

9.       brrestore -a 40-69,70-100=/oracle/C11/sapbackup
Restores the archived redo log files with the log sequence numbers from 40 through 69 in the archiving directory, and those with the log sequence numbers from 70 through 100 in directory sapbackup

10.   brrestore -n det_log
Restores a detail log to the local working directory

1 comment:

Unknown said...

Excellent post! Appreciate it!