# Backing up a database

You can back up a database either offline (when it is shut down) or online (when it is running).

After you back up a database, make sure the backup copy is not corrupt. To do this, run the `SYSCS_UTIL.SYSCS_CHECK_TABLE` system function on all the tables in the backup copy. Do not discard the previous backup until you have verified the consistency of the current one. See Checking database consistency for more information.

The topics in this section describe how to back up a database.

- Offline backups
  To perform an offline backup of a database, use operating system commands to copy the database directory.
- Online backups
  Use online backups to back up a database while it is running, without blocking transactions.
- When the log is in a non-default location
  If you put the database log in a non-default location prior to backing up the database, be aware of the following requirements.
- Backing up encrypted databases
  When you back up an encrypted database, both the backup and the log files remain encrypted.

Parent topic: Backing up and restoring databases
Related concepts
Roll-forward recovery
Related tasks
Restoring a database from a backup copy
Creating a database from a backup copy