VALIDATE DATABASE DATAFILE

The VALIDATE DATABASE DATAFILE command performs validation of data files across the primary database and standby databases.

The validation of data files detects lost writes at either database.

Format

VALIDATE DATABASE [VERBOSE] <db_unique_name> | ALL] DATAFILE { <datafile_name> | <datafile_number> | ALL } OUTPUT="output_file_name";

Command Parameters

db_unique_name

The name of the database for which you want to display information. The VERBOSE keyword, if used, must come before the DB_UNIQUE_NAME or an error is returned.

If the database to be validated is either the primary or ALL, then the data files for all standby databases are compared with data files of the primary.

If the database to be validated is a standby database, then its data files are compared with the data files of the primary.

datafile_name | datafile_number
You can specify a data file to be compared by name (datafile_name) or by number (datafile_number).

The datafile_name is the name of a specific date file that you want validated.

The datafile_number is the file identification number of a data file (as shown in the FILE# column of the V$DATAFILE view).

output_file_name
A file generated on the server that you must check to determine if block comparison is completed and whether there were any lost writes. Output files are created in the diagnostics trace directory of the database being compared.

Usage Notes

  • When the VALIDATE DATABASE command is issued, it immediately returns a message that data file comparison has started on a database, but this does not mean that data file comparison completed or that there were no lost-writes between data files. You must check the output files that are generated to determine whether data file comparison was completed, or if there were lost writes.

  • The VERBOSE option can be used to dump the block contents of the specified data file.

Command Example

Example: Using VALIDATE DATABASE DATAFILE to Compare Data Files

The following command would compare the data files on the standby to those on the primary. Output would be sent to a file named dbcomp1.out.

DGMGRL> VALIDATE DATABASE boston DATAFILE ALL OUTPUT=dbcomp1.out;
Operation requires a connection to database "boston"
Connecting ...
Output files are created in /path/to/trace on host "standby-host"

The following shows sample output from the command:

     Client is connected to database: boston. Role: physical standby.

    ******************************
    Remote database chicago.
    remote db role: primary database

    Slave Id  0
    Summary:
    Different data block pairs: 66617

    Details:
***************************************************
    ID: Block Type Id
    TOTAL: Total number of blocks found
    DIFFV: Number of block pairs with different version
    LWLOC: Lost Writes at Local
    LWRMT: Lost Writes at Remote
    SAMEV: Number of block pairs with same version
    SAMEV&C: Number of block pairs with same version and checksum
    DIFFPAIR: Number of block pairs with same version but different contents
    ENCERR: Undecided blocks related to encryption/decrytion error.
            e.g. Wallet is not open.
    SKIPPED: Skipped blocks due to data corruption, direct load, etc

    ID TOTAL   DIFFV   LWLOC   LWRMT   SAMEV   SAMEV&C DIFFPAIR ENCERR SKIPPED
    02 0067698 0001032 0000000 0000000 0066666 0000049 0066617 0000000 0000000
    29 0000001 0000001 0000000 0000000 0000000 0000000 0000000 0000000 0000000
    30 0000125 0000001 0000000 0000000 0000124 0000124 0000000 0000000 0000000
    38 0000014 0000014 0000000 0000000 0000000 0000000 0000000 0000000 0000000