Thursday, March 15, 2012

DBVERIFY: Database Verification Utility

DBVERIFY is a utility of Oracle , that can be used to perform a physical structure integrity check against database files.


Note that the database should be off line before performing a DBVERIFY.
But it will work with online data files also,but its not recommended.


DBVERIFY is invoked using dbv command.It should be called from ORACLE_HOME/bin directory.

To access help on DB_VERIFY type: 
dbv help=y




To perform a simple DBVIRIFY use below command.Output will be written to the dbv.log file.


>dbv file=/u01/oracle/product/10.2.0/oradata/orcl/users01.dbf logfile=dbv.log


Note that this is only a verification tool to get a idea about data files,whether they are corrupted or not.You'll have to follow other methods to recover corrupted data files.




Exmples:
dbv example of  a datafile with no corruption.
(Pages are data blocks)


DBVERIFY: Release 11.2.0.2.0 - Production on Tue Mar 13 15:41:47 2012
Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
DBVERIFY - Verification starting : FILE = /..../a_01.dbf
DBVERIFY - Verification complete


Total Pages Examined         : 193648
Total Pages Processed (Data) : 43877
Total Pages Failing   (Data) : 0
Total Pages Processed (Index): 65406
Total Pages Failing   (Index): 0
Total Pages Processed (Other): 18833
Total Pages Processed (Seg)  : 0
Total Pages Failing   (Seg)  : 0
Total Pages Empty            : 65532
Total Pages Marked Corrupt   : 0
Total Pages Influx           : 0
Total Pages Encrypted        : 0
Highest block SCN            : 3753900931 (1388.3753900931)


dbv example of  a datafile with a corruption. 


DBVERIFY: Release 11.2.0.2.0 - Production on Tue Mar 13 15:32:33 2012


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


DBVERIFY - Verification starting : FILE = /..../a_02.dbf
Page 127845 is influx - most likely media corrupt
Corrupt block relative dba: 0x03c1f365 (file 15, block 127845)
Fractured block found during dbv:
Data in bad block:
 type: 6 format: 2 rdba: 0x03c1f365
 last change scn: 0x056c.dd2d2b24 seq: 0x1 flg: 0x06
 spare1: 0x0 spare2: 0x0 spare3: 0x0
 consistency value in tail: 0x00000000
 check value in block header: 0x21e0
 computed block checksum: 0x4ce


Page 127846 is marked corrupt
Corrupt block relative dba: 0x03c1f366 (file 15, block 127846)
Completely zero block found during dbv:


Page 127847 is marked corrupt
Corrupt block relative dba: 0x03c1f367 (file 15, block 127847)
Completely zero block found during dbv:


Page 127848 is marked corrupt
Corrupt block relative dba: 0x03c1f368 (file 15, block 127848)
Completely zero block found during dbv:
......
.....
....
...
Page 141294 is marked corrupt
Corrupt block relative dba: 0x03c227ee (file 15, block 141294)
Completely zero block found during dbv:


Page 141295 is marked corrupt
Corrupt block relative dba: 0x03c227ef (file 15, block 141295)
Completely zero block found during dbv:


Page 141296 is marked corrupt
Corrupt block relative dba: 0x03c227f0 (file 15, block 141296)
Completely zero block found during dbv:


DBVERIFY - Verification complete


Total Pages Examined         : 141296
Total Pages Processed (Data) : 60687
Total Pages Failing   (Data) : 0
Total Pages Processed (Index): 43333
Total Pages Failing   (Index): 0
Total Pages Processed (Other): 5417
Total Pages Processed (Seg)  : 0
Total Pages Failing   (Seg)  : 0
Total Pages Empty            : 18407
Total Pages Marked Corrupt   : 13452
Total Pages Influx           : 1
Total Pages Encrypted        : 0
Highest block SCN            : 3753900926 (1388.3753900926)

Tuesday, March 13, 2012

Partitioning and Formatting Second Hard Drive in Linux - (ext3)



by Jeff Hunter

http://www.idevelopment.info/data/Unix/Linux/LINUX_PartitioningandFormattingSecondHardDrive_ext3.shtml

Linux tar Command

The tar(tape archive) command bundles a bunch of files together and creates an archive on a tape, disk drive etc.


Simple way for creating a tar file.
Go to the relevant path.In our example go to the path where "myfolder" resides.So if I want to add files in myfolder to a tar file issue below command.It will create the tar file in /my location.


tar -cvf  /my/test.tar  myfolder


How to untar...
Go to the location where you want to untar the files/folder and issue below command.


tar -xvf  /my/test.tar


You can use below command to list the contents of a tar file to a log.


tar -tvf  test.tar  > temp/test.log




Options available with tar command:


Create a new archive.
List the contents of an archive.
Extract the contents of an archive.
The archive file name is given on the command line (required whenever the tar output is going to a file)
The archive can span multiple floppies.
Print verbose output (list file names as they are processed).
Add files to the archive if they are newer than the copy in the tar file.
Compress or decompress files automatically.