Supporting MongoDB

MongoDB is a scalable, high performance, open source, document-oriented database written in C++.

logo

The database is document-oriented so it manages collections of JSON-like (JavaScript Object notation) documents. Many applications can thus model data in a more natural way, as data can be nested in complex hierarchies and still be query-able and indexable.

It is an Unrelational, NoSQL database with the closest RDBMS probably MySQL. A good description i found for explaining what MongoDB is…

If you take MySql, and change the data model from relational to document based, you get a lot of great features: embedded docs for speed, manageability, agile development with schema-less databases, easier horizontal scalability because joins aren’t as important

-Eliot and the core MongoDB Team

Installing

We have installed on Linux. more information here

Connecting to MongoDB

The DB can be easily connected to via command prompt.

H:\>C:\Users\me\Desktop\mongodb-win32-x86_64-1.8.3-rc1\bin\mongo.exe mymongodbserver

Once connected, the chevron (>) will appear

MongoDB shell version: 1.8.3-rc1
connecting to: devmogo.domain.net/test
>

Some commands while trialling

To create a new DB is very simple

> use dbatemp

The above syntax will switch to the DB if it exists, if not it will create the new DB.

> show dbs
admin (empty) dbatemp 0.203125GB
local (empty) > use dbatemp
switched to db dbatemp

> show collections
dbatemp
system.indexes

> db.dbatemp.find(); { "_id" : ObjectId("4e4bd13d02a334bc80fd344f"), "name" : "Ronaldo" } { "_id" : ObjectId("4e4bd46fd424e8988c136a71"), "name" : "Mos!!!" } > db.dbatemp.update({"name" : "Mos!!!"}, {"name" : "MohsinWasHere", "Title" : "Mr"}); > db.dbatemp.find(); { "_id" : ObjectId("4e4bd13d02a334bc80fd344f"), "name" : "Ronaldo" } { "_id" : ObjectId("4e4bd46fd424e8988c136a71"), "name" : "MohsinWasHere", "Title" : "Mr" } > show collections
dbatemp
system.indexes

> db.dbatemp.find(); { "_id" : ObjectId("4e4bd13d02a334bc80fd344f"), "name" : "Ronaldo" } { "_id" : ObjectId("4e4bd46fd424e8988c136a71"), "name" : "MohsinWasHere", "Title" : "Mr" } > use dbatemp
switched to db dbatemp

> db.addUser("mohsin", "letmein"); { "user" : "mohsin", "readOnly" : false, "pwd" : "a3d585f806eedb44077cb71fd39763b7"
} > db.system.users.find(); { "_id" : ObjectId("4e4d102c38496fd5f156dbe1"), "user" : "mohsin", "readOnly" : false, "pwd" : "a3d585f806eedb44077cb71fd39763b7" } > db.auth("mohsin", "letmein") 1

Basic Comparison with an RDBMS

image

image

image

image

More available here

Managing from a GUI

JMongoBrowser

Advertisements

OEM: The database target is currently unavailable

Problem: Within Grid control, the homepage for a Database gives the error:

'The database target is currently unavailable. 
The state of the components are listed below.'

Initially attempted to resolve by bouncing the affected grid control agent:

> cd $ORA_AGENT_HOME
> cd bin
> ./emctl stop agent
> ./emctl start agent

This didnt work so tried to restart grid control:

> cd $ORA_GC_HOME
> cd oms10g
> cd opmn 
> cd bin
> ./opmnctl status  > ./opmnctl stoppall
> ./opmnctl startall

Solution

the fix in the end was to run a clearstate against the agent.

The ’emctl clearstate’ command forces the agent to take a new reading of the severity and status of each components and resend this information to the OMS

> ./emctl clearstate agent