今日は朝から悩んだSQL Serverのエラーについて備忘録として投稿します。
エラーは以下の通り。(ちょっとだけ改変してます)
The log scan number passed to log scan in database ‘master’ is not valid. This error may indicate data corruption or that the log file (.ldf) does not match the data file (.mdf). If this error occurred during replication, re-create the publication. Otherwise, restore from backup if the problem results in a failure during startup.
ごく簡単に言うと、SQL ServerがWindows Serviceで起動しない。
色々ググってみましたが今ひとつ正解に当たらない・・・
もうSQL Server毎再インストールしちゃおうかなぁなんて思ってたのですが、そこはまぁやっぱり・・・と言うことでまたGoogle先生に再度聞き直し(笑)
最終的にはこの記事に助けられました。先人の知恵は偉大です。ありがとーございます。
http://mywindowsblog.com/?p=638
SQL Serverのインストールディレクトリを圧縮したりすると発生するエラーとの事ですが、いまいち原因は分からず。
そして、ここからがかなり厄介だったのですが、やっとSQL Serverが動いたと思ったらSQL Management Studioからローカルのデータベースにログイン出来ない・・・・(汗)どうやらAdministratorでログインしているのに何故がこのアカウントがロックアウトされている様子。
ここで思い出したのがSupportチームのボス・Oliverさんが教えてくれたロックアウトされた場合のTips。
Single User Modeでアクセスしてなんとかログイン設定を修正。やっとログイン出来たと思ったら、今度はデータベースが全滅・・・仕方ないので.mdfからアタッチして復元。そしたら今度はアタッチ出来ないデータベースが出現。こればかりはどうしようもないなぁと思いつつ悪戦苦闘。結局Dataフォルダから該当する.mdfと.ldfを一旦移動させて、手動で同名のデータベースを作成しました。あとはボスの作ったツールでデータベースをアップデートさせて万事完了!これが出来るデータベースで良かったです。
最後にDSMIを最新版にアップデートしてFinalcheckをして元通り。
あぁ、やっぱりこれはMSのサポートに頼む話であってDSMのサポート案件では無いような気もするんですが。
結論:データベースを使うアプリケーションは必ずバックアップの設定をして、定期的にフルバックアップを取りましょう。ついつい忘れがちですが、これが一番重要ですね。
I love what you guys tend to be up too. Such clever work and reporting!
Keep up the good works guys I’ve incorporated you guys
to blogroll.
Hello there! This post could not be written any better!
Reading through this post reminds me of my previous room mate!
He always kept talking about this. I will forward this write-up to
him. Fairly certain he will have a good read. Thanks for sharing!
It’s very straightforward to find out any topic on web as compared to textbooks,
as I found this article at this web page.
Paragraph writing is also a excitement, if you be familiar
with after that you can write or else it is complicated to write.