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

« | »

MS SQL SERVER 2000 LOG檔太大

2007-07-12 @ 11:43 in Windows

 

 教你一個土方法
先卸除資料庫
如果你的資料庫建置在預設目錄的話
可以在下列路徑刪除檔案
C:\Program Files\Microsoft SQL Server\MSSQL\Data\資料庫名稱.ldf
然後重新附加資料庫即可
最後再去限制交易記錄檔的成長空間

 

1. 先將 Transaction Log 
    BACKUP LOG <db name> WITH NO_LOG

2. 利用 sp_helpdb 找出 DB 的 log file 的 logical name
    一般預設的名稱是 <db name>_log

3. 將 Logfile 檔案變成指定大小的 size
    DBCC SHRINKFILE ( <log file name>, <file size> )    
    ex. DBCC SHRINKFILE(ABC_log,3)

這樣就可以不須要停掉 DB 伺服器

至 於要自動覆蓋記錄檔?這個 SQL Server 2000 並不支援,不過您可以利用 BACKUP LOG <db name> WITH NO_LOG 的指令,定期清除記錄檔,或是是將復原模式改成 simply 或是 Bulk-Logged 如果交易記錄檔對您的復原並不重要

參考自 http://forum.tpc.edu.tw/ShowPost.aspx?PostID=3172 

2008-01-11 新增 dellog.sql

今天在清除 HSDB 的 Log 檔時,想說每次都要手動修改很不方便,於是就想說要修改的資料庫只有 HSDB,CPA,PSM 寫一個 sql 檔,放在 mssql 的維護計劃內,讓它每個星期天清理一次就好了,於是就寫了一個 dellog.sql  的程序,禮拜一去看看,如果執行成功就太完美了,以後就不用擔心  LOG  檔太大的問題

迴響

MS SQL SERVER 2000 LOG檔太大 | 豬窩

I think that what you published made a bunch of sense. However, what about this?

suppose you composed a catchier post title?
I mean, I don't want to tell you how to run your website,
however what if you added something that makes people desire more?

I mean MS SQL SERVER 2000 LOG檔太大 | 豬窩 is a little vanilla.
You could peek at Yahoo's home page and note how they create news headlines to get viewers interested.
You might add a related video or a related pic or two to
get readers excited about everything've got to
say. In my opinion, it might bring your posts a little bit more interesting.

作者 www.qhnbld.com @ 14:25, 2020-06-26

MS SQL SERVER 2000 LOG檔太大 | 豬窩

If you desire to take a great deal from this article
then you have to apply these strategies to your won webpage.

作者 tinyurl.com @ 15:08, 2020-06-26

MS SQL SERVER 2000 LOG檔太大 | 豬窩

Everything is very open with a precise description of the challenges.
It was definitely informative. Your website is very useful.
Thanks for sharing!

作者 cbd oil that works 2020 @ 01:14, 2020-06-28

MS SQL SERVER 2000 LOG檔太大 | 豬窩

Hello There. I discovered your weblog the use of msn. This is a very
neatly written article. I will be sure to bookmark it and return to learn extra of your useful information. Thanks for the
post. I will definitely comeback.

作者 cbd oil that works 2020 @ 05:53, 2020-06-28

MS SQL SERVER 2000 LOG檔太大 | 豬窩

Hello, Neat post. There is certainly a challenge with your site in internet
explorer, would check this? IE nonetheless will be the marketplace chief and an enormous
part of folks will pass over your fantastic writing due to this issue.

作者 Range Cooker In Island @ 09:52, 2020-07-07
發表迴響
 authimage