Академический Документы
Профессиональный Документы
Культура Документы
Objectives
After completing this lesson, you should be able to: Identify the causes of database corruption:
Hardware oftware
7-2
7-3
7-4
7-
7-!
Corruption+!elated 5eatures
"eat#re %'()&*"+ ANALYZE DB_BLOCK_CHECKING DB_BLOCK_CHECKSUM exp "lash/ac0 DBMS_REPAIR 'loc0 3edia recovery
Corr#ptio$ %etected ,hysical -ogical -ogical ,hysical ,hysical -ogical -ogical 4o$e
&epairs Corr#ptio$ "A-.) "A-.) "A-.) "A-.) "A-.) 1&2) 1&2) 1&2)
7-7
D%67!I58 4tility
$or&s only on data files9 redo log files cannot be chec&ed Chec&s bloc& consistency Can be used while the database is open #ame of the utility program: d"5
7-8
: A : 0 : B5A8DB +03B5A8DB2
7 - 60
ANALYZE Command
=erforms a logical bloc& chec& Does not mar& bloc&s as soft corrupt9 only reports them 6alidates inde< and table entries
SELF ANALYZE =ABLE table_name VALIDA=E < S=RGC=GRE CASCADEH SELF ANALYZE INDEI index_name VALIDA=E < S=RGC=GREH
7 - 66
7 - 62
1A,
7 - 63
7 - 64
D%A
4 7!
7-6
DBMS_REPAIR =ac&age
Available procedures CHECK_OBKEC= FII_CORRGP=_BLOCKS DGMP_ORPHAN_KEYS REBGILD_FREELIS=S SEGMEN=_FII_S=A=GS SKIP_CORRGP=_BLOCKS ADMIN_=ABLES
7 - 6!
4sing DBMS_REPAIR
.( Detect and report corruptions(
SE= SERVEROG=PG= ON DECLARE @(?_%$''()! IN=H BEGIN @(?_%$''()! :7 0H DBMS_REPAIR3CHECK_OBKEC= + 0%C*? _@ ?* 7F LHRJ1 $"M*%!_@ ?* 7F JDEPAR=MEN=SJ1 '*) -'_! "#*_@ ?* 7F JREPAIR_=ABLEJ1 %$''()!_%$(@! 7F @(?_%$''()!2H ENDH
7 - 67
7 - 68
4sing DBMS_REPAIR
B( "a&e objects usable(
SE= SERVEROG=PG= ON DECLARE @(?_,-> IN=H BEGIN @(?_,-> :7 0H DBMS_REPAIR3FII_CORRGP=_BLOCKS + 0%C*? _@ ?* 7F JHRJ1 $"M*%!_@ ?* 7F JDEPAR=MEN=SJ1 $"M*%!_!N)* 7F DBMS_REPAIR3=ABLE_OBKEC=1 '*) -'_! "#*_@ ?* 7F JREPAIR_=ABLEJ1 ,->_%$(@! 7F @(?_,->2H ENDH
7 - 65
4sing DBMS_REPAIR
C( !epair corruptions and rebuild lost data(
SE= SERVEROG=PG= ON DECLARE @(?_$')C @0 IN=H BEGIN @(?_$')C @0 :7 0H DBMS_REPAIR3DGMP_ORPHAN_KEYS + 0%C*? _@ ?* 7F JSCO==J1 $"M*%!_@ ?* 7F JPK_DEP=J1 $"M*%!_!N)* 7F DBMS_REPAIR3INDEI_OBKEC=1 '*) -'_! "#*_@ ?* 7F JREPAIR_=ABLEJ1 $')C @_! "#*_@ ?* 7F JORPHAN_KEY_=ABLEJ1 &*N_%$(@! 7F @(?_$')C @02H DBMS_OG=PG=3PG=_LINE+J$')C @ &*N %$(@!: J OO =O_CHAR+@(?_$')C @022H ENDH
7 - 20 Copyright 2008, Oracle. All rights reserved.
7 - 26
BLOCKRECOVER Command
2he !"A# BLOCKRECOVER command: Identifies the bac&ups containing the bloc&s to recover !eads the bac&ups and accumulates re3uested bloc&s into in+memory buffers "anages the bloc& media recovery session by reading the archive logs from bac&up if necessary Cannot be used for incomplete recovery
RMANF BLOCKRECOVER DA=AFILE B BLOCK DH
7 - 22
7 - 23
7 - 24
2he V6BACKGP_CORRGP=ION view shows the list of corrupted bloc&s in data file bac&ups( 2he V6COPY_CORRGP=ION view shows the list of corrupted bloc&s in image file copies(
7-2
7 - 2!
ummary
In this lesson, you should have learned how to: Identify the causes of database corruption:
Hardware oftware
7 - 27
7 - 28