Created
September 9, 2015 08:33
-
-
Save marcoberri/dc03eba1952cb8a48b77 to your computer and use it in GitHub Desktop.
MongoDB - Enable all profile for all db (excluded local and admin)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var dbs_list = db.getMongo().getDBNames(); | |
| for(var d in dbs_list){ | |
| var name = dbs_list[d]; | |
| if(name == 'admin') | |
| continue; | |
| if(name == 'local') | |
| continue; | |
| dbOne = db.getSisterDB(name); | |
| dbOne.setProfilingLevel(0); | |
| dbOne.system.profile.drop(); | |
| dbOne.createCollection("system.profile", {capped:true, size:8000000}); | |
| dbOne.setProfilingLevel(2); | |
| print(name + " --> complete"); | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment