Sei sulla pagina 1di 33

1.

Database backups
1. Database all data files ( CRD Files).

Database Backups Page 1


Database Backups Page 2
2. Loss of System.dbf file.

a.

b.

Database Backups Page 3


b.

c.

d.

Database Backups Page 4


e.

3. Loss of Control File.

a.

b.

Database Backups Page 5


c.

d.

Database Backups Page 6


Database Backups Page 7
Database Backups Page 8
3. Loss of Control files Recovering Manually .

Vi crete_ctl.sql

Database Backups Page 9


Edit crectl.sql

Database Backups Page 10


SQL> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-01194: file 1 needs more recovery to be consistent
ORA-01110: data file 1: '/u01/app/oracle/oradata/rev1/system01.dbf'

SQL> recover database using backup controlfile until cancel;


ORA-00279: change 557988 generated at 09/21/2010 16:13:51 needed for thread 1
ORA-00289: suggestion :
/u01/app/oracle/flash_recovery_area/REV1/archivelog/2010_09_21/o1_mf_1_4_
%u_.arc
ORA-00280: change 557988 for thread 1 is in sequence #4

Specify log: {=suggested | filename | AUTO | CANCEL}


auto
ORA-00308: cannot open archived log
'/u01/app/oracle/flash_recovery_area/REV1/archivelog/2010_09_21/o1_mf_1_4_
%u_.ar
c'
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory
Additional information: 3

ORA-00308: cannot open archived log


'/u01/app/oracle/flash_recovery_area/REV1/archivelog/2010_09_21/o1_mf_1_4_
%u_.ar
c'
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory
Additional information: 3

ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
ORA-01194: file 1 needs more recovery to be consistent
ORA-01110: data file 1: '/u01/app/oracle/oradata/rev1/system01.dbf'

apply the current online redolog files for recover the database here in our example the
current
logfile is redo02.log
SQL> col member format a50
SQL> select a.group#,a.member,b.status from v$logfile a, v$log b where
a.group#=b.group#;

GROUP# MEMBER STATUS


---------- -------------------------------------------------- ----------------
3 /u01/app/oracle/oradata/rev1/redo03.log ACTIVE
2 /u01/app/oracle/oradata/rev1/redo02.log CURRENT
1 /u01/app/oracle/oradata/rev1/redo01.log ACTIVE

SQL> recover database using backup controlfile until cancel;

Database Backups Page 11


ORA-00279: change 557988 generated at 09/21/2010 16:13:51 needed for thread 1
ORA-00289: suggestion :
/u01/app/oracle/flash_recovery_area/REV1/archivelog/2010_09_21/o1_mf_1_4_
%u_.arc
ORA-00280: change 557988 for thread 1 is in sequence #4

Specify log: {=suggested | filename | AUTO | CANCEL}


/u01/app/oracle/oradata/rev1/redo02.log
Log applied.
Media recovery complete.

4. Loss of Redo log Files.

Database Backups Page 12


Database Backups Page 13
Database Backups Page 14
5. Loss of Undo table space.

Database Backups Page 15


Database Backups Page 16
6. Loss of non-system dbf files which is not in the present backup set.

Database Backups Page 17


7. Loss on Non-system dbf files which is our present backup set.

Database Backups Page 18


8. Loss of point-in-time recovery ( Oracle 11g R3)
Ref:- http://oracleinstance.blogspot.in/2011/08/rman-tablespace-point-
in-time-recovery.html

Database Backups Page 19


Database Backups Page 20
Database Backups Page 21
Database Backups Page 22
Database Backups Page 23
Database Backups Page 24
Database Backups Page 25
Database Backups Page 26
Database Backups Page 27
Database Backups Page 28
9.Perform Block Media Recovery using RMAN

When you get some data blocks in the data files physically corrupt, then you will
have to restore the full data file from backup for the recovery of those few block,
if you don't have RMAN backups. But if you do then you can take benefit of this
very powerful feature of RMAN called BMR (BLOCK MEDIA RECOVERY). Using
BMR only those blocks which are corrupt can be recovered from a backup instead
of recovering whole file.

Database Backups Page 29


We have a tablespace srini, which has a table named Sri owned by the user srini.
Lets take a backup of this tablespace using RMAN.

Database Backups Page 30


Now we have a backup of data file "/u01/oradata/raja/srini.dbf" tagged as
healthy.
Lets see where in the data file this table is sitting.

The header of the table is in block 43, so if the block 44 or so are corrupted we
will get an error when we try to select data from the table. Lets corrupt block 44
using the "dd" command in Linux.
DISCLAIMER: The dd command given below is just for learning purposes and
should only be used on testing systems. I will not take any responsibility of any
consequences or loss of data caused by this command.

Database Backups Page 31


After this command successfully executed block 44 in the data file
"/u01/oradata/raja/srini.dbf" is corrupt.

/*
We need to flush the buffer_cache because if the block 44 is
in the buffer_cache already it will not be read from the data file.
*/

The error that we get due to a block corruption is very clear. It will tell you the file
and block#.
Let’s do BMR for data file 5 and block 44.

Database Backups Page 32


BLOCK MEDIA RECOVERY Complete we should now get the block 44 recovered
back.

Database Backups Page 33

Potrebbero piacerti anche