SlideShare ist ein Scribd-Unternehmen logo
1 von 4
Downloaden Sie, um offline zu lesen
Checking backups for corruption                                             Backup and Recovery Tips




Checking backups for corruption

If you use RMAN to perform backups, the contents of this paper don’t apply to you. Being
an Oracle utility, RMAN knows the structure of Oracle blocks, and can therefore detect
corruption as it is backing things up. If any corruption is encountered, it will throw an
error stack the size of the Empire State Building, and proceed no further.

If you are using Operating System techniques to take your backups, though, then there is a
real risk that the resulting copies of Data Files and so forth might get corrupted as part of
the backup process –or that the Data Files themselves already contain corruption, which
the O/S just happily copies across, oblivious to its presence.

Fortunately, Oracle supplies a handy little utility called “dbverify” which can be used to
check the backed up copies of the Data Files for corruption, once the backup has finished.

This utility is run from the command line, by typing in the command dbv. You simply tell
it what files to check, and supply some other run-time parameters if needed. You might
type something like this, therefore:

C:>     DBV FILE=D:BACKUPSSYSTEM01.BKP BLOCKSIZE=8192 LOGFILE=DBVLOG.TXT


Note that you must tell dbverify what size Oracle blocks to expect when it scans the Data
File copy. If you miss that parameter out, dbverify will expect to find 2K blocks, and when
it encounters anything else, will simply abort with an error. Curiously, the error message
will tell you precisely what block size it did encounter –and you might well wonder why, if
it can identify the correct block size for the sake of error reporting, it doesn’t simply go on
to use the discovered block size for its continued work! One of life’s little mysteries, I
guess –and we just have to live with it.

You’ll also notice there a ‘logfile’ parameter. That’s so that dbverify’s work can be output
to a text file for later reading. If you miss it out, the results of the check are simply
displayed on screen, which is probably not exactly what you want.

There are some other parameters that can be supplied, too. For example, you can request
a check of parts of a Data File copy, by specifying the start and end block addresses. If
you need the complete list of available parameters, just type:

C:>     DBV HELP=Y


When dbverify has completed its work, you’ll want to check the logfile output. That will
look a bit like this:




Copyright © Howard Rogers 2001             24/10/2001                                      Page 1 of 4
Checking backups for corruption                                                 Backup and Recovery Tips


DBVERIFY: RELEASE 9.0.1.1.1 - PRODUCTION                 ON    FRI OCT 19 09:21:30 2001

(C) COPYRIGHT 2001 ORACLE CORPORATION. ALL                   RIGHTS RESERVED.



DBVERIFY - VERIFICATION           STARTING   : FILE = D:BACKUPS SYSTEM01.BKP

DBVERIFY - VERIFICATION           COMPLETE


TOTAL    PAGES     EXAMINED            :   83200
TOTAL    PAGES     PROCESSED (DATA)    :   50807
TOTAL    PAGES     FAILING (DATA)      :   0
TOTAL    PAGES     PROCESSED (INDEX)   :   7537
TOTAL    PAGES     FAILING (INDEX)     :   0
TOTAL    PAGES     PROCESSED (OTHER)   :   1342
TOTAL    PAGES     PROCESSED (SEG)     :   0
TOTAL    PAGES     FAILING (SEG)       :   0
TOTAL    PAGES     EMPTY               :   23514
TOTAL    PAGES     MARKED CORRUPT      :   0
TOTAL    PAGES     INFLUX              :   0

Here, the word “page” means an Oracle block. So this report indicates that 83,200 blocks
were looked at –and the key bit is that none of them are reported as “failing” or “marked
corrupt”. That means this backup file can be considered clean, and there’d be no
problems using it during a recovery.

In case you’re wondering, the “Total Pages Influx” line is there because dbverify can be
used to check for corruption in online Data Files, not just backup copies of them. When
used for that purpose, it’s possible that DBWR is writing to a block just as dbverify wishes
to check it –at which point, dbverify gives up, and just declares that the block was being
changed as it was being investigated.

I’d go so far as to suggest that no Operating System-type backup can be considered
complete without running dbverify against every data file copy taken as part of the backup.
It’s desperately simple to run, relatively quick, and is the easiest way to find out your
backups have problems before you start relying on them.

Now all the Oracle documentation states that dbverify can only be applied to ‘cache
managed files’ –i.e., ones which are read into the Buffer Cache. So that theoretically rules
out running it against the Control Files and seeing whether they are internally corrupt.
However, in Oracle version 8.0, 8i and 9i, you can run the tool against Control Files. I have
not run it against a 7 database, but you might give it a try and see if anything useful
results. But as proof that it works in the 8s and 9s, I offer the following log file output:




Copyright © Howard Rogers 2001                  24/10/2001                                     Page 2 of 4
Checking backups for corruption                                                  Backup and Recovery Tips


DBVERIFY - VERIFICATION STARTING : FILE =
D:ORACLEORADATAHJR9CONTROL03.CTL                        !NOTE IT’S A CONTROL FILE!!
 [SNIP]

PAGE 450 IS MARKED CORRUPT
***
CORRUPT BLOCK RELATIVE DBA: 0X200001C2 (FILE 128, BLOCK 450)
BAD HEADER FOUND DURING DBV:
DATA IN BAD BLOCK -
 TYPE: 32 FORMAT: 32 RDBA: 0X20202020
 LAST CHANGE SCN: 0X2020.20202020 SEQ: 0X20 FLG: 0X20
 CONSISTENCY VALUE IN TAIL: 0X20202020
 CHECK VALUE IN BLOCK HEADER: 0X2020, BLOCK CHECKSUM DISABLED
 SPARE1: 0X20, SPARE2: 0X20, SPARE3: 0X2020
***

DBVERIFY - VERIFICATION           COMPLETE


TOTAL    PAGES     EXAMINED        : 450
TOTAL    PAGES     PROCESSED (DATA) : 0
TOTAL    PAGES     FAILING (DATA) : 0
TOTAL    PAGES     PROCESSED (INDEX): 0
TOTAL    PAGES     FAILING (INDEX): 0
TOTAL    PAGES     PROCESSED (OTHER): 0
TOTAL    PAGES     PROCESSED (SEG) : 0
TOTAL    PAGES     FAILING (SEG) : 0
TOTAL    PAGES     EMPTY           : 0
TOTAL    PAGES     MARKED CORRUPT : 450
TOTAL    PAGES     INFLUX          : 0

Clearly, therefore, dbverify is a perfectly useful tool in ensuring that your Control File
backups are free of corruption… at least, demonstrably so in versions 8.0.5, 8.1.6, 8.1.7
and 9.0.1.1. However, for anything earlier than these versions, you’re really on your own.
Try it and see. Don’t forget, however, that the SQL command

ALTER DATABASE BACKUP CONTROLFILE TO         ‘D:BACKUPSCONTROL01.BKP’;

…is guaranteed to result in a binary image of the Control File which is consistent and
corruption-free (though it can obviously only be issued when the database is at least in the
MOUNT stage).

So that’s Data Files and Control Files dealt with: how about the Redo Logs?

Online Redo Logs may be copied if you are taking cold backups, and Archived Redo Logs
will also be copied, whatever type of backup you are doing, where they exist. How can
either of these types of Logs be checked for corruption?
Copyright © Howard Rogers 2001                 24/10/2001                                       Page 3 of 4
Checking backups for corruption                                               Backup and Recovery Tips


Well, dbverify honestly cannot be used to verify redo log files, whether of the Online or
Archived variety (if you try it, you’ll get a report indicating that the entire file is corrupted,
which simply means it doesn’t understand their contents). Therefore, the only really
viable tool is Log Miner –and that was only introduced in Oracle 8.1.x (though it can be
used from there to examine 8.0.x-version logs).

If Log Miner encounters corruption during its analysis session (begun with the EXECUTE
DBMS_LOGMNR.START_LOGMNR(DICTFILENAME=>’HJRDICT.ORA’) command), then it simply
bombs out with an error –at which point you know you have a problem.

If you need to check Oracle 7 logs, however, Log Miner can’t help you, and I know of no
other Oracle-supplied tool that can (there are third-party tools that can do the job, but
they cost an arm and a leg –yet another reason for upgrading to a more recent version).

I can offer, therefore, no better suggestion than that you perform regular practice
recoveries (which you should be doing anyway as a matter of ordinary precautionary
management). If the recoveries work, the Logs are clean. If not…




Copyright © Howard Rogers 2001              24/10/2001                                       Page 4 of 4

Weitere ähnliche Inhalte

Was ist angesagt?

researchpaper-complete
researchpaper-completeresearchpaper-complete
researchpaper-completeAnna Bennett
 
Functional tests for dummies
Functional tests for dummiesFunctional tests for dummies
Functional tests for dummiescpsitgmbh
 
JUG Summer Camp - Une nouvelle vision des tests avec Arquillian
JUG Summer Camp - Une nouvelle vision des tests avec ArquillianJUG Summer Camp - Une nouvelle vision des tests avec Arquillian
JUG Summer Camp - Une nouvelle vision des tests avec ArquillianAlexis Hassler
 
Hotsos 2017 - Protect or Perform by Paul G. Matuszyk
Hotsos 2017 - Protect or Perform by Paul G. MatuszykHotsos 2017 - Protect or Perform by Paul G. Matuszyk
Hotsos 2017 - Protect or Perform by Paul G. MatuszykPaul Matuszyk
 
0396 oracle-goldengate-12c-tutorial
0396 oracle-goldengate-12c-tutorial0396 oracle-goldengate-12c-tutorial
0396 oracle-goldengate-12c-tutorialKlausePaulino
 
Pandora FMS: DB2 Enterprise Plugin
Pandora FMS: DB2 Enterprise PluginPandora FMS: DB2 Enterprise Plugin
Pandora FMS: DB2 Enterprise PluginPandora FMS
 
Oracle DBA interview_questions
Oracle DBA interview_questionsOracle DBA interview_questions
Oracle DBA interview_questionsNaveen P
 
Slick: Bringing Scala’s Powerful Features to Your Database Access
Slick: Bringing Scala’s Powerful Features to Your Database Access Slick: Bringing Scala’s Powerful Features to Your Database Access
Slick: Bringing Scala’s Powerful Features to Your Database Access Rebecca Grenier
 
Hacking Oracle From Web Apps 1 9
Hacking Oracle From Web Apps 1 9Hacking Oracle From Web Apps 1 9
Hacking Oracle From Web Apps 1 9sumsid1234
 
Hidden Gems of Performance Tuning: Hierarchical Profiler and DML Trigger Opti...
Hidden Gems of Performance Tuning: Hierarchical Profiler and DML Trigger Opti...Hidden Gems of Performance Tuning: Hierarchical Profiler and DML Trigger Opti...
Hidden Gems of Performance Tuning: Hierarchical Profiler and DML Trigger Opti...Michael Rosenblum
 
DBA Commands and Concepts That Every Developer Should Know
DBA Commands and Concepts That Every Developer Should KnowDBA Commands and Concepts That Every Developer Should Know
DBA Commands and Concepts That Every Developer Should KnowAlex Zaballa
 
#29.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_스프링프레임워크 강좌, 재직자환급교육,실업자국비지원...
#29.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_스프링프레임워크 강좌, 재직자환급교육,실업자국비지원...#29.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_스프링프레임워크 강좌, 재직자환급교육,실업자국비지원...
#29.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_스프링프레임워크 강좌, 재직자환급교육,실업자국비지원...탑크리에듀(구로디지털단지역3번출구 2분거리)
 

Was ist angesagt? (20)

researchpaper-complete
researchpaper-completeresearchpaper-complete
researchpaper-complete
 
Functional tests for dummies
Functional tests for dummiesFunctional tests for dummies
Functional tests for dummies
 
File handaling
File handalingFile handaling
File handaling
 
JUG Summer Camp - Une nouvelle vision des tests avec Arquillian
JUG Summer Camp - Une nouvelle vision des tests avec ArquillianJUG Summer Camp - Une nouvelle vision des tests avec Arquillian
JUG Summer Camp - Une nouvelle vision des tests avec Arquillian
 
Hotsos 2017 - Protect or Perform by Paul G. Matuszyk
Hotsos 2017 - Protect or Perform by Paul G. MatuszykHotsos 2017 - Protect or Perform by Paul G. Matuszyk
Hotsos 2017 - Protect or Perform by Paul G. Matuszyk
 
groovy & grails - lecture 11
groovy & grails - lecture 11groovy & grails - lecture 11
groovy & grails - lecture 11
 
36612 volberg
36612 volberg36612 volberg
36612 volberg
 
0396 oracle-goldengate-12c-tutorial
0396 oracle-goldengate-12c-tutorial0396 oracle-goldengate-12c-tutorial
0396 oracle-goldengate-12c-tutorial
 
Pandora FMS: DB2 Enterprise Plugin
Pandora FMS: DB2 Enterprise PluginPandora FMS: DB2 Enterprise Plugin
Pandora FMS: DB2 Enterprise Plugin
 
Oracle DBA interview_questions
Oracle DBA interview_questionsOracle DBA interview_questions
Oracle DBA interview_questions
 
groovy & grails - lecture 12
groovy & grails - lecture 12groovy & grails - lecture 12
groovy & grails - lecture 12
 
Spring 4 - A&BP CC
Spring 4 - A&BP CCSpring 4 - A&BP CC
Spring 4 - A&BP CC
 
SQL2SPARQL
SQL2SPARQLSQL2SPARQL
SQL2SPARQL
 
Tomcat + other things
Tomcat + other thingsTomcat + other things
Tomcat + other things
 
Slick: Bringing Scala’s Powerful Features to Your Database Access
Slick: Bringing Scala’s Powerful Features to Your Database Access Slick: Bringing Scala’s Powerful Features to Your Database Access
Slick: Bringing Scala’s Powerful Features to Your Database Access
 
Hacking Oracle From Web Apps 1 9
Hacking Oracle From Web Apps 1 9Hacking Oracle From Web Apps 1 9
Hacking Oracle From Web Apps 1 9
 
Hidden Gems of Performance Tuning: Hierarchical Profiler and DML Trigger Opti...
Hidden Gems of Performance Tuning: Hierarchical Profiler and DML Trigger Opti...Hidden Gems of Performance Tuning: Hierarchical Profiler and DML Trigger Opti...
Hidden Gems of Performance Tuning: Hierarchical Profiler and DML Trigger Opti...
 
DBA Commands and Concepts That Every Developer Should Know
DBA Commands and Concepts That Every Developer Should KnowDBA Commands and Concepts That Every Developer Should Know
DBA Commands and Concepts That Every Developer Should Know
 
Glassfish JEE Server Administration - Clustering
Glassfish JEE Server Administration - ClusteringGlassfish JEE Server Administration - Clustering
Glassfish JEE Server Administration - Clustering
 
#29.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_스프링프레임워크 강좌, 재직자환급교육,실업자국비지원...
#29.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_스프링프레임워크 강좌, 재직자환급교육,실업자국비지원...#29.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_스프링프레임워크 강좌, 재직자환급교육,실업자국비지원...
#29.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_스프링프레임워크 강좌, 재직자환급교육,실업자국비지원...
 

Andere mochten auch (6)

Configuremts
ConfiguremtsConfiguremts
Configuremts
 
Perfstats
PerfstatsPerfstats
Perfstats
 
Columndrop
ColumndropColumndrop
Columndrop
 
Applyinga blockcentricapproach
Applyinga blockcentricapproachApplyinga blockcentricapproach
Applyinga blockcentricapproach
 
Createclone
CreatecloneCreateclone
Createclone
 
Usertracing
UsertracingUsertracing
Usertracing
 

Ähnlich wie Corruptbkp

patchVantage Cloud Starter Pack
patchVantage Cloud Starter Pack patchVantage Cloud Starter Pack
patchVantage Cloud Starter Pack David McNish
 
Help! my sql server log file is too big!!! tech republic
Help! my sql server log file is too big!!!   tech republicHelp! my sql server log file is too big!!!   tech republic
Help! my sql server log file is too big!!! tech republicKaing Menglieng
 
You Oracle Technical Interview
You Oracle Technical InterviewYou Oracle Technical Interview
You Oracle Technical InterviewHossam El-Faxe
 
Redo and Rollback
Redo and RollbackRedo and Rollback
Redo and RollbackTubaahin10
 
Data recovery consistency with check db
Data recovery consistency with check dbData recovery consistency with check db
Data recovery consistency with check dbguesta1b3b39
 
Testing Delphix: easy data virtualization
Testing Delphix: easy data virtualizationTesting Delphix: easy data virtualization
Testing Delphix: easy data virtualizationFranck Pachot
 
Oracle dba interview question
Oracle dba interview questionOracle dba interview question
Oracle dba interview questionAmarendra Sharma
 
RMAN in 12c: The Next Generation (WP)
RMAN in 12c: The Next Generation (WP)RMAN in 12c: The Next Generation (WP)
RMAN in 12c: The Next Generation (WP)Gustavo Rene Antunez
 
Oracle11g(1z0 050) v100612[1]
Oracle11g(1z0 050) v100612[1]Oracle11g(1z0 050) v100612[1]
Oracle11g(1z0 050) v100612[1]revoluson
 
Oracle business intelligence enterprise edition 11g
Oracle business intelligence enterprise edition 11gOracle business intelligence enterprise edition 11g
Oracle business intelligence enterprise edition 11guzzal basak
 
Manual Tecnico OGG Oracle to MySQL
Manual Tecnico OGG Oracle to MySQLManual Tecnico OGG Oracle to MySQL
Manual Tecnico OGG Oracle to MySQLErick Vidbaz
 

Ähnlich wie Corruptbkp (20)

patchVantage Cloud Starter Pack
patchVantage Cloud Starter Pack patchVantage Cloud Starter Pack
patchVantage Cloud Starter Pack
 
Undo internals paper
Undo internals paperUndo internals paper
Undo internals paper
 
Sqllite
SqlliteSqllite
Sqllite
 
Help! my sql server log file is too big!!! tech republic
Help! my sql server log file is too big!!!   tech republicHelp! my sql server log file is too big!!!   tech republic
Help! my sql server log file is too big!!! tech republic
 
You Oracle Technical Interview
You Oracle Technical InterviewYou Oracle Technical Interview
You Oracle Technical Interview
 
Redo and Rollback
Redo and RollbackRedo and Rollback
Redo and Rollback
 
Data recovery consistency with check db
Data recovery consistency with check dbData recovery consistency with check db
Data recovery consistency with check db
 
Testing Delphix: easy data virtualization
Testing Delphix: easy data virtualizationTesting Delphix: easy data virtualization
Testing Delphix: easy data virtualization
 
Dbcc.doc
Dbcc.docDbcc.doc
Dbcc.doc
 
DBCC - Dubi Lebel
DBCC - Dubi LebelDBCC - Dubi Lebel
DBCC - Dubi Lebel
 
Oracle dba interview question
Oracle dba interview questionOracle dba interview question
Oracle dba interview question
 
RMAN in 12c: The Next Generation (WP)
RMAN in 12c: The Next Generation (WP)RMAN in 12c: The Next Generation (WP)
RMAN in 12c: The Next Generation (WP)
 
oracle dba
oracle dbaoracle dba
oracle dba
 
Oracle11g notes
Oracle11g notesOracle11g notes
Oracle11g notes
 
Oracle11g(1z0 050) v100612[1]
Oracle11g(1z0 050) v100612[1]Oracle11g(1z0 050) v100612[1]
Oracle11g(1z0 050) v100612[1]
 
Oracle business intelligence enterprise edition 11g
Oracle business intelligence enterprise edition 11gOracle business intelligence enterprise edition 11g
Oracle business intelligence enterprise edition 11g
 
Manual Tecnico OGG Oracle to MySQL
Manual Tecnico OGG Oracle to MySQLManual Tecnico OGG Oracle to MySQL
Manual Tecnico OGG Oracle to MySQL
 
Cloning 2
Cloning 2Cloning 2
Cloning 2
 
Daos
DaosDaos
Daos
 
Missing redo logs in oracle
Missing redo logs in oracleMissing redo logs in oracle
Missing redo logs in oracle
 

Mehr von oracle documents (20)

Applyinga blockcentricapproachtotuning
Applyinga blockcentricapproachtotuningApplyinga blockcentricapproachtotuning
Applyinga blockcentricapproachtotuning
 
Windowsosauthent
WindowsosauthentWindowsosauthent
Windowsosauthent
 
Whatistnsnames
WhatistnsnamesWhatistnsnames
Whatistnsnames
 
Whatisadatabaselink
WhatisadatabaselinkWhatisadatabaselink
Whatisadatabaselink
 
Varraysandnestedtables
VarraysandnestedtablesVarraysandnestedtables
Varraysandnestedtables
 
Userpasswrd
UserpasswrdUserpasswrd
Userpasswrd
 
Userlimit
UserlimitUserlimit
Userlimit
 
Undo internalspresentation
Undo internalspresentationUndo internalspresentation
Undo internalspresentation
 
Tablespacelmt
TablespacelmtTablespacelmt
Tablespacelmt
 
Tablerename
TablerenameTablerename
Tablerename
 
Sql scripting sorcerypresentation
Sql scripting sorcerypresentationSql scripting sorcerypresentation
Sql scripting sorcerypresentation
 
Sql scripting sorcerypaper
Sql scripting sorcerypaperSql scripting sorcerypaper
Sql scripting sorcerypaper
 
Sql for dbaspresentation
Sql for dbaspresentationSql for dbaspresentation
Sql for dbaspresentation
 
Sequencereset
SequenceresetSequencereset
Sequencereset
 
Rollbacksizes
RollbacksizesRollbacksizes
Rollbacksizes
 
Rollbackshrinks
RollbackshrinksRollbackshrinks
Rollbackshrinks
 
Rollbacklmt
RollbacklmtRollbacklmt
Rollbacklmt
 
Rollbackblocking
RollbackblockingRollbackblocking
Rollbackblocking
 
Rollback1555s
Rollback1555sRollback1555s
Rollback1555s
 
Redosize
RedosizeRedosize
Redosize
 

Corruptbkp

  • 1. Checking backups for corruption Backup and Recovery Tips Checking backups for corruption If you use RMAN to perform backups, the contents of this paper don’t apply to you. Being an Oracle utility, RMAN knows the structure of Oracle blocks, and can therefore detect corruption as it is backing things up. If any corruption is encountered, it will throw an error stack the size of the Empire State Building, and proceed no further. If you are using Operating System techniques to take your backups, though, then there is a real risk that the resulting copies of Data Files and so forth might get corrupted as part of the backup process –or that the Data Files themselves already contain corruption, which the O/S just happily copies across, oblivious to its presence. Fortunately, Oracle supplies a handy little utility called “dbverify” which can be used to check the backed up copies of the Data Files for corruption, once the backup has finished. This utility is run from the command line, by typing in the command dbv. You simply tell it what files to check, and supply some other run-time parameters if needed. You might type something like this, therefore: C:> DBV FILE=D:BACKUPSSYSTEM01.BKP BLOCKSIZE=8192 LOGFILE=DBVLOG.TXT Note that you must tell dbverify what size Oracle blocks to expect when it scans the Data File copy. If you miss that parameter out, dbverify will expect to find 2K blocks, and when it encounters anything else, will simply abort with an error. Curiously, the error message will tell you precisely what block size it did encounter –and you might well wonder why, if it can identify the correct block size for the sake of error reporting, it doesn’t simply go on to use the discovered block size for its continued work! One of life’s little mysteries, I guess –and we just have to live with it. You’ll also notice there a ‘logfile’ parameter. That’s so that dbverify’s work can be output to a text file for later reading. If you miss it out, the results of the check are simply displayed on screen, which is probably not exactly what you want. There are some other parameters that can be supplied, too. For example, you can request a check of parts of a Data File copy, by specifying the start and end block addresses. If you need the complete list of available parameters, just type: C:> DBV HELP=Y When dbverify has completed its work, you’ll want to check the logfile output. That will look a bit like this: Copyright © Howard Rogers 2001 24/10/2001 Page 1 of 4
  • 2. Checking backups for corruption Backup and Recovery Tips DBVERIFY: RELEASE 9.0.1.1.1 - PRODUCTION ON FRI OCT 19 09:21:30 2001 (C) COPYRIGHT 2001 ORACLE CORPORATION. ALL RIGHTS RESERVED. DBVERIFY - VERIFICATION STARTING : FILE = D:BACKUPS SYSTEM01.BKP DBVERIFY - VERIFICATION COMPLETE TOTAL PAGES EXAMINED : 83200 TOTAL PAGES PROCESSED (DATA) : 50807 TOTAL PAGES FAILING (DATA) : 0 TOTAL PAGES PROCESSED (INDEX) : 7537 TOTAL PAGES FAILING (INDEX) : 0 TOTAL PAGES PROCESSED (OTHER) : 1342 TOTAL PAGES PROCESSED (SEG) : 0 TOTAL PAGES FAILING (SEG) : 0 TOTAL PAGES EMPTY : 23514 TOTAL PAGES MARKED CORRUPT : 0 TOTAL PAGES INFLUX : 0 Here, the word “page” means an Oracle block. So this report indicates that 83,200 blocks were looked at –and the key bit is that none of them are reported as “failing” or “marked corrupt”. That means this backup file can be considered clean, and there’d be no problems using it during a recovery. In case you’re wondering, the “Total Pages Influx” line is there because dbverify can be used to check for corruption in online Data Files, not just backup copies of them. When used for that purpose, it’s possible that DBWR is writing to a block just as dbverify wishes to check it –at which point, dbverify gives up, and just declares that the block was being changed as it was being investigated. I’d go so far as to suggest that no Operating System-type backup can be considered complete without running dbverify against every data file copy taken as part of the backup. It’s desperately simple to run, relatively quick, and is the easiest way to find out your backups have problems before you start relying on them. Now all the Oracle documentation states that dbverify can only be applied to ‘cache managed files’ –i.e., ones which are read into the Buffer Cache. So that theoretically rules out running it against the Control Files and seeing whether they are internally corrupt. However, in Oracle version 8.0, 8i and 9i, you can run the tool against Control Files. I have not run it against a 7 database, but you might give it a try and see if anything useful results. But as proof that it works in the 8s and 9s, I offer the following log file output: Copyright © Howard Rogers 2001 24/10/2001 Page 2 of 4
  • 3. Checking backups for corruption Backup and Recovery Tips DBVERIFY - VERIFICATION STARTING : FILE = D:ORACLEORADATAHJR9CONTROL03.CTL !NOTE IT’S A CONTROL FILE!! [SNIP] PAGE 450 IS MARKED CORRUPT *** CORRUPT BLOCK RELATIVE DBA: 0X200001C2 (FILE 128, BLOCK 450) BAD HEADER FOUND DURING DBV: DATA IN BAD BLOCK - TYPE: 32 FORMAT: 32 RDBA: 0X20202020 LAST CHANGE SCN: 0X2020.20202020 SEQ: 0X20 FLG: 0X20 CONSISTENCY VALUE IN TAIL: 0X20202020 CHECK VALUE IN BLOCK HEADER: 0X2020, BLOCK CHECKSUM DISABLED SPARE1: 0X20, SPARE2: 0X20, SPARE3: 0X2020 *** DBVERIFY - VERIFICATION COMPLETE TOTAL PAGES EXAMINED : 450 TOTAL PAGES PROCESSED (DATA) : 0 TOTAL PAGES FAILING (DATA) : 0 TOTAL PAGES PROCESSED (INDEX): 0 TOTAL PAGES FAILING (INDEX): 0 TOTAL PAGES PROCESSED (OTHER): 0 TOTAL PAGES PROCESSED (SEG) : 0 TOTAL PAGES FAILING (SEG) : 0 TOTAL PAGES EMPTY : 0 TOTAL PAGES MARKED CORRUPT : 450 TOTAL PAGES INFLUX : 0 Clearly, therefore, dbverify is a perfectly useful tool in ensuring that your Control File backups are free of corruption… at least, demonstrably so in versions 8.0.5, 8.1.6, 8.1.7 and 9.0.1.1. However, for anything earlier than these versions, you’re really on your own. Try it and see. Don’t forget, however, that the SQL command ALTER DATABASE BACKUP CONTROLFILE TO ‘D:BACKUPSCONTROL01.BKP’; …is guaranteed to result in a binary image of the Control File which is consistent and corruption-free (though it can obviously only be issued when the database is at least in the MOUNT stage). So that’s Data Files and Control Files dealt with: how about the Redo Logs? Online Redo Logs may be copied if you are taking cold backups, and Archived Redo Logs will also be copied, whatever type of backup you are doing, where they exist. How can either of these types of Logs be checked for corruption? Copyright © Howard Rogers 2001 24/10/2001 Page 3 of 4
  • 4. Checking backups for corruption Backup and Recovery Tips Well, dbverify honestly cannot be used to verify redo log files, whether of the Online or Archived variety (if you try it, you’ll get a report indicating that the entire file is corrupted, which simply means it doesn’t understand their contents). Therefore, the only really viable tool is Log Miner –and that was only introduced in Oracle 8.1.x (though it can be used from there to examine 8.0.x-version logs). If Log Miner encounters corruption during its analysis session (begun with the EXECUTE DBMS_LOGMNR.START_LOGMNR(DICTFILENAME=>’HJRDICT.ORA’) command), then it simply bombs out with an error –at which point you know you have a problem. If you need to check Oracle 7 logs, however, Log Miner can’t help you, and I know of no other Oracle-supplied tool that can (there are third-party tools that can do the job, but they cost an arm and a leg –yet another reason for upgrading to a more recent version). I can offer, therefore, no better suggestion than that you perform regular practice recoveries (which you should be doing anyway as a matter of ordinary precautionary management). If the recoveries work, the Logs are clean. If not… Copyright © Howard Rogers 2001 24/10/2001 Page 4 of 4