Category Archives: Database

Scripting for Mongo

Sometimes you want to automate certain tasks using scripts. MongoDB also supports this: http://docs.mongodb.org/manual/tutorial/write-scripts-for-the-mongo-shell/

Posted in MongoDB, shell | Tagged , , , , , | Leave a comment

Delete entire database from mongo from cmd line

To quickly delete / remove a entire database from mongo you can use the command line interface: volker@Volkers-MacBook-Pro ~> mongo 127.0.0.1 # connect to default port MongoDB shell version: 2.4.9 connecting to: 127.0.0.1/test > show dbs AWESOME_DB 0.203125GB local 0.078125GB … Continue reading

Posted in MongoDB, OS X | Tagged , , , , , | Leave a comment

Export data collection from mongodb to json

for exporting a data collection to a json you can use this simple command: mongoexport –jsonArray -d DATABASE-NAME -c collectionName[, collectionName2,…] To write data to a file you just append a redirect mongoexport –jsonArray -d DATABASE-NAME -c collectionName[, collectionName2,…] > … Continue reading

Posted in MongoDB | Tagged , | Leave a comment

Change mysql user password

In case you want to change or reset the password for a mysql user account you can use this command: UPDATE mysql.user SET Password=PASSWORD(‘newpass’) WHERE User=’bob’ [AND Host=’%.loc.gov’]; FLUSH PRIVILEGES; Source: http://goo.gl/dn6kKN

Posted in MySql | Tagged , , | Leave a comment

Video Tutorial on Talend Open Studio

My experience with etl tools is limited. In my current project we use talend open studio (tos) to manage our assets. I found good video tutorials on tos on youtube: Importing data from csv-file into tos Working w databases Importing Excel … Continue reading

Posted in Database | Tagged , , , | Leave a comment

Finding Primary Keys in Oracle

A Query i use from time to time to find out which primary key columns are defined for a certain table: SELECT cols.table_name, cols.column_name, cols.position, cons.status, cons.owner FROM all_constraints cons, all_cons_columns cols WHERE cols.table_name = ‘_TABLE-NAME_’ AND cons.constraint_type = ‘P’ … Continue reading

Posted in Database, Oracle | Tagged , , | Leave a comment