Hello Seem to be a hardest word

Just another WordPress.com weblog

Backup – Restore – Well-done

– 1 xoa device, xoa file vat ly chua device, xoa history
sp_dropdevice ‘DevTracNghiem’,'delfile’
go
msdb..sp_delete_backup_and_restore_history ‘TracNghiem’

– 2 tao lai bak device
sp_addumpdevice ‘disk’,'DevTracNghiem’,'C:\TracNghiem.dev’

– 3 tao backup
backup database TracNghiem to DevTracNghiem with noinit — backup full ma khong overwrite len cac ban full truoc do
backup database TracNghiem to DevTracNghiem with differential,name = ‘thang 7′,description=’backup choi cho vui’

– 4 xem cac ban backup
select
database_name,position,user_name,name,description,database_creation_date,backup_start_date,backup_finish_date
logical_device_name,physical_device_name
from msdb.dbo.backupset A ,msdb.dbo.backupmediafamily B
where A.media_set_id=B.media_set_id

– 5 restore csdl ve 1 version bat ky da tao ra: phai qua 2 buoc: restore ve ban full gan nhat + restore ve ban chi dinh
restore database TracNghiem from DevTracNghiem with norecovery
restore database TracNghiem from DevTracNghiem with file = 3,recovery

Tháng Năm 27, 2008 Đăng bởi fate | MS SQLSERVER | | No Comments Yet