Hi,
Right now, I am working on a dbcc perl script for a Sybase database. I
have noticed that I get a different output with dbi (do(do checkdb ...))
than with isql. What can I do to get the same output with dbi as with
isql. I plan to use the output to check the database for any kind of
inconsistencies.
Any help would be highly appreciated.
Tobias Hausmann
# check database integrity
sub checkdbintegrity
{
my @searchlist = qw (Msg Level State error: corrupt);
my $sth1 = $dbh->prepare("select name from sysdatabases");
$sth1->execute();
while( my $dbname = $sth1->fetchrow_array)
{
$sth = $dbh->do("dbcc checkdb ($dbname)")
#process output
$dbh->errstr();
.....
}
}
________________________________________________________
isql output:
Checking master
Checking sysobjects
The total number of data pages in this table is 4.
Table has 64 data rows.
Checking sysindexes
The total number of data pages in this table is 7.
Table has 76 data rows.
Checking syscolumns
The total number of data pages in this table is 17.
__________________________________________________________________
dbi do(checkdb checkdb(db)) output:
Server message number=2536 severity=10 state=2 line=1 text=Checking
master
Server message number=2536 severity=10 state=3 line=1 text=Checking
sysobjects
Server message number=2579 severity=10 state=1 line=1 text=The total
number of d
ata pages in this table is 4.
Server message number=7929 severity=10 state=1 line=1 text=Table has 64
data row
s.