Posts

Showing posts with the label Oracle

Installing Oracle 11g Enterprise Edition on Ubuntu 12.10

Image
Required Software’s VMware Player Download and install VMware Player (Non-Commercial Software) Ubuntu 12.10 Download and install Ubuntu 12.10 32 bit or 64 bit based on your Hardware. XClock Problem To setup $DISPLAY across the user try running this as root before you do "su - oracle" or other users. $> xhost local:oracle $> xhost local:sirishg Oracle Installation Process Follow the below link, http://install-climber.blogspot.com/2012/10/InstallOracle11gR2DatabaseLinuxUbuntu1210Quantal64bit.html Note: About link works for Ubuntu 32 Bit as well. Note: Just ignored all above missing packages. Note: Run the above commands as root user. Post Installation Errors Error Message while starting sqlplus sqlplus: error while loading shared libraries: libclntsh.so.11.1: cannot open shared object file: No such file or directory. Reason for the Problem libclntsh.so.11.1 was missin...

Oracle Documentation Links

Few good oracle documentation links we can learn pretty much oracle by self, Oracle® Server Concepts http://docs.oracle.com/cd/E11882_01/server.112/e25789/toc.htm Oracle® 2-Day Developers Guide http://docs.oracle.com/cd/E11882_01/appdev.112/e10766/toc.htm Oracle® Database 2 Day DBA http://docs.oracle.com/cd/E11882_01/server.112/e10897/toc.htm Oracle® Database 2 Day + Performance Tuning Guide http://docs.oracle.com/cd/E11882_01/server.112/e10822/toc.htm

​ Oracle 11g R2 32 bit Installation on Ubuntu 12.10 32 Bit

​Finally oracle up and running on on my ​Ubuntu 12.10​ ​ VM. Followed the below posts, http://www.makina-corpus.org/blog/howto-install-oracle-11g-ubuntu-linux-1204-precise-pangolin-64bits ​ ​http://install-climber.blogspot.com/2012/10/GettingStartedInstallOracle11gR2DatabaseFedora17Lxde.html

oracle queries

Covert Date to Timestamp TO_TIMESTAMP(SYSDATE,'DD-MM-RRRR HH24:MI:SS') FROM DUAL;

Oracle Dates difference in Days

create or replace function date_diff( p_date1 DATE , p_date2 DATE) return char is  Years        NUMBER;  months       NUMBER;  days         NUMBER;  day_fraction NUMBER;  hrs          NUMBER;  mints        NUMBER;  sec          NUMBER; begin  Years :=trunc( months_between( p_date2 , p_date1 ) /12 );  months:=mod( trunc( months_between( p_date2, p_date1 ) ), 12 );  days  :=trunc(p_date2 - add_months(p_date1,trunc(months_between(p_date2,p_date1) )));  day_fraction:= (p_date2-p_date1)-trunc(p_date2-p_date1);  hrs   :=trunc(day_fraction*24);  mints :=trunc((((day_fraction)*24)-(hrs))*60);  sec   :=trunc(mod((p_date2-p_date...

Oracle timestamp difference in Days

create or replace FUNCTION timestamp_diff ( start_time_in TIMESTAMP , end_time_in TIMESTAMP ) -- RETURN NUMBER RETURN VARCHAR AS l_days NUMBER; l_hours NUMBER; l_minutes NUMBER; l_seconds NUMBER; l_milliseconds NUMBER; BEGIN SELECT extract(DAY FROM end_time_in-start_time_in) , extract(HOUR FROM end_time_in-start_time_in) , extract(MINUTE FROM end_time_in-start_time_in) , extract(SECOND FROM end_time_in-start_time_in) INTO l_days, l_hours, l_minutes, l_seconds FROM dual; --l_milliseconds := l_seconds*1000 + l_minutes*60*1000 + l_hours*60*60*1000 + l_days*24*60*60*1000; --RETURN ' Milliseconds ' || l_milliseconds; l_milliseconds := (l_seconds - FLOOR(l_seconds) ) * 1000000 ; -- + l_minutes*60*1000 + l_hours*60*60*1000 + l_days*24*60*60*1000; --RETURN 'Days '|| l_days ||' Hours '|| l_hours||' Minutes '||l_minutes||' Seconds '||FLOOR(l_seconds)||' Milliseconds '|| l_milli...