Generating data backup and restore scripts (Windows)

Procedure

To generate the backup and restore scripts, run the backupScriptGen.xml script located in the <INSTALL_DIR>\bin directory using the following command:

sci_ant.cmd -f backupScriptGen.xml -DdbType=<database_type>

This script generates sample backup and restore scripts in the <INSTALL_DIR>\bin\sample directory.

You can rename and customize the scripts to suit your business needs. For example, you can modify the script to add your custom configuration tables and modify the path where the data files are stored. These scripts depend on utilities provided by the database vendors.

The backupScriptGen.xml script accepts the following arguments:

Table 1. BackupScripGen.xml arguments
Argument Purpose Accepted Values
-Dos= Determines what kind of script is generated.

If "windows" is selected, a .cmd file is created.

If "linux" or "unix" is selected, a .sh file is created.

If "all" is selected, both .cmd and .sh files are created.

  • windows
  • unix
  • linux
  • all
-DdbType= Determines for which databases the scripts will be generated.
  • oracle
  • db2
  • all
-DtableType= Determines which entities to generate scripts for. Valid values are any TableType attribute defined for an entity.
  • ALL
  • CONFIGURATION
  • MASTER
  • METADATA
  • STATISTICS
  • TRANSACTION
Note: The value ALL is supported only for single-schema mode.

Results

Running the backupScriptGen.xml script creates both backup and restore scripts for the selected operating systems and databases.

For example, Oracle scripts depend on export, import, or sqlplus utilities. You can modify and use the following scripts:
  • backup_config_oracle.cmd - generates backup_<tabletype>_<dbtype>.cmd, a backup script for the given table type and database vendor.
  • restore_config_oracle.cmd - generates restore_<tabletype>_<dbtype>.cmd, a restore script for the given table type and database vendor.
  • delete_configuration_oracle.sql - generates delete_<tabletype>_<dbtype>.sql, a SQL script to delete all data of a given table type, used as part of a restore script.