Cari Blog Ini

20 Juli 2012

Example of Backup and Restore VerifyOnly Database Using Password

1. Backup database
----------------------------------------------------------------------------
-----code:start-----
----------------------------------------------------------------------------
BACKUP DATABASE DB_Simulasi TO DISK = 'D:\DB_Simulasi.bak'
    WITH
    PASSWORD='123456';
----------------------------------------------------------------------------
-----code:end-----
----------------------------------------------------------------------------

Result Messages:
Processed 66832 pages for database 'DB_Simulasi', file 'SeaSQL_dat' on file 1.
Processed 1 pages for database 'DB_Simulasi', file 'SeaSQL_log' on file 1.
BACKUP DATABASE successfully processed 66833 pages in 13.349 seconds (39.114 MB/sec).


2. Restore using RESTORE VERIFYONLY Statement

----------------------------------------------------------------------------
-----code:start-----
----------------------------------------------------------------------------
RESTORE VERIFYONLY FROM DISK = 'D:\DB_Simulasi.bak'
    WITH PASSWORD = '123456'
----------------------------------------------------------------------------
-----code:end-----
----------------------------------------------------------------------------

Result Messages:
The backup set on file 1 is valid.



Source:
http://syntaxhelp.com/SQLServer/Backup/FULL