Monthly Archives: October, 2014

Shell Script: Check Database is UP/DOWN


#Setup Environment
export ORACLE_HOME=/home/oracle/product/
export ORACLE_SID=sid1
export HNAME=`uname -n`

#Check pmon process
check_stat=`ps -ef|grep ${ORACLE_SID}|grep pmon|wc -l`;
if [ “$check_stat” -lt  “1” ]
#On some platforms, you can use mailx instead of mail
echo “Please contact Duty DBA ASAP” | mail -s “URGENT: $ORACLE_SID is down on $HNAME!”
exit 1

# Check DB Connection
$ORACLE_HOME/bin/sqlplus / as sysdba<<! > /tmp/dbchk_$ORACLE_SID.ora
select * from v\$database;

# If not, exit and e-mail . . .
check_stat=`cat /tmp/dbchk_$ORACLE_SID.ora|grep -i error|wc -l`;

if [ “$check_stat”  -ne  “0” ]
echo “Please contact Duty DBA ASAP” | mail -s “URGENT: $ORACLE_SID is down on $HNAME!”
exit 2




Difference between Unix and Linux

Whether you are an expert in Unix/Linux environment or a complete newbie into Black & White screen world, it’s some time hard to answer this basic question. If you have that feeling, please read on!

Before we understand the difference between Unix & Linux, let me share the origin of “Uni”x name.

Before UNIX came into the Industry, there used be an Operating Sytem (OS) called “Multics” (Multiplexed Information and Computing Service). If you observe the word “Multi”cs, there is a little word inside it called “Multi”, which means more than one. That was exactly this MULTICS operating system used to do; It tried to balance all operating system features such as response time, user interfaces, etc.

But, our UNIX Inventors – Brain kernighan and Ken Thompson @AT&T Bell Laboratories in early 1970’s – wanted to have an operating system that delivers faster response time for their academic project; Unfortunately, MULTICS was not designed for this single purpose of giving faster response time. Hence, these inventors started writing a platform with concentration on only one feature, faster response time. Hence, the name “Uni”x.

If you ask me the authenticity of the above 2 paragraphs, I might be wrong! But it at least helped me to remember the “Unix” meaning permanently.

To add further, 1970’s was the same time, Dennis Ritchie invented “C” programming language. So, Unix has got 90% of it code developed in “C” language and 10% in machine specific assembly code.

After their academic project, the source code for UNIX was kept open, which eventually received wider acceptance from Industry leaders such as IBM, SCO, SUN, Berkley, HP, etc. From then, each vendor/industry leader developed its own operating system.

Few examples of such UNIX operating systems: IBM AIX, SUN Solaris, HP-Ux, SCO

Then, What is LINUX?
Linux is a Unix clone written from SCRATCH by Linus Torvalds with assistance from a loosely-knit team of hackers across the Net. Taking the first name – Linux- of this inventor, this operating system has been named as “Linu”x.  In my opinion, Linux included Unix functionality PLUS GUI capabilities that lacked in Unix platforms. Probably, to take out the market share from Windows GUI platform.

Few example LINUX operating systems: Debian, Ubuntu, Redhat, etc

Hope this helps. Feel free to comment if any queries/changes you think are needed.
P.S: The above post is for Knowledge purpose only, neither intended to violate any copyrights nor to take away someone else’s
credit on our name. If you think, any such violation, please email me at We will include the credits accordingly.

P.S: If you are interested in sharing your knowledge, please email your articles to

Happy Reading & Sharing!


Former Netezza Team Reunites And Lands $8M To Solve Today’s Big Data Problem

BIGDATA startup Team CAZENA raises $8 million to solve Today’s Big Data problems. We congratulate Team CAZENA on this big achievement and wishing the Team good luck with this new technology.

For further reading, please refer:

Former Netezza Team Reunites And Lands $8M To Solve Today’s Big Data Problem