(原文地址:http://blogs.msdn.com/b/varund/archive/2010/09/02/create-a-sql-server-database-on-a-network-shared-drive.aspx)

Create a SQL Server Database on a network shared drive

(创建基于网上邻居共享路径的数据库)

Sometime back, I have written blog post on ‘Backing-up SQL Server Database on a network shared drive’. This can be found here. I have received numerous queries on an another related topic i.e. ‘How to Create a SQL Server Database on a network shared drive’. It took sometime (a brand new SQL Release) before I could get the answer as follow:

1. Create a database on Network Share in SQL Server 2008 / SQL Server 2005

In SQL 2008 and SQL 2005, By default, you cannot create a new database on a network share 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)

DBCC TRACEON(1807, -1)

Step 2. Identify a file share, where SQL Server Service start-up account has FULL access

Step 3. Create the database

CREATE DATABASE [networked] ON  PRIMARY
    ( NAME = N'networked', FILENAME = N'\\varund-win7\ATOMNETWORKDB\networked.mdf' , SIZE = 3072KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )
    LOG ON
    ( NAME = N'networked_log', FILENAME = N'\\varund-win7\ATOMNETWORKDB\networked_log.ldf' , SIZE = 1024KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)
    GO

2. Create a database on Network Share in SQL Server 2008R2

Starting SQL Server 2008R2, you are now allowed to cerate database on network file share (UNC path), without the need to Trace 1807

Step 1. Identify a file share, where SQL Server 2008R2 Service start-up account has FULL access

Step 2. Create the database

CREATE DATABASE [networked_r2] ON  PRIMARY
    ( NAME = N'networked_r2', FILENAME = N'\\varund-win7\ATOMNETWORKDB\networked_r2.mdf' , SIZE = 3072KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )
    LOG ON
    ( NAME = N'networked_r2_log', FILENAME = N'\\varund-win7\ATOMNETWORKDB\networked_log_r2.ldf' , SIZE = 1024KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)
    GO

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.

Microsoft recommends that you store database files either on Local Disk or on Storage Area Networks (SANs).

Create a SQL Server Database on a network shared drive的更多相关文章

  1. P6 Professional Installation and Configuration Guide (Microsoft SQL Server Database) 16 R1

    P6 Professional Installation and Configuration Guide (Microsoft SQL Server Database) 16 R1       May ...

  2. [转]How to: Create a Report Server Database (Reporting Services Configuration)

    本文转自:https://docs.microsoft.com/en-us/previous-versions/sql/sql-server-2008-r2/ms157300%28v%3dsql.10 ...

  3. How to Kill All Processes That Have Open Connection in a SQL Server Database[关闭数据库链接 最佳方法] -摘自网络

    SQL Server database administrators may frequently need in especially development and test environmen ...

  4. SQL Server Database Backup and Restore in C#

    SQL Server Database Backup and Restore in C# Syed Noman Ali Shah,                          7 Feb 201 ...

  5. 转载:Restore SQL Server database and overwrite existing database

    转载自:https://www.mssqltips.com/sqlservertutorial/121/restore-sql-server-database-and-overwrite-existi ...

  6. Visual Studio 2012创建SQL Server Database Project提示失败解决方法

    新建一个SQL Server Database Project,提示: Unable to open Database project This version of SQL Server Data ...

  7. SQL Server database mail问题诊断一例

    产品环境sql server database的mail发不出邮件,影响客户的业务,在数据库中进行诊断 诊断sql: EXEC msdb.dbo.sp_send_dbmail @profile_nam ...

  8. SQL Server database – Error 3743

    Database mirroring must be removed before you drop SQL Server database – Error 3743 If you try to dr ...

  9. SQL Server Database 维护计划创建完整的备份策略

    SQL Server的维护计划Maintenance Plan是一个非常实用的维护工具,可以完成大多数的数据库维护任务,通过对这些功能的封装,可以省去很多的代码编写时间.网络上完整介绍的不是很多,特此 ...

随机推荐

  1. vim 长句子中的上下移动

    当一个句子很长的时候,屏幕显示不下,就会分为多行,这个时候,你又想找到中间几行某部分的字母,怎么办?这个时候,先按下一个 g ,在按下 j / k ,就可以实现长句子的上下移动了.

  2. MySQL sql_safe_updates 分析

    我在练习MySQL操作语句时,使用一条完全没有错误的语句: update students set name='drake' where name='chuan'; 却报了如下错误: Error Co ...

  3. F-并查集

    Problem F Time Limit : 2000/1000ms (Java/Other)   Memory Limit : 60000/30000K (Java/Other) Total Sub ...

  4. JacksonUtils.java

    package com.vcredit.framework.utils; import java.io.IOException;import java.util.List; import com.fa ...

  5. Cannot instantiate the type AppiumDriver

    I have added following jars in my projects build path: java-client-2.0.0 from http://appium.io/downl ...

  6. TotalCommander 之 日常使用技巧

    一. 常用操作 常用的操作如查看.复制.移动.删除退出已经在Total Commander下方列出,选择好文件后单击相应的按钮或是按下相应的快捷键(F3~F7)就可以完成操作.也可以像Windows中 ...

  7. UPDATE INNER JOIN 两表联合更新

    UPDATE B_READMETER_HANDWORK INNER JOIN B_READMETER_ORDER_SP ON B_READMETER_HANDWORK.ID = B_READMETER ...

  8. [dpdk] 熟悉SDK与初步使用 (四)(L3 Forwarding源码分析)

    接续前节:[dpdk] 熟悉SDK与初步使用 (三)(IP Fragmentation源码分析) 前文中的最后一个问题,搁置,并没有找到答案.所以继续阅读其他例子的代码,想必定能在其他位置看到答案. ...

  9. 初探Redis+Net在Windows环境下的使用

    Redis官网地址:https://redis.io/:Redis官方暂时不支持Windows环境,但是MicroSoft Open Tech group开发了一个Windows平台下运行的版本. R ...

  10. Sql Server海量数据插入

    目录 1.前言 2.BULK INSERT 3.简单示例 前言 由于昨天接到一个客户反馈导出数据卡死的问题,于是决定今天模拟一下千万级的数据,然后傻傻的等待插入数据了半天...... 对于海量数据,上 ...