Cloning an Oracle/DB2/Sybase Database in a SAN Environment Using EVA Snapclone Technology (August 2007)

15
Important:
Cloning a database using cold backup is faster and more consistent than using hot backup.
Therefore, cloning database using a cold backup is highly recommended.
Validating the Cloned Database Using Oracle db_verify Script
To verify the Oracle database data files for integrity, save the following script in the
db_verify.pl file and execute it:
#!/usr/bin/perl
##################################################################
#File:dbverify.pl
#This script is used to verify Oracle database datafiles
#Usage: perl db_verify.pl --dir=directory_of_the_datafiles
##################################################################
use strict;
use Getopt::Long;
use IO::Handle;
my $dir;
my $status;
GetOptions ('dir=s' => \$dir,);
chomp ($dir);
#Create an output file
open (IFP, ">db_verify.txt") or die "Can't open file:$!\n";
IFP->autoflush(1);
my @dbf_list = `ls -alt $dir`;
# Do db_verify on all the DB data files and print the results
for (my $i =0; $i < @dbf_list; $i++) {
if ($dbf_list[$i] =~ /\s+(\S+\.dbf)/) {
print IFP "\n\nVerify $1\n";
$status = `dbv file=$dir/$1 blocksize=8192 2>&1`;
print IFP "$status";
}
}
close (IFP);
The output for the above db_verify file is as shown below: