Ms7 Search
Google 搜尋 翻譯
calendar
« 九月 2024 »
            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            
近期文章
文章分類
網站連結
Syndicate

« | »

MSSQL SERVER 的維護計畫與 rsync 的異地備份

2007-07-22 @ 10:45 in Windows


今天突然想做一下行玫系統資料庫的遠端備份,因為萬一機器出問題,而系統師又沒有備份,多年資料不見,那就損失慘重了(真受不了自己的雞婆).

我的想法是用 MSSQL 的每晚自動備份,再利用 RSYNC 的遠端備份,將備份檔從主機房複製一份到電腦教室,這樣有兩份異地備份檔案,應該就比較放心了,

可是又想到如果備份檔案無限增加.而系統師又不去整理,那可能會將  MSSQL  主機和電腦教室備份機操爆,結果在 MSSQL  的維護計畫中竟然有一個選項在完整備份中可以指定移出檔案的時限,我將它設為10日,也就是我只保持10日內的備份檔,其它的就看系統師有沒有燒在光碟上了.我的做法如下

  1. 在 MSSQL SERVER 的主機執行=>程式集=>MSSQL SERVER=>ENTERPRISE MANAGE=>SQL SERVER 群組=>管理=>資料庫維護計劃(將要備份的資料庫,即時限照所需要選一選,最後選每天備份的排程,就完成了資料庫備份)
  2. 因為要利用 rsync 做遠端備份所以去下載 CwRsync  因為只要備份,不做備份主機,所以只安裝 client 版,然後寫了一個 hsdb.cmd 如下
  3.     @cls
        @echo off

        path=C:\Program Files\cwRsync\bin;%path%
        rsync -arvlHpogDtS --delete --password-file=c:\WINNT\rsyncd.dat /cygdrive/c/backup/2007 rsyncd_user@203.72.59.??::mssql
        echo. & pause

        在 MSSQL SERVER 排程排入 hsdb.cmd 每天的執行時間,就好了

  4. 在 c:\WINNT\ 建立一個密碼檔 rsyncd.dat ,內容如下
    rsyncd_password
  5. 在 rsync server 主機設定 /etc/rsyncd.conf 內容如下(我的 server 是 fedora 7 ,所以設定在 /etc/ 下)
    [mssql]
    path = /back/mssql
    auth_users = mssql_rsync
    uid = root
    gid = root
    secrets file = /etc/rsyncd.secrets
    read only = no
  6. 在 rsync server 設定密碼檔 /etc/rsyncd.secrets 如下
    rsyncd_user:rsyncd_password
  7. 在 rsync server 的主機建立 /back/mssql 目錄,就 ok 了

rsync -arvlHpogDtS --delete --password-file=c:\WINNT\rsyncd.dat /cygdrive/c/backup/2007 rsyncd_user@203.72.59.??::mssql

上面這一行是 windows  用的 ,跟  linux  的用法有點差異,在拷貝目錄的地方,linux 只要從 / 目錄開始寫就好了,而 windows 確必須寫 /cygdrive/磁碟機/目錄才可以,這是我的破英文一邊猜一邊試出來的,因為這樣設定就可以備份了,如果有設錯,請來信指教

迴響

MSSQL SERVER 的維護計畫與 rsync 的異地備份 | 豬窩

Whoa! This blog looks just like my old one! It's on a entirely different topic
but it has pretty much the same page layout and design. Superb choice of colors!

作者 best web hosting @ 21:40, 2020-07-16

MSSQL SERVER 的維護計畫與 rsync 的異地備份 | 豬窩

If you wish for to improve your experience only keep visiting this site and be updated
with the most recent news posted here.

作者 website hosting services @ 09:28, 2020-07-18

MSSQL SERVER 的維護計畫與 rsync 的異地備份 | 豬窩

Useful info. Fortunate me I found your web site unintentionally, and I am surprised why this
twist of fate did not came about in advance! I bookmarked
it.

作者 web hosting companies @ 07:52, 2020-07-26

MSSQL SERVER 的維護計畫與 rsync 的異地備份 | 豬窩

Appreciating the hard work you put into your site and in depth information you present.
It's nice to come across a blog every once in a while that isn't the
same unwanted rehashed material. Great read! I've saved your
site and I'm including your RSS feeds to my Google account.

作者 web hosting @ 05:48, 2020-07-27

MSSQL SERVER 的維護計畫與 rsync 的異地備份 | 豬窩

You've made some good points there. I looked on the net for more info about the issue
and found most people will go along with your views on this website.

作者 cheap flights to florida jetblue @ 19:24, 2020-07-27
發表迴響
 authimage