You are here:Home » tsql » Backing up and Restoring the database with spiltting files to multiple disks

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

-- Backing up the database with spiltting files to multiple disks
BACKUP DATABASE SPLITFILEDISK TO
DISK = 'C:\BACKUPDIR\SPLITFILEDISK_1.BAK',
DISK = 'C:\BACKUPDIR\SPLITFILEDISK_2.BAK',
DISK = 'C:\BACKUPDIR\SPLITFILEDISK_3.BAK'


-- Feaching logical filenames from one of split backup
RESTORE FILELISTONLY
FROM DISK = 'C:\BACKUPDIR\SPLITFILEDISK_1.BAK'


-- Restoring database from multiple spilt files
RESTORE DATABASE SPLITFILEDISK_COPY FROM
DISK = 'C:\BACKUPDIR\SPLITFILEDISK_1.BAK',
DISK = 'C:\BACKUPDIR\SPLITFILEDISK_2.BAK',
DISK = 'C:\BACKUPDIR\SPLITFILEDISK_3.BAK'
WITH REPLACE ,
MOVE 'SPLITFILEDISK'
TO 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\SPLITFILEDISK_COPY_DATA.MDF',
MOVE 'SPLITFILEDISK_LOG'
TO 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\SPLITFILEDISK_COPY_LOG.LDF'