H2 Database 简明教程
H2 Database - Backup
BACKUP 是用于将数据库备份到单独的 .zip 文件中的命令。对象未锁定,在对备份进行备份时,也会复制事务日志。执行此命令需要管理员权限。
BACKUP is the command used to take database backup into a separate .zip file. Objects are not locked, and when it takes backup the transaction log is also copied. Admin rights are required to execute this command.
Syntax
以下是 Backup 命令的通用语法。
Following is the generic syntax of the Backup command.
BACKUP TO fileNameString;
Example
在此示例中,让我们将当前数据库备份到 backup.zip 文件中。为此,请使用以下命令。
In this example, let us take a backup of the current database into backup.zip file. Use the following command for the same.
BACKUP TO 'backup.zip';
在执行以上命令时,您将在本地文件系统中获得 backup.zip 文件。
On executing the above command, you will get the backup.zip file in your local file system.