Option 2 - Using Scripts
You can use DB2 commands in a script to achieve the same goal. The script method is recommended because it facilitates specifying the environment variables and allows for greater flexibility.
To back up the database, enter the db2 backup command in your script. The backup statement should specify the shared library libbexdb2-shared.a.64 for UNIX or bexdb2.dll for Windows by using the load parameter. The following three customizable parameters of the backup statement should be considered for performance optimization:
BUFFERSIZE (default = 4096 per page)
NUMBER OF BUFFERS (default = 4)
NUMBER OF SESSIONS (default = 1)
The following is a UNIX example of a DB2 backup script, which includes environment settings as well as the db2 backup statement:
The DB2 installation program for UNIX generates the sample script db2backup, which is in the bin subdirectory of the directory in which DPX is installed, similar to the one above. You can edit the sample script and then use it as your DB2 backup script in the INSTHOME directory.
Note. The script displayed above is an example of how to invoke DB2 support on DB2 UDB EE. On the Extended Enterprise version (EEE), backups can be run simultaneously on multiple nodes using the db_all command.
Last updated