Académique Documents
Professionnel Documents
Culture Documents
Page 1 of 4
Hello All,
You have a situation wherein you want to backup SQL Server database to a network mapped drive. So all you
thought of doing is mapping the drive from Operating System with a Drive Letter. Now you tried taking the backup
from SSMS backup GUI, however you cannot view the network mapped drive.
“For a network share to be visible to SQL Server, the share must be mapped as a network drive in the session in
which SQL Server is running”
Prerequisite: The steps are applicable on machines running under “Domain Account”.
Once done, you will be able to view the network mapped drive from Backup/Restore GUI.
NOTE: Only flipside is that this network drive mapping will remain till next SQL Server Service restart. So, To
make above 'Network Drive mapping’ Permanent follow either of below options
- Once “Backup Device” is created, network mapped drive will be visible across SQL Server reboot.
http://blogs.msdn.com/b/varund/archive/2009/06/04/backup-sql-server-database-to-a-shar... 23/03/2011
Backup and Restore SQL Server Database to a network shared drive - Varun Dhawan's Bl... Page 2 of 4
Alternate way to Backup and Restore SQL Server database from Network
Shared Drive -
Using Trace Flag 1807
In SQL 2008/R2 and SQL 2005, By default, you cannot backup and restore a database on a network shared
drive. This restriction is primarily due to fact that, On a network file share, there is always a risk on network errors
compromising database integrity, along with I/O performance issues which might partial or total data loss or
corruption. Reference >> Microsoft KB # 304261
However, there’s a “workaround”, if in case you still want to go ahead. Follow below steps:
Step 1. Enable the Trace Flag 1807: (Bypasses the check and allows you to configure SQL Server with network-
based database files)
Step 2. Identify a file share, where SQL Server Service start-up account has FULL access for Reading and Write
CAUTION: While the above options will surely help you to manage space used by database file across your
networked servers, please be aware of the risk involved (as I discussed above). Once such known issue has
been discussed in this CSS post. It is therefore advised to run SQLIOSIM.exe that ships with SQL Server 2008
R2, this has now been updated to allow testing against a UNC locations.
The above error clearly indicates that you need to ENABLE xp_cmdshell. Use below command:
sp_configure 'xp_cmdshell',1;
Go
RECONFIGURE WITH OVERRIDE;
Go
Disclaimer: I work at Microsoft. Everything here, though, is my personal opinion and is not read or approved by
Microsoft before it is posted. No warranties or other guarantees will be offered as to the quality of the opinions or
anything else offered here.
Comments
http://blogs.msdn.com/b/varund/archive/2009/06/04/backup-sql-server-database-to-a-shar... 23/03/2011
Backup and Restore SQL Server Database to a network shared drive - Varun Dhawan's Bl... Page 3 of 4
Steven P Harris
15 Jun 2009 4:53 AM
USE [master]
GO
GO
GO
GO
Additionally on the remote server, set up a bat file job to delete old .bak files, with the following:
Varun
21 Jul 2009 3:18 AM
Thanks Steven,
Jason
10 Sep 2009 11:58 AM
http://blogs.msdn.com/b/varund/archive/2009/06/04/backup-sql-server-database-to-a-shar... 23/03/2011
Backup and Restore SQL Server Database to a network shared drive - Varun Dhawan's Bl... Page 4 of 4
http://blogs.msdn.com/b/varund/archive/2009/06/04/backup-sql-server-database-to-a-shar... 23/03/2011