Quantcast
Channel: Gokhan Atil’s Technology Blog
Viewing all articles
Browse latest Browse all 163

Dbverify (dbv) in parallel

$
0
0

Today, I read the blog of Uwe Hesse about multiple dbverify sessions accessing one large datafile in parallel. I had some doubts if running multiple dbverify in parallel can significantly speed up the verification process but it looked like a good idea to me, so I decided to write a perl script to fetch size of the datafile, then spawn dbverify processes according to the desired parallelism.

Here’s the test result:

[oracle@cloudcontrol12 ~]$ dbv file=/oracle/oradata/emrep/mgmt.dbf;date

DBVERIFY: Release 11.2.0.3.0 - Production on Tue Aug 21 17:46:55 2012

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

DBVERIFY - Verification starting : FILE = /oracle/oradata/emrep/mgmt.dbf

DBVERIFY - Verification complete

Total Pages Examined         : 339200
Total Pages Processed (Data) : 26880
Total Pages Failing   (Data) : 0
Total Pages Processed (Index): 15980
Total Pages Failing   (Index): 0
Total Pages Processed (Other): 32496
Total Pages Processed (Seg)  : 0
Total Pages Failing   (Seg)  : 0
Total Pages Empty            : 263844
Total Pages Marked Corrupt   : 0
Total Pages Influx           : 0
Total Pages Encrypted        : 0
Highest block SCN            : 1868007 (0.1868007)
Tue Aug 21 17:47:12 EEST 2012

As you see, it took about 17 seconds to process 2 GB data file with dbverify. Then I run my script to run dbverify in parallel:

[oracle@cloudcontrol12 emrep]$ date;./dbvp.pl /oracle/oradata/emrep/mgmt.dbf 4;date
Tue Aug 21 17:48:22 EEST 2012

dbvp (C) 2012 Gokhan Atil http://www.gokhanatil.com 

Total Pages Examined         : 339200 
Total Pages Processed (Data) : 26880 
Total Pages Failing   (Data) : 0 
Total Pages Processed (Index): 15980 
Total Pages Failing   (Index): 0 
Total Pages Processed (Other): 32496 
Total Pages Processed (Seg)  : 0 
Total Pages Failing   (Seg)  : 0 
Total Pages Empty            : 263844 
Total Pages Marked Corrupt   : 0 
Total Pages Influx           : 0 
Total Pages Encrypted        : 0 
Highest block SCN            : 1868007  
Tue Aug 21 17:48:33 EEST 2012

It took only 11 seconds. Not a significant improvement but all these tests are done in a virtual machine and I only processed about 2 GB datafile. If you test it on bigger datafiles, you can get surprising results. I used “date” function to measure the time, and I cleared the Linux Filesystem read cache between tests (and repeated the tests multiple times to be sure about the results).

If you want to test dbverify in parallel, you can download the perl file (dbvp.pl) and test it by yourself:

dbvp.pl

 

My script (dbvp.pl) takes only 2 arguments: filename and parallelism (number of threads). For example the following command will let dbvp script to spawn 5 dbverify processes to check the datafile:

./dbvp.pl /oracle/oradata/emrep/mgmt.dbf 5

Because it uses dbv, you should set ORACLE_HOME and PATH variables according to your Oracle Home. I should say that I wrote this script just for fun and tested only on 11gR2, so there’s no guarantee that it would work on any other system. Anyway, if you find any bug, you may contact me and ask for a fix. If you like it, you can use it as you wish.


Viewing all articles
Browse latest Browse all 163

Trending Articles