是否应该将SAN上的SQL Server中的user database的data文件, log文件和TempDB文件放在不同的LUN上?

请看下面的两个精彩解答:

解答1:

If your SAN has performance and availability algorithms built into the management software then yes, it is a good idea for both performance and availibility to put them on the SAN. As I understand it, SANs manage the pools and dynamically allocate storage as needed for either performance or disk failures (it senses that the disk is about to fail due to low performance metrics and physically moves files to other disks in the pool).

It is best practice to put log files and data files on seperate "physical" disks for 2 reasons:

  • First, your logfile is used as part of data recovery if your data files become corrupted.
  • Second, the logfile is read and write intensive because all DB activity (except for SELECT statements) are first written to the logfile, then out to data files. If you follow the sequence you would see that for a single transaction, it would have to (at a minimum) read from the same disk 4 times if logfiles and data files resided on the same disk. On seperate disks, it cuts the IO in half.

In an ideal situation, the log files and data files would reside on disks found on seperate controllers as this is the best performance and HA gain along with the disk speed and RAID choice.

 

解答2:

One thing to consider is that the log files are sequential writes where as the data files are non sequential. That is one of the reasons for separate LUNs. Log files write faster if they are on their own LUN because the spindles don't have to skip around, just write sequential. If you add in a data file then the spindles have to skip around and you lose some performance. I'm hoping I got the right terminology there as I'm not all that familiar with SANs themselves. The idea behind it should be however.

Frequently vendor recommendations are wrong when it comes to SQL Server. Just because SQL Server has different needs than most applications that use a SAN.

 

参考资料

=======================

SQL Server - Separating data, log, and TempDB files on a SAN

http://dba.stackexchange.com/questions/35404/sql-server-separating-data-log-and-tempdb-files-on-a-san

Any benefit to separate LUNs for log/DB when using SAN pooled storage?

http://community.spiceworks.com/topic/284204-any-benefit-to-separate-luns-for-log-db-when-using-san-w-pooled-storage?page=1#entry-1846277

posted on   中道学友  阅读(517)  评论(0编辑  收藏  举报

编辑推荐:
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
阅读排行:
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 单元测试从入门到精通
· 上周热点回顾(3.3-3.9)
· winform 绘制太阳,地球,月球 运作规律
历史上的今天:
2010-11-12 [跨DB查询]查找SharePoint 2007中的Orphan Feature的SQL语句

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

技术追求准确,态度积极向上

点击右上角即可分享
微信分享提示