Posts

Showing posts with the label tip

Oracle Goldengate Issue OGG-00664 OCI Error during OCIServerAttach (status = 12547-ORA- 12547: TNS:lost contact)

 I have recently encountered this issue OGG-00664 OCI Error during OCIServerAttach (status = 12547-ORA- 12547: TNS:lost contact) After doing some research, tried several approach, finally found a solution that worked for me Approaches I tried that didn't work for me but seems to work for some people: I have also listed the approaches in the order I tried them as sometimes some configuration we applied does help to achieve our resolution in the end.  1. I noticed the os user I use to log into ggsci does not belong to the group oinstall which is the group that owns the oracle binary, so basically run the following, note that oragg is the os username that I use to run my ggsci usermod -a -G oinstall oragg 2. Add the following lines the prm files SETENV (TNS_ADMIN="<your oralce home>/network/admin") SETENV (ORACLE_SID='<your oracle sid>') SETENV (ORACLE_HOME="<your oracle home>") I also did try (NOTE: my thought process was I don't need...

Linux Tips: 3 quick interesting tip

//Redo last command as Sudo sudo !! //Create a super fast RAM disk  👍 [root@msdlvd-dsnavl02 ~]# mkdir -p /mnt/ram [root@msdlvd-dsnavl02 ~]# mount -t tmpfs tmpfs /mnt/ram -o size=1024M [root@msdlvd-dsnavl02 ~]# mkdir /data/ram [root@msdlvd-dsnavl02 ~]# cd /data/ram [root@msdlvd-dsnavl02 ram]# dd if=/dev/zero of=test.iso bs=1M count=1000 1000+0 records in 1000+0 records out 1048576000 bytes (1.0 GB) copied, 3.00793 s, 349 MB/s [root@msdlvd-dsnavl02 ram]# rm test.iso rm: remove regular file ‘test.iso’? y [root@msdlvd-dsnavl02 ram]# cd /mnt/ram [root@msdlvd-dsnavl02 ram]# dd if=/dev/zero of=test.iso bs=1M count=1000 1000+0 records in 1000+0 records out 1048576000 bytes (1.0 GB) copied, 0.594687 s, 1.8 GB/s //not in history, don't add your previously ran command in history, leave a leading space before command  ls -al

MongoDB tips : check for types, bi connector issue and resolution

Image
This issue arises when end user mentioned they couldn't locate certain records and they know the record is indeed in the database and they were using _id to reference the record. Quick investigation of our database, we can see our _id type is split into total count: db.getCollection('upDown').find({}).count() //2403170 count by type 2 which is string db.getCollection('upDown').find({_id:{$type:2}}).count() //1630934 count by not type2 db.getCollection('upDown').find({_id:{$not:{$type:2}}}).count() //772236 check a few sample record, we see the _id is in the default format of bson object, objectId db.getCollection('upDown').find({_id:{$not:{$type:2}}}) This issue was first discovered by end user who uses MongoDB  BI connector to query mongodb data. In the drdl I see we have exposed the field as     - Name: _id       MongoType: string       SqlName: _id       SqlType: varchar from MySQL query, it looks lik...

MongoDB Tip: 4.0.x encryption at rest

I just want to quickly document what to look for in the log when we have successfully enable encryption at rest for mongodb database create keyfile openssl rand -base64 32 > monogdb-ear-keyfile copy the ear-keyfile into /etc chmod 600 /etc/mongodb-ear-keyfile mongod --port 17017 --dbpath /data/earTest/ --logpath /data/earTest/ear.log --enableEncryption --encryptionKeyFile /data/earTest/mongodb-ear-keyfile --fork check the log after mongod is started If you see this line, then your mongod has successfully launched in encryption at rest mode 2019-08-05T09:48:12.555-0400 I STORAGE  [initandlisten] Encryption key manager initialized with key file: /etc/monogdb-ear-key

MongoDB tip: cursor.map

This is just a quick example of how we can use cursor.map to change the shape of the array. //push all the _id we found into an array, but the problem we have right now is how it's stored as array of documents while we are only interested in the value. var updateArray = db.getSiblingDB("equipment").needProcessedEquip.find({}, {_id: 1}).toArray(); updateArray; [     {         "_id" : "5680e9b8-6ffe-41bb-a035-e255ede87b8e"     },     {         "_id" : "08b08206-f2a7-49b8-bf7a-b72a6494e556"     },     {         "_id" : "17e49c0d-0892-4f4b-a0c5-effaaf07a058"     },     {         "_id" : "1b1756ce-63fe-4b9e-baf3-e2f418feb3d7"     },     {         "_id" : "e31a02f6-e217-4172-bcf5-684ab40321de"     },     {         "_id" : "01f6fcab-4123-44aa-a...