(原文地址: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. *HDU3367 最小生成树

    Pseudoforest Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Tot ...

  2. js入门篇之Math对象

    Math对象用于执行数学任务 Math对象的属性: Math对象的方法: 常用属性和方法: Math.PI ----------------返回圆周率3.14 ... Math.ceil(x) --- ...

  3. 手动安装配置mongodb

    2.1查看当前操作系统版本 2.2下载mongodb安装包 我的下载路径:http://www.mongodb.org/downloads 注意这里要下载和操作系统匹配的版本,因为我的系统是32位的, ...

  4. 2016huasacm暑假集训训练四 DP_B

    题目链接:http://acm.hust.edu.cn/vjudge/contest/125308#problem/M 题意:有N件物品和一个容量为V的背包.第i件物品的费用是体积c[i],价值是w[ ...

  5. mysql求最大第二,最大第三个数

    题目是这样的: 集团有多个部门,部门下有多个员工,求每个部门绩效排名第二的人员 sql语句是这样的 SELECT dep, MAX(score) FROM zx WHERE score NOT IN ...

  6. js中列表控件排序箭头,在wke中不支持的解决办法

    列表中箭头,实际使用的在线css样式,wke不支持排序箭头(实际是字体)的在线css样式,可以客户端安装对应的字体,之后显示就正常了.

  7. 使用 PDO 方式将 Session 保存到 MySQL 数据中

    类: <?php /* 使用数据库保存session */ class DBHandler implements SessionHandlerInterface { protected $dbh ...

  8. Purfer Sequence

    原文地址:http://www.cnblogs.com/zhj5chengfeng/archive/2013/08/23/3278557.html 我们知道,一棵树可以用括号序列来表示,但是,一棵顶点 ...

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

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

  10. How to inspect who is caller of func and who is the class of instance

    1. Who is the class of self instance ? class aa(object): def a(self): if self.__class__.__name__ == ...