Installing Oracle Instant Client for Mac OSX

I came across few links for installing Oracle Instant Client on Mac OS X namely – this and this. But I don’t like to tinker with the System paths while installing any s/w manually. I did the same with perl CPAN modules, I install them locally in home directory and same with Python pip packages, but that’s another post for future. So I had to work out the following method for installing the Oracle Instant Client as I needed sqlplus client for connecting to my RDS Oracle instance.

Download the following two files from http://www.oracle.com/technetwork/topics/intel-macsoft-096467.html

instantclient-basic-macos.x64-11.2.0.4.0.zip
instantclient-sqlplus-macos.x64-11.2.0.4.0.zip

These will be downloaded in the Downloads directory

Unzip these two files in a single directory

$ cd Downloads
$ unzip instantclient-sqlplus-macos.x64-11.2.0.4.0.zip
$ unzip instantclient-basic-macos.x64-11.2.0.4.0.zip
$ cd ~

Create the required structure in the home directory and copy the files in place

$ mkdir -p oracle/product/instantclient_64/11.2.0.4.0/{bin,lib,jdbc/lib,rdbms/jlib,sqlplus/admin,network/admin}
$ mv Downloads/instantclient_11_2/ojdbc* product/instantclient_64/11.2.0.4.0/jdbc/lib/
$ mv Downloads/instantclient_11_2/x*.jar product/instantclient_64/11.2.0.4.0/rdbms/jlib/
$ mv Downloads/instantclient_11_2/glogin.sql product/instantclient_64/11.2.0.4.0/sqlplus/admin/
$ mv Downloads/instantclient_11_2/*dylib* product/instantclient_64/11.2.0.4.0/lib/
$ mv Downloads/instantclient_11_2/*README product/instantclient_64/11.2.0.4.0/
$ mv Downloads/instantclient_11_2/adrci instantclient_11_2/genezi instantclient_11_2/sqlplus instantclient_11_2/uidrvci product/instantclient_64/11.2.0.4.0/bin/

Make the following additions to your ~/.bashrc file –

ORACLE_HOME="~/oracle/product/instantclient_64/11.2.0.4.0"
PATH=$ORACLE_HOME/bin:$PATH
alias sqlplus="DYLD_LIBRARY_PATH=$ORACLE_HOME/lib sqlplus"

Now I can connect to the Oracle RDS instance using –

$ sqlplus 'root@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ajitabh-oracle-test.bkl9a9lqwsoxcd.us-west-1.rds.amazonaws.com)(PORT=1521))(CONNECT_DATA=(SID=ORCL)))'

SQL*Plus: Release 11.2.0.4.0 Production on Wed Aug 26 21:59:46 2015

Copyright (c) 1982, 2013, Oracle. All rights reserved.

Enter password:

Connected to:
Oracle Database 11g Release 11.2.0.4.0 - 64bit Production

SQL>

That’s it. More on exploring Oracle RDS later.

Posted in Databases, Tips/Code Snippets | Tagged , , , , | Leave a comment

Expanding HardDisk of VirtualBox Guest

VirtualBox is a beautiful piece of virtualisation software created for users, first acquired by Sun and then by Oracle as a part of Sun acquisition. I have been using VirtualBox for quite a few testing projects, however until today have never needed to expand my hard drive on a guest. I am running a Windows 7 guest for some client side related tests. I started with a 25Gb disk for Windows 7, but after applying all security patches (I like my machines patched and upto-date), I realised that 25GB is all gone.

This is where I love virtualisation. I do not need to buy a new disk if I need more space on my virtual machine (as far as my physical disk has enough space). I can just expand the existing virtual hard disk and get all the space I need. VirtualBox does not yet have a GUI option to do storage expansion work, but fortunately VirtualBox comes with an excellent command line, so I followed the following steps in order to increase my hard drive space.

In order to see the virtual hard disk info, following command can be used.

$ VBoxManage showhdinfo VirtualBox\ VMs/Win764/Win764.vdi
UUID: e2272600-df31-4dbc-a71d-56af5f5714df
Parent UUID: base
State: created
Type: normal (base)
Location: /Users/ajitabhp/VirtualBox VMs/Win764/Win764.vdi
Storage format: VDI
Format variant: dynamic default
Capacity: 25600 MBytes
Size on disk: 25502 MBytes
In use by VMs: Win764 (UUID: 1beda97f-4222-49ad-993e-342e1d44e288)

To expand this to 50GB and then verify that the operation is done

$ VBoxManage modifyhd --resize 50000 VirtualBox\ VMs/Win764/Win764.vdi
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
$ VBoxManage showhdinfo VirtualBox\ VMs/Win764/Win764.vdi
UUID:           e2272600-df31-4dbc-a71d-56af5f5714df
Parent UUID:    base
State:          created
Type:           normal (base)
Location:       /Users/ajitabhp/VirtualBox VMs/Win764/Win764.vdi
Storage format: VDI
Format variant: dynamic default
Capacity:       50000 MBytes
Size on disk:   25502 MBytes
In use by VMs:  Win764 (UUID: 1beda97f-4222-49ad-993e-342e1d44e288)

Now so far we have only been able to expand the Hard disk drive, but the partition table still would say that the NTFS filesystem is still the original size. However, we can not use Windows to expand the partition table of the same partition wherein it is installed. The System Rescue CD came to help here. I attached the System Rescue CD ISO to the windows virtual machine and booted the system.

In the command prompt, I used the GNU parted to expand the partition table (partition 2 in my case)

% parted resizepart 2 50GB /dev/sda

In case you want to check which is your NTFS partition, which you want to expand use the following command –

% parted print /dev/sda

After expanding the partition table, we need to expand the NTFS filesystem on it, which can be done by ntfsresize utility as below. First I ran the utility in info mode to find out the exact size to which to expand to and then in dry run (test) mode and finally actually ran it.

% ntfsresize --info /dev/sda2
% ntfsresize -n -s 52294093824 /dev/sda2
% ntfsresize -s 52294093824 /dev/sda2

Finally remove the the System Rescue CD ISO file and boot the system normally in windows, a check will be force and you are done.

Posted in FLOSS | Tagged , | Leave a comment

Kurukshetra by Ramdhari Singh ‘Dinkar’

Kurukshetra book coverKurukshetra is a poetic description of the analysis and after effects of a war. The poet has taken the Bhishma – Yudhishthir dialogue after the Mahabharat war was over in order to explain the effects of war.

After the war was over, Yudhishthir repents on the unjust caused by war. Yudhistir says that everybody understands the effects of war. The end result of every war is only destruction, but is it just to have enormous casualties for the selfish purpose of few.

“युद्ध को पहचानते सब लोग हैं,
जानते हैं, युद्ध का परिणाम अन्तिम ध्वंस है!
सत्य ही तो, कोटि का वध पाँच के सुख के लिए!”

Bhishm replies that nobody wants to get sick, but when the infection has already spread then their is no alternative other than treating it from root. He then explains that by itself no action is just or unjust. It is the internal feeling which makes it so.

“रुग्ण होना चाहता कोई नहीं,
रोग लेकिन आ गया जब पास हो,
तिक्त ओषधि के सिवा उपचार क्या?
शमित होगा वह नहीं मिष्टान्न से।

है मृषा तेरे हृदय की जल्पना,
युद्ध करना पुण्य या दुष्पाप है;
क्योंकि कोई कर्म है ऐसा नहीं,
जो स्वयं ही पुण्य हो या पाप हो।

Bhishm further explains that Lord Krishna explained it very well that the feelings of the actor are more important than the action itself. And it is important for one to separate oneself from the “Karma” and still continue doing that. He explains to Yudhishthir that although the prime duty of a human being is mercy and compassion. but  when the interest of the larger society is concerned we have to forget that prime duty. He then says that pardoning only suits the powerful people.

सत्य ही भगवान ने उस दिन कहा,
‘मुख्य है कर्त्ता-हृदय की भावना,
मुख्य है यह भाव, जीवन-युद्ध में
भिन्न हम कितना रहे निज कर्म से।'”

“व्यक्ति का है धर्म तप, करुणा, क्षमा,
व्यक्ति की शोभा विनय भी, त्याग भी,
किन्तु, उठता प्रश्न जब समुदाय का,
भूलना पड़ता हमें तप-त्याग को।

जो अखिल कल्याणमय है व्यक्ति तेरे प्राण में,
कौरवों के नाश पर है रो रहा केवल वही।
किन्तु, उसके पास ही समुदायगत जो भाव हैं,
पूछ उनसे, क्या महाभारत नहीं अनिवार्य था?”

“क्षमा शोभती उस भुजंग को,
जिसके पास गरल हो।
उसको क्या, जो दन्तहीन,
विषरहित, विनीत, सरल हो ?

Finally he explained the episode from Ramayan as mentioned below –

तीन दिवस तक पन्थ माँगते
रघुपति सिन्धु-किनारे,
बैठे पढते रहे छन्द
अनुनय के प्यारे-प्यारे।

उत्तर में जब एक नाद भी
उठा नहीं सागर से,
उठी अधीर धधक पौरुष की
आग राम के शर से।

सिन्धु देह धर ‘त्राहि-त्राहि’
करता आ गिरा शरण में,
चरण पूज, दासता ग्रहण की,
बँधा मूढ बन्धन में।”

About the Author

Ramdhari Singh ‘Dinkar’ was an Indian Hindi poet, essayist, patriot and academic. He is famous for his nationalist poetry written in the days before Indian independence. He was born on 23rd September 1908 and passed away on 24th April 1974)

Posted in Book Reviews | Tagged | Leave a comment

Scion of Ikshvaku by Amish Tripathi

Scion of Ikshvaku Book coverAnother historical book by Amish Tripathi. This time he has chosen the story of Ramayan (around 3400 BCE). Its re-telling of the standard Ram-Sita life-story as mentioned in various versions of Ramayan’s by various authors over a period of time. Mostly it seems it has been taken from Valmiki Ramayan as I could not find a trace of Tulsidas’s Ramcharitmanas in it.

The way characters are presented in this book, seems more practical to me and there is no God / Goddess like behaviour being exhibited by Ram and Sita. Their character is purely human, albeit with more mature and practical thoughts. Once again Amish has used the concept of “Nagas” (people born with deformities) to explain Hanuman, Kumbhakaran and Jatayu, which sounds more practical, rather than animals able to talk like humans. This characters of this book must not be treated like religious characters rather it will be best to imagine they just have the same names as of the Ramayan characters and then people will be able to accept this book as interesting thriller.

Even though we all know the story, yet every page turn was worth it and the presentation wanted me to finish and see what’s in store next.

Strong Dislikes

Having a rape case sounding similar to the Delhi Rape case and then pages and pages of lectures by Ram on the Law and how an underage can not be punished because there is no provision for death penalty in law for underage criminals is something which seriously could have been avoided. Were you trying to throw your ideas about the whole “Nirbhaya” issue Amish, if so, I disagree with your thoughts.

Verdict

Overall, I will be waiting for the next book in the series.

About the Author

Amish Tripathi is an IIM graduate banker turned full time author. He is passionate about history, mythology and philosophy. “Siva Trilogy” was his first series which got immensely popular.

Posted in Book Reviews | Tagged , | Leave a comment

Chandrakanta by Devakinandan Khatri

Chandrakanta Book CoverChandrakanta is a hindi novel written in 1888. This is fantasy fiction something similar to the “Harry Potter” series, which the younger generation of today is so fan of. It is important to note that during the time when this book was written, Urdu was the language in use in the country and Farsi being the official language of Mughal courts. Therefore, this work is considered to be the first work of prose in the modern Hindi language. There were people from different generations who learn hindi script (devanagari) in order to just read this series of books. This story has a big hand in making Hindi popular among masses.

Chandrakanta is a simple love story between a prince Virendra Singh of Naugarh and princess Chandrakanta of Vijaygarh. The lust of Krur Singh, who was a member in the court of Vijaygarh is the main reason of twists and turns in this story and brings in the concept of Aiyyar and Tilasm. An aiyyar is usually employed by royal houses. They are expert spies and are well versed in the act of disguise, medicines and fighting. As usual with many love stories, this story too ends with both the lovers meeting together and getting married.

Overall the story line is quite captive inspite of being a very simple plot. There is no break in the story and the interest of the reader remains till the end, where a lot of secrets are disclosed.

The book is in Devanagari script (Hindi script), but uses a lot of Urdu words, as Urdu was very popular language at those times.

Followed by Chandrakanta, the author also wrote a series – “Chandrakanta Santati”, meaning “The Sons of Chandrakanta”. I am looking forward to reading that series too.

About the Author

Babu Devakinandan Khatri was born in 1861 in Samastipur in Bihar (India). He was an employee of the “Raja of Banaras” and also established a printing press called “Lahari Press”, which interestingly is still in existence near the city of Varanasi. The author has written several Hindi fiction / fantasy novels and has quite a big hand in making Hindi a popular language. Interestingly he never wrote any of his works at one go. He used to write individual chapters, called “Bayans” – an urdu word meaning “Statement” and publish them. People used to wait for those individual chapters in order to know what happened next in the story. Devakinandan Khatri passed away in 1913.

Posted in Book Reviews | Tagged , , | Leave a comment