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 的異地備份 | 豬窩

Nice weblog right here! Additionally your website a lot up fast!
What web host are you using? Can I am getting your associate hyperlink on your host?
I desire my site loaded up as quickly as yours lol
adreamoftrains website hosting services

作者 adreamoftrains best hosting @ 19:17, 2020-07-30

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

Have you ever considered writing an e-book or guest authoring on other sites?

I have a blog based upon on the same ideas you discuss and would love to have you share some stories/information. I
know my readers would value your work. If you're even remotely interested, feel free to
send me an e-mail.

作者 air tickets @ 10:59, 2020-07-31

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

I'm amazed, I have to admit. Seldom do I encounter a blog that's
equally educative and amusing, and let me tell you, you've hit
the nail on the head. The problem is an issue that not enough men and women are speaking intelligently about.
Now i'm very happy that I stumbled across this during my search
for something relating to this.

作者 web hosting @ 20:55, 2020-08-05

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

Thanks in support of sharing such a good thought, piece of writing is good, thats
why i have read it completely

作者 best website hosting @ 20:03, 2020-08-07

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

We're a group of volunteers and opening a
new scheme in our community. Your site provided us with valuable information to work on. You've done an impressive job and our entire community will be thankful to you.

作者 web hosting sites @ 21:46, 2020-08-07
發表迴響
 authimage