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  檔太大的問題

迴響

選對資料庫


2. 時必須選 master 資料庫
3. 時必須選 logfile 檔的資料庫

作者 shyong @ 19:45, 2007-12-26

MS SQL SERVER 2000 LOG檔太大 | 豬窩

Stunning quest there. What occurred after? Thanks!

作者 g make @ 10:02, 2020-06-20

MS SQL SERVER 2000 LOG檔太大 | 豬窩

Wow that was unusual. I just wrote an very long comment but after I
clicked submit my comment didn't show up. Grrrr... well I'm not writing all that over again. Anyways, just wanted to say excellent blog!

作者 take g @ 20:02, 2020-06-21

MS SQL SERVER 2000 LOG檔太大 | 豬窩

I think this is one of the most important information for me.
And i am glad reading your article. But should remark on few general things, The website
style is ideal, the articles is really excellent : D. Good job,
cheers

作者 https://tinyurl.com/rsacwgxy g @ 21:31, 2020-06-22

MS SQL SERVER 2000 LOG檔太大 | 豬窩

Cbd oil that works 2020
I'm gone to convey my little brother, that he should also
go to see this web site on regular basis to obtain updated from newest reports.
best rated cbd oil http://t.co/4kPhN7Ek0L cbd oil that works 2020 http://t.co/4kPhN7Ek0L

作者 http://t.co/4kPhN7Ek0L @ 14:19, 2020-06-24
1 2 3 4 5  下一篇»
發表迴響
 authimage