Cara penulisan perintah Backup database dengan Transact-SQL adalah sebagai berikut:
BACKUP DATABASE { database_name | @database_name_var }Contoh sederhana membackup data dengan Transact-SQL database hrd ke drive C:\ adalah sebagai berikut:
TO < backup_device > [ ,...n ]
[ WITH
[ BLOCKSIZE = { blocksize | @blocksize_variable } ]
[ [ , ] DESCRIPTION = { 'text' | @text_variable } ]
[ [ , ] DIFFERENTIAL ]
[ [ , ] 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 } ]
[ [ , ] { NOSKIP | SKIP } ]
[ [ , ] { NOREWIND | REWIND } ]
[ [ , ] { NOUNLOAD | UNLOAD } ]
[ [ , ] RESTART ]
[ [ , ] STATS [ = percentage ] ]
]
BACKUP DATABASE hrd TO DISK = 'C:\hrd.bak'Contoh Transact-SQL di atas akan membackup database hard ke disk C:\ dengan nama file hrd.bak dan nama backupnya Full Backup of hrd.
WITH FORMAT,
NAME = 'Full Backup of hrd'
GO
Peintah backup di atas dapat dieksekusi melalui SQL Query Analyzer.
1 comment:
mang admin saya mau nanya caranya backup pertable gimna di sql server 2015
trimakasih
Post a Comment