YourSQLDba介紹
YourSQLDba是一個法國人寫的程序,它是由一系列T-SQL存儲過程構成的腳本文件。可以理解成一個組件或安裝包,從而簡化了在Mircorsoft SQL Server 2005/2008 數據庫的安裝,部署。它可以提供自動、復雜,非常容易定制的數據庫維護管理,從而可以極大的讓DBA從繁雜的維護工作中釋放出來。這是一個優秀的工具,可以減輕你的工作。也是每個DBA應該努力的方向,可以編寫自己的數據庫管理維護工具,讓你從繁雜的工作中解脫出來。
YourSQLDba的官方網站:http://www.grics.qc.ca/yoursqldba/index_en.shtml
主要設計目標
1. 實現SQL服務器維護的最佳實踐
2. 易於部署(從后面的介紹可以看出)
3. 沒有依賴其他工作的SQL代理和工作SQL Management Studio等
4. 大量日志記錄和報告,非常便於診斷問題
5. 確保維護問題可以自動產生報告
6. 確保嚴重的情況也不容忽視很長時間。
功能介紹
完整備份和日志備份的自動化
執行更新統計信息(通常每隔一個指定的周期執行一次,默認是一周)
選擇性reorganize或重建那些超過閥值的索引。
檢查數據庫的完整性。
保持MSDB的最新備份,並記錄備份歷史(每個完整或日志備份周期)
清理歷史記錄(備份、Sql Agent、 Sql Maintenance)
清空(回收)SQL Server錯誤日志每天(30條以上歸檔)
提供簡單的存儲過程工具做手工備份、復制數據庫、恢復數據庫
數據庫維護任務的Schedule
配置數據庫郵件維護報告
發送電子郵件,定期通知維護活動。
發送異常郵件通知數據庫維護中的一些問題
Disable immediately databases with integrity problem
當備份失敗超過3次時,禁用數據庫備份(手工備份可以重置失敗次數)
Connect network drives visible to database engine for backup purposes, and make them auto-reconnect at startup.
對應英文文檔如下:
Automate full backups and recurrent log backups.
Perform update statistics (spread all of them over a specified period of time, by default a week)
Selectively reorganize or rebuild index that show a fragmentation thresold
Check database integrity
Keep an up-to-date backup of MSDB which record all backup history (at the end of each full or log backup cycle)
Clean-up history log (backup, Sql Agent, Sql maintenance)
Recycle SQL Server error log every day (keep up to 30 archives)
Provides simplified sp utilities to do manual backup, duplicate database, and restore database.
Schedule agent task for maintenance
Configure database mail for maintenance reporting
Send e-mail that regular notify maintenance activity
Send exceptional e-mail for notifying problematic maintenance issues
Disable immediately databases with integrity problem
Disable databases which failed to be backup more than 3 consecutives times (manual backup can reset the failure count)
Connect network drives visible to database engine for backup purposes, and make them auto-reconnect at startup.
版本跟新情況
YouSQLDba的最新版本是2012-06-12年發布的Version 5.0.2版本。
12-003 | Release – Version 5.0.2 2012-06-12 of YourSQLDba | 2012-06-12 |
12-002 | Release – Version 5.0.1 2012-03-20 of YourSQLDba | 2012-03-20 |
12-001 | Release – Version 5.0 2012-03-02 of YourSQLDba | 2012-03-02 |
11-006 | Release – Version 4.0.11 2011-10-06 of YourSQLDba | 2011-10-06 |
11-005 | Release – Version 4.0.9 2011-09-21 of YourSQLDba | 2011-09-21 |
幫助文檔
你從官網下載的YourSQLDba_ENU.chm幫助時,要注意不要下載了法文的文檔。基本上關於YouSQLDba的資料都可以從幫助文檔獲取。
安裝過程
YourSQLDba的安裝步驟很簡單,首先安裝前,你先看一下幫助文檔的Deployment & Update文檔部分。對整體安裝部署有個了解先。
1:打開SQL Server Management studio. 新建一個查詢界面。
2:然后通過幫助文件中的“Click here to open the script”連接,進去復制拷貝腳本YourSQLDba_InstallOrUpdateScript.sql。
3:執行腳本成功后,會在數據庫實例上創建一個YourSQLDba 數據庫和相關的維護程序。
4:解決方案成功部署之前,需要初始化設置。初始化設置是一個存儲過程,是這一解決方案的一部分。
文檔中例子如下:
Exec YourSQLDba.Install.InitialSetupOfYourSQLDba
@FullBackupPath = 'c:\iSql2005Backups' -- full backup path destination 完全備份目錄地址
, @LogBackupPath = 'c:\iSql2005Backups' -- log backup path destination 日志備份目錄地址
, @email = 'myAdmin@myDomain.com' -- Email recipients (or distribution list) Email賬號
, @SmtpMailServer = 'myMailServer' -- Mail server that accept SMTP mail 郵箱服務器
, @ConsecutiveFailedbackupsDaysToPutDbOffline = 0000 -- Maximum number of consecutive days of failed full backups allowed
-- for a database before putting that database (Offline).
-- You must choose a value between 4 and 9999.
-- Important: Your can read the explanations in the InitialSetupOfYourSQLDba page
-- for using the @ConsecutiveFailedbackupsDaysToPutDbOffline parameter.
從名字可以看出YourSQLDba_FullBackups_And_Maintenance 它主要是做全備以及維護工作。YourSQLDba_LogBackups作業做日志備份工作。有時候需要對這兩個作業的命令根據具體需要和需求做出具體調整。例如做全備或日志備份時,排除某個數據庫等,設置保留周期等等。
5:設置接收郵件的郵箱地址,初始化之后,它會創建一個叫YourSQLDba_Operator的操作員,你去里面添加
這個時候基本上就配置成功了,你會在備份目錄看到,相應的備份文件將會生成。
使用情況
接下來你會收到YourSQLDba發送過來各類郵件(備份情況郵件)
維護報告
報錯郵件
如果發現上面出錯報告,你可以執行郵件里面的腳本,這樣你就可以在“Action”列看到報錯的詳細信息(見下圖),然后就可以着手解決問題。