Backup dan Restore dfd, 2012
Pengantar Backup dan Restore dapat digunakan untuk menghindari masalah hilangnya data Backup dan Restore dapat dilakukan secara rutin dfd, 2012
Backup Jenis Backup 1. Full Backup Backup seluruh data dan log file yang ada pada database 2. Differential Backup Backup seluruh data dan log yang ada pada database setelah proses full backup 3. Transactional Log Backup Backup log yang ada pada database dfd, 2012
Perintah Backup BACKUP DATABASE { database_name | @database_name_var } TO <backup_device> [ ,...n ] [ <MIRROR TO clause> ] [ next-mirror-to ] [ WITH { DIFFERENTIAL | <general_WITH_options> [ ,...n ] } ] [;] dfd, 2012
Back Up File atau Filegroup BACKUP DATABASE { database_name | @database_name_var } <file_or_filegroup> [ ,...n ] TO <backup_device> [ ,...n ] [ <MIRROR TO clause> ] [ next-mirror-to ] [ WITH { DIFFERENTIAL | <general_WITH_options> [ ,...n ] } ] [;] dfd, 2012
Back Up Transaction Log BACKUP LOG { database_name | @database_name_var } TO <backup_device> [ ,...n ] [ <MIRROR TO clause> ] [ next-mirror-to ] [ WITH { <general_WITH_options> | <log-specific_optionspec> } [ ,...n ] ] [;] <backup_device>::= { { logical_device_name | @logical_device_name_var } | { DISK | TAPE } = { 'physical_device_name' | @physical_device_name_var } } dfd, 2012
<MIRROR TO clause>::= MIRROR TO <backup_device> [ ,...n ] <file_or_filegroup>::= { FILE = { logical_file_name | @logical_file_name_var } | FILEGROUP = { logical_filegroup_name | @logical_filegroup_name_var } } dfd, 2012
<general_WITH_options> [ ,...n ]::= --Backup Set Options COPY_ONLY | { COMPRESSION | NO_COMPRESSION } | DESCRIPTION = { 'text' | @text_variable } | NAME = { backup_set_name | @backup_set_name_var } | PASSWORD = { password | @password_variable } | { EXPIREDATE = { 'date' | @date_var } | RETAINDAYS = { days | @days_var } } dfd, 2012
--Log-specific Options { NORECOVERY | STANDBY = undo_file_name } | NO_TRUNCATE dfd, 2012
Restore 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> | , <service_broker_WITH options> | , <point_in_time_WITH_options—RESTORE_DATABASE> } [ ,...n ] [;] dfd, 2012
Restore Files atau Filegroups RESTORE DATABASE { database_name | @database_name_var } <file_or_filegroup> [ ,...n ] [ FROM <backup_device> [ ,...n ] ] WITH { [ RECOVERY | NORECOVERY ] [ , <general_WITH_options> [ ,...n ] ] } [ ,...n ] [;] dfd, 2012
Restore Log 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 ] ] [;] dfd, 2012
<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 } dfd, 2012
Detach sp_detach_db [ @dbname= ] 'database_name' [ , [ @skipchecks= ] 'skipchecks' ] [ , [ @keepfulltextindexfile = ] 'KeepFulltextIndexFile' ] Attach sp_attach_db [ @dbname= ] 'dbname' , [ @filename1= ] 'filename_n' [ ,...16 ] dfd, 2012