事务日志备份既备份数据库的数据文件和日志文件存储在相同的位置

事务日志备份既备份数据库的数据文件和日志文件存储在相同的位置,第1张

备份一个事务日志

BACKUP LOG { database_name | @database_name_var }

{

TO < backup_device > [ ,n ]

[ WITH

[ BLOCKSIZE = { blocksize | @blocksize_variable } ]

[ [ , ] DESCRIPTION = { 'text' | @text_variable } ]

[ [ ,] EXPIREDATE = { date | @date_var }

| RETAINDAYS = { days | @days_var } ]

[ [ , ] PASSWORD = { password | @password_variable } ]

[ [ , ] FORMAT | NOFORMAT ]

[ [ , ] { INIT | NOINIT } ]

[ [ , ] MEDIADESCRIPTION = { 'text' | @text_variable } ]

[ [ , ] MEDIANAME = { media_name | @media_name_variable } ]

[ [ , ] MEDIAPASSWORD = { mediapassword | @mediapassword_variable } ]

[ [ , ] NAME = { backup_set_name | @backup_set_name_var } ]

[ [ , ] NO_TRUNCATE ]

[ [ , ] { NORECOVERY | STANDBY = undo_file_name } ]

[ [ , ] { NOREWIND | REWIND } ]

[ [ , ] { NOSKIP | SKIP } ]

[ [ , ] { NOUNLOAD | UNLOAD } ]

[ [ , ] RESTART ]

[ [ , ] STATS [ = percentage ] ]

]

}

还原事务日志:

RESTORE LOG { database_name | @database_name_var }

[ FROM < backup_device > [ ,n ] ]

[ WITH

[ RESTRICTED_USER ]

[ [ , ] FILE = { file_number | @file_number } ]

[ [ , ] PASSWORD = { password | @password_variable } ]

[ [ , ] MOVE 'logical_file_name' TO 'operating_system_file_name' ]

[ ,n ]

[ [ , ] MEDIANAME = { media_name | @media_name_variable } ]

[ [ , ] MEDIAPASSWORD = { mediapassword | @mediapassword_variable } ]

[ [ , ] KEEP_REPLICATION ]

[ [ , ] { NORECOVERY | RECOVERY | STANDBY = undo_file_name } ]

[ [ , ] { NOREWIND | REWIND } ]

[ [ , ] { NOUNLOAD | UNLOAD } ]

[ [ , ] RESTART ]

[ [ , ] STATS [= percentage ] ]

[ [ , ] STOPAT = { date_time | @date_time_var }

| [ , ] STOPATMARK = 'mark_name' [ AFTER datetime ]

| [ , ] STOPBEFOREMARK = 'mark_name' [ AFTER datetime ]

]

]

例如:restore log dbname from disk='filename'

DABAN RP主题是一个优秀的主题,极致后台体验,无插件,集成会员系统
网站模板库 » 事务日志备份既备份数据库的数据文件和日志文件存储在相同的位置

0条评论

发表评论

提供最优质的资源集合

立即查看 了解详情