欧美一区二区三区老妇人-欧美做爰猛烈大尺度电-99久久夜色精品国产亚洲a-亚洲福利视频一区二区

MongoDBDrop集合不釋放磁盤空間的解決辦法

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,但是查看數(shù)據(jù)文件發(fā)現(xiàn)大小不變,MongoDB不會自動釋放文件空間


db.repairDatabase() //執(zhí)行這個命令后,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.

網頁標題:MongoDBDrop集合不釋放磁盤空間的解決辦法
文章位置:http://chinadenli.net/article28/giiecp.html

成都網站建設公司_創(chuàng)新互聯(lián),為您提供ChatGPT用戶體驗、定制開發(fā)面包屑導航、軟件開發(fā)做網站

廣告

聲明:本網站發(fā)布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經允許不得轉載,或轉載時需注明來源: 創(chuàng)新互聯(lián)

網站建設網站維護公司