Thursday, January 25, 2007

Dev : Installing Oracle 9i on Solaris 8

Whew... It's really a mess to install oracle in Unix machine. Lucky for me, I've found some steps online where it has reduce many white hair growing on my head.

It make me sweat when asking me to change the Solaris Kernel Parameters. After some troublesome findings, I finally manage to change the kernel parameters at /etc/system and manage to get the oracle 9i installed and database created. If not, you will always get oracle error complaining "Out Of Memory". Remember, it is the kernel parameters' fault. Not your RAM, not your SWAP (because I have increase my RAM from 512Mb to 1Gb and SWAP from 500Mb to 1.5 Gb :D ).

After installing and created a database, you need to create at least a user.
To create a user :
  1. Login SQL*Plus with sqlplus "/ as sysdba".
  2. In SQL*Plus, type sql > create user user_name identified by user_password;.
  3. Grant some access for the user.
    sql > grant connect to user_name;
    sql > grant resource to user_name;
    sql > grant create any snapshot to user_name;

After that, to access oracle from other workstation, you should start the oracle process first.

  1. In console, type cd /oracle/home/bin/.
  2. To start the oracle process, in console, type ./lsnrctl start.
  3. To start the database, in console, type ./dbstart.

And there you go! The very basic of oracle. :)

Wednesday, January 17, 2007

Dev : Swap for Solaris

How do we add extra swap space in Solaris version 5.x? For the ease of most users, follow the steps as below...

1. Log in console as root.
2. In console, type root: /usr > df -k to see the available space and the available swap by typing root: /usr > swap -l in console.
3. Locate a suitable location, create a file for swapping. Eg, to create an empty 1 Gb file call swapfile: root: /usr > mkfile 1g swapfile
4. Add the swapfile to the swap. Eg: root: /usr > swap -a /usr/swapfile (must use absolute path)
5. Edit the /etc/vfstab, add in a new line call /usr/swapfile - - swap - no - to enable the swap file at the next boot.
6. Check your swap again by by typing root: /usr > swap -l in console. You will find that there is a new swap available and you are ready to use it. :)

Monday, December 18, 2006

Dev : CVS vs VSS

Virtual Source Safe (a.k.a. VSS) and Concurrent Versions System (a.k.a. CVS), which one you prefer?

In general, VSS will lock a file for a user, and this will make sure no one will use the file until the current user checks it in. In the downside, when a user checked out the file for a long time, this means that other user have to wait for a long time too if they wanted to use it.

There are more comparisons we can get online, this is one of them.

Friday, December 15, 2006

ORA-00911: invalid character

ORA-00911: invalid character, I've been seeing this error message for 2 long, headache days. What is wrong with my SQL coding?

At first, I thought it was the values that I have inserted were wrong. After much checking, I decided to print out the whole query, copy it and put it into the Oracle SQL client to see what is fxxking wrong.

Test and test and test and retest. No! My query is totally correct to me, but it keep saying that I am wrong, even using Oracle SQL client! So my last resort for this is to remove each of the character in the query one by one. And there is it, the stupid ";" (semicolon) at the end of the query which cause all the misery!

Wednesday, December 13, 2006

Error: Object doesn't support this property or method

I was wondering for quite a while when I hit a javascript error. It stated "Error: Object doesn't support this property or method". The error was in this function, the line which has the word action:

function InsertRecord(){

var myForm = document.form1;

myForm.action="xxxxxxxxxxxx";
myForm.submit();
}

Lucky for me, my sifu, Steven, helped me out on this. My problem was actually a simple and silly error. What I done wrong was:

<button name="action" value="Attachment">

I have actually define one of my button in the form with the name of "action". After changing the name to a more meaningful one, it works once again. :-)

Tuesday, November 28, 2006

Signal Before You Turn

This morning while I was having my breakfast near a market area, out of a sudden, "bang~~crrraaanggg....". A motorcycle hit a car at the side! Luckily, the motocyclist and his pillion rider was not hurt bad. A few bruises thats all.

The point I am saying this is because nowadays, car signal had become useless to many drivers. They don't even bother to use it. Not until anything had happen. Some drivers are even smarter. They switch it on while turning, not before.

I felt sorry for the poor motorcyclist as I have experience the same thing before. For my case, a try to negotiate the driver to pay for my motorcycle maintenance, and if he would not do it, then I will file a police report on him. But later on, he tried to threaten me with my "Professional" sticker on my bike. He say if I were to report, I will have trouble with getting a valid licence. I quickly answer that the "P" was not mine as I have gotten my valid licence years ago. Only then, he agreed to pay me. Whew.... I was actually quite scared because it was 2 people against me. None of the busybodies who witness the incident stopped to help.

Friday, November 24, 2006

Not Clever Enough

Have you ever use Oracle's Exp to backup a user? It will ask you to specify file name, export grant, yadda, yadda, yadda....

Just right before the end, Exp will once again request the user to enter the user name or press return to exit. Normally, if we were to backup a user call "sample_database", we will type "sample_database" at the end and when Exp request user once again, we will just hit the return key to start a process.

But... have you tried to enter the same user twice? Oracle's Exp will just cleverly export the user twice, making the size of export double as well.

Monday, November 20, 2006

Same Name, Same Directory?

Today when I was checking on some system log files, I came across with one unexplainable phenomenon. There are 2 files with the same name in the same directory!


This image had not been edited or photoshoped or what so ever. This is captured from a telnet terminal. It is running on Solaris 10. Anyone has any idea what is happening?

Wednesday, November 08, 2006

Five Square Boxes At The Lower Right Of Internet Explorer

Have you all notice there are 5 small square boxes at the lower right of Internet Explorer? Any idea what is that for? I have tried double clicked it, and yes, it does response. HA~~~

Nothing for the first box. Second box will allow to toggle and configure the pop-up blocker. Third box will allow you to manage your IE add-on. What is IE add-on you may ask. IE add-on is some program that is installed to run together with your IE. Such as google toolbar, Yahoo toolbar, Microsoft Developer toolbar and many more.

The forth box does not seems to appear anything. Last but not least, the fifth box shows you the security certificates for a secure website, if there is any.

p/s: These elaboration is from my own understanding. If you have more ideas on it, please leave a comment for me.

Monday, November 06, 2006

ORA-01441: cannot decrease column length because some value is too big

One day when you suddenly found that a field in a table that you have inserted eons ago to Oracle is too large. You wanted varchar2(10), but you accidentally set it to varchar2(100). So with data in it, you wanted to alter the table's structure so that the field is decreased to varchar2(10) only.

To our cleverity, we started to use the alter command. "ALTER table_name MODIFY field_too_long VARCHAR2(10);". But guess what? Oracle will immediately complaint "ORA-01441: cannot decrease column length because some value is too big".

After some finding on the Net, only I realized that not only in Oracle, even DB2 also face the same problem, you can alway increase but not decrease a field length. MSSQL2000 is able to let the user to decrease it field length, as long as the existing data is shorter or the same with the new length.

Actually, from my point of view there are 2 turnarounds for this problem,
1) Either you export everything out, modify the script, remove the original database and import everything in.
2) Or, change the field to an "allow null" field, export the field data out, remove everything in the field to null, alter the table, import all the field data in and set it to "not null" again. "NULL" field does not hold any restriction, if all the values is null, you can even change to other datatype, as long there is no constrain.