Saturday, August 16, 2014

Oracle - automatic startup and shutdown scripts

DBAs can rest when server admins restart the server. Usually it engages both the teams when server is taken down for maintenance. By deploying the scripts, DBAs need not shutdown and startup the databases and services manually.

The scripts I have used have been taken from Tim Halls' oracle-base. The scripts from his site works when there is single database. I have modified the scripts so that they can be used when the server has multiple databases. The only requirement is that all database names should be available in /etc/oratab as shown below:



In the above picture, one database name is commented and one is given "N". The script ignores these unwanted databases and takes into account only active databases.

The scripts need not need any specific modification except that you may need to edit the script and place the location of your bash profile you want to use.

Download these 3 files:

dbora
startup.sh
shutdown.sh

copy dbora file to /etc/init.d/ 

and then execute:

chmod 750 /etc/init.d/dbora
 
  
Add dbora to the run level as below :

chkconfig --add dbora
 

This ensures the script runs when the host server goes for startup or shutdown.

 Note: the above 2 steps dealing with dbora file is done by root user


copy startup.sh and shutdown.sh to /app/oracle/scripts/  or any other desired location and test by restarting the server. Check the log startup_shutdown.log in the same location.


Cheers!!
 
 

Tuesday, July 22, 2014

oracle 12c Installation and Database creation

I have installed Oracle 12c (12.1.0) in Oracle Linux 6. Below are the steps:

Set ORACLE_HOME to the location where the files will be installed and set the port no for the EM:
export $ORACLE_HOME=/u01/app/oracle/product/12.1.0/db_1
export $DBEXPRESS_HTTPS_PORT=5500
 

 


  


























Monday, June 2, 2014

Installing JSF in Eclipse

File--> New--> Dynamic Web Project




Select Download Library (The floppy Disk icon)





Installing Glassfish 4.0 from Eclipse IDE




Since Glassfish is not found, select "Download Additional server adapters" on top-right.




The error on the top indicates that Glassfish doesn't recognize the jdk installed on the system. Therefore, go to Window-->Preferences--> Java-->Installed JREs

Now Add the jdk as shown below

Make sure the jdk checkbox is selected


Now follow the above steps again and the error won't appear as shown below

and select "Install Server"










Once the installation is complete


Open a browser


Friday, April 4, 2014

Ubuntu One services shutdown


Its so shocking to hear Ubuntu One shutting down....

Further info here.

In the upcoming Ubuntu 14.04 LTS release, the Ubuntu One file services will be not be included. Further from June 1, the services will be unavailable in older versions of Ubuntu, yet the files are available for download till 31 July...

Phew...I gotta save my files back!!!

Saturday, March 15, 2014

When you forget to close database connections while coding server side scripting!!! - You forgot to give it closure!!!!

When you are in the initial stages of developing code either in JSP, PHP, Python etc., there might be chances that closing the connections can be forgotten. Especially we are just at the login page (the first stage of the project).

I did forget to close the connections!!! (a blunder) and after several testing... what did I get..


Then I checked the mysql database for maximum allowable connections


Maximum allowable is 151








If you see in the result above, there are several connections which are in Sleep which is because I didnt close the connections. Now one way is to kill atleast some of the processes






Viola!!!! Now I am able to get the Login page




If you can restart the OS, all the connections will be killed. See below, I have only one sleep process, rest all have been wiped out