Friday 16 October 2020

ojdbc7.jar driver mentioned in agent.properties was not found. Exiting

 Error :

ERROR ojdbc7.jar driver mentioned in agent.properties was not found. Exiting.

Solution Details:

uncomment line server.driversLocation = drivers

comment line server.jdbcDriver=<server.jdbcDriver>

copy ojdbc7.jar to agent directory location driver folder 

and start agent 

[oracle@veridata agent1]$ sh agent.sh start agent.properties


Thursday 17 September 2020

install mongoDB enterprise 4.4.0 on LVM storage

 

In this QuickStart, we learn how to:

  • Create LVM storage.
  • Download mongoDB 4.4.0 software and unzip
  • Install net-snmp package
  • create user and directory structure
  • Copy binary to mongo home
  • Set variable for mongoDB in Bash profile
  • Create config file for mongoDB instance
  • Start mongo daemon using config file
  • Validation

1] Create LVM storage.

 

·         list existing partition

 

[root@lvm_node ~]# fdisk -l


·         create new partition for LVM Disk Group

 

-          Enter P to display the existing Partitions 

-          Create New partition of 10GB size


-          Change the partition to LVM system


-          Use partprobe command to change the partition table




-          Move newly created disk to lvm PV



-          create the volume group


-          create lvm on volume group 




-          Format the LVM file system to use




                   -      Mount LVM file system to directory 


                     -        Made the changes in /etc/fstab to permanent changes




2] Download mongoDB 4.4.0 software and unzip

https://www.mongodb.com/try/download/enterprise



[mongo@lvm_node tmp]$ pwd

/tmp

[mongo@lvm_node tmp]$

[mongo@lvm_node ~]$ cd /tmp

[mongo@lvm_node tmp]$ ls -ltr

total 128900

-rw-rw-r--. 1 mongo mongo 131986084 Aug 22 15:40 mongodb-linux-x86_64-enterprise-rhel70-4.4.0.tgz

-rw-------. 1 root  root          0 Aug 25 21:16 yum.log

-rwx------. 1 root  root        836 Aug 25 21:30 ks-script-9cUA9D

 

[mongo@lvm_node tmp]$ tar -xvzf mongodb-linux-x86_64-enterprise-rhel70-4.4.0.tgz

mongodb-linux-x86_64-enterprise-rhel70-4.4.0/LICENSE-Enterprise.txt

mongodb-linux-x86_64-enterprise-rhel70-4.4.0/MPL-2

mongodb-linux-x86_64-enterprise-rhel70-4.4.0/README

mongodb-linux-x86_64-enterprise-rhel70-4.4.0/THIRD-PARTY-NOTICES

mongodb-linux-x86_64-enterprise-rhel70-4.4.0/bin/install_compass

mongodb-linux-x86_64-enterprise-rhel70-4.4.0/bin/mongo

mongodb-linux-x86_64-enterprise-rhel70-4.4.0/bin/mongocryptd

mongodb-linux-x86_64-enterprise-rhel70-4.4.0/bin/mongod

mongodb-linux-x86_64-enterprise-rhel70-4.4.0/bin/mongodecrypt

mongodb-linux-x86_64-enterprise-rhel70-4.4.0/bin/mongokerberos

mongodb-linux-x86_64-enterprise-rhel70-4.4.0/bin/mongoldap

mongodb-linux-x86_64-enterprise-rhel70-4.4.0/bin/mongos

mongodb-linux-x86_64-enterprise-rhel70-4.4.0/snmp/MONGOD-MIB.txt

mongodb-linux-x86_64-enterprise-rhel70-4.4.0/snmp/MONGODBINC-MIB.txt

mongodb-linux-x86_64-enterprise-rhel70-4.4.0/snmp/README-snmp.txt

mongodb-linux-x86_64-enterprise-rhel70-4.4.0/snmp/mongod.conf.master

mongodb-linux-x86_64-enterprise-rhel70-4.4.0/snmp/mongod.conf.subagent

3] Install net-snmp package

[root@lvm_node ~]# yum install net-snmp*

Loaded plugins: fastestmirror

Loading mirror speeds from cached hostfile

 * base: mirrors.raystedman.org

 * extras: distro.ibiblio.org

 * updates: mirror.cs.uwp.edu

base                                                                                                                                               | 3.6 kB  00:00:00

extras                                                                                                                                             | 2.9 kB  00:00:00

updates                                                                                                                                            | 2.9 kB  00:00:00

Resolving Dependencies

--> Running transaction check

---> Package net-snmp.x86_64 1:5.7.2-48.el7_8.1 will be installed

--> Processing Dependency: libsensors.so.4()(64bit) for package: 1:net-snmp-5.7.2-48.el7_8.1.x86_64

---> Package net-snmp-agent-libs.x86_64 1:5.7.2-48.el7_8.1 will be installed

-

-

-

-

-

-

Dependency Updated:

  e2fsprogs.x86_64 0:1.42.9-17.el7        e2fsprogs-libs.x86_64 0:1.42.9-17.el7      elfutils.x86_64 0:0.176-4.el7              elfutils-libelf.x86_64 0:0.176-4.el7

  elfutils-libs.x86_64 0:0.176-4.el7      krb5-libs.x86_64 0:1.15.1-46.el7           libcom_err.x86_64 0:1.42.9-17.el7          libdb.x86_64 0:5.3.21-25.el7

  libdb-utils.x86_64 0:5.3.21-25.el7      libselinux.x86_64 0:2.5-15.el7             libselinux-python.x86_64 0:2.5-15.el7      libselinux-utils.x86_64 0:2.5-15.el7

  libss.x86_64 0:1.42.9-17.el7            openssl.x86_64 1:1.0.2k-19.el7             openssl-libs.x86_64 1:1.0.2k-19.el7        rpm.x86_64 0:4.11.3-43.el7

  rpm-build.x86_64 0:4.11.3-43.el7        rpm-build-libs.x86_64 0:4.11.3-43.el7      rpm-libs.x86_64 0:4.11.3-43.el7            rpm-python.x86_64 0:4.11.3-43.el7

  rpm-sign.x86_64 0:4.11.3-43.el7

 

Complete!

[root@lvm_node ~]#

 

4] create user and directory structure

[root@lvm_node ~]# adduser mongo

[root@lvm_node ~]# passwd mongo

Changing password for user mongo.

New password:

BAD PASSWORD: The password is shorter than 8 characters

Retype new password:

passwd: all authentication tokens updated successfully.

[root@lvm_node ~]#

[root@lvm_node ~]# chown mongo:mongo /u01/app

[root@lvm_node ~]# chmod 775 /u01/app

[root@lvm_node ~]#

[root@lvm_node ~]# su - mongo

Last login: Sat Aug 29 17:29:23 EDT 2020 on pts/0

[mongo@lvm_node ~]$

[mongo@lvm_node ~]$ mkdir -p /u01/app/mongo/product

[mongo@lvm_node 4.4.0]$

[mongo@lvm_node 4.4.0]$ mkdir -p /u01/app/mongo/etc

[mongo@lvm_node 4.4.0]$ mkdir -p /u01/app/mongo/data

[mongo@lvm_node 4.4.0]$ mkdir -p /u01/app/mongo/log

[mongo@lvm_node 4.4.0]$

 

5] Copy binary to mongo home 

[mongo@lvm_node tmp]$ mv mongodb-linux-x86_64-enterprise-rhel70-4.4.0 /u01/app/mongo/product/

[mongo@lvm_node tmp]$ cd /u01/app/mongo/product/

[mongo@lvm_node product]$ ls -ltr

total 4

drwxrwxr-x. 4 mongo mongo 4096 Aug 29 17:36 mongodb-linux-x86_64-enterprise-rhel70-4.4.0

[mongo@lvm_node product]$ mv mongodb-linux-x86_64-enterprise-rhel70-4.4.0 4.4.0

[mongo@lvm_node product]$ cd 4.4.0

[mongo@lvm_node 4.4.0]$ pwd

/u01/app/mongo/product/4.4.0

[mongo@lvm_node 4.4.0]$

6] Set variable for mongoDB in Bash profile 




7]  Create config file for mongoDB instance

[mongo@lvm_node 4.4.0]$ cd /u01/app/mongo/etc/

[mongo@lvm_node etc]$ pwd

/u01/app/mongo/etc

[mongo@lvm_node etc]$ vi mongoDB.conf

[mongo@lvm_node etc]$ cat mongoDB.conf

# mongod.conf

# for documentation of all options, see:

#   http://docs.mongodb.org/manual/reference/configuration-options/

# where to write logging data.

systemLog:

  destination: file

  logAppend: true

  path: /u01/app/mongo/log/mongod.log

# Where and how to store data.

storage:

  dbPath: /u01/app/mongo/data

  journal:

    enabled: true

#  engine:

#  mmapv1:

#  wiredTiger:

# how the process runs

processManagement:

  fork: true  # fork and run in background

  pidFilePath: /u01/app/mongo/data/mongod.pid  # location of pidfile

# network interfaces

net:

  port: 27017

  bindIp: localhost  # Listen to local interface only, comment to listen on all interfaces.

security:

 authorization: enabled

 keyFile: /u01/app/mongo/pkey/dev1-key

#security:

#operationProfiling:

#replication:


8] Start mongo daemon using config file


[mongo@lvm_node etc]$ pwd

/u01/app/mongo/etc

[mongo@lvm_node etc]$ ls -ltr

total 4

-rw-rw-r--. 1 mongo mongo 783 Aug 29 18:40 mongoDB.conf

[mongo@lvm_node etc]$ mongod -f /u01/app/mongo/etc/mongoDB.conf

about to fork child process, waiting until server is ready for connections.

forked process: 16097

child process started successfully, parent exiting

[mongod@localhost ~]$

9] validation

[mongo@lvm_node etc]$ mongo

MongoDB shell version v4.4.0

connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb

Implicit session: session { "id" : UUID("fcec5d01-62d1-40e2-9d38-a12e8d6529b0") }

MongoDB server version: 4.4.0

MongoDB Enterprise > db.version()

4.4.0

MongoDB Enterprise >


Monday 14 September 2020

Sort operation used more than the maximum 33554432 bytes of RAM. Add an index, or specify a smaller limit.

 

Error: 

Error: error: {

        "ok" : 0,

        "errmsg" : "Executor error during find command: OperationFailed: Sort operation used more than the maximum 33554432 bytes of RAM. Add an index, or specify a smaller limit.",

        "code" : 96,

        "codeName" : "OperationFailed"

}


Solution: 

         when you execute query on large collection that time error will come. use limit() method to get data.

db.employees.find().sort({employee_id: 1 } ).limit(1)




Error: [INS-08101] Unexpected error while executing the action at state: 'supportedOSCheck'

 


Error: 

Error: [INS-08101] Unexpected error while executing the action at state: 'supportedOSCheck'


Solution:

[oracle@node1 dbhome_1]$ cd  $ORACLE_HOME/cv/admin

[oracle@node1 admin]$ vi cvu_config

un-comment the below parameter and set value as your OS version 

# Fallback to this distribution id

CV_ASSUME_DISTID=OEL8.2           #my OS version is CentOS Linux release 8.2.2004 (Core)

Tuesday 8 September 2020

 

                     M001: MongoDB Basics




Chapter 1: Introduction

Lab 1.1: Install Compass and Connect

Problem:

If you haven't downloaded Compass yet then please go back to this lecture Connecting to MongoDB Using Compass in Chapter 0 and follow the instructions mentioned there for downloading Compass and connecting to the class Atlas cluster.

If you have already downloaded Compass then please use this connection string for connecting to the class Atlas cluster :

mongodb+srv://m001-student:m001-mongodb-basics@cluster0-jxeqq.mongodb.net/test
  • Once connected, navigate to the Schema tab in Compass and hit Analyze Schema and answer the following question.

Question:

Which of the following field names appear in documents in the movies collection of the video database. Check all that apply.

Lab 1.2: Determine the Value Type, Part 1

Problem:

What is the value type of the ts field for documents in the 100YWeatherSmall.data collection?

Lab 1.4: Determine the Value Type, Part 3

Problem:

What is the value type of the year field for documents in the video.movies collection?

Lab 1.5: Scavenger Hunt, Part 1

Problem:

How many movies in the video collection were directed by Patty Jenkins. Stated more precisely, how many documents in the video.movies collection have a value of "Patty Jenkins" for the director field?
Lab 1.6: Scavenger Hunt, Part 2

Chapter 2: The MongoDB Query Language + Atlas

Lab 2.1: How Many Comedies?

Problem:

  1. If you have not already loaded the video.movieDetails collection, please review the lesson "Loading Data into Your Sandbox Cluster" for a tutorial. Then, use the script, loadMovieDetailsDataset.js, provided in the handouts for the lesson, "Connecting to an Atlas Cluster from the Mongo Shell" to load the movieDetails collection.
  2. Use Compass to connect to your sandbox cluster.
  3. In Compass, view the video.movieDetails collection and apply the filter {genres: "Comedy"}.

How many documents in video.movieDetails match the filter {genres: "Comedy"}?

Lab 2.2: How Many Inserted?

Problem:

If the collection video.myMovies is currently empty, how many documents would be inserted by the following call to insertMany().

Lab 2.4: Queries on Array Fields, Part 1

Problem:

Explore the movieDetails collection that you loaded into your Atlas sandbox cluster and then issue a query to answer the following question. How many movies in the movieDetails collection list "Family" among its genres?

You will find the count() method useful in answering this question using the mongo shell.

Lab 2.5: Queries on Array Fields, Part 2

Problem:

Explore the movieDetails collection that you loaded into your Atlas sandbox cluster and then issue a query to answer the following question. How many movies in the movieDetails collection list "Western" second among its genres?

You will find the count() method useful in answering this question using the mongo shell.

Lab 2.6: Update Operators

Problem:

To work on this lab, you need to connect to the sandbox cluster in which you have imported the video.movieDetails collection.

Suppose you wish to update the value of the plot field for one document in our movieDetails collection to correct a typo. Which of the following update operators and modifiers would you need to use to do this?


Chapter 3: Deeper Dive into the MongoDB Query Language

Challenge Problem: Single Value in an Array of Integers

Solution: for shell => db.score.find({results:{$elemMatch: {$gte: 70},{$lte: 80 }}})

For compass =>{results: {$elemMatch: {"score": {$gte: 70}, "score": {$lte: 80 }}}}



Final Exam

Final Exam: Question 1

Problem:

Connect to our class Atlas cluster from Compass and view the citibike.trips collection.

Use the schema view and any filters you feel are necessary to determine the range of values for the usertype field. Which of the following are values found in this collection for the field usertype?

Solution: 

Final Exam: Question 2

Problem:

Connect to our class Atlas cluster from Compass and view the 100YWeatherSmall.data collection.

Using the Schema view, explore the wind field. The wind field has the value type of document. Which of the following best describes the schema of this embedded document?

Final Exam: Question 3

Problem:

Connect to our class Atlas cluster from Compass and view the 100YWeatherSmall.data collection.

What is the value type of the "wind.speed.rate" field?

Final Exam: Question 4

Problem:

Please connect to our class Atlas cluster and view the citibike database.

How many documents in the citibike.trips collection have the key tripduration set to null? Ignore any documents that do not contain the tripduration key.

Final Exam: Question 5

Final Exam: Question 6

Problem:

Please connect to our class Atlas cluster from the mongo shell or Compass and view the video.movies collection.

How many movies match the following criteria? - The cast includes either of the following actors: "Jack Nicholson", "John Huston". - The viewerRating is greater than 7. - The mpaaRating is "R".


work on autovacuum postgreSQL parameter

 In This blog, we are discussing the auto vacuum parameter on a small scale. we will understand the below parameters and will see how to mod...