> For the complete documentation index, see [llms.txt](https://docs.storware.eu/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.storware.eu/protecting-applications/applications/db2.md).

# DB2

To create a new application for DB2 database backup, go to the tab: **Applications -> Instances**

Then select the **Create** button. The Creating an Application Definition section will be displayed, which needs to be completed.

This is a description of how your script is going to be invoked - you need to specify:

* **Name** - unique name of the application in the Storware Backup & Recovery system.
* **Choose Node Config** - select which node should perform the task.
* **Backup policy** - specify which backup policy should be used for this application.
* **Command execution configuration** - select a prepared template for DB2 backup or create a [new](/administration/applications/execution-configurations.md) one yourself.

In the SSH access subtab, complete the following fields:

* **Host** - set the address of the host where the DB2 instance exists.
* **Port** - set the host port.

Next, select OS Credentials or create a new one and provide the following information:

* **Name** - unique name of the OS Credentials.
* **User** - indicate a user for SSH connection.
* **Password** - enter the connection password.
* **SSH key path** - alternatively, you can specify the SSH key path for authorization.

After saving the application configuration, define the following environment variables:

#### Environment Variables

<table data-search="false"><thead><tr><th>Variable</th><th>Value</th><th>Description</th></tr></thead><tbody><tr><td><code>VP_DB2_INCREMENTAL</code></td><td><code>yes</code> / <code>no</code></td><td>Creates an incremental backup on the DB2 server. Set to <code>no</code> for a full backup.</td></tr><tr><td><code>VP_DB2_DBLIST</code></td><td><em>string</em></td><td>Database names to back up. Separate multiple names with commas.</td></tr><tr><td><code>VP_DB2_SCRIPTPATH</code></td><td><em>string</em></td><td>Path to the backup script on the DB2 host. Copy the appropriate script from <code>/opt/vprotect/server/scripts/application</code> to the database host. Then specify its destination path here.</td></tr><tr><td><code>VP_DB2_PASSWORD</code></td><td><em>string</em></td><td>Password for the DB2 database user.</td></tr><tr><td><code>VP_DB2_COMPRESS</code></td><td><code>yes</code> / <code>no</code></td><td>Compresses the backup on the DB2 server.</td></tr><tr><td><code>VP_DB2_LOGFILE</code></td><td><em>string</em></td><td>Path on the DB2 server for the backup job log file.</td></tr><tr><td><code>VP_DB2_USER</code></td><td><em>string</em></td><td>DB2 login username.</td></tr><tr><td><code>VP_DB2_STOREPATH</code></td><td><em>string</em></td><td>Path on the DB2 server for the backup file.</td></tr></tbody></table>

{% hint style="info" %}
**Note:** After the new application is fully configured, **save** the changes and go to the [Backup SLAs](/administration/applications/backup-slas.md) configuration.
{% endhint %}
