Installing DB2 for Oracle dummies
Posted by Lonneke Dikmans late at night: April 20, 2006
I am working on a project where they use IBM tools at the client site: Websphere 5.1.8, DB2 and Eclipse. I already have a MySQL instance running, an Oracle 9 RDMBS and some version of SQL Server that came with Windows XP so I did not install DB2 on my laptop.
Of course it's a bad idea to develop an application on a different platform than the production platform, so inevitably, we ran into trouble. Specifically with datatypes. Some code would run fine on WAS with MySQL but as soon as we deployed it to the (AS400) DB2 environment the JDBC exceptions started flooding.
I decided to take the plunge (I am more an Oracle type of person) and install DB2 Personal Edition for Windows on my machine. This would make my machine more compatible with the production database, although there are differences between DB2 for Windows and DB2 for AS400. I anticipated a long download (I aborted the Websphere download after two hours), but after ten minutes the entire DB2 Personal Edition was downloaded to my machine. Next I unpacked the zipfile. Still everything went smoothly: if only it had stayed that way...
I was starting to think this might not be such a big deal after all.... wishful thinking: mistake number 1!
I double clicked the setup.exe and started clicking 'next' in the wizard. I assumed that leaving the defaults was the best way to go. Defaults are designed for people that don't know what they are doing, right? Assumptions: mistake number 2! The only thing I changed, was the option to start the database automatically.
When I finished the wizard, I shut down my PC and decided wait until the next morning to check what happened with the database.
When I logged on, I noticed to my surprise that a new user was present: 'db2admin'. I logged on with my own username and started the database.
Then I tried to access the database with the control center.
I got hit with the error message SQL1035N The database is currently in use. SQLSTATE=57019. The problems and possible solutions I found on the IBM website did not help at all. I tried a couple of things:
- I added my windows user to the group of DB2 ADMINISTRATORS
- I started and stopped the database
- I restarted my machine
- I waited (also one of the suggestions).
- I logged on as db2admin on my machine. I figured that maybe the database was in use by 'db2admin'. This did not help: when I launched the control center and tried to access anything, I got the same message
I was ready to give up. One of the other developers on the project tried to install DB2 on his machine. Because he heard me complain (I tend to 'think' aloud), he used his 'normal' windows account as administrator for the database. He managed to get the database up and running in no time. I don't like to be defeated by some tool, so tonight I started over: I deinstalled DB2, renamed my windows user so it does not contain any spaces (yes you can do that!), created a TOOLDB, lowered the memory use for the instance and clicked 'finish'.
The database started, and I could access it using the control center! I then created a new database (I needed to use 'standard' as type, other types still give me weird errors) and a new user. I then spend some time figuring out how to change the password. I finally came across this link: sqlzoo and decided I was done.
Tomorrow I am going to try to connect Websphere to this database. I hope this will be an easier exercise: my collegue already managed to do this. If I just follow his instructions noting can go wrong, right? Hmm, reading this I can see the two mistakes popping up again: assumptions and wishfull thinking. But then again, nothing would ever happen, if you give up before you even try!
To sum up: I still don't know exactly what caused the problem, but I learned a couple of interesting lessons:
- You can actually change your windows username, without having to change anything else.
- Don't use the default db2admin as the administrator when you use the personal edition for Windows
- Try to get a DB2 DBA or Expert sitting next to you, when you click your way though the wizard
Basically it is like installing an Oracle database: all you have to do is click 'next'. If it fails, you are in trouble and you need an expert. If it succeeds, you were lucky and (people think) you are the expert.
[tags]oracle,db2,database[/tags]
Filed under: Java
April 21st, 2006 at 10:32 am
[Trackback] Si vous avez eu quelques soucis lors d‘une installation d‘une base oracle sur votre machine, vous en aurez lors d‘une installation d‘une base DB2 . Dans le post Installling DB2 for Oracle dummy’s , l’auteur de l’ Inspiring…