sql server的备份语句sql数据库备份文件
英文回答:
Basic syntax for backing up a database.
sql.
BACKUP DATABASE database_name.
TO disk_file_path.
WITH (。
[option] = value,。
...
)。
Options for the WITH clause.
The following options can be used in the `WITH` clause:
NAME: Specifies the name of the backup file.
DESCRIPTION: Specifies a description for the backup file.
EXPIRY_DATE: Specifies the date when the backup file will expire.
COPY_ONLY: Creates a copy-only backup, which cannot be restored.
NORECOVERY: Creates a non-recoverable backup, which cannot be used to restore the database.
STANDBY: Creates a standby backup, which can be used to create a read-only replica of the database.
CHECKSUM: Computes a checksum for the backup file.
COMPRESSION: Compresses the backup file.
ENCRYPTION: Encrypts the backup file.
MAXTRANSFERSIZE: Specifies the maximum size (in KB) of each transfer unit.
BLOCKSIZE: Specifies the block size (in KB) used to write the backup file.
REWIND: Repositions the backup file to the beginning before writing data.
NOFORMAT: Does not format the backup file before writing data.
FORMAT: Formats the backup file before writing data.
Example.
The following statement backs up the `AdventureWorks2019` database to the file `C:\Backups\AdventureWorks2019.bak`:
sql.
BACKUP DATABASE AdventureWorks2019。
TO DISK = 'C:\Backups\AdventureWorks2019.bak'。
WITH (。
NAME = 'AdventureWorks2019 Backup',。
DESCRIPTION = 'Backup of AdventureWorks2019 database',。
EXPIRY_DATE = '2023-12-31',。
COMPRESSION = ON.
发表评论