RESTORE DATABASE |
Restauration de la base de données |
---|---|
Microsoft SQL Server |
Syntaxe
RESTORE DATABASE { database_name | @database_name_var } [ FROM backup_device [ ,...n ] ] [ WITH { [ RECOVERY | NORECOVERY | STANDBY = {standby_file_name | @standby_file_name_var } ] | , general_WITH_options [ ,...n ] | , replication_WITH_option | , change_data_capture_WITH_option | , FILESTREAM_WITH_option | , service_broker_WITH options | , \point_in_time_WITH_options-RESTORE_DATABASE } [ ,...n ] ] [;] RESTORE DATABASE { database_name | @database_name_var } files_or_filegroups [ ,...n ] [ FROM backup_device [ ,...n ] ] WITH PARTIAL, NORECOVERY [ , general_WITH_options [ ,...n ] | , \point_in_time_WITH_options-RESTORE_DATABASE ] [ ,...n ] [;] RESTORE DATABASE { database_name | @database_name_var } file_or_filegroup [ ,...n ] [ FROM backup_device [ ,...n ] ] WITH { [ RECOVERY | NORECOVERY ] [ , general_WITH_options [ ,...n ] ] } [ ,...n ] [;] RESTORE DATABASE { database_name | @database_name_var } PAGE = 'file:page [ ,...n ]' [ , file_or_filegroups ] [ ,...n ] [ FROM backup_device [ ,...n ] ] WITH NORECOVERY [ , general_WITH_options [ ,...n ] ] [;] RESTORE LOG { database_name | @database_name_var } [ file_or_filegroup_or_pages [ ,...n ] ] [ FROM backup_device [ ,...n ] ] [ WITH { [ RECOVERY | NORECOVERY | STANDBY = {standby_file_name | @standby_file_name_var } ] | , general_WITH_options [ ,...n ] | , replication_WITH_option | , \point_in_time_WITH_options-RESTORE_LOG } [ ,...n ] ] [;] RESTORE DATABASE { database_name | @database_name_var } FROM DATABASE_SNAPSHOT = database_snapshot_name backup_device::= { { logical_backup_device_name | @logical_backup_device_name_var } | { DISK | TAPE | URL } = { 'physical_backup_device_name' | @physical_backup_device_name_var } } files_or_filegroups::= { FILE = { logical_file_name_in_backup | @logical_file_name_in_backup_var } | FILEGROUP = { logical_filegroup_name | @logical_filegroup_name_var } | READ_WRITE_FILEGROUPS } general_WITH_options [ ,...n ]::= MOVE 'logical_file_name_in_backup' TO 'operating_system_file_name' [ ,...n ] | REPLACE | RESTART | RESTRICTED_USER | CREDENTIAL | FILE = { backup_set_file_number | @backup_set_file_number } | PASSWORD = { password | @password_variable } | MEDIANAME = { media_name | @media_name_variable } | MEDIAPASSWORD = { mediapassword | @mediapassword_variable } | BLOCKSIZE = { blocksize | @blocksize_variable } | BUFFERCOUNT = { buffercount | @buffercount_variable } | MAXTRANSFERSIZE = { maxtransfersize | @maxtransfersize_variable } | { CHECKSUM | NO_CHECKSUM } | { STOP_ON_ERROR | CONTINUE_AFTER_ERROR } | STATS [ = percentage ] | { REWIND | NOREWIND } | { UNLOAD | NOUNLOAD } replication_WITH_option::= | KEEP_REPLICATION change_data_capture_WITH_option::= | KEEP_CDC FILESTREAM_WITH_option::= | FILESTREAM ( DIRECTORY_NAME = directory_name ) service_broker_WITH_options::= | ENABLE_BROKER | ERROR_BROKER_CONVERSATIONS | NEW_BROKER \point_in_time_WITH_options-RESTORE_DATABASE::= | { STOPAT = { 'datetime'| @datetime_var } | STOPATMARK = 'lsn:lsn_number' [ AFTER 'datetime'] | STOPBEFOREMARK = 'lsn:lsn_number' [ AFTER 'datetime'] } \point_in_time_WITH_options-RESTORE_LOG::= | { STOPAT = { 'datetime'| @datetime_var } | STOPATMARK = { 'mark_name' | 'lsn:lsn_number' } [ AFTER 'datetime'] | STOPBEFOREMARK = { 'mark_name' | 'lsn:lsn_number' } [ AFTER 'datetime'] } |
Description
Cette instruction permet de restituer une copie de sauvegarde effectué précédemment par une instruction «BACKUP DATABASE».
Dernière mise à jour : Vendredi, le 19 Juin 2020