G3.3. Database Commands |
Database Initialization
drwcsd [<switches>] modexecdb database-init [<license_key> [<password>]]—database initialization. •<license_key>—path to Dr.Web license key file agent.key. If the license key is not specified, it must be added later from the Control Center or get from the neighbor Dr.Web Server via the interserver connection. •<password>—original password of the Dr.Web Server administrator (logged in as ). The default password is .
Adjusting parameters of database initialization If embedded database is used, initialization parameters can be set via an external file. The following command is used for this: drwcsd.exe modexecdb database-init@<response-file> <response-file>—file with initialization parameters written line-by-line in the same order same as parameters of the database-init command. File format:
If a string consists of only the %nil value, the default value is used (as in database-init). Database Upgrading drwcsd modexecdb database-upgrade [pretend] [upgrade_ver_flag]—run Dr.Web Server to upgrade the structure of the database to a new version using the internal scripts. •pretend=false—default value. Instructs to update the database. If true, only checking the relevance of the database will be performed instead of database update. •upgrade_ver_flag=true—during the update database version and data are recorded on each successful update to the next version of the database schema. Database Export a)drwcsd modexecdb database-export <file>[ignore_tables]—export the database to a specified file. •<file>—path to the file to which the database will be exported. •ignore_tables—allows to specify a string or a table with strings containing the names of stations which are not to be exported. The format of tables with rows is as follows: %{"table1", "table2"}. In case of specifying a row—table1. :
Under Unix-like OS, the action is performed on behalf of the drwcs:drwcs user to the $DRWCS_VAR directory (except OS, which by default saves the file to the directory from which the script was run; if the path is specified explicitly, then the directory should have the write access for the <user>:<group> that had been created at installation, by default it is drwcs:drwcs). b)drwcsd modexecdb database-export-xml <xml_file> [ignore_tables]—export the database to a specified XML file. •<xml-file>—path to the XML file to which the database will be exported. •ignore_tables—allows to specify a string or a table with strings containing the names of stations which are not to be exported. The format of tables with rows is as follows: %{"table1", "table2"}. In case of specifying a row—table1. If you specify the gz file extension, during the export, database file will be packed into the gzip archive. If you do not specify any extension or specify an extension other than gz, export file will not be archived. : •To export the database into the XML file with no compression:
•To export the database into the XML file compressed to an archive:
: •To export the database into the XML file with no compression:
•To export the database into the XML file compressed to an archive:
a)drwcsd modexecdb database-import <file> [ignore_tables]—import the database from a specified file (in this case all records from all tables are deleted, the tables themselves are not deleted - records from the export are inserted into them). •<file>—path to the file from which the database will be imported. •ignore_tables—allows to specify a string or a table with strings containing the names of stations which are not to be imported. The format of tables with rows is as follows: %{"table1", "table2"}. In case of specifying a row—table1. b)drwcsd modexecdb database-import-and-upgrade <file> [import_only_flag] [upgrade_ver_flag] [ignore_tables]—import and upgrade the database exported from Dr.Web Server of previous version. The tables themselves are deleted, new tables are created according to the description from the export. Records from the export are inserted into new tables, and then the update procedure is started. •<file>—path to the file from which the database will be imported. •import_only_flag—if %true, only import is performed, without database update and verification. •upgrade_ver_flag—if %true, during a database upgrade, the database version and data are committed each time it is successfully upgraded to the next version of the database schema. •ignore_tables—allows to specify a string or a table with strings containing the names of stations which are not to be imported. The format of tables with rows is as follows: %{"table1", "table2"}. In case of specifying a row—table1.
Database Verification drwcsd modexecdb database-verify [full=%false [ignore-version=%false]]—run Dr.Web Server to verify the database. In order to record the results into a log file, the command shall be followed by a -log key. Details on how to use the key are described in G3.8. The Description of Switches. •full=%false—defines the verification type. By default (%false) a quick check is made, if true—a full verification. •ignore-version=%false—defines whether the database schema version needs to be ignored during verification. %false by default. If %true, verification will continue even if the schema version is wrong. Database Speed Up drwcsd [<switches>] modexecdb database-speedup—execute the VACUUM, CLUSTER, ANALYZE commands to speed up the DB operation. Database Restore drwcsd repairdb—repair malformed disk image of embedded database or corrupted tables of external database. may be also automatically recovered on the Dr.Web Server startup if in the database settings in the Control Center, the flag is set (see , p. Database Restore). drwcsd modexecdb database-clean—clean up the Dr.Web Server database by deleting all tables. drwcsd modexecdb set-admin-password <login> <new_password>—set a new password for the specified administrator account. |