真实的国产乱ⅩXXX66竹夫人,五月香六月婷婷激情综合,亚洲日本VA一区二区三区,亚洲精品一区二区三区麻豆

成都創(chuàng)新互聯(lián)網(wǎng)站制作重慶分公司

MongoDBDrop集合不釋放磁盤(pán)空間的解決辦法

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


db.repairDatabase() //執(zhí)行這個(gè)命令后,Mongodb會(huì)把不需要的空間釋放出來(lái)

> db.repairDatabase()
{ "ok" : 1 }
>
注意:repairDatabase期間會(huì)產(chǎn)生鎖,建議關(guān)閉應(yīng)用后再進(jìn)行此操作

官方文檔對(duì)這個(gè)命令的解釋如下:


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.

網(wǎng)站題目:MongoDBDrop集合不釋放磁盤(pán)空間的解決辦法
文章鏈接:http://weahome.cn/article/giiecp.html

其他資訊

在線(xiàn)咨詢(xún)

微信咨詢(xún)

電話(huà)咨詢(xún)

028-86922220(工作日)

18980820575(7×24)

提交需求

返回頂部