Re: How Remove database with special char ?

38 views
Skip to first unread message

Dwight Merriman

unread,
Nov 15, 2012, 3:35:31 PM11/15/12
to mongod...@googlegroups.com
you could try something like this:

> var name = db.getMongo().getDBs().databases[2].name
> var bad_db = db.getSisterDB(name)

Another way: shut down the whole set (all its processes).  Delete the datafiles for the junk database on all mongod locations of relevance.  Restart.

Do all members of the replica set have the bad database?


On Thursday, November 15, 2012 7:54:33 AM UTC-5, Mathieu Chocat wrote:
Hi,

After a mongodb crash on replicaset, mongo have create a database called '�t@���i�ڷPfilemasterdb'  in _status web page is '�t@���i�ڷP\u0007filemasterdb' .

I've tried:
> use �t@���i�ڷPfilemasterdb
> db.dropDatabase()
And
> db.getSiblingDB("�t@���i�ڷPfileadserver").dropDatabase()

Without success, i search for other method, i can't dump/restore this mongodb replicaset.

Sam Helman

unread,
Nov 20, 2012, 3:31:07 PM11/20/12
to mongod...@googlegroups.com
What does "show dbs" output?  Additionally, how much data do you have in your other dbs?  If you don't have a prohibitive amount of data, you could mongoexport or mongodump every db except the bad one, and then delete the data files and reimport them.


On Monday, November 19, 2012 5:40:58 AM UTC-5, Mathieu Chocat wrote:
> var name = db.getMongo().getDBs().databases[2].name
> var bad_db = db.getSisterDB(name)

I've tried this, but mongodb don't find the file on disk, in console drop is Ok, in log nothing, but the database is not removed (may be because special char has been replaced by '?' on disk since i've migrated mongo 2.0.7 => 2.2.1 and resync).

To delete the file, i don't know the reaction of mongo with a replicaset (risk of crash with oplog replay or resync if i don't stop all the replica and i can't stop all)


> Do all members of the replica set have the bad database?
Yes
Reply all
Reply to author
Forward
0 new messages