DB2 Commands: db2licm
Managing DB2 licenses isn’t exactly the glory work of DB2. It’s not fun, and the only scenario you might come out of messing with them with Kudos is if you’re dealing with an expired Try&Buy license – and then only if it’s someone else’s fault there was a Try&Buy in the first place.
Licensing as a whole can be confusing, and even trying to get a straight answer out of IBM on some things can be difficult. So I’m not going to cover the “how much” or “with what” types of questions here. This is just a simple “I have a license file, what do I do with it?” type article – with a few tips for licensing file problems I’ve seen at the end.
DB2’s handling of licenses always seemed a bit easier to me than some software products’. You don’t have to type some long string in or anything, you just have to have the right file.
You can actually install full-on DB2 ESE from the FixPacks that anyone can download from the Web. However, if you do it that way, you’ll end up with a 60 or 90 day Try&Buy license, and when that time period is up, DB2 stops working.
If you download your fully licensed code from Passport Advantage, then it doesn’t usually automatically include the license file – the license file is usually a separate download. However, the code shows “License not registered”, and will never stop working via an expiration. Once when on the phone with support they seemed surprised that I even cared about getting the license file applied when it was in this state. So maybe IBM doesn’t care if you leave it this way, as long as your paperwork and payments are in order.
If you are an IBM Partner and download your code from PartnerWorld, it comes in that same “License not registered” state, but you cannot get a real full license file that way – you have to get it from Passport Advantage.
How to check your license status
You can check the status of your license files and server license status using the db2licm command:
> db2licm -l Product name: "DB2 Enterprise Server Edition" License type: "License not registered" Expiry date: "License not registered" Product identifier: "db2ese" Version information: "9.7"
In this installation, you can see I’ve got it in that permanent state where it won’t expire, but it doesn’t have my license file applied either.
How to Add a License File
First, you have to get the license file from your install media or Passport Advantage, and place it on your server. If you’re using WebSphere Commerce, it’s a fully separate (very small) download, and may indicate in the name that it’s a “Restricted” license, because your DB2 license is only for use with WebSphere Commerce.
The file name varies depending on whether it’s a full license or a restricted one like what comes with WebSphere Commerce. It used to just be db2ese.lic – but that is now what gets you “License not registered”, I think. The restricted one that I use is db2ese_o.lic.
We use the same command with different arguments to add a license file:
> db2licm -a ./db2ese_o.lic LIC1402I License added successfully. LIC1426I This product is now licensed for use as outlined in your License Agreement. USE OF THE PRODUCT CONSTITUTES ACCEPTANCE OF THE TERMS OF THE IBM LICENSE AGREEMENT, LOCATED IN THE FOLLOWING DIRECTORY: "/opt/IBM/db2/V9.7/license/en_US.iso88591"
And always immediately check to make sure the license information is updated. I’ve had license issues before where it didn’t say there was a problem, but it also didn’t apply the license properly.
> db2licm -l Product name: "DB2 Enterprise Server Edition" License type: "Restricted" Expiry date: "Permanent" Product identifier: "db2ese" Version information: "9.7"
When License Files Go Wrong
It is pretty rare to have a problem with this process, but I’ve seen it a couple of times. the first thing to never do is to never recursively change owners or permissions on db2 files. I’ve seen someone change the owner of /opt/IBM/db2/V9.7/license/nodelock before and have issues because of that.
Being aware of /opt/IBM/db2/V9.7/license/nodelock is important. Just last year, I had an issue where this file appeared to have some corruption, and every time I went to add the license, I got:
LIC1416N The license could not be added to the nodelock file automatically. The return code is "-110".
There were a number of things I tried, but with support’s help, what finally worked was to make a backup copy of /opt/IBM/db2/V9.7/license/nodelock and then just delete it entirely and run the db2licm -a command again. It only worked for me because I have a pretty simple ESE-only license setup.
Another thing to try if you’re having issues adding a license file is to simply re-down/upload the file – it could be a simple file transfer issue.
Has anyone else had pain points with managing or adding license files?