ePages 6.10 - DE_EPAGES/Database/API/DBCC.pm

Package DE_EPAGES::Database::API::DBCC

Database consistency checker.

Example
RunOnStore(
    Store => 'Backup',
    DBPassword => 'sa_password',
    Sub => sub {
        my $dbcc = DE_EPAGES::Database::API::DBCC->new( Database => 'storedb' );
        $dbcc->checkalloc;
        print "$_\n" foreach @{$dbcc->messages};
        $dbcc->reset;
        $dbcc->checkcatalog;
        print "$_\n" foreach @{$dbcc->messages};
    }
);

Functions

checkalloc
checkcatalog
checkdb
database
fixalloc
messages
new
reset

checkalloc

Checks for corruptions in database tables and indexes. Adds any messages to $self->messages.

Syntax
$self->checkalloc;

checkcatalog

Checks the system table consistency. Adds any messages to $self->messages.

Syntax
$self->checkcatalog;

checkdb

Checks consistency of data and index pages in all tables. Adds any messages to $self->messages.

Syntax
$self->checkdb;

database

Returns the database name where checks are run on.

Syntax
$Database = $self->database;
Return
$Database (string)
database name

fixalloc

Repairs any corruptions found by the checkalloc method. Note: the database is set temporary to 'single user' mode. Therefore any existing connections to the database will be terminated.

Syntax
$self->fixalloc;

messages

Returns all messages from previous checks.

Syntax
$aMessages = $self->messages;
Return
$aMessages (ref.array.string)
list of messages

new

Returns the DBCC object where you can run checks on. Note: the current database connection should be established to the 'master' database with the 'sa' user login.

Syntax
$DBCC = DE_EPAGES::Database::API::DBCC->new( Database => $Database );
Example
$DBCC = DE_EPAGES::Database::API::DBCC->new( Database => 'storedb' );
Input
$Database (string)
database name

reset

Resets all accumulated messages.

Syntax
$self->reset;