Create a SQL Server Database on a network shared drive
(原文地址: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的更多相关文章
- 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 ...
- [转]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 ...
- 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 ...
- SQL Server Database Backup and Restore in C#
SQL Server Database Backup and Restore in C# Syed Noman Ali Shah, 7 Feb 201 ...
- 转载:Restore SQL Server database and overwrite existing database
转载自:https://www.mssqltips.com/sqlservertutorial/121/restore-sql-server-database-and-overwrite-existi ...
- Visual Studio 2012创建SQL Server Database Project提示失败解决方法
新建一个SQL Server Database Project,提示: Unable to open Database project This version of SQL Server Data ...
- SQL Server database mail问题诊断一例
产品环境sql server database的mail发不出邮件,影响客户的业务,在数据库中进行诊断 诊断sql: EXEC msdb.dbo.sp_send_dbmail @profile_nam ...
- SQL Server database – Error 3743
Database mirroring must be removed before you drop SQL Server database – Error 3743 If you try to dr ...
- SQL Server Database 维护计划创建完整的备份策略
SQL Server的维护计划Maintenance Plan是一个非常实用的维护工具,可以完成大多数的数据库维护任务,通过对这些功能的封装,可以省去很多的代码编写时间.网络上完整介绍的不是很多,特此 ...
随机推荐
- EaseMode
The following graphs demonstrate the different values of EasingMode, where f(t) represents the anima ...
- Android:Activity生命周期
Android是使用任务(Task)来管理活动的,一个任务就是一组存放在栈里的活动的集合,这个栈也被称作返回栈(Back Stack). 栈是一种后进先出的数据结构,在默认情况下,每当我们启动了一个新 ...
- Ubuntu系统的安装与使用 深度音乐播放器
1.添加深度音乐播放器的ppa源并更新源缓存 sudo add-apt-repository ppa:noobslab/deepin-sc sudo apt-get update 2. 安装需要的依 ...
- ubuntu实现ramdisk
1. linux内核提供了16个ramdisk供使用者使用,只需格式化,并挂在便可以使用.查看 ls /dev/ram* 2. 修改配置文件: sudo gedit /etc/default/grub ...
- [UVa 1619]Feel Good
#include <bits/stdc++.h> using namespace std; const int maxn = 1000010; struct node { int num; ...
- 企业app分发
http://beyondvincent.com/2014/07/30/2014-07-30-provision-ios-ipa-app-for-in-house-enterprise-distrib ...
- 如果让你来做HashMap扩容,如何实现在不影响读写的情况下扩容?
我觉得逼格高,不是体现在问题多刁钻,知识点多深,而是一个非常明确,无歧义的问题,能考察出面试者多方面的能力.这个问题背后:1.了解java中,HashMap的实现:如果一个面试者了解这一点,说明至少他 ...
- KITTI数据集格式说明
由于上一篇博客所提到的论文中的训练数据是KITTI的数据集,因此如果我想要用自己的数据集进行训练的话,就需要先弄清楚KITTI数据集的格式,在以下的网址找到了说明: 首先,数据描述中是这样的: 在以下 ...
- Jmeter参数化
使用jmeter时有时需要访问不同的uri,或POST不同的数据.这时候可以对数据参数化,将数据写入文件,再从文件读取.下面举个例子说明如何使用CSV Data Set Config参数化. 这里有两 ...
- MSSQL 全表搜索 指定字符串
平时在在MSSql中查询数据的时候,想查找,某个字段在数据库中是否存在,并且查询出在哪个表中,哪个字段下面,在不知道的情况下,操作起来会很麻烦,然后就写了一个sql语句,使用起来感觉挺方便的.当然了, ...