Showing posts with label Windows Fix. Show all posts
Showing posts with label Windows Fix. Show all posts

Wednesday, December 16, 2009

Think Out of the Big Box

A bank customer of us was requesting helps to solve a sudden problem dealing with their IBM DWE server. Apparently from certain date onwards, all the processes executed within the DWE console were failed as shown in the following figure:



Interesting because there are few applications running in DWE and some of them already run for more then 2 years without any problems and now all of them failed at once?

Looking at the logs, obviously db2cmd.exe is throwing out a return code of 5 with exception code SQL1042C which means:



And oh shit, what the hell is the meaning of return code 5?

Tried to google, lookup IBM forums, contacted IBM Support and no one can tell me the definition of code 5?

The real fun is almost all other DB2/DWE components are running fine. db2cc, db2hc, db2start, db2stop, db2licm and many others I tried works. It seems like db2cmd.exe being cursed.

I did many other novel investigations. To name a few:

1. Rule out Windows environment variables
- Open up an instance of command prompt, clear off every environment variable.
- Run db2cmd.exe, still failed with the same error message.

2. Rule out Windows registry
- Open up regedit, throw away \HKEY_LOCAL_MACHINE\SOFTWARE\IBM and one under Current User(Of course, you backup it first)
- Run db2cmd.exe, still failed with the same error message.

3. Rule out corrupted files #1
- Copy db2cmd.exe and all the necessary dll files from my machine into the server.
- Open up command prompt, and point every thing to my new db2cmd.exe folder
- Run db2cmd.exe, still failed with the same error message.

4. Rule out corrupted files #2
- Reinstall DB2 Admin Client (Same FP)
- Run db2cmd.exe, still failed with the same error message.

5. Rule out corrupted files #3
- Reinstall DB2 everything (Latest FP)
- Run db2cmd.exe, still failed with the same error message.

6. Trace through AD GPO/Windows stuffs
- Use gpmc.msc, gpresult, gpedit.msc and many windows tools
- Trace into event viewers
- Look for suspicious items. Nothing found

7. Diagnosing DB2 #1
- Set DB2TEMPDIR to non-existing folder/folder where current user don't have security right to access/write
- db2cmd.exe normally will throw DB2CMD.EXE -> 0, Access denied message.
- Nope, still DB2CMD.EXE -> 5

8. Diagnosing DB2 #2
- Put DIAGLEVEL to 4, restart db2, run db2cmd.exe
- Nothing useful in db2diag.log

9. Diagnosing DB2 #3
- Use db2trc, turn it on, run db2cmd.exe, turn it off.
- Nothing useful.

10. Diagnosing DB2 #4
- Execute db2setcp and db2clpsetcp independently with success.

11. Diagnosing DB2 #5
- Fooling around using db2set, removing settings, changing value to bogus one and adding things.
- Still Error code 5 with db2cmd.exe

12. Finding what the heck is error code 5
- Open db2cmd.exe with notepad, look for any potential hints. Found a list of API used. Cross check API name with return code 5 using Google.
- Seems like return code 5 is usually associated with Access Denied error.

13. Finale
Google again "db2cmd.exe -> 5" +SQL1042C. Found one related post in a china forum. Apparently the fella who faces the problem is a student who was trying out DB2 for some homeworks or so. No solution from the post either.

Very interesting... What is the connection or similarity between a student machine in china and a production level server machine in Malaysia? Indeed, I found the answer to this question and yes, it solved the problem!

Any idea? :D




Thursday, June 26, 2008

Installing IBM RPM in Microsoft Windows Vista



The IBM RPM 7.1.1 documentation stated that you can install and use IBM RPM client in Microsoft Windows Vista. Is that really true? Yes and No.

No in the sense that the installation is not one step process. Some additional steps are needed to ensure all the necessary components are properly configured. Yes because I tried and the program seems working after the installation. Of course, maybe there will be some bugs I haven't discover yet. I will briefly describe the steps you need to perform.

There are 2 components (RPMBrokers.dll, RPMImpex.dll) to be registered for RPM Rich Client to work and 3 components (RPMBrokers.dll, RPMImpex.dll, RPMPlgin.ocx) for RPM Plugin.

Ok, the ONLY REAL installation in Vista is just the ActiveX component registration is troublesome. If you try to register these components manually after the RPM installation, most probably you will hit by a 0x80004005 error.

Note: The below are the steps I conducted to make the thing works, however I'm not sure whether some of it are mandatory.

The first thing you should do is to enable ActiveX Installer in Vista. You can do this by going to [Control Panel] > [Programs and Features] > [Turn Windows Feature On or Off]. Then from the list select [ActiveX Installer]. Click Ok to proceed.

Then you go to [Control Panel] > [Administrative Tool] > [Services] and turn the [ActiveX Installer] service on (Started).

And finally the real meat is here.

You need to remove the "cached" copy of the regsvr32.exe from Vista.

P/S: It might be helpful to restart your PC first.

Using Windows Explorer, go to C:\Windows\Prefetch, remove all the files where the names start with REGSVR32.

Next, you need to use the regsvr32.exe program shipped along with the IBM RPM. This file can be located in %RPM_INSTALLATION_FOLDER%, i.e. C:\Program Files\IBM\Rational Project Manager\regsvr32.exe. To do this, go to [All Programs] > [Accessories], right click on [Command Prompt] and select [Run as administrator]. After that you need to change directory to the RPM installation folder using command like [CD C:\PROGRAM FILES\IBM\RATIONAL PORTFOLIO MANAGER]. Try to execute the regsvr32. If you succeed, you shall get a message box on how to use it.

You can register the RPMBrokers.dll by typing the command [regsvr32 RPMBrokers.dll]. You will get a message indicating the registration was succeeded.

And before you continue to register the next one, you should perform the removal of REGSVR32 files from PREFETCH folder again.

You can register the RPMImpex.dll by typing the command [regsvr32 RPMImpex.dll]. You will get a message indicating the registration was succeeded.

Again, do the C:\Windows\PREFETCH\REGSVR32 clearing steps.

Lastly, You can register the RPMPlgin.ocx by typing the command [regsvr32 RPMPlgin.ocx]. You will get a message indicating the registration was succeeded.

Taa Daa, you should be able to run the IBM RPM client program now.

Good luck.



Top Blogs

Saturday, January 12, 2008

Terrible Networking Day

A day for damned networking

When I first turned on my home computer screen, the Bit Torrent client I'm using to do P2P stuffs strew up, application window hung. Most windows icons turned black without properly displaying the supposed images. Treated it like another "MS did it again" day, without hesitation, I pressed the restart button.

Things start to get ugly when Windows restarted. I was unable to connect to my Wifi access point. It keeps on showing the message "Waiting for the network..." blah blah and at the end I got my self an Automatic Private Address with limited connectivity.
Shoot, someone hacked my AP and changed the network key? ? ?

NOPE, I tried the same key on my laptop and it worked perfectly.

Reverted back to the normal Power On/Off cycle on AP and the Wifi client, nothing seems improving.

I've made a wrong step by changing some values in HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows NT/NetworkCards and this causes a big hassle when I next restarted the PC. Everything's strew up. DB2 was down, DHCP client was failed to start, and other applications which are relied on the TCPIP communication protocol stacks doesn't seem to like you anymore... jesus christ. And all this happened just because a simple change of value in the registry. Hahaha. Well done, MS.

Struggled for a few minutes, I decided to repair the TCPIP stack and also Winsock.
MS Knowledge Base got few articles that illustrate the steps for doing so, but basically it involves the following:

1. Log into Safe Mode
2. Delete the key HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/Winsock and
HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/Winsock
3. Edit the nettcpip.inf file in %SYSTEM_ROOT%\inf\nettcpip.inf, locate the below lines:

[MS_TCPIP.PrimaryInstall]
"Characteristics = 0xa0"......

And change the value 0xa0 to 0x80

4. Go into command prompt window, type "netsh winsock reset"

5. You can try also this command "netsh int ip reset resetlog.txt"

6. Restart your machine

7. Go to control panel -> Network Connections -> Right click on any of the connection that has TCPIP installed and check out the connection Properties

8. Click on Install button, then select Protocol from the available list. Then click on the Have Disk button, type in the "C:\windows\inf" in the "Copy manufacturer's file from:" text box. (Assuming your Windows is located at c:\windows). Lastly click ok.

9. Select Internet Protocol (TCP/IP) from the Network Protocol list. Click Ok.

10. When you return to the connection properties screen and this time if you select the Internet Protocol (TCP/IP), the Uninstall button is now enabled. Click on the Uninstall button.

11. This step is particularly important. You should wait for at least 10 minutes for the process to be completed. If you terminated your system now, the stack shall get corrupted and you will need to restart the above steps again.

12. Restart the machine

13. Now reinstall the TCPIP stack by performing the above step 7 to 12.

Lastly to ensure everything ok, do the power on/off cycle on the AP and your machine.

And this works for me finally, in the early morning of next day. Indeed a bad day.