Wednesday, May 30, 2012

PL/SQL - More useful than its perception

Although my general perception about the development tools of Oracle has never been quite good but I have always admired and loved PL/SQL; especially the PL part of it. Oracle has done quite a few changes in normal syntax of SQL as well and I think they have only enhanced the normal standard ANSI SQL which is the standard and is independent of any DBMS. Many believe that Analytical Functions introduced by Oracle are the best things that has happened to SQL after SELECT statement. Coming back to PL/SQL...

The greatest thing about PL/SQL has been over the years is that it is tightly integrated to a RDBMS that holds more than 40% of market share of databases. You can query something and immediately start using the programming constructs with absolutely no extra effort. All you have to do is to enclose your query within a Begin and an End. You don't need to do import any classes or packages; there are no setup costs or efforts. Although the part of it has to do with Oracle including its compiler into the RDBMS but you simply can't resist the simplicity and usefulness of this language. Every Oracle application developer will happily tell you how good it is and how difficult his/her life would have been without it.

When Oracle started to push Java more and more - due to whatever reasons - many thought that end is near for PL/SQL. With the recent acquisition of Sun Micro Systems by Oracle and thus Java as well, this rumor started to heat up again. But somehow it has successfully passed the test of time ever since it came into being back in 1988 with Oracle Version 6. Although its name still says that it is a procedural language but it has everything that an object oriented language should have. Even every SOA application has some kind of dependency on it because it manipulates and programs the single most important entity of an organization i.e. Data with ease that is unmatched.

When Oracle introduced HTML DB now known as APEX I was more than sure that Oracle has no plans of deprecating PL/SQL. APEX is another very handy tool that uses just PL/SQL and nothing else. If you want to quickly build Oracle database backed web applications APEX is your dream tool and much like PL/SQL it is free as well. You can literally build entire websites just using PL/SQL and this is just another huge plus point for a language that is mostly considered an underdog.

Saturday, May 26, 2012

Recovering lost home directory in Linux

Not to use root user to log into Linux system is one of the first things that is told when you step foot in Linux administration world. Although in real world it is still used but it is discouraged and for good reasons as well. Many Linux distributions have alternate ways which can be used to simulate root user privileges for example one of them is sudo command. I still use root especially on VM machines which I have kept for practice reasons and felt the curse of it a few days back when I accidentally deleted the home directory of Oracle user. If you ever had an experience of running Oracle on Linux you know that this user is mandatory to successfully install and maintain the Oracle Software.
More importantly I was logged into Oracle user desktop at that time and switched to root at command prompt. Although the home directory was deleted for the current logged in user but Linux being Linux did not even bothered to notify me. But when I tried to log into Linux again the day after with Oracle user I was unable to see the desktop and I was told that home directory is missing and you won't be able to use GUI or even normal command prompt. I was presented with a drilled down version of Shell terminal which was less than useful for me. So I went to Google and found after some Googling that I need to perform the below mentioned steps to restore my home directory:
1. Log in using root (Yeah, again)  and create the home directory manually in /home folder (You can change the location if you want to).
2. Copy the contents of /etc/skel directory to the newly created home directory.
3. Change the ownership from root to the user for which home directory is being created (In my case oracle).
4. Set the appropriate permissions on directory.
Now you can log off that freak root and can log in using the normal user again. Technically below mentioned commands are required to be executed to recreate the lost home directory of e.g. oracle user after you get logged in using root.
mkdir -p /home/oracle
cp /etc/skel/.* /etc/skel/* /home/oracle
chown -R oracle:oinstall /home/oracle
chmod -R 775 /home/oracle
P.S. If you had your personal data stored in your home directory when you lost it, the data will be lost and you will have to restore it using your backup. The /etc/skel only contains files required to get any new user be able to log in unless it is changes manually by System Admins.

Cross Posted on Tech Blessing

Wednesday, May 23, 2012

Blog, blog and blog!!!

I started this blog with a lot of passion. I was a student at that time and mindset was completely different than I have today. In course of three years I realized that even passion has its own limits and corporate world is much different than what we expect. Here is a bit techy example to explain my journey. :) I learned and believed that Oracle RDBMS is an almost perfect software that is ever written. Even the masterpieces like Linux Kernel suffer from dead locks but Oracle RDBMS does not. To this point I still believe in this theory but what I learned after when I came in real world business was even more surprising. Oracle may be the perfect software but that does not mean it won't have any problems. After all there are situations in real world where Oracle RDBMS is dependent on Softwares like Windows operating system.

When I started blogging my world was hardly anything more than Oracle and Blogger. So the hurdles were minimum. As time went along and money became a more prominent factor in dictating the road that I need to follow, things changed. When I learned the hard truth that the Golden era of web when every blog and website can make money was over; this passion of mine suffered more because I required to look after other things more than blogging because from there my livelihood was coming.

Although I never quite blogging permanently but the thing that suffered the most was this blog of my own where I started all. My blogging range expanded from Oracle to include Cricket, general tech, Smart Phones, tablets, Social Media and of course I also blogged a lot about my new found love i.e. iPhone; but that was on some of my close friend's websites. 

This is my third coming back to myself and I hope that I can keep up with it. But the plan is more realistic this time and the goal is simple for now i.e. blog two to three times per week and mostly on Weekends.