Posts

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

MongoDB - quick view of the "view"

Quick overview about Mongodb view A view is merely a saved aggregation pipeline that's called whenever you reference the name of the view as though you were querying a collection. You cannot modify the view Here are a few simply facts about MongoDB View: 1. It's read only 2. View must be created in the same db as the based collection 3. It's a good alternative to mask sensitive data 4. Cannot be renamed , do drop and create instead 5. It doesn't materialized, meaning view does not store anything but definition To create the view with real example: db . getSiblingDB("personnel-core").createView ( "nameView",name , [{                                         "$project" : {                                                 "fullName" : {                                                         "$concat" : [                                                                 "$firstName",                                

MongoDB Script Get all Indexes Creation Script

MongoDB: Get All Indexes in DB via Mongo Shell This is a simple script to backup all the index creation scripts Note: background:true is deprecated since MongoDB 4.2, but it's okay to leave it in. Options for all Index types To run this, simply save to a script and run it with mongo shell mongo -u admin -p --authenticationDatabase=admin --host localhost getAllIndexesCreationScript.js > output.js db.getMongo().getDBNames().forEach(function(dbName) { if (dbName != "admin" && dbName != "local") { db.getSiblingDB(dbName).getCollectionNames().forEach(function(coll) { db.getSiblingDB(dbName)[coll].getIndexes().forEach(function(index) { if ("_id_" !== index.name) { print("db.getSiblingDB('" + dbName + "')." + coll + ".createIndex(" + tojson(index.key) + ",{background:true}" + ")"); } }); }); } });

MongoDB Log Switch Script

Image
It's been a while since I wrote a post, I have been busy exploring everything I want to learn outside of work and it's been fun. I think it's time to get back and document some more!  Today I want to talk about  log switching.  Having been managing MongoDB databases and MongoDB BI Connector for quite a while now. I can't put enough appreciation of how the logs have helped of making my life so much easier and they should be the one of the first things we check whenever we encounter any issue in regards to the aforementioned.  If you agree with me on how important the log is, please read on. Log is definitely your friend, but I know I had made the mistake of leaving it alone for a long while and when I truly needed it, it became a monster that I had to cut and dissect into workable size.  There was one time we had a production issue and I had to look into the issue immediately and of course I went straight to my friend, the logs. I tried looking into the log and the respo

MongoDB BI Connector - a more elaborative guide

Image
It's been a while since I last wrote about MongoDB BI Connector but I felt it's still quite important as most people still feel more comfortable getting their information from using conventional tabular format.  Let's get started! 0. Where to Download Simple choose the platform you would like to host your MongoDB BI Connector process 1. How to install   A. on windows Simply download the .msi, keep everything as default, just click next when prompted, and hit Finish to close the window when installation is completed. B. on linux, will try to point out the difference in the distribution if I encounter any Here I am just using Redhat 7.x as an example scp this onto my Redhat Linux Server, I have installed and configured mingw, therefore, I am able to run scp on my windows box, one of the alternatives would be to use winscp scp mongodb-bi-linux-x86_64-rhel70-v2.13.1.tgz <user>@<target ip>:/tmp Log onto the server U

Redis Cluster basic setup

Image
Disclaimer: Make sure to use Redis 5 to follow along this quick guide, if using the older distribution, please refer to  Official Documentation  for more information. This works on Redhat 7, to install Redis 5 #Set up repo rpm -ivh https://rpms.remirepo.net/enterprise/remi-release-7.rpm # install redis yum install -y redis --enablerepo=remi This creates 3 shards and 3 replicas Client we are using here is the redis-cli command line tool ShardX, SalveX are redis-server processes #create conf files node1.conf ------------------ port 7001 cluster-enabled yes cluster-config-file cluster-node-1.conf cluster-node-timeout 5000 appendonly yes appendfilename node-1.aof dbfilename dump-1.rdb . . . node6.conf ------------------ port 7006 cluster-enabled yes cluster-config-file cluster-node-6.conf cluster-node-timeout 5000 appendonly yes appendfilename node-6.aof dbfilename dump-6.rdb #Start each redis-server node -------------------------

Redis Basics

Going over the basics // to check if there is connection with Redis 127.0.0.1:6379> ping PONG // echo a string 127.0.0.1:6379> echo 'hello' "hello" // insert a record 127.0.0.1:6379> SET foo 100 OK // get record based on the key 127.0.0.1:6379> GET foo "100" 127.0.0.1:6379> SET bar "Hello world" OK //  increment value by 1 127.0.0.1:6379> INCR foo (integer) 101 // can't increment text 127.0.0.1:6379> INCR bar (error) ERR value is not an integer or out of range // value of foo is increased by 1 127.0.0.1:6379> GET foo "101" // decrease by 1 127.0.0.1:6379> DECR foo (integer) 100 127.0.0.1:6379> GET foo "100" // check if the key exists, if exists, return 1, else return 0 127.0.0.1:6379> EXISTS foo (integer) 1 127.0.0.1:6379> EXISTS bar (integer) 1 127.0.0.1:6379> EXISTS foo1231 (integer) 0 // remove key 127.0.0.1:6379> DEL bar (integer)