When you back up an LDF file, you are given the opportunity to specify the new size for this file. If you don't specify a size,
SQL will try to compact this file down as small as possible which might be 1 or 2 MB in size. Although this is ideal as far as drive space is concerned, it is NOT ideal for performance with the
SQL databases for
SharePoint. There is no set formula or rule on how large the LDF file should be, but it should be of an adequate size that will prevent it from having to grow automatically every single day when it reaches its current size limit. For instance, if you state that the new size of the LDF file is going to be 2 GB in size, the initial size of the LDF file will be 2 GB, and it will stay this size until 2GB worth of new transactions have taken place. When this point is reached, the LDF file will grow automatically, and for that short time during its automatic growth, you might see a small performance hit on the
SQL Server. This is what needs to be avoided if possible. The
SQL Engineer I spoke with stated that if your MDF file was around 30 to 50 GB in size, a 2 to 3 GB LDF file should be more than adequate to start out with, but again there is no hard formula for what the size of the LDF file should be.
Why are some DBs set to FULL RECOVERY and some are not? Is there even any supported
SharePoint restore method that uses
SharePoint’s RESTORE to restore the full databases; and then a more current Transaction Log restore within
SQL to move databases set to FULL RECOVERY to a more current point in time?
(came from Microsoft
SPS escalation team)
The reason that the _SITES database is the only database that has Full Recovery Mode enabled is because it is created by Windows
SharePoint Services and the other databases are created by
SharePoint Portal Server. [Actually – the Config DB is also set to FULL RECOVERY by default – but it stays small.] If you have a standalone deployment of Windows
SharePoint services, it is possible to back up the database via
SQL and add the data from the transaction logs after the fact. With a
SharePoint Portal Server deployment all of the databases must be backed up and restored from the same point in time, so this option is not possible. I believe this is why the Solution Object from our Development Team stated that it would be all right in a Portal deployment to go ahead and change the Recovery method to simple as the only supported restore method is from the Full
SQL Backups taken by the
SharePoint Portal Data Backup and Restore utility.
Anyway – since I’m a full
SPS deployment – my next (and hopefully final!) reconfig task is to set all my databases to SIMPLE RECOVERY for better performance – and this will make the whole logfile size thing a moot point!
Sara
From: Bill English [mailto:bill@mindsharp.com]
Sent: Sunday, January 09, 2005 7:25 PM
To: Sara
Subject: RE: question from an old student
At a minimum, may I turn this into a blog entry? I’ll post it at mindsharpblogs.com, if that would be acceptable to you.
Bill English, MCSE, MCT, MVP
From: Sara
Sent: Thursday, January 06, 2005 11:16 AM
To: Bill English
Subject: RE: question from an old student
I’m hoping that info about the
SQL DBs & logfile sizes, maintenance plans, etc. will eventually be documented via KB or whatever for
SPS admins (many of whom, like me, are probably NOT
SQL DBAs so are somewhat clueless about
SQL maintenance… but nevertheless have to deal with it as a part of
SPS!).
I’m still muddling things through with PSS – it actually appears that, by default, the PROF & SERV DBs are set to SIMPLE RECOVERY in
SQL, while the Config & SITE DBs are set to FULL RECOVERY… which means very different backup/recovery scenarios… which gets very confusing as you then end up (assuming you follow
SQL guidelines for frequent & separate backup of the logfiles for the FULL RECOVERY DBs) with the
SPS DBs backed up to different points in time: all of them backed up to one point via
SPS’s tools, and then the FULL RECOVERY DB logfiles backed up to a more current point in time.
The whole 「logfile backup」 thing is also somewhat separate from the 「shrink the logfiles to manageable sizes」 thing, which was my original question – this task took a series of logfile backups + DBCC SHRINKFILE commands (multiple times) to finally make it work.
I’ll be interested to see what the final recommendations end up being (assuming that there ARE some final recommendations!).
Take care,
Sara
From: Bill English [mailto:bill@mindsharp.com]
Sent: Tuesday, January 04, 2005 7:15 PM
To: Sara
Subject: RE: question from an old student
Thanks for the update, Sara. I’ll be sure to include this in my revised courseware.
Bill English, MCSE, MCT, MVP
From: Sara
Sent: Tuesday, January 04, 2005 4:07 PM
To: Bill English
Subject: RE: question from an old student
Hi again,
I actually ended up with a free case from Microsoft Premier Support, as this is apparently a current issue being tossed around by the
SPS &
SQL folks.
It appears that:
- Although SPS can back up the SQL databases through the builtin backup/restore utility – it can’t really (supportably) affect the behavior of the SQL databases & transaction logs themselves… this has to be configured within SQL.
- If SQL 2000 is installed as recommended for SharePoint (which is essentially with default configuration), then the SQL recovery mode is set to FULL RECOVERY, which logs all transactions so the installation can be recovered to the point of failure (and not just to the last backup)… which is a good thing.
- Additionally, with SQL 2000 installed as recommended, transaction logs filesize is set to be unlimited… so it just continues to grow.
- By default, auto shrink is NOT enabled… which they say is a good thing as auto shrink can’t be scheduled so can kick on at very inopportune times.
- When a full backup is successfully completed, the committed transactions are purged from the logfile; however – the filesize itself remains the same as it doesn’t go through a shrink process; hence – the LDF filesize remains at the largest size it’s ever reached.
Current recommendations (which I’m going to try tonight):
- Do NOT turn on Auto Shrink for the databases; instead create a scheduled job using the DBCC SHRINKFILE utility (KB272318) to shrink the logfile sizes (can be scheduled within Enterprise Manager using the Mgmt tools).
- Leave the SQL RECOVERY MODE at 「Full Recovery」 for all SPS SQL databases; this allows for a restore up to the point of failure.
- Be sure to create a scheduled job that backs up the Transaction Logs separate from the SharePoint backups; without the Transaction Logs SQL can’t be restored to the point of failure (can be done within Enterprise Manager using the Mgmt tools).
I’m going to try the steps tonight & see how it goes… it sounds like some recommendations/solutions will eventually work their way into
SPS documentation since there are definitely related performance issues as well as disaster recovery issues.
Hope all is well!
Thanks,
Sara
From: Sara
Sent: Monday, January 03, 2005 11:52 AM
To: Bill English (bill@mindsharp.com)
Subject: question from an old student
Hi Bill,
In all your spare time – if you have a few moments for another question from an old student I’d sure appreciate your input!
In looking at the
SQL databases housing my SPS2003 data, I see that for the larger databases (typically _SITE) the LDF file (which I believe is the
SQL transaction logfile) is quite a bit larger than the MDF file (which I believe is the primary
SQL database file). For example, one of my _SITE database files is about 33GB in size; its companion LDF file is about 55GB in size.
I’m successfully backing up my
SPS sites with the builtin backup/restore tool [still working out issues with the CommVault Qinetix
SPS backup piece] – successful backups are logged both by
SharePoint as well as on the
SQL box itself… and I know the backups are working as I’ve had to move my
SPS sites around WAY more often than I’d like via the restore tool.
I’ve only recently begun to really take a look at the actual
SQL files (had to move the databases to larger partitions) – and I guess I expected the logfiles to be purged once successful backups are done – but it appears that they just keep growing.
I got a newsgroup response saying that the behavior of the
SQL LDF files actually depends on settings within
SQL itself – and that I probably don’t need the logfiles if I’m using
SPS backups or some other tool (which I am) – but I’m wondering if there are any
SPS recommendations about the
SQL logfile settings?
I pretty much installed
SQL with the default settings other than file locations (but in an active/passive 2-node
SQL cluster).
I can’t seem to find anything on recommended
SQL settings for
SharePoint – is there any info you can pass along?
(please let me know if this doesn’t make any sense)
Thanks,
Sara
如何壓縮WSS3.0的ldf日誌文件(利用SQL2005 express管理工具壓縮WSS3.0日誌文件)
由於最近也遇到這個問題,並且是在生產環境中,WSS3.0所在分區只剩不到10%空間,狀況十分嚴重。通過多方查找(本人在SQL方面連個菜鳥都算不上)終於找到了解決的方法。由於是學習多位大俠的方法,因此寫在這兒,以供遇到同類問題的朋友參考。
環境:WSS3.0 安裝的數據庫是SQL簡化版
問題:WSS的WSS_Content_log.LDF/ SharePoint_Config_cab00c0b-ee12-434b-aed3-482add86567f_log.LDF兩個日誌文件分別達到了50G和17G左右,並且還在不斷增大。
解決方法:先安裝SQL2005 express版的管理工具(在迅雷裏找的)安裝後將服務器名稱設爲: \\.\pipe\MSSQL$MICROSOFT##SSEE\sql\query
進行鏈接。
打開數據庫目錄後,能夠發現WSS_Content 和SharePoint_Config_cab00c0b-ee12-434b-aed3-482add86567f兩個數據庫(個人機器是這樣的) 選中某個數據庫點右鍵後,在彈出菜單中選擇任務-收縮-文件 在彈出的窗口 文件類型 中選擇日誌 (下面一步很關鍵)這個時候選擇 「確實」來收縮日誌文件實際是收縮不了的。必須採用 一個命令來中斷日誌,而後才能夠收縮成功,個人做法是:在右鍵菜單裏選擇 新建查詢 輸入命令:BACKUP LOG "SharePoint_Config_cab00c0b-ee12-434b-aed3-482add86567f" WITH NO_LOG (這裏的數據庫名稱中有不規則字符,因此要""起來),點執行 完成後,再回到剛纔的收縮界面中,便可以收縮成功(注意這裏的收縮操做有3種,我本身總結應該用第二種,不過第二種須要指定容量)。
再說一個我本身遇到的問題,由於很菜,因此遇到。
在我收縮WSS3.0 config日誌後,在WSS管理中心中,進行備份時沒法進行。
也沒法刪除備份任務,刪除時即提示未知錯誤。管理中心的不少功能也沒法執行。用WSS的修復功能也沒法解決。重壓之下,偶然用到了 收縮窗口中的 收縮操做第二項「在釋放未使用的空間前從新組織頁」而後從新進行了一次收縮(在未中斷日誌的狀況下),結果所有恢復正常。估計是收縮日誌時選了第一項收縮,引發日誌錯誤了。 寫這麼多,是由於被日誌問題困擾了一個多月。但願其它的朋友沒必要象我這樣麻煩
©著做權歸做者全部:來自51CTO博客做者BearStudyHard的原創做品,如需轉載,請與做者聯繫,不然將追究法律責任
掃一掃,領取大禮包mysql
Ctrl+Enter 發佈html
發佈java
取消node