MongoDB Drop集合不釋放磁碟空間的解決辦法
C:\Users\duansf>mongo
MongoDB shell version: 2.6.6
connecting to: test
> use test
switched to db test
> show collections
articles
books
chenfeng
dsf
fs.chunks
fs.files
system.indexes
system.profile
test
users
> db.books.drop();
true
>
刪除books這個collection,但是檢視資料檔案發現大小不變,MongoDB不會自動釋放檔案空間
db.repairDatabase() //執行這個命令後,Mongodb會把不需要的空間釋放出來
> db.repairDatabase()
{ "ok" : 1 }
>
注意:repairDatabase期間會產生鎖,建議關閉應用後再進行此操作
官方文件對這個命令的解釋如下:
repairDatabase requires free disk space equal to the size of your current data set plus 2 gigabytes. If the volume that holds dbpath lacks sufficient space,
you can mount a separate volume and use that for the repair. When mounting a separate volume for repairDatabase you must run repairDatabase from the command
line and use the --repairpath switch to specify the folder in which to store temporary repair files.
MongoDB shell version: 2.6.6
connecting to: test
> use test
switched to db test
> show collections
articles
books
chenfeng
dsf
fs.chunks
fs.files
system.indexes
system.profile
test
users
> db.books.drop();
true
>
刪除books這個collection,但是檢視資料檔案發現大小不變,MongoDB不會自動釋放檔案空間
db.repairDatabase() //執行這個命令後,Mongodb會把不需要的空間釋放出來
> db.repairDatabase()
{ "ok" : 1 }
>
注意:repairDatabase期間會產生鎖,建議關閉應用後再進行此操作
官方文件對這個命令的解釋如下:
repairDatabase requires free disk space equal to the size of your current data set plus 2 gigabytes. If the volume that holds dbpath lacks sufficient space,
you can mount a separate volume and use that for the repair. When mounting a separate volume for repairDatabase you must run repairDatabase from the command
line and use the --repairpath switch to specify the folder in which to store temporary repair files.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/15498/viewspace-2120383/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- OS 刪除temp表空間 而磁碟空間未釋放的解決方案
- drop表空間以及對應的資料檔案後空間不釋放的問題
- lsof |grep deleted 釋放磁碟空間delete
- docker磁碟空間清理辦法Docker
- delete不釋放表空間delete
- n97mini專用的c盤空間不足記憶體釋放解決辦法記憶體
- Oracle資料庫的歸檔日誌寫滿磁碟空間解決辦法Oracle資料庫
- 解決linux下刪除檔案或oracle表空間後空間不釋放的問題LinuxOracle
- Mongodb中回收remove的磁碟空間MongoDBREM
- win10怎麼釋放空間_win10釋放磁碟空間的方法Win10
- 截斷表後空間不釋放的原因分析
- Mysql InnoDB刪除資料後釋放磁碟空間的方法MySql
- MySQL 5.7的表刪除資料後的磁碟空間釋放MySql
- u盤打不開怎麼辦 可移動磁碟打不開的解決辦法
- hpux刪除檔案後空間不釋放UX
- 電腦時間不準怎麼辦 電腦時間不對的解決辦法
- 如何釋放Mac空間?釋放Mac系統空間小技巧Mac
- mongodb日誌太大的解決辦法MongoDB
- 安裝ORACLE db /tmp空間不足解決辦法Oracle
- Linux 刪除檔案後空間不釋放Linux
- Linux rm掉檔案空間不釋放原因Linux
- oracle 釋放undo空間Oracle
- undo表空間太大解決辦法
- oracle 剩餘表空間查詢慢,解決辦法Oracle
- Oracle delete資料後的釋放表空間問題的解決 --轉Oracledelete
- C盤空間莫名其妙變小怎麼辦 C盤空間不足的解決辦法
- 臨時表空間使用率過高的解決辦法
- 詳解清除MongoDB所佔用的多餘的磁碟空間的方法MongoDB
- 刪除正在使用的檔案,空間不釋放的問題
- linux中如何解決檔案已刪除但空間不釋放的案例Linux
- 刪除檔案後,磁碟空間沒有釋放的處理記錄
- 將Outlook中的郵件儲存到本地磁碟,釋放郵箱空間
- RM刪除檔案空間釋放詳解
- 【技術貼】所有好友的QQ空間都打不開進不去的超簡單解決辦法!
- 行動硬碟不顯示怎麼辦? 行動硬碟不顯示磁碟機代號的解決辦法硬碟
- 集合類不安全及解決辦法
- (轉載)刪除檔案後硬碟空間不釋放的問題硬碟
- kill session之後,會話一直無法釋放的巧妙解決辦法(lsof)Session會話