# CNStats STD/PRO 3.2 / User manual

© "CN-Software" Ltd. 2002-2008
support@cn-software.com
www.cnstats.com, www.cn-software.com

# Database management

The section is intended for CNStats database management.

> Database management operations may take a lot of time. If you are not sure that you have right to launch long-working PHP-scripts, then you should execute these requests manually by means of database management application. It may be MySql console client or special applications, such as phpMyAdmin.

> CNStats will try to increase time execution of PHP-script (this time is set by means of $STATS_CONF["slow_reports_time_limit"] option at config.php file). Unfortunately, increase of the script execution time may be forbidden by the server administrator.

You can perform the following options in this section:

## Rebuild attendance statistics by days

Statistics rebuilding is usually required in case statistics for one or more days is absent (the so-called lost days). As a rule, such statistic accumulation failures are related to complete or partial server inoperability.

Note: You should not perform this operation too often. In case statistics data for certain days remains absent, then you should postpone midnight accumilation for several minutes. It can be done with the help of $COUNTER["timeoffset"] option.

If statistics for some days is still lost, we recommend you to change the hosting-provider.

## Repair the database

This operation is intended for restoring the database operability in case of failures caused by incorrect functioning of the file system or MySql. As a rule, such errors occur because of insufficient disk space or emergency shutdown of the server.

## Optimize the database size

One should perform database optimization in order to increase MySql efficiency and to free disk space from deleted records. (record deletion does not always free space in MySql). This operation should be performed after deletion of old days from the statistics (see below).

## Delete old days from the statistics

This operation is performed automatically once a day - at midnight. In case you'd like to free space immediately after changing the option $COUNTER["savelog"], then you may delete the old days statistics manually anytime. (To free space physicaly after this operation you should optimize the database (see above)).

Back | Manual index | Next