How to add partitions to an existing table in Oracle database

When the data in the table becomes bigger, we’ll need partitioning in order to make our SQL command faster. But the thing is we already have data in that table. These queries will help you do that with just one execution step.

--create new partitioned table from old table
CREATE 
Read the rest “How to add partitions to an existing table in Oracle database”

Oracle: “CREATE TABLE AS SELECT” (CTAS) with PARTITIONING and Column Default Value

This article guides you to write Oracle PL/SQL command for creating new table as select from other tables/views with partitioning and column default value.

First of all, this is the syntax of a simple CTAS:

CREATE TABLE TBLA AS SELECT * FROM TBLB;

Please note that in the example above, … Read the rest “Oracle: “CREATE TABLE AS SELECT” (CTAS) with PARTITIONING and Column Default Value”

Insert json file into mongodb

Insert json file into mongodb

I am new in mongodb. After installing mongodb in windows I am trying to insert a simple json file using the following command:
C:\mongodb\bin\mongoimport –db test –collection docs < example2.json I am getting the following error: connected to: 127.0.0.1 Fri Oct 18 09:05:43.749 exception:BSON representation of supplied JSON is too large: code FailedToParse: FailedToParse: Field name expected: offset:43 Fri Oct 18 09:05:43.750 Fri Oct 18 09:05:43.750 exception:BSON representation of supplied JSON is too large: code FailedToParse: FailedToParse: Expecting '{': offset:0 Fri Oct 18 09:05:43.751 Fri Oct 18 09:05:43.751 exception:BSON representation of supplied JSON is too large: code FailedToParse: FailedToParse: Field name expected: offset:42 Fri Oct 18 09:05:43.751 Fri Oct 18 09:05:43.751 exception:BSON representation of supplied JSON is too large: code FailedToParse: FailedToParse: Expecting '{': offset:0 Fri Oct 18 09:05:43.751 Fri Oct 18 09:05:43.752 exception:BSON representation of supplied JSON is too large: code FailedToParse: FailedToParse: Field name expected: offset:44 Fri Oct 18 09:05:43.752 Fri Oct 18 09:05:43.752 exception:BSON representation of supplied JSON is too large: code FailedToParse: FailedToParse: Expecting '{': offset:0 Fri Oct 18 09:05:43.752 Fri Oct 18 09:05:43.752 check 0 0 Fri Oct 18 09:05:43.752 imported 0 objects Fri Oct 18 09:05:43.752 ERROR: encountered 6 error(s)s example2.file {"FirstName": "Bruce", "LastName": "Wayne", "Email": "bwayne@Wayneenterprises.com"} {"FirstName": "Lucius", "LastName": "Fox", "Email": "lfox@Wayneenterprises.com"} {"FirstName": "Dick", "LastName": "Grayson", "Email": "dgrayson@Wayneenterprises.com"} What do I need to do to import new json file into mongodb?

Solutions/Answers:

Solution 1:

Use

mongoimport --jsonArray --db test --collection docs --file example2.json

Its probably messing up

Read the rest “Insert json file into mongodb”

Failed to connect to 127.0.0.1:27017, reason: errno:111 Connection refused

Failed to connect to 127.0.0.1:27017, reason: errno:111 Connection refused

while trying this mongo command in ubuntu
I am getting this error.
ritzysystem@ritzysystem-Satellite-L55-A:~$ mongo
MongoDB shell version: 2.6.1
connecting to: test
2014-10-06T12:59:35.802+0530 warning: Failed to connect to 127.0.0.1:27017, reason: errno:111 Connection refused
2014-10-06T12:59:35.802+0530 Error: couldn’t connect to server 127.0.0.1:27017 (127.0.0.1), connection … Read the rest “Failed to connect to 127.0.0.1:27017, reason: errno:111 Connection refused”

MongoDB: Server has startup warnings ”Access control is not enabled for the database”

MongoDB: Server has startup warnings ”Access control is not enabled for the database”

I firstly installed MongoDB 3.4.1 today.But when i start it and use MongoDB shell, it gave me these warnings below:
C:\Users\hs”C:\Program Files\MongoDB\Server\3.4\bin\mongo.exe
MongoDB shell version v3.4.1
connecting to: mongodb://127.0.0.1:27017
MongoDB server version: 3.4.1
Server has startup … Read the rest “MongoDB: Server has startup warnings ”Access control is not enabled for the database””

MongoDB Data directory /data/db not found [duplicate]

MongoDB Data directory /data/db not found [duplicate]

This question already has an answer here:

Mongod complains that there is no /data/db folder

19 answers

When I try to run Mongod in terminal I got this message :
2015-05-14T17:33:04.554+0700 I STORAGE [initandlisten] exception in initAndListen: 29 Data directory /data/db not found., … Read the rest “MongoDB Data directory /data/db not found [duplicate]”

Why getting error mongod dead but subsys locked and Insufficient free space for journal files on Linux?

Why getting error mongod dead but subsys locked and Insufficient free space for journal files on Linux?

I have installed mongo-10gen mongo-10gen-server on Linux CentOS server.
I followed the steps from Link.
I have configured /etc/mongod.conf as –
logpath=/var/log/mongo/mongod.log
port=27017
dbpath=/var/lib/mongo

I have set port 27017 for mongo in iptables.… Read the rest “Why getting error mongod dead but subsys locked and Insufficient free space for journal files on Linux?”