<< CSQL Indexes - TOC - Tool Reference >>
CSQL Provide two recovery mechanism,
CSQL recovers the database automatically after a crash or system failure. By default, durability mode is set to false in csql.conf. In order to recover the data till the last committed transaction, this mode should be set to true when starting the server.
DATABASE_FILE configuration parameter specifies the directory in which checkpoint and redo log files are stored. Make sure that enough space (twice the size of the database size) is available in disk, which contains this directory.
The database server completes recovery process within seconds for large database files (in GB) where server start up is critical for application. This could be achieved by setting the MMAP configuration parameter to true in csql.conf file.
This is useful for applications with large databases requiring durability and with the server start up would be the prime importance like telecom applications. To recover the databases in default configuration with shared memory architecture takes in minutes in case of large database files (in GB). To resolve this problem, CSQL incorporates memory mapped architecture for user database, in which server will come up in seconds. This is achieved only by setting MMAP configuration variable to true.
This is a manual recovery mechanism. The user should take the backup of the database using csqldump tool and restore it using csql tool after the server starting.
In case of hard disk failure, CSQL won’t be able to recover the database from its checkpoint and redo log files. To recover database in this scenario, user needs to take backup of the CSQL database periodically using csqldump tool and store in file in another machine, In case of any disk failure, this archive file shall be used to restore the database. The interval at which the archive needs to be taken is decided based on the application requirement.
csqldump tool is used to take archive of the database. This command stores all the tables and records into the specified file.
$csqldump >/tmp/archive1
Start the server and run the following command to restore the database from the archive.
$csql –s /tmp/archive1
If DURABILITY option is set in csql.conf file, then remove all the files under the directory specified in DATABASE_FILE before starting the server.
<< CSQL Indexes - TOC - Tool Reference >>