I Have a mongo shard db system with two shards and and three mongos servers.My application creates DB on daily basis as per our business requirements. We have some sharded collection in each day DB.

I removed some old DB using db.dropDatabse(). Now when i connect to mongos server and run show dbs these databases are not there but when i check config database it still has entries for these database in in different collections. Like database,changelog,chunk

Could you please tell me how i can permanently delete these database


Unfortunately there is some stuff that will not be cleaned up through dropDatabase. On the other hand if you delete it by hand may not will be harmful. Some data like statistics will reside on your nodes anyway till the restart of mongods. (Try it out first! Not on the production), as the configuration database is relatively small and does not have huge requirements in terms of performance, that maybe even not a problem, just to be on the safe side and leave them as they are.

Also something to check out how to make the manual actions: https://stackoverflow.com/questions/9407838/mongodb-dropdatabase-not-working

and as it is mentioned on this question the dropDatabase in such case a bit bugy:https://jira.mongodb.org/browse/SERVER-4804

|improve this answer|||||
  • Hi This bug is still existing. I tried to drop it using these steps: 1. Stop Balancer 2. Drop data base. It is old DB so no app server is writing but still this is shown in show dbs command. When i check db.stats for this db it shows me it is on primary shard but no space is mentioned in the stats output. – viren Dec 31 '14 at 5:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.