Installing Oracle 10g Express edition in Mandriva 2009

Hi,

This is to share the screenshot of the oracle installation in my mandriva 2009 (Free). The installation is very simple. Download the oracle installation jar from oracle.com. It has only one dependency, considering mandriva 2009, which is libaio.jar. See whether it is coming with Mandriva, or else download from the web. thats it. then install the RPMs.

Once RPMs are installed, database need to be configured. Issue the following command to configure the database.

/etc/init.d/oracle-xe configure

This will take you to a text wizard asking the system username, password etc and complete your installation process. See the screenshot below.

Oracle installation screenshot

Thats all!

Try to login to your oracle server with the web interface
http://localhost:8080/apex
ofcourse you have the option to change the port also.

oracle web interface

happy dbing!

Advertisements

Oracle listener configuration after changing machine name

I was not able to start my oracle instance today. The start and stop server scripts dint show any error, instead they said server started/stopped without any problem. Windows System event log had a error entry saying “The OracleXETNSListener service terminated unexpectedly. It has done this 8 time(s).”Oracle listener issue screenshotwhen I run lsnrctl start I found the issue.D:Documents and Settingspandian> lsnrctl startLSNRCTL for 32-bit Windows: Version 10.2.0.1.0 - Production on 23-NOV-2008 01:08:40Copyright (c) 1991, 2005, Oracle. All rights reserved.Starting tnslsnr: please wait...TNSLSNR for 32-bit Windows: Version 10.2.0.1.0 - ProductionSystem parameter file is D:oraclexeapporacleproduct10.2.0servernetworkadminlistener.oraLog messages written to D:oraclexeapporacleproduct10.2.0servernetworkloglistener.logListening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\.pipeEXTPROC_FOR_XEipc)))Error listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=acs-59abc34f442)(PORT=1521)))TNS-12545: Connect failed because target host or object does not existTNS-12560: TNS:protocol adapter errorTNS-00515: Connect failed because target host or object does not exist32-bit Windows Error: 1001: Unknown errorListener failed to start. See the error message(s) above...There is the issue. I renamed my host name. So listener is not able to start. I edited the listener.ora found at oraclexeapporacleproduct10.2.0serverNETWORKADMIN folder. I changed the host to localhost. It is working now! 🙂

Oracle 10g Express edition

DB legends are releasing their edition as a miniature, previously MS-SQL came with their own mini server. MySQL is always small doing great jobs. and Here I am giving Oracle 10g Express edition. It is cool, very easy to install and get it running. Add to its great things, It offers a cool web interface (see the screenshot below), like Linux admin tools :). Oracle says it is free to develop, deploy, and distribute. Those who are interested can get their copies at

http://www.oracle.com/technology/products/database/xe/index.html

Oracle web admin screenshot

auto increment in oracle

This post is regarding auto increment in oracle. Usually I used to add AUTO_INCREMENT flag in mysql. But it is not a single word task oracle. we need to create sequence and trigger to do the same. please see the following examples 1. Here is my table structure.

CREATE TABLE FEED_DETAIL
(
FEED_ID NUMBER(6, 0),
FEED_TEXT VARCHAR2(128 BYTE),
FEED_TITLE VARCHAR2(128 BYTE),
FEED_TYPE VARCHAR2(12 BYTE),
XML_URL VARCHAR2(128 BYTE),
HTML_URL VARCHAR2(128 BYTE)
)
2. lets play with FEED_ID now. lets make it auto increment. create a sequence now

create sequence FEED_DETAIL_SEQUENCE
start with 1
increment by 1
nomaxvalue;

A sequence is an object in Oracle that is used to generate a number sequence. This can be useful when you need to create a unique number to act as a primary key.

3. Now create a trigger. A database trigger is procedural code that is automatically executed in response to certain events on a particular table in a database. Triggers can restrict access to specific data, perform logging, or audit data modifications.

create or replace trigger FEED_DETAIL_TRIGGER
before insert on FEED_DETAIL
for each row
begin
select FEED_DETAIL_SEQUENCE.nextval into :new.feed_id from dual;
end;

Now insert the values

insert into feed_detail (feed_text, feed_title, feed_type, xml_url, html_url) values('a', 'b', 'c', 'd', 'e');
insert into feed_detail (feed_text, feed_title, feed_type, xml_url, html_url) values('a', 'b', 'c', 'd', 'e');

Enjoy auto incrementing column now!

java.sql.SQLException: ORA-01000: maximum open cursors exceeded

As I have told you in my previous post, I was trying to read from a table within a loop. I am opening a new connection, new statement and firing the query to get the resultset. It was working fine for a few records, finally it dies with this exception

java.sql.SQLException: ORA-01000: maximum open cursors exceeded

Alas, I forgot to close the resultset!!

ORA-12519, TNS:no appropriate service handler found

I dint write for two weeks. I could not sit in these weekends. so, there are much more error messages left behind my desk. here is the situation. I am doing multiple reads from database. I am opening a connection, creating a statement, and executing a query to get resultset. it was working fine, but when loop goes beyond 100, I got the following error.

java.sql.SQLException: Listener refused the connection with the following error:
ORA-12519, TNS:no appropriate service handler found
The Connection descriptor used by the client was:
152.200.100.5:1521:PANDIAN

I think, the problem is with connection leak. connection or resultset somethign is not closed properly. I removed the connection opening part and replaced with connection pool. Now it is working fine!

java.lang.UnsatisfiedLinkError: no ojdbc14 in java.library.path

This month I am logging only the errors 😦 I am setting up a backup of a working application, where I came across the previous errors. Here is another one.

java.lang.UnsatisfiedLinkError: no ojdbc14 in java.library.path

Let me tell you the environment,

I have the application, whose lib folder contains class12.jar and ojdbc14.jar. Both the jars are in classpath, then I replaced this ojdbc14.jar of the application with the ojdbc14.jar from the local oracle installation folder. That doesnt solve the issue, later i need to replace classes12.jar also. That application lib folder files are working fine for Oracle 9i. but not for 10g. So, this is basically a version incompatibility.