SQL Server 2005,維護計划建議

[英]SQL Server 2005, Maintenance Plan suggestion


I need some advice on SQL Server 2005 maintenance plan, okay here some question:

我需要一些關於SQL Server 2005維護計划的建議,這里有一些問題:

  1. What task(s) is/are suitable for daily maintenance and what for weekly/monthly maintenance
  2. 什么任務適用於日常維護以及每周/每月維護的任務

  3. Do database need to be offline while in some task, example : reorganize/rebuild index, Shrinking database, etc... (since we need to keep 90% uptime)
  4. 在某些任務中,數據庫是否需要脫機,例如:重新組織/重建索引,縮小數據庫等...(因為我們需要保持90%的正常運行時間)

  5. How long can check database integrity, reorganize/rebuild index, cleanup history be?
  6. 可以檢查數據庫完整性,重組/重建索引,清理歷史多長時間?

  7. Should we do both reorganize and rebuild index?
  8. 我們應該重組和重建索引嗎?

  9. Do we need to update statistic after reorganize index? Since rebuild index will auto update statistic
  10. 重組索引后是否需要更新統計信息?由於重建索引將自動更新統計信息

In our case, data is inputed every 1 minute (merely 200 records per minute) 24 hours, 7 days a week.

在我們的例子中,數據每周7天,每隔1分鍾(僅每分鍾200條記錄)24小時輸入。

Can someone suggest me what Maintenance Plan that good for this database?

有人可以建議我哪個維護計划對這個數據庫有好處嗎?

Thanks,
Dels

3 个解决方案

#1


Maintenance plans really depend on your database processes. Since the data is inputted every minute, do you have any rollup and etl processes running?

維護計划實際上取決於您的數據庫進程。由於數據是每分鍾輸入的,您是否有任何匯總和etl進程在運行?

The most important process that I can tell you is the daily backup (both tape and disk)of your data and transaction logs.

我能告訴你的最重要的過程是數據和事務日志的每日備份(包括磁帶和磁盤)。

Check for any slow running queries using query plan analyzer and you may need to re-index some of your tables either daily or weekly depending on your needs. You can do online re-indexing in SQL Server 2005 enterprise edition, which means you do not need to be offline.

使用查詢計划分析器檢查任何運行緩慢的查詢,您可能需要根據需要每天或每周重新索引一些表。您可以在SQL Server 2005企業版中進行在線重新索引,這意味着您不需要脫機。

Have a good process by creating a maintenance plan and automate as much as possible by creating scheduled jobs.

通過創建維護計划並通過創建預定作業盡可能自動化來實現良好的流程。

#2


Two Words: Disaster Recovery

兩個詞:災難恢復

The best plan is one which you have tested.

最好的計划是你測試過的計划。

Plan for a disaster recovery and see how much you can restore your existing system from this plan. Note any issues and find ways of resolving them, then re-run the disaster recovery. You will find this will help you make decisions and prioritize requirements.

規划災難恢復,並了解您可以從此計划中恢復現有系統的數量。記下任何問題並找到解決方法,然后重新運行災難恢復。您會發現這將有助於您做出決策並確定需求的優先順序。

It is best to do this with both an O/S restore as well as an SQL server restore.

最好通過O / S還原和SQL Server還原來執行此操作。

Also some advice: Setup an O/S scheduled task to do a file system copy of the master, model, mssqlsystemresource databases. This will save you grief and having to run the SQL server in single-user mode to try and restore your master db from a backup.

還有一些建議:設置O / S計划任務來執行master,model,mssqlsystemresource數據庫的文件系統副本。這將節省您的悲痛並且必須以單用戶模式運行SQL服務器以嘗試從備份還原主數據庫。

Its all well and good having backups, but if you never test recovery, then your backups are worthless.

一切都很好,有備份,但如果你從未測試過恢復,那么你的備份毫無價值。

#3


To maintain performance and ensure database consistency, I typically run the following tasks each and every night:

為了保持性能並確保數據庫一致性,我通常每晚都運行以下任務:

1) Backing up a database (Typically this is a FULL backup. However if the database is very large then a FULL backup is run once per week {on the weekend} and an incremental or differential each weekday)

1)備份數據庫(通常這是一個完整的備份。但是如果數據庫非常大,那么每周運行一次FULL備份{在周末}並且每個工作日增量或差異

2) Rebuild all indexes (This automatically reorganizes all indexes as well, so the reorganize step is not needed.)

2)重建所有索引(這也會自動重新組織所有索引,因此不需要重新組織步驟。)

3) Updating database statistics (Only Column statistics are needed since the other statistics are automatically updated by the Index Rebuild which ran earlier)

3)更新數據庫統計信息(僅需要列統計信息,因為其他統計信息由之前運行的索引重建自動更新)

4) Verifying database integrity (This is the most important step as it could get corrupted by almost anything and still run just fine for a while, meanwhile all the data is getting more and more corrupted.)

4)驗證數據庫完整性(這是最重要的一步,因為它幾乎可以被任何東西破壞,並且仍然可以運行一段時間,同時所有數據都會越來越多地被破壞。)

5) Notify operator via e-mail of success (You must send both success and failures. IF you only send failures then there is a chance the server might have another issue preventing the sending of the failure email and then they would never know.)

5)通過電子郵件通知操作員成功(您必須發送成功和失敗。如果您只發送失敗,那么服務器可能有另一個問題阻止發送失敗電子郵件然后他們永遠不會知道。)

6) Cleaning files (Depending upon the drive space, you will need to remove old backups. I try to keep at least a few weeks worth if there is room, but as the database grows will need to check this and possibly reduce this to as low as one or two full backups.)

6)清理文件(根據驅動器空間的不同,您需要刪除舊備份。如果有空間,我會盡量保持至少幾周的價值,但隨着數據庫的增長需要檢查這一點並可能將其減少為低至一個或兩個完整備份。)

7) Cleanup history (The Maintenance plan log history is not very large so you can keep a long history of these without worrying about space too much. It is sometimes helpful when you come across a database that has been failing for a long time to see when it started failing and use that to point out to the people monitoring it that it has not been properly monitored for success.)

7)清理歷史記錄(維護計划日志歷史記錄不是很大,所以你可以保留很長的歷史記錄,而不必過多地擔心空間。當你遇到一個長時間失敗的數據庫時,它有時很有用。當它開始失敗並使用它向監視它的人指出它沒有被正確監視以獲得成功。)

NOTES: Be sure to copy the backups off the main database server and store them offsite.

注意:確保從主數據庫服務器復制備份並將其存儲在異地。


注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:https://www.itdaan.com/blog/2009/04/15/7212f3fd47670e449ecf598a37574b55.html



 
粤ICP备14056181号  © 2014-2021 ITdaan.com