Search

Friday, June 29, 2012

Backing up and Restoring the database with splitting files to multiple disks

Backing up the database with spiltting files to multiple disks 


BACKUP DATABASE DemoData TO
DISK = 'C:\BACKUPDIR\DemoData_1.BAK',
DISK = 'C:\BACKUPDIR\DemoData_2.BAK',
DISK = 'C:\BACKUPDIR\DemoData_3.BAK'


Feaching logical filenames from one of split backup


RESTORE FILELISTONLY 
FROM DISK = 'C:\BACKUPDIR\DemoData_1.BAK'


Restoring database from multiple spilt files 


RESTORE DATABASE DemoData_COPY FROM
DISK = 'C:\BACKUPDIR\DemoData_1.BAK',
DISK = 'C:\BACKUPDIR\DemoData_2.BAK',
DISK = 'C:\BACKUPDIR\DemoData_3.BAK'
WITH REPLACE ,
MOVE 'DemoData' 
TO 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\DemoData_COPY_DATA.MDF',
MOVE 'DemoData_LOG' 
TO 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\DemoData_COPY_LOG.LDF'

No comments:

Post a Comment