Quantcast
Channel: Build – db2commerce.com
Viewing all 43 articles
Browse latest View live

Commerce 7.0 Build: IBM DB2 Universal Database may not be installed

$
0
0

This was a new one to me, and it took some time of some top level experts to find the tech note on it, so I thought I’d post it here so others can hopefully find it more easily.

The scenario was a new install of Commerce with experienced client DBAs doing the DB2 install, instance creation, and database creation, including installing the DB2 client on the app servers (3 tier environment). I’m used to doing all of the DB2 work myself.

On the prerequisite checking done by Commerce (on install, not instance creation), it returned an error:

Thu Apr 21 11:45:22 EDT 2011 com.ibm.commerce.install.wizard.panel.CustomInstallPathPanel.validate(), IBM DB2 Universal
 Database path = /usr/IBM/db2/V9.5
 Thu Apr 21 11:45:22 EDT 2011 com.ibm.commerce.install.wizard.panel.CustomInstallPathPanel.validateDB2(), DB2 should be installed
 Thu Apr 21 11:45:22 EDT 2011 com.ibm.commerce.install.wizard.panel.CustomInstallPathPanel.validate(), Path for IBM DB2 Universal Database does not contain a valid install
 Thu Apr 21 11:45:22 EDT 2011 com.ibm.commerce.install.wizard.panel.CustomInstallPathPanel.execute(), Exiting with exit code 407

And/Or

Message Text: CWXAI7757W: The following silent install warning occured:
 The required IBM DB2 Universal Database may not be installed.
 If you want to use a local database with WebSphere Commerce, ensure that IBM DB2 Universal Database Enterprise Server Ed
 ition version 9.5.0.4 is installed on this machine before continuing.
 If you want to use a remote database with WebSphere Commerce, ensure that IBM DB2 Universal Database Administration Clie
 nt is installed on this machine before continuing.
 Check the install documentation for further details.
Message Text: CWXAI7756E: The following silent install error (407) occured:
 The specified location of IBM DB2 Universal Database does not appear to contain a valid installation.
 Check the install documentation for further details.

And the frustrating thing was that we had DB2 9.7 installed just fine. BUT the client had not installed the Data Server Client on the app servers – they had installed the RUNTIME Data Server Client on the app servers. I always do the Data Server Client. After some creative googling (it didn’t come up with the first few searches), I found this technote:

https://www-304.ibm.com/support/docview.wss?uid=swg21461522

The simple solution was to uninstall the runtime client and then install the full Data Server Client on the application server. At one point I was mislead into thinking that Commerce was looking for the 9.5 db2 instead of 9.7, but that was not the root issue.


DB2 Clients

$
0
0

So there are a few topics I wanted to cover relating to DB2 clients and how Commerce uses them.

Type 2 vs. Type 4 drivers

So strictly speaking, this is referring to the JDBC driver being used. Type 2 JDBC drivers are the traditional kind that require having a DB2 client installed, and the databases properly cataloged within that DB2 client. Type 4 JDBC drivers allow an application to connect without the use of a DB2 client – simply using a JDBC url. Commerce 6 used type 2 drivers by default, and Commerce 7 uses type 4 by default. However, that is only for normal application traffic. Utilities like stagingcopy or stagingprop or dbclean or others may or may not be able to use the type 4 drivers – some of them may require that you have the client available so they can use type 2 drivers. Interestingly enough, Commerce also requires the type 2 drivers during Commerce Instance Creation, so you’ll have to have them there in each environment during build anyway.

Because of this, you’ll still need to install a db2 client on at least one application server, and frequently at least one application server in each environment (prod, stage, qa, dev, test, authoring – whatever you call them)

Runtime vs. Admin client

Just to keep us on our toes, IBM changes terminology from time to time. Between db2 version 8 and 9, they changed the client terminology. On DB2 version 8, we installed the “Administration Client”. On DB2 9, the same thing is called “IBM Data Server Client”.

Commerce needs the full IBM Data Server Client. There’s something called the Runtime client or IBM Data Server Runtime client – this does not work for Commerce. You must have the full one installed, not the runtime one. The runtime is a smaller footprint that is designed for vendors to include in their own code, essentially.

Fix Packs

As well as changing the terminology, they also change how you spell Fix Pack. Is it FixPak or FixPack or Fix Pack now? I don’t honestly know. Whatever you call it, you can use the same “Universal” Fix Pack to patch both the clients and the servers. That’s my preference, to have the Universal Fix Pack code on my build server, NFS mount it to my clients and servers, and patch them all from that source. I have heard you can also use the individual client code to apply a Fix Pack, but in all honesty, have never tried it myself.

I always patch my Clients when I do my Servers – this is not strictly required. The old rule was “Two down, one up” – meaning that for full version changes, you could connect to the previous two full version changes and to the next one full version up at a minimum. That changed a bit with DB2 version 8, so you may have to look closely, but I have never seen nor heard of an issue caused by a client on a different Fix Pack of the same version of the Servers it connects to. If I don’t patch them all at the same time, then I might forget the client – since it make so little difference, and it’s so infrequent that I have to do anything at all with a client.

How to Download DB2 FixPacks via FTP

$
0
0

Just a simple post here, but you used to be able to fairly easily find the link for FTPing Fix Packs. Since I work from home, downloading and then uploading code is rather slow. If I can manage to go directly to the target server, I can save literally hours.

With the introduction of “Fix Central”, DB2 Fix Packs are no longer stored in the standard locations on ftp.software.ibm.com. So you now must first use your laptop/desktop/some computer with a browser to get a temporary FTP location, and then use wherever you want to FTP to (which can be a Linux/AIX server) to access that temporary location. Details on how to do this are here:

WebSphere Commerce Instance Creation Doesn’t Like DB2 9.7 FixPack 5

$
0
0

This post is specific to WebSphere Commerce. We spent a fair amount of time on this, both on a SUSE server and a Red Hat Server. The problem manifested in different ways. The main thing that became obvious to me is that Commerce was not creating the Commerce database as the dbaUser specified in createInstance.properties file, but was instead using the id that was running the Commerce Instance creation. While one workaround is simply to allow this to happen, and grant dbadm and secadm to the user you wanted in the first place later, we were on the first server of at least 4 in a build and wanted to have a reproducible process.

Error Messages Encountered

So you’ll get different error messages at different stages depending on how you’ve set up ids. You should always have a different dbaUser from the main Commerce user. And likely you’ll be using yet a third id to run the instance creation. If you’re mingling ids you may not run into problems here at all, but mingling ids is bad for a number of reasons, not the least of which is security and PCI. If the id you’re using to run the Commerce instance creation is not in the SYSADM group defined in db2’s dbm cfg, you’ll see an error message that references the id that you’re using for commerce instance creation not having authority to create the database. I’m sorry that I don’t have the exact syntax for that – if anyone else does, please comment with it, and I’ll update the post with it.

If you don’t catch this during instance creation, you’ll later see this when you  try to use the id you thought was DBADM to do something:

Error perform operation "SELECT" on object "WSCOMUSR.STGMERTAB".  SQLSTATE=42501
:
SQL0551N  "DB2INST1" does not have the required authorization or privilege to
Error perform operation "SELECT" on object "WSCOMUSR.STGSITETAB".  SQLSTATE=42501
:
SQL0551N  "DB2INST1" does not have the required authorization or privilege to

 

IBM’s Tech Note on This Issue

So I’m not entirely sure that this Tech Note is the same issue, but it’s what first gave me the idea that it might be DB2 9.7 FixPack 5. We had plenty of 9.7 installs with no issues on earlier FixPacks of 9.7.

https://www-304.ibm.com/support/docview.wss?uid=swg21572427

Resolving This Issue

So the fix for us was simply to do Commerce instance creation on 9.7 Fixpack 4, and we were able to successfully apply DB2 9.7 FixPack 5 afterwards with no ill effects.

Communicating with IBM will be important if you run into this one. I’m not sure we’ve managed to convince WebSphere Commerce Support of the importance on this one yet.

 

Update February 9, 2012: Commerce support has confirmed the issue we saw was NOT directly related to the Tech Note above. Still waiting to see if they point us to another issue or give us an APAR or what.

db2val – Validating your Install

$
0
0

I’m constantly discovering new features. You’d think at this point that I’d know the contents of the /opt/IBM/db2/V9.7/bin directory by heart. Especially since I intentionally went through everything in there when deciding on one of the topics for the db2Night Show’s DB2’s Got Talent competition. But today when dealing with a borked database, I found a new one.

What is db2val

db2val is new in DB2 9.7, and requires root or SYSADM plus instance owner.

db2val is a tool for validating your database environment and installation. In my mind, there are three different levels that you can perform validation at – the installation, the instance, and the database levels. db2val allows you check at each of these levels. Honestly, until today, I might have dismissed the need for such a tool. In my experience problems with validity are pretty rare, and easily resolved by re installing or re-creating the instance or database. Today we were having onion problems with a new install. There were layers of problems and they were stinky ones. After getting rid of the silly outer layers, we reduced it to the dreaded SQL1042C (on db2start). Normally, this error requires a db2iupdt to resolve, but in this case, db2iupdt did not do the trick.

Some Examples

Since this was on install/build, normally at this point, we would have uninstalled and reinstalled. Not a big deal, but takes a bit of time. We were able to verify that the product files themselves were OK using db2val:

> db2val -o
DBI1379I  The db2val command is running. This can take several minutes.

DBI1335I  Installation file validation for the DB2 copy installed at
      /opt/IBM/db2/V9.7 was successful.

DBI1343I  The db2val command completed successfully. For details, see
      the log file /tmp/db2val-05_29_18:08:46.log.

 

Since we had this confirmation, we dropped and re-created just the db2 instance (using db2idrop/db2icrt), and things worked as expected afterwards.

Playing around a bit with db2val, I can see the three levels at which it works.

> db2val -b sample
DBI1379I  The db2val command is running. This can take several minutes.

DBI1335I  Installation file validation for the DB2 copy installed at
      /opt/IBM/db2/V9.7 was successful.

DBI1339I  The instance validation for the instance db2inst1 was
      successful.

DBI1340I  Database validation for instance db2inst1 was
      successful.

DBI1343I  The db2val command completed successfully. For details, see
      the log file /tmp/db2val-05_29_18:21:46.log.

I do find it interesting that it still reports successful, even if the database name you supply does not exist (though the database vaildation line with DBI1340I above is not part of the output). However, if the database name you pass it is hosed in some way, then it will report an error, though it does appear the database level errors are a bit more general than the instance-level ones. The following output is from a database where the database returned SQL1035 on any attempt to connect, though the instance and installation were just fine:

> db2val -b D01
DBI1379I  The db2val command is running. This can take several minutes.

DBI1335I  Installation file validation for the DB2 copy installed at
      /opt/IBM/db2/V9.7 was successful.

DBI1339I  The instance validation for the instance db2inst1 was
      successful.

DBI1350E  The database validation failed for the instance
      db2inst1. Reason code=2.

Explanation:

Database validation failed because of one of the following reasons:

1. Database creation failed because of system errors.
2. Database connection failed because of system errors.
3. An unexpected internal error occurred.

User response:

Check the log file for details, or rerun the db2val command. If this
error persists, contact your IBM service representative.

DBI1343I  The db2val command completed successfully. For details, see
      the log file /tmp/db2val-05_29_16:31:12.log.

It sounds like they’re intending this for scenarios where you’re copying db2 stuff manually, which I find I have more and more reasons to do. But at the same time, it has some useful properties for normal installs that get borked in some way. The developer works article linked to in the “References” section below does a good job of showing a number of scenarios.

References

Info Center entry on db2val: http://publib.boulder.ibm.com/infocenter/db2luw/v9r7/topic/com.ibm.db2.luw.admin.cmd.doc/doc/r0053565.html

Developer Works article on db2val: http://www.ibm.com/developerworks/data/library/techarticle/dm-1107db2valtool/index.html?ca=drs-

Installing DB2 Using a Response File

$
0
0

Some friends on Twitter were commenting that db2_install is not just deprecated in DB2 10, but is fully discontinued and not available. Melanie Stopfer mentioned this on her webcast on June 22. I do dozens of installs a year, and most of them are using a response file. The same response file, actually, since a standard starting point makes sense at that level for WebSphere Commerce installs. Still, I created the file myself.

If you’re not familiar with db2_install, it was a command line script that seemed to work when other install methods failed, and just did the most basic tasks of getting DB2 code installed on a system.

What is a Response File?

A response file is simply a text (ASCII) file that you use to provide inputs to db2setup instead of providing inputs via GUI. Most DBAs I know are command line geeks like me and tend to avoid GUIs. I have actually set up Xwindows and done a GUI install on a Linux system, but as we say where I work, my X-fu is not strong. I haven’t done it in years.

And honestly, why would I? I install enough very similar servers every year that response files make sense for me. I have used db2_install in the last 18 months, so I definitely see the use case for it, but I can survive without it.

A response file actually goes a bit beyond what you do with db2_install. It will acutally let you create instances and databases and set most instance and database level settings at the same time. When I personally do an install myself, I tend to keep things separate – I do the db2_install first, then go out and create instances, and then databases. You don’t have to do any of the extra work with the response file – you can use it for strictly the task of installing DB2. In our normal scripted installs, I use the response file to install DB2, create an instance, and set some of the most common instance level settings.

When to Use a Response File

The perfect use case for a response file is when you do multiple similar installs. It makes it very easy to script installs too. But a response file can really be used for any install. It’s perfect for use when you don’t want to or cannot use a GUI. If you’re scripting an install, the response file is the only way to go.

Where to get a Response File

To get a response file, there are two main methods:

  1. Do a gui install using db2setup and click the box to create a response file
  2. Pull the sample file from the installation media and edit it manually

Surprise, surprise, I’m actually a fan of the second. Either one will work, but since I avoid GUIs, the last time I actually used the db2setup GUI was about 3 years ago for a windows install.

Response files can change between versions of DB2 and between operating systems (though I find the same file seems to work across various Linux and UNIX distributions). You can find the sample file on your installation media under db2/<platform>/samples. That’s right, it’s not in your installed code, so you cannot just grab one from another server, you have to go to your downloaded installation media or your DVD.

Response files are finicky on syntax, and don’t always give the best error messages. That is the most difficult part about them. If you’re like me and can’t seem to write a 20-line script that runs right on the first execution, you may have to try several times to get the install to run with an response file. If a client is running an install, I prefer to only hand them a tested and proven response file for this reason.

What does a response file look like?

Here’s essentially the one that I use most frequently(some names may have been changed to protect the innocent – I don’t actually recommend some of the settings like /home for an instance home):

** Response File for ESE
**  Also creates and starts db2 instance and makes entry in /etc/services
**  Configures all required instance-level parameters except SYSMON_GROUP, which must still be set manually
**  Additional DB2 work is still required after Commerce instance creation
PROD                      = ENTERPRISE_SERVER_EDITION
FILE                      = /opt/IBM/db2/V9.7
LIC_AGREEMENT             = ACCEPT         ** ACCEPT or DECLINE
INSTALL_TYPE              = TYPICAL         ** TYPICAL, COMPACT, CUSTOM
INSTALL_TSAMP            = YES             ** YES or NO. Valid for root install only
INSTANCE                  = db2inst1
db2inst1.NAME             = db2inst1        ** real name of the instance
db2inst1.GROUP_NAME       = db2grp        ** char(30) no spaces
db2inst1.HOME_DIRECTORY   = /home/db2inst1                ** char(64) no spaces. Valid for root install only
db2inst1.AUTOSTART        = YES             ** YES or NO
db2inst1.START_DURING_INSTALL = NO         ** YES or NO
db2inst1.SVCENAME        = db2c_db2inst1   ** BLANK or char(14). Reserved for root install only
db2inst1.PORT_NUMBER     = 50000           ** 1024 - 65535, Reserved for root install only
db2inst1.TYPE            = ESE             ** ESE WSE STANDALONE CLIENT
db2inst1.AUTHENTICATION  = SERVER          ** CLIENT, SERVER, or SERVER_ENCRYPT
db2inst1.FENCED_USERNAME  = db2fenc        ** char(8)  no spaces, no upper case letters
db2inst1.FENCED_GROUP_NAME = db2fgrp       ** char(30)  no spaces
db2inst1.FENCED_HOME_DIRECTORY = /home/db2fenc          ** char(64) no spaces
db2inst1.DFTDBPATH       = /data                ** any valid path
db2inst1.DFT_MON_BUFPOOL = ON                 ** ON or OFF
db2inst1.DFT_MON_LOCK    = ON                 ** ON or OFF
db2inst1.DFT_MON_SORT    = ON                 ** ON or OFF
db2inst1.DFT_MON_STMT    = ON                 ** ON or OFF
db2inst1.DFT_MON_TABLE   = ON                 ** ON or OFF
db2inst1.DFT_MON_UOW     = ON                 ** ON or OFF
db2inst1.DFT_MON_TIMESTAMP = ON               ** ON or OFF
db2inst1.HEALTH_MON      = OFF
db2inst1.DIAGPATH        = /diag                ** BLANK or char(215)
db2inst1.INSTANCE_MEMORY = AUTOMATIC       ** AUTOMATIC or a number in range [0, 1000000] for 32-bit and [0, 68719476736] for 64-bit
db2inst1.HEALTH_MON      = OFF                ** default is ON; ON or OFF
db2inst1.SHEAPTHRES      = 50000                ** 250 - 2097152
db2inst1.SPM_NAME        = NULL                ** BLANK or char(8)
db2inst1.SYSADM_GROUP    = db2adm                 ** BLANK or char(30)
db2inst1.DB2BIDI         = ON                 ** BLANK, 0, 1, YES, NO, ON, OFF, Y, N, TRUE, FALSE, T or F
db2inst1.DB2_PARALLEL_IO = *                 ** BLANK, * or 0-4095,0-4095,...
db2inst1.DB2_INLIST_TO_NLJN = YES              ** BLANK or YES, NO
db2inst1.DB2_USE_ALTERNATE_PAGE_CLEANING = ON ** BLANK or ON, OFF
db2inst1.DB2_WORKLOAD    = WC         ** BLANK, SAP
db2inst1.DB2COMM                 = TCPIP
DAS_USERNAME             = dasusr                 ** char(8)  no spaces, no upper case letters
DAS_GROUP_NAME           = dasgrp                 ** char(30)  no spaces

I discovered the hard way that at least for 9.7 FixPack 3 and before, you cannot set the SYSMON group in the response file. It may have changed, I haven’t tried it on FixPacks 4 or 5 because I have additional scripting that makes it easy for me to set parameters manually while I’m doing some other database level set up work. There may be other random settings like that missing.

Note that most of the parameters are prefixed with the instance name – one thing that does is make it so I could create multiple instances using a single response file, and have differing settings for them.

Comments in this file are done by using a double asterix (**), and many of the comments that I’ve left in here are ones that come with the sample file, reminding us of ranges and so forth.

I think you could get by with just the following minimal settings:

  • PROD
  • FILE
  • LIC_AGREEMENT
  • INSTALL_TYPE
  • INSTALL_TSAMP

But you would have to test it before relying on that advice, and you would also have to do the basics like setting DB2COMM and SVCENAME manually

How to use the response file

This is truly the easy part. To use a response file, all you have to do is execute db2setup as you normally would, but add the -r flag and specify the full path to the response file. Obviously you’re running it as root. It looks something like this:

# ./db2setup -r /downloads/scripts/response_files/my_db2ese_9_7.rsp

Anything I’m missing here? anything else you’d like to know about installing DB2 using a response file?

References

Good developerWorks Article on response files:http://www.ibm.com/developerworks/data/library/techarticle/0302gao/0302gao.html
Info Center entry on response file considerations (links to other good info center entries on response files): http://publib.boulder.ibm.com/infocenter/db2luw/v9r7/topic/com.ibm.db2.luw.qb.server.doc/doc/c0007502.html
Info Center entry on response file keywords: http://publib.boulder.ibm.com/infocenter/db2luw/v9r7/topic/com.ibm.db2.luw.qb.server.doc/doc/r0007505.html

DBI1306N when trying to use db2set

$
0
0

This was a new one for me, so I thought I’d write up a quick blog entry on it. After creating a new instance and a new database, and even after executing one db2set command successfully, I got this:

>  db2set DB2_CAPTURE_LOCKTIMEOUT=YES

DBI1306N  The instance profile is not defined.

Explanation:

The instance is not defined in the target machine registry.

User response:

Specify an existing instance name or create the required instance.

On googling, I found this technote:
http://www-01.ibm.com/support/docview.wss?uid=swg1IC67080

And to resolve the issue, I ran a db2iupdt (this requires a db2instance outage). First as the db2 instance owner:

> db2stop force
06/27/2012 16:28:45     0   0   SQL1064N  DB2STOP processing was successful.
SQL1064N  DB2STOP processing was successful.
> ipclean
ipclean: Removing DB2 engine and client's IPC resources for db2inst1.
> db2licd -end

Then login as root and do:

> cd /opt/IBM/db2
> cd V9.7
> cd instance
> ./db2iupdt -k -e
db2inst1
DBI1070I  Program db2iupdt completed successfully.


> ./dasupdt
SQL4410W  The DB2 Administration Server is not active.
SQL4406W  The DB2 Administration Server was started successfully.
DBI1070I  Program dasupdt completed successfully.

Then, finally, as db2inst, verify it worked:

> db2start
06/27/2012 16:31:39     0   0   SQL1063N  DB2START processing was successful.
SQL1063N  DB2START processing was successful.
> db2set DB2_CAPTURE_LOCKTIMEOUT=YES
> db2set -all
[i] DB2_CAPTURE_LOCKTIMEOUT=YES
[i] DB2_OPT_MAX_TEMP_SIZE=10240 [DB2_WORKLOAD]
[i] DB2_WORKLOAD=WC
[i] DB2_SKIPINSERTED=YES [DB2_WORKLOAD]
[i] DB2_OPTPROFILE=YES [DB2_WORKLOAD]
[i] DB2_USE_ALTERNATE_PAGE_CLEANING=ON
[i] DB2_INLIST_TO_NLJN=YES [O]
[i] DB2_MINIMIZE_LISTPREFETCH=YES [DB2_WORKLOAD]
[i] DB2_REDUCED_OPTIMIZATION=INDEX,UNIQUEINDEX,JOIN,NO_SORT_MGJOIN,JULIE [DB2_WORKLOAD]
[i] DB2_EVALUNCOMMITTED=YES [DB2_WORKLOAD]
[i] DB2_ANTIJOIN=EXTEND [DB2_WORKLOAD]
[i] DB2_SKIPDELETED=YES [DB2_WORKLOAD]
[i] DB2BIDI=ON
[i] DB2COMM=TCPIP
[i] DB2_PARALLEL_IO=*
[g] DB2FCMCOMM=TCPIP4
[g] DB2SYSTEM=redacted
[g] DB2INSTDEF=redacted
[g] DB2ADMINSERVER=redacted

Overall, not a complicated problem

DB2 Commands: db2licm

$
0
0

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.

License Files

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?


Using TSA/db2haicu to Automate Failover Part 3: Testing, Ways Setup can go Wrong and What to do.

$
0
0

Part 3 in this series is a bit overdue. Parts 1 and 2 were back in April. This is a complicated topic. Please use any procedures here with extreme care, and keep in mind that if you have anything other than the standard two-server HADR-only TSA implementation, these procedures probably aren’t the best idea, as they could break other things. There will also be a Part 4 – dealing with problems after set-up.

I’m not saying I’m covering every possible failure scenario, but I’ve seen a number of different issues and wanted to share some strategies for dealing with them.

Testing automated failover

First of all, it is absoultely critical that you test your failover. As many tests as you can manage will help you out here. I try to set up hadr, set up failover using TSA/db2haicu, and test all in the same week to keep things from getting missed.
The absolute minimum tests you should do are:

  • Manual takeover, verifying the database
  • Manual takeover, verifying the Commerce (or other) application
  • Hard failure with inability to start (renaming executable)

If at all possible, also do the following tests:

  • Power-off tests on each node
  • db2_kill test on each node (with caution)
  • Manual takeover by force on each node
  • Network failure test on each node
  • Failover under load (during load test)

See section 6 of this document for some really excellent details on testing: http://download.boulder.ibm.com/ibmdl/pub/software/dw/data/dm-0908hadrdb2haicu/HADR_db2haicu.pdf

If you just assume it will work, it probably will not. On at least three occasions, I’ve caught issues while testing failover.

Failure causes

While I’ve caught 3 issues while testing failover, I’ve had at least twice that many during the setup process. The most common cause of failure that I’ve seen is missed steps during preparation. For nearly every problem or issue I’ve seen, I’ve gone back and added to that preparation post. The first few times I set up TSA with HADR, my preparation was mostly just gathering inputs. Then, one by one, as I saw failures, I added to the prep work. I’m still going to talk about what those missed prep work errors look like, because it’s easy to miss something. I always say that the best DBA is a detail-oriented control freak, and this is one area where that’s certainly true. If you’re having problems, literally go through the preparation post line by line on each server and see if you missed anything. Seriously, for any failure prior to testing, go through the preparation items with a fine-tooth comb on both servers.

preprpnode Failure

If you go to do the preprpnode preparation step, and you get a failure like this:

# preprpnode server1.domain.com server2.domain.com

-bash: preprpnode: command not found

This likely means that your SAM installation was not completed successfully. See http://db2commerce.com/2012/04/09/using-tsadb2haicu-to-automate-failover-part-1-the-preparation/ – the section called “Software Installed” – for details on how to do that.

Failure on Creating the Domain

What this looks like

> db2haicu
...
Create the domain now? [1]
1. Yes
2. No
1
Creating domain prod_db2ha in the cluster ...
Creating domain failed. Refer to db2diag.log and the DB2 Information Center for details.

I don’t have excerpts from the db2diag log at this point – if anyone does, please share.

Resolution

This usually means you didn’t do the preprpnode or you didn’t do it properly. Remember that the preprpnode must be done as root on both servers in this format:

# preprpnode server1.domain.com server2.domain.com

db2haicu Fails Near the End of the Setup for the Standby Server

What This Looks Like

> db2haicu
...
Retrieving high availability configuration parameter for instance db2inst1 ...
The cluster manager name configuration parameter (high availability configuration parameter) is not set. For more information, se
e the topic "cluster_mgr - Cluster manager name configuration parameter" in the DB2 Information Center. Do you want to set the hi
gh availability configuration parameter?
The following are valid settings for the high availability configuration parameter:
  1.TSA
  2.Vendor
Enter a value for the high availability configuration parameter: [1]
1
Setting a high availability configuration parameter for instance db2inst1 to TSA.
Adding DB2 database partition 0 to the cluster ...
There was an error with one of the issued cluster manager commands. Refer to db2diag.log and the DB2 Information Center for detai
ls.

Resolution

In the case where I most recently saw this particular failure, I had set up HADR with IP addresses. TSA/db2haicu does not seem to like or allow the use of just IP addresses. So I had to go back and re-do the HADR setup using host names. I believe I’ve also seen failures here due to incorrect formatting of the hosts file or incorrect entries in db2nodes.cfg(yes, for single node implementations). Basically a failure at this point most frequently means that you missed some part of the preparation steps. See http://db2commerce.com/2012/04/09/using-tsadb2haicu-to-automate-failover-part-1-the-preparation/.

Failure on failover test while testing the Application

This one seems a bit dumb in retrospect, but I was working with someone I don’t normally, and made some assumptions that I shouldn’t have. Essentially what happened was that when we tested the failover, we saw the database come up fine every time, but the application never seemed to re-establish connections. After a couple of hours of troubleshooting, we realized that the application’s ID did not exist on the standby server, and when it was created and the passwords synced, the problem immediately went away. This holds true for just standard HADR, even if you’re not using TSA: ensure that your user ids and passwords are identical between your primary and your standby database servers.

TSA Installation Issues

We normally install DB2 from Base Code, and then Apply the latest FixPack (well, as long as it has been out for a month or so). On RedHat, we’ve seen issues where the version of RedHat we’re using doesn’t support the version of TSA that comes with the base code. So when we install DB2, it gives an error message that the TSA/SAM component could not be installed. Luckily the version of TSA that comes with FixPack 4 and later is supported with the version of RedHat. But the FixPack does not automatically install it, of course. So for servers where we want to use TSA, we have to install the DB2 Base Code, Install the FixPack, and then install the TSA/SAM component from the FixPack code using this procedure: http://db2commerce.com/2012/04/09/using-tsadb2haicu-to-automate-failover-part-1-the-preparation/ – the section called “Software Installed”

Other Failures

Ultimately, I know that I don’t fully understand at least half of the failures I’ve seen. I need to see what information I can find on pure TSA so that I really understand what to do and all of the states. I would love it if there were some education offered for this at the conference or even just in a webcast. So what I really have are a series of things that I try when a failure occurs. Some I’ve already mentioned above.

  1. Go through the prep work with a fine tooth comb: http://db2commerce.com/2012/04/09/using-tsadb2haicu-to-automate-failover-part-1-the-preparation/. This includes:
    • Double and tripple check that you have picked either the server’s short name or the server’s long name and are using it consistently in each of:
      • /etc/hosts
      • HADR configuration parameters in db cfg
      • db2nodes.cfg (in $HOME/sqllib)
      • Results of the ‘hostname’ command
    • Double check that you successfully executed the preprpnode command on both hosts
    • Double check that you successfully executed the db2cptsa command on both hosts
  2. Start Over. Delete your TSA work using the -delete option on db2haicu and start over with db2haicu fresh
    [db2inst1@403238-Prod-db2 ~]$ db2haicu -delete
    Welcome to the DB2 High Availability Instance Configuration Utility (db2haicu).
    
    You can find detailed diagnostic information in the DB2 server diagnostic log file called db2diag.log. Also, you can use the util
    ity called db2pd to query the status of the cluster domains you create.
    
    For more information about configuring your clustered environment using db2haicu, see the topic called 'DB2 High Availability Ins
    tance Configuration Utility (db2haicu)' in the DB2 Information Center.
    
    db2haicu determined the current DB2 database manager instance is db2inst1. The cluster configuration that follows will apply to t
    his instance.
    
    When you use db2haicu to configure your clustered environment, you create cluster domains. For more information, see the topic 'C
    reating a cluster domain with db2haicu' in the DB2 Information Center. db2haicu is searching the current machine for an existing
    active cluster domain ...
    db2haicu found a cluster domain called prod_db2ha on this machine. The cluster configuration that follows will apply to this doma
    in.
    
    Deleting the domain prod_db2ha from the cluster ...
    Deleting the domain prod_db2ha from the cluster was successful.
    All cluster configurations have been completed successfully. db2haicu exiting ...
    
  3. Try uninstalling and re-installing the TSA/SAM component
    • Uninstalling looks like this:
      [root@server1]# cd /db2/linuxamd64/tsamp
      [root@server1]# ./uninstallSAM
      uninstallSAM: Uninstalling System Automation on platform: x86_64
      uninstallSAM: Package is not installed: sam.sappolicy
      uninstallSAM: Uninstalling
       sam.adapter-3.1.0.1-08261.i386
      uninstallSAM: Uninstalling
       sam.msg.de_DE-3.1.0.0-0.i386
       sam.msg.de_DE.ISO-8859-1-3.1.0.0-0.i386
       sam.msg.de_DE@euro-3.1.0.0-0.i386
       sam.msg.de_DE.UTF-8-3.1.0.0-0.i386
      uninstallSAM: Uninstalling
       sam.msg.es_ES-3.1.0.0-0.i386
       sam.msg.es_ES.ISO-8859-1-3.1.0.0-0.i386
       sam.msg.es_ES@euro-3.1.0.0-0.i386
       sam.msg.es_ES.UTF-8-3.1.0.0-0.i386
      uninstallSAM: Uninstalling
       sam.msg.fr_FR-3.1.0.0-0.i386
       sam.msg.fr_FR.ISO-8859-1-3.1.0.0-0.i386
       sam.msg.fr_FR@euro-3.1.0.0-0.i386
       sam.msg.fr_FR.UTF-8-3.1.0.0-0.i386
      uninstallSAM: Uninstalling
       sam.msg.it_IT-3.1.0.0-0.i386
       sam.msg.it_IT.ISO-8859-1-3.1.0.0-0.i386
       sam.msg.it_IT@euro-3.1.0.0-0.i386
       sam.msg.it_IT.UTF-8-3.1.0.0-0.i386
      uninstallSAM: Uninstalling
       sam.msg.ja_JP.eucJP-3.1.0.0-0.i386
       sam.msg.ja_JP.UTF-8-3.1.0.0-0.i386
      uninstallSAM: Uninstalling
       sam.msg.ko_KR.eucKR-3.1.0.0-0.i386
       sam.msg.ko_KR.UTF-8-3.1.0.0-0.i386
      uninstallSAM: Uninstalling
       sam.msg.pt_BR-3.1.0.0-0.i386
       sam.msg.pt_BR.UTF-8-3.1.0.0-0.i386
      uninstallSAM: Uninstalling
       sam.msg.zh_CN.GB2312-3.1.0.0-0.i386
       sam.msg.zh_CN.GB18030-3.1.0.0-0.i386
       sam.msg.zh_CN.GBK-3.1.0.0-0.i386
       sam.msg.zh_CN.UTF-8-3.1.0.0-0.i386
      uninstallSAM: Uninstalling
       sam.msg.zh_TW-3.1.0.0-0.i386
       sam.msg.zh_TW.Big5-3.1.0.0-0.i386
       sam.msg.zh_TW.eucTW-3.1.0.0-0.i386
       sam.msg.zh_TW.UTF-8-3.1.0.0-0.i386
      uninstallSAM: Uninstalling
       sam-3.1.0.1-08261.i386
      uninstallSAM: Uninstalling
       rsct.opt.storagerm-2.5.1.4-08249.i386
      uninstallSAM: Uninstalling
       rsct.64bit-2.5.1.4-08249.x86_64
      uninstallSAM: Uninstalling
       rsct.basic.msg.de_DE-2.5.1.2-0.i386
       rsct.basic.msg.de_DE.ISO-8859-1-2.5.1.2-0.i386
       rsct.basic.msg.de_DE@euro-2.5.1.2-0.i386
       rsct.basic.msg.de_DE.UTF-8-2.5.1.2-0.i386
      uninstallSAM: Uninstalling
       rsct.basic.msg.es_ES-2.5.1.2-0.i386
       rsct.basic.msg.es_ES.ISO-8859-1-2.5.1.2-0.i386
       rsct.basic.msg.es_ES@euro-2.5.1.2-0.i386
       rsct.basic.msg.es_ES.UTF-8-2.5.1.2-0.i386
      uninstallSAM: Uninstalling
       rsct.basic.msg.fr_FR-2.5.1.2-0.i386
       rsct.basic.msg.fr_FR.ISO-8859-1-2.5.1.2-0.i386
       rsct.basic.msg.fr_FR@euro-2.5.1.2-0.i386
       rsct.basic.msg.fr_FR.UTF-8-2.5.1.2-0.i386
      uninstallSAM: Uninstalling
       rsct.basic.msg.it_IT-2.5.1.2-0.i386
       rsct.basic.msg.it_IT.ISO-8859-1-2.5.1.2-0.i386
       rsct.basic.msg.it_IT@euro-2.5.1.2-0.i386
       rsct.basic.msg.it_IT.UTF-8-2.5.1.2-0.i386
      uninstallSAM: Uninstalling
       rsct.basic.msg.ja_JP.eucJP-2.5.1.2-0.i386
       rsct.basic.msg.ja_JP.UTF-8-2.5.1.2-0.i386
      uninstallSAM: Uninstalling
       rsct.basic.msg.ko_KR.eucKR-2.5.1.2-0.i386
       rsct.basic.msg.ko_KR.UTF-8-2.5.1.2-0.i386
      uninstallSAM: Uninstalling
       rsct.basic.msg.pt_BR-2.5.1.2-0.i386
       rsct.basic.msg.pt_BR.UTF-8-2.5.1.2-0.i386
      uninstallSAM: Uninstalling
       rsct.basic.msg.zh_CN.GB2312-2.5.1.2-0.i386
       rsct.basic.msg.zh_CN.GB18030-2.5.1.2-0.i386
       rsct.basic.msg.zh_CN.GBK-2.5.1.2-0.i386
       rsct.basic.msg.zh_CN.UTF-8-2.5.1.2-0.i386
      uninstallSAM: Uninstalling
       rsct.basic.msg.zh_TW-2.5.1.2-0.i386
       rsct.basic.msg.zh_TW.Big5-2.5.1.2-0.i386
       rsct.basic.msg.zh_TW.eucTW-2.5.1.2-0.i386
       rsct.basic.msg.zh_TW.UTF-8-2.5.1.2-0.i386
      uninstallSAM: Uninstalling
       rsct.basic-2.5.1.4-08249.i386
      uninstallSAM: Uninstalling
       rsct.core.msg.de_DE-2.5.1.2-0.i386
       rsct.core.msg.de_DE.ISO-8859-1-2.5.1.2-0.i386
       rsct.core.msg.de_DE@euro-2.5.1.2-0.i386
       rsct.core.msg.de_DE.UTF-8-2.5.1.2-0.i386
      uninstallSAM: Uninstalling
       rsct.core.msg.es_ES-2.5.1.2-0.i386
       rsct.core.msg.es_ES.ISO-8859-1-2.5.1.2-0.i386
       rsct.core.msg.es_ES@euro-2.5.1.2-0.i386
       rsct.core.msg.es_ES.UTF-8-2.5.1.2-0.i386
      uninstallSAM: Uninstalling
       rsct.core.msg.fr_FR-2.5.1.2-0.i386
       rsct.core.msg.fr_FR.ISO-8859-1-2.5.1.2-0.i386
       rsct.core.msg.fr_FR@euro-2.5.1.2-0.i386
       rsct.core.msg.fr_FR.UTF-8-2.5.1.2-0.i386
      uninstallSAM: Uninstalling
       rsct.core.msg.it_IT-2.5.1.2-0.i386
       rsct.core.msg.it_IT.ISO-8859-1-2.5.1.2-0.i386
       rsct.core.msg.it_IT@euro-2.5.1.2-0.i386
       rsct.core.msg.it_IT.UTF-8-2.5.1.2-0.i386
      uninstallSAM: Uninstalling
       rsct.core.msg.ja_JP.eucJP-2.5.1.2-0.i386
       rsct.core.msg.ja_JP.UTF-8-2.5.1.2-0.i386
      uninstallSAM: Uninstalling
       rsct.core.msg.ko_KR.eucKR-2.5.1.2-0.i386
       rsct.core.msg.ko_KR.UTF-8-2.5.1.2-0.i386
      uninstallSAM: Uninstalling
       rsct.core.msg.pt_BR-2.5.1.2-0.i386
       rsct.core.msg.pt_BR.UTF-8-2.5.1.2-0.i386
      uninstallSAM: Uninstalling
       rsct.core.msg.zh_CN.GB2312-2.5.1.2-0.i386
       rsct.core.msg.zh_CN.GB18030-2.5.1.2-0.i386
       rsct.core.msg.zh_CN.GBK-2.5.1.2-0.i386
       rsct.core.msg.zh_CN.UTF-8-2.5.1.2-0.i386
      uninstallSAM: Uninstalling
       rsct.core.msg.zh_TW-2.5.1.2-0.i386
       rsct.core.msg.zh_TW.Big5-2.5.1.2-0.i386
       rsct.core.msg.zh_TW.eucTW-2.5.1.2-0.i386
       rsct.core.msg.zh_TW.UTF-8-2.5.1.2-0.i386
      uninstallSAM: Uninstalling
       rsct.core-2.5.1.4-08249.i386
      uninstallSAM: Uninstalling
       rsct.core.utils.msg.de_DE-2.5.1.2-0.i386
       rsct.core.utils.msg.de_DE.ISO-8859-1-2.5.1.2-0.i386
       rsct.core.utils.msg.de_DE@euro-2.5.1.2-0.i386
       rsct.core.utils.msg.de_DE.UTF-8-2.5.1.2-0.i386
      uninstallSAM: Uninstalling
       rsct.core.utils.msg.es_ES-2.5.1.2-0.i386
       rsct.core.utils.msg.es_ES.ISO-8859-1-2.5.1.2-0.i386
       rsct.core.utils.msg.es_ES@euro-2.5.1.2-0.i386
       rsct.core.utils.msg.es_ES.UTF-8-2.5.1.2-0.i386
      uninstallSAM: Uninstalling
       rsct.core.utils.msg.fr_FR-2.5.1.2-0.i386
       rsct.core.utils.msg.fr_FR.ISO-8859-1-2.5.1.2-0.i386
       rsct.core.utils.msg.fr_FR@euro-2.5.1.2-0.i386
       rsct.core.utils.msg.fr_FR.UTF-8-2.5.1.2-0.i386
      uninstallSAM: Uninstalling
       rsct.core.utils.msg.it_IT-2.5.1.2-0.i386
       rsct.core.utils.msg.it_IT.ISO-8859-1-2.5.1.2-0.i386
       rsct.core.utils.msg.it_IT@euro-2.5.1.2-0.i386
       rsct.core.utils.msg.it_IT.UTF-8-2.5.1.2-0.i386
      uninstallSAM: Uninstalling
       rsct.core.utils.msg.ja_JP.eucJP-2.5.1.2-0.i386
       rsct.core.utils.msg.ja_JP.UTF-8-2.5.1.2-0.i386
      uninstallSAM: Uninstalling
       rsct.core.utils.msg.ko_KR.eucKR-2.5.1.2-0.i386
       rsct.core.utils.msg.ko_KR.UTF-8-2.5.1.2-0.i386
      uninstallSAM: Uninstalling
       rsct.core.utils.msg.pt_BR-2.5.1.2-0.i386
       rsct.core.utils.msg.pt_BR.UTF-8-2.5.1.2-0.i386
      uninstallSAM: Uninstalling
       rsct.core.utils.msg.zh_CN.GB2312-2.5.1.2-0.i386
       rsct.core.utils.msg.zh_CN.GB18030-2.5.1.2-0.i386
       rsct.core.utils.msg.zh_CN.GBK-2.5.1.2-0.i386
       rsct.core.utils.msg.zh_CN.UTF-8-2.5.1.2-0.i386
      uninstallSAM: Uninstalling
       rsct.core.utils.msg.zh_TW-2.5.1.2-0.i386
       rsct.core.utils.msg.zh_TW.Big5-2.5.1.2-0.i386
       rsct.core.utils.msg.zh_TW.eucTW-2.5.1.2-0.i386
       rsct.core.utils.msg.zh_TW.UTF-8-2.5.1.2-0.i386
      uninstallSAM: Uninstalling
       rsct.core.utils-2.5.1.4-08249.i386
      uninstallSAM: Uninstalling
       src.msg.de_DE-1.3.0.3-0.i386
       src.msg.de_DE.ISO-8859-1-1.3.0.3-0.i386
       src.msg.de_DE@euro-1.3.0.3-0.i386
       src.msg.de_DE.UTF-8-1.3.0.3-0.i386
      uninstallSAM: Uninstalling
       src.msg.es_ES-1.3.0.3-0.i386
       src.msg.es_ES.ISO-8859-1-1.3.0.3-0.i386
       src.msg.es_ES@euro-1.3.0.3-0.i386
       src.msg.es_ES.UTF-8-1.3.0.3-0.i386
      uninstallSAM: Uninstalling
       src.msg.fr_FR-1.3.0.3-0.i386
       src.msg.fr_FR.ISO-8859-1-1.3.0.3-0.i386
       src.msg.fr_FR@euro-1.3.0.3-0.i386
       src.msg.fr_FR.UTF-8-1.3.0.3-0.i386
      uninstallSAM: Uninstalling
       src.msg.it_IT-1.3.0.3-0.i386
       src.msg.it_IT.ISO-8859-1-1.3.0.3-0.i386
       src.msg.it_IT@euro-1.3.0.3-0.i386
       src.msg.it_IT.UTF-8-1.3.0.3-0.i386
      uninstallSAM: Uninstalling
       src.msg.ja_JP.eucJP-1.3.0.3-0.i386
       src.msg.ja_JP.UTF-8-1.3.0.3-0.i386
      uninstallSAM: Uninstalling
       src.msg.ko_KR.eucKR-1.3.0.3-0.i386
       src.msg.ko_KR.UTF-8-1.3.0.3-0.i386
      uninstallSAM: Uninstalling
       src.msg.pt_BR-1.3.0.3-0.i386
       src.msg.pt_BR.UTF-8-1.3.0.3-0.i386
      uninstallSAM: Uninstalling
       src.msg.zh_CN.GB2312-1.3.0.3-0.i386
       src.msg.zh_CN.GB18030-1.3.0.3-0.i386
       src.msg.zh_CN.GBK-1.3.0.3-0.i386
       src.msg.zh_CN.UTF-8-1.3.0.3-0.i386
      uninstallSAM: Uninstalling
       src.msg.zh_TW-1.3.0.3-0.i386
       src.msg.zh_TW.Big5-1.3.0.3-0.i386
       src.msg.zh_TW.eucTW-1.3.0.3-0.i386
       src.msg.zh_TW.UTF-8-1.3.0.3-0.i386
      uninstallSAM: Uninstalling
       src-1.3.0.4-08249.i386
    • For re-installing see: http://db2commerce.com/2012/04/09/using-tsadb2haicu-to-automate-failover-part-1-the-preparation/ – the section called “Software Installed”

Now that I have my prep work figured out, I can get a clean setup on the first try about 50-75% of the time. The rest of the time, I still have some sort of issue that I have to troubleshoot and deal with on setup or testing. So don’t be discouraged – just work through the issues. I hope this post can provide you with a good toolbox of things to try. Please comment or contact me if you have additional issues that you have seen and solved so others can benefit from your pain.

Other Posts In This Series

This series consists of four posts:
Using TSA/db2haicu to automate failover – Part 1: The Preparation
Using TSA/db2haicu to automate failover – Part 2: How it looks if it goes smoothly
Using TSA/db2haicu to Automate Failover Part 3: Testing, Ways Setup can go Wrong and What to do.
“Using TSA/db2haicu to automate failover Part 4: Dealing with Problems After Setup

Search this blog on “TSA” for other posts on TSA issues and tips.

Cloning a DB2 Database Server

$
0
0

I’ve built new servers in half a dozen different ways. One of the ways most favored these days, especially by the other Engineers on my team is cloning. Whether it’s an Amazon EC2 copy or VM Ware that you’re using, some method of taking an image of an existing server and turning it into a new server seems to be gaining popularity.

What I’m talking about in this post is NOT cloning a database – using redirected restore or db2move or whatever to get a database from one server to another, but the whole server level. I’m also not going to discuss the technical elements of how to us Amazon or VM Ware’s tools to do the actual cloning – I’ll write that off to the SA sphere of influence. What I do want to talk about is the DB2-specific details on what you need to do to make such copies possible.

First, let’s make it clear that my experience in this area is with DB2 9.7 on Linux (RedHat, SuSe). So take my advice here in that context. I remember attempting to clone back on 8.2, and having major issues – including being unable to apply a FixPack to the cloned servers. I can’t recommend cloning for 8.2 if you’re still stuck on 8.2.

Before You Clone

Before you take a copy that a clone is to be made from, it is best if you stop DB2 entirely. It may work if you don’t, but it’s just not as certain. DB2 has always (ok, at least back to version 5 where my experience starts) supported taking database files and copying/backing them up/moving them while the database is down, but not while the database is running (that’s what online backup is for). If you try it while DB2 is up, at a minimum, you’ll have to go through crash recovery when the database comes back up – and it is possible that you may even have to restore the database. I’m always surprised with how stable DB2 is and how infrequently that happens, but still.

Settings to Change

Once the server has been copied and you bring it up somewhere else, there are still some things that you may have to do.

The main issues you’re likely to see are related to the server name change. In fact, this document can be helpful, and has details for windows, which my post doesn’t detail: http://www-01.ibm.com/support/docview.wss?uid=swg21258834 In my experience, you’re likely to have to make changes in two places: the DB2 registry and the db2nodes.cfg.

DB2 Registry

It is a variable that you almost never mess with, but if you do a db2set -all, one of the parameters that you will see set is called DB2SYSTEM. It looks like this:

$ db2set -all |grep g
[g] DB2FCMCOMM=TCPIP4
[g] DB2SYSTEM=svq00db01z.domain.com
[g] DB2INSTDEF=db2inst1
[g] DB2ADMINSERVER=dasusr1

Chances are that most DBAs have never even changed the [g] parameters. You have to change this as root. To do that, you’ll need to su to root or login as root, and then source the db2profile and use the command:

# . /db2home/db2inst1/sqllib/db2profile
# db2set -g DB2SYSTEM=svs00db01z.domain.com

Of course the path for the db2profile will vary. It is in the instance owner’s home directory under the sqllib sub directory.

The document I linked to above has a slightly different command which I haven’t tested myself.

Check the output of db2set again – you should be all set. You’ll have to restart the instance(db2stop/db2start) for the change to take effect.

db2nodes.cfg

The other place you need to check the server name is in the db2nodes.cfg file. While we usually only associate db2nodes.cfg with a multi-partition database (DPF or EEE), it is still there and used for single partition databases. Assuming you’re working with a single partition database, you’ll only have one line to change, which will look something like this:

0 svq00db01z.domain.com 0

Here, you’ll just have to edit the file with vi or your favorite text editor to change the server name to the new server name.

0 svs00db01z.domain.com 0

Chances are you won’t have been able to start db2 before making these changes. They won’t take effect until the next db2start.

DB2 Info Center Entry on db2nodes.cfg: http://publib.boulder.ibm.com/infocenter/db2luw/v9r7/topic/com.ibm.db2.luw.qb.server.doc/doc/t0006350.html

Changing Names

I have a strong dislike for having two databases with the same name. I’m usually supporting about 6 clients at once (more like 12 if you count covering for my co-workers), each with a minimum of 4 databases and a maximum of 100 databases. In order to help me not make basic human mistakes, I like all the databases to have different names. This helps me not accidentally do something on the wrong environment.

And someone is thinking “yeah, but how often does that happen?” I have one client that actually has two databases with the same name. They’re on different VPNS, but still. Last night, I accidentally applied changes on one that belonged on the other. Because I had a database backup before I made the changes, and they were both QA systems, it wasn’t a major problem – I reversed the mistake easily. While that’s the first time in at least 2 or 3 years, these kind of human mistakes happen, and if we can prevent them using different database names, all the better.

So I like to keep all database names different – you can still easily restore one database into another. To change the database name, the db2relocatedb command is really, really easy to use. You create a cfg file, which for a database name change looks like this:

> cat relocatetempdb.cfg
DB_NAME=TESTDB,DBTEMP
DB_PATH=/db_data
INSTANCE=db2inst1
NODENUM=0

And then you execute the relocatedb command like this:

> db2relocatedb -f relocatetempdb.cfg
Files and control structures were changed successfully.
Database was catalogued successfully.
DBT1000I  The tool completed successfully.

You’ll also have to consider what other things you want to change – is your log directory in a custom location that includes the database name? Archive logs? If the data itself is in a location that includes the database name, you may want to consider a redirected restore instead of the relocatedb option laid out above. I’m lucky in that most of my implementations are one-database->one-instance->one-server. I like to keep everything consistent.

Obviously, the cloning gets more complicated the more you have to change. Changing the instance name would require dropping and re-creating the instance and then either re-cataloging or restoring the database (and copying all instance-level settings using db2cfexp/db2cfimp).

Especially when you have the install scripted, a complete new build sometimes seems easier. If you ask me, installing DB2 is the easiest and least time consuming part of a build.

References:

Technote on changing the hostname of a DB2 server: http://www-01.ibm.com/support/docview.wss?uid=swg21258834
DB2 Info Center Entry on db2nodes.cfg: http://publib.boulder.ibm.com/infocenter/db2luw/v9r7/topic/com.ibm.db2.luw.qb.server.doc/doc/t0006350.html
developerWorks Article on db2relocatedb: http://www.ibm.com/developerworks/data/library/techarticle/dm-0407schlamb/

Error on Installation of DB2 /tmp/…: Permission Denied

$
0
0

I haven’t actually personally installed DB2 in about a year. We scripted it out, and I’ve been spoiled to just use the script. But now we have a custom server that varies enough from our standards that I’m installing it manually. The OS is Red Hat 6.2.

db2_install or db2setup

So today when I went to install, I got this error:

 /opt/media/x86_64/DB2/ese/db2/linuxamd64/install/db2setup: line 484: /tmp/db2.tmp.5703/db2/linuxamd64/install//db2chgpath: Permission denied
/opt/media/x86_64/DB2/ese/db2/linuxamd64/install/db2setup: line 815: /tmp/db2.tmp.5703/db2/linuxamd64/install//db2setup_exec: Permission denied
/opt/media/x86_64/DB2/ese/db2/linuxamd64/install/db2setup: line 815: exec: /tmp/db2.tmp.5703/db2/linuxamd64/install//db2setup_exec: cannot execute: Permission denied

It actually sounded pretty straight forward, but I was logged in as root, which should have permssions on everything. When I checked the permissions on /tmp they were pretty wide open.

It didn’t take much time searching to discover the issue, and there are other sources for the solution than my blog, but I thought I’d share it with my readers. Interestingly enough, I ran into the exact error above (including file names) when using both db2_install and db2setup. I also ran into similar errors with similar solutions on both installFixPack and db2_deinstall.

Mabye I’m just late to the game, as I remember someone asking me if I had edited the install scripts at the conference and being just baffled as to why I would ever have to do that. I guess I know now. In any case, the solution is to create your own TMP directory somewhere else. In my case, I ran:

mkdir /db2home/db2inst1/tmp

I then had to go and edit the file it referred to – in the case of the error above, ‘/opt/media/x86_64/DB2/ese/db2/linuxamd64/install/db2setup’ to specify the different path. There’s a variable in there called TMPDIR, and it looks like this:

TMPDIR=${DB2TMPDIR:-/tmp}

I changed that to:

TMPDIR=${DB2TMPDIR:-/db2home/db2inst1/tmp}

When I executed the db2_install again, it was successful.

installFixPack

The error I got for the installFixPack was:

/opt/media/x86_64/DB2/universal/db2/linuxamd64/install/installFixPack: line 249: /tmp/db2.tmp.20614/db2/linuxamd64/install//db2chgpath: Permission denied
/opt/media/x86_64/DB2/universal/db2/linuxamd64/install/installFixPack: line 997: /tmp/installFixPack_exec.20614: Permission denied
/opt/media/x86_64/DB2/universal/db2/linuxamd64/install/installFixPack: line 997: exec: /tmp/installFixPack_exec.20614: cannot execute: Permission denied 

In that case, the same edits were needed to ‘/opt/media/x86_64/DB2/universal/db2/linuxamd64/install/installFixPack’.

db2_deinstall

And the final case where I ran into the issue was with db2_deinstall. That one looked like this:

/opt/ibm/db2/V9.7/install/db2_deinstall: line 1037: /tmp/db2_deinstall_exec.25903: Permission denied
/opt/ibm/db2/V9.7/install/db2_deinstall: line 1037: exec: /tmp/db2_deinstall_exec.25903: cannot execute: Permission denied 

In that case, the file to edit was ‘>/opt/ibm/db2/V9.7/install/db2_deinstall’. The interesting thing about db2_deinstall was that it had not just one but two places where I had to make the same change within the script before it worked.

But, Why?

The entire reason this error occurs is because in some cases, /tmp is mounted with ‘noexec’, which means that no matter what the filesystem permissions look like, no one, including root, can execute things from there. This is a security feature. DB2 is apparently unusual in that it copies things to /tmp before executing them when it is being installed.

If you want more information on the security advantages of mounting /tmp with noexec, check out this discussion: http://serverfault.com/questions/72356/how-useful-is-mounting-tmp-noexec

How to Disable ASLR and Why you Should do it

$
0
0

Update: Oct 28, 2013 – the below applies only to DB2 before DB2 10.1 Fixpack 3. IBM says that ASLR can safely be used with DB2 on 10.1 Fixpack 3 and later. See the technote at http://www-01.ibm.com/support/docview.wss?uid=swg21365583. FixPack 3 was released on September 27th. Also, please see comment from a reader at the bottom about the security implications of disabling ASLR.

This post is specific to Linux. The commands shared have been tested on RedHat 6.2.

What is ASLR

Address Space Layout Randomization is a security feature that randomizes where in a process’s address space key data is stored. This enhances security by making it harder for a hacker to find these key memory areas. I believe it is enabled by default on recent RedHat distributions. You can find more information on the concept here: http://en.wikipedia.org/wiki/Address_space_layout_randomization

Why ASLR Should be Disabled on all DB2 Database Servers

Quite simply, enabling ASLR can cause odd behavoir for a number of DB2 processes other than the core db2sysc. IBM details it in this technote: https://www-304.ibm.com/support/docview.wss?uid=swg21365583. DB2 maps a shared memory object across processes, and apparently it can’t always handle the addressing if ASLR is enabled.

The error message from the db2 diagnostic log that I’ve most frequently seen is one of these two:

2012-01-12-15.38.24.853671-300 E304269938E671      LEVEL: Error (OS)
PID     : 12732                TID  : 46912562375120PROC : db2bp
INSTANCE: db2inst1             NODE : 000
APPID   : *LOCAL.db2inst1.120117015847
FUNCTION: DB2 UDB, oper system services, sqlowqueInternal, probe:40
MESSAGE : ZRC=0x870F003E=-2029060034=SQLO_QUE_BAD_HANDLE "Bad Queue Handle"
          DIA8555C An invalid message queue handle was encountered.
CALLED  : OS, -, msgsnd                           OSERR: EINVAL (22)
DATA #1 : system V message queue identifier., PD_TYPE_SYSV_QUEUE_ID, 4 bytes
0x02F7000C
DATA #2 : Pointer, 8 bytes
0x00000000007d7890
DATA #3 : unsigned integer, 8 bytes
3841
2011-08-17-12.14.51.565199-300 I657879649E972      LEVEL: Error
PID     : 15948                TID  : 47622807768096PROC : db2egcf
INSTANCE: db2inst1             NODE : 000
FUNCTION: <0>, <0>, <0>, probe:100
MESSAGE : ZRC=0x850F0005=-2062614523=SQLO_NOSEG
          "No Storage Available for allocation"
          DIA8305C Memory allocation failure occurred.
DATA #1 : String, 22 bytes
sqlocshr.-2062614523..
CALLSTCK:
  [0] 0x00002B500232AA9D pdOSSeLoggingCallback + 0x91
  [1] 0x00002B50076EE5FB /opt/IBM/db2/v9.5/lib64/libdb2osse.so.1 + 0x1B25FB
  [2] 0x00002B50076EE3FC ossLog + 0xA6
  [3] 0x0000000000402BBE _Z21db2haAttachToDatabasePcP9SQLE_KRCBPP16sqeLocalDatabase + 0x22A
  [4] 0x0000000000402C58 _Z17db2haGetHADRStatePcP9HDR_STATES_ + 0x64
  [5] 0x0000000000402225 main + 0x1DD
  [6] 0x0000003ECC01D994 __libc_start_main + 0xF4
  [7] 0x0000000000401FAA pdOSSeLoggingCallback + 0x7A
  [8] 0x0000000000000000 ?unknown + 0x0
  [9] 0x0000000000000000 ?unknown + 0x0

In the second, you’ll note that the process – db2egcf – is a monitoring process for HADR. Since one of the possible failure scenarios with ASLR relates to unexpected HADR failovers, this fits right in with the tech note linked above.

How to Disable it

First, you must have root for this. Or use an SA as your Waldo if you are not able to get root yourself. There are two pieces to this – disabling it for your server currently and ensuring that change is persistent across reboots.

Runtime

This is quite simple – a single command:

# sysctl -w kernel.randomize_va_space=0

You do not have to restart db2 or the server for the change to take effect.

Saving it for all future reboots

To make your change persistent, you have to add a line to the /etc/sysctl.conf file (on RedHat). This can easily be accomplished using:

# echo "" >> /etc/sysctl.conf
# echo '# Disabling ASLR per IBM recommendation for DB2 servers:' >> /etc/sysctl.conf
# echo '#   ASLR may cause intermittent failures in shmat() for any db2 processes other than db2sysc.' >> /etc/sysctl.conf
# echo 'kernel.randomize_va_space = 0' >> /etc/sysctl.conf

Obviously, I’ve included comment lines here. They help to keep it clear why something is defined – my hope is that if some System Administrator sees that at some point in the future, they would research or contact a DBA before changing the setting

Three HADR Failures

$
0
0

When you move DB2 servers from one hosting provider to another, you have to re-do hadr. Along with another DBA, I had 6 production databases across 3 instances to move last Saturday night, along with the HADR databases. The entire change had been tested ahead of time at least once, and probably more like 3 times, with no hiccups. But when we went to do it for real, we ran into three different HADR failures, so I thought I’d share them with my readers. Our solutions worked, but there may have been other options.

HADR isn’t “configured” properly

This is actually a common error message when you’re first setting up HADR. In that case, it most often means you have a typeo in one of the HADR parameters in the database configuration. AFTER HADR appears to have started successfully, it stops, and then you get errors like this in the db2diag.log:

2012-09-30-00.33.14.123075-240 I33173537E425      LEVEL: Error
PID     : 9586                 TID  : 182959892064PROC : db2hadrs (PWPTST) 0
INSTANCE: db2wps1              NODE : 000         DB   : PWPTST
FUNCTION: DB2 UDB, High Availability Disaster Recovery, hdrEduS, probe:20750
RETCODE : ZRC=0x87800140=-2021654208=HDR_ZRC_CONFIGURATION_ERROR
          "One or both databases of the HADR pair is configured incorrectly"

In this case, when I checked the HADR configuration and found it was all correct.

Primary

$ db2 get db cfg for PWPTST |grep HADR
 HADR database role                                      = STANDARD
 HADR local host name                  (HADR_LOCAL_HOST) = srv-db2p05
 HADR local service name                (HADR_LOCAL_SVC) = 18950
 HADR remote host name                (HADR_REMOTE_HOST) = srv-db2p08
 HADR remote service name              (HADR_REMOTE_SVC) = 18951
 HADR instance name of remote server  (HADR_REMOTE_INST) = db2wps1
 HADR timeout value                       (HADR_TIMEOUT) = 120
 HADR log write synchronization mode     (HADR_SYNCMODE) = NEARSYNC

Standby

$ db2 get db cfg for PWPTST |grep HADR
 HADR database role                                      = STANDARD
 HADR local host name                  (HADR_LOCAL_HOST) = srv-db2p08
 HADR local service name                (HADR_LOCAL_SVC) = 18951
 HADR remote host name                (HADR_REMOTE_HOST) = srv-db2p05
 HADR remote service name              (HADR_REMOTE_SVC) = 18950
 HADR instance name of remote server  (HADR_REMOTE_INST) = db2wps1
 HADR timeout value                       (HADR_TIMEOUT) = 120
 HADR log write synchronization mode     (HADR_SYNCMODE) = NEARSYNC

But I’ve seen these before, so I knew to check /etc/hosts. My HADR configuration uses host names, and DB2 then resolves those host names to IP addresses using the hosts file (/etc/hosts). In this case, /etc/hosts was correct on the standby Server, but incorrect on the Primary server. If you didn’t already know, this is a confirmation that the standby talks to the primary even before you get HADR started on the primary – I went through all of this before even issuing the command to start HADR on the primary server.
As soon as the hosts file was corrected, HADR stayed up on the standby, and I was able to start HADR on the primary and see them sync up.

An Odd One

This failure was the oddest of the three. When the command was issued to start HADR on the standby database, the following error was returned:

SQL1224N A database agent could not be started to service a request, or was terminated as a result of a database system shutdown or a force command.
SQLSTATE=*

My first thoughts on this error are to try it again, to try a db2 terminate, and to try stopping and starting the instance (not a big deal since this is a standby), but even after a db2stop/db2start, this message was still returned. There were no errors in db2diag.log. We then fail back to our general HADR setup bag of tricks. First, we took a new backup, and tried to restore it to see if that would work. It didn’t. Finally we resorted to dropping the database on the standby server, restoring the same image we had been using, and then re-configuring HADR. If you end up dropping your HADR standby database, you lose the HADR settings. That was what finally worked.

Bad Log File

The third failure we saw on Saturday night was a bad log file. After the restore, DB2 should be deleting all active log files. It usually gives you a warning message that it is doing this. But occasionally it doesn’t for whatever reason. In this case, again HADR looked like it started successfully, but then went down with the following in the db2diag.log:

2012-09-30-01.43.50.480225-240 I16080925E381      LEVEL: Error
PID     : 4826                 TID  : 182959892064PROC : db2hadrs (TS256P01) 0
INSTANCE: db2inst1             NODE : 000         DB   : TS256P01
FUNCTION: DB2 UDB, High Availability Disaster Recovery, hdrEduEntry, probe:21150
RETCODE : ZRC=0x87800148=-2021654200=HDR_ZRC_BAD_LOG
          "HADR standby found bad log"

In this case, at least the solution is simple. We deleted all the logs on the standby and then did the restore again, and it worked. As much as I hate deleting log files – especially since they were in the active path – it was necessary.

Conclusion

No matter how many times you test it, you can still run into issues when you go to do a change in production. It is important to be prepared to try different solutions. Sometimes you don’t even know the true problem – you simply have a set of solutions that have worked in the past for a given problem, and you work through them until something works.

Special thanks to Jim Reutener who I was assisting in this situation.

New Builds – Do You Have a Checklist?

$
0
0

In case anyone is wondering why I’m currently just barely managing one post a week, the first and most obvious reason is preparation for Black Friday/Cyber Monday. Retail clients really stress their databases on these days, and a bit of proactive work can go a long way. The other reason is because somehow someone thought it would be a good idea to schedule a go-live for a rather large client for early/mid November. If I figure out who, I may have to complain. But it got me thinking about a checklist in my own head that I roll through before go-live, so I thought this week’s two-hour or less post would be on that.

Purpose of a go-live Checklist and Details

Many people who work on WebSphere Commerce just for their smallish employer may have only one go-live, or maybe 2-3 over 10 years to cover hardware and major software/site upgrades. The DBAs where I work handle about 6-12 per year, on top of the on-going support, builds, and training. After a while we’ve built up a list of things to double check. Most of these we do during a build process that is 2 months or longer and just check off when we’re getting close to go-live.

My list is very specifically DBA focused – there is plenty more for WebSphere Commerce or your specific application that it may not cover.

DBA e-commerce Checklist for go-live

The things I check are for WebSphere Commerce, but they should all apply to all e-commerce and even many DW/DSS databases.

  1. Basic database maintenance is scheduled. This includes:
    • Backups
    • Reorgs, Runstats, Rbinds
    • Performance monitoring/Snapshots
    • Archiving of db2diag.log, instance.nfy, and cleaning up of DIAGPATH
    • Fail-safe maintenance check script to find silent maintenance failures
  2. Standard starting settings are in place. This includes:
    • DB2 Registry
    • DBM Configuration
    • DB Configuration
  3. Standard permissions scheme in place. This includes:
    • Revoking connect from PUBLIC
    • Giving the WebSphere Commerce database id DBADM and/or DATAACCESS
    • Creating groups for read-only and select/update/insert/delete access – per server if LDAP is used for database connections
  4. Data pruning strategy in place. This is one step that can be done either pre-go-live or shortly after go-live. This includes:
    • Discussing detailed plan with dev team and client to identify any gaps or custom pruning areas needed
    • Sign off by dev team and Project Manager and Client on all retention guidelines
    • Coding of custom pruning areas if needed
    • Scheduling of pruning scripts in crontab
  5. Failover tests for all types of HA and DR solutions used
  6. Performance review. This includes:
    • Preferably load testing. Please, please, please let this client do full load testing.
    • Detailed review of physical database performance, and tweaking of parameters
    • SQL review – even if client doesn’t do load testing, look for problem SQL
  7. Quick physical storage review – is any filesystem getting full as we load data in?
  8. Code – may not have time to apply a DB2 FixPack, but I like to know if I’m going to need to in the near future. Sometimes a new one came out between the time I built the servers and the time we go live.
  9. Licensing – did I remember to apply a license file to all servers?
  10. db2look – I like to grab the structure of the objects via a db2look as it is during the pre-go-live code freeze

So what am I missing?

Most of this is in my head and the head of one of our other DBAs – between two of us, we handle most of the go-lives.

“Now, now you two play nice”… DB2 and HACMP Failover

$
0
0

The holy grail of I/T is to be up all the time with no user impact. As most companies mature in the I/T area there is a shift from reactive tactics to proactive measures. There is a strong desire to be an industry leader and adhere to a “Five 9’s” mentality. The “Five 9’s” is a desire for 99.999% uptime of any given system or application.

So, how is this done? From a DBA’s perspective this means redundancy, the ability to pick up where we left off before an outage or performance impact occurred. There are many tools to address this issue: Power HA, DB2’s HADR, Veritas, TSA, Purescale, and Data Propagator just to name a few. For the purpose of this article we are going to focus on IBM’s Power HA (HACMP) and do a very brief comparison to DB2’s HADR. These are the more common methods of redundancy that a DBA may face.

What’s the difference?
To borrow from Ember’s previous post on HADR (Reference Article), HADR is essentially “DB2′s implementation of log shipping. Which means it’s a shared-nothing kind of product. But it is log shipping at the Log Buffer level instead of the Log File level, so it can be extremely up to date. It even has a Synchronous mode that would guarantee that committed transactions on one server would also be on another server”.

Power HA (or HACMP) is IBM’s solution for high availability clusters at an OS and hardware level. Power HA can run on up to 32 nodes “each of which is either actively running an application (active) or waiting to take over when another node fails (passive)” (Source: Wikipedia). Essentially specific disks are detached, swung over to a waiting passive node, and brought online.

Which solution is for you? There are arguments for and against both, and your individual environment and corporate policies will dictate which you choose. This article addresses the ins and outs of Power HA from a DBA’s perspective.

What this article will and will not cover.
Power HA is an unusual tool. You need a firm grasp of server level engineering as well as DB2. Unless you have a solid understanding of both worlds you will most likely be paired up with a System Administrator as you swap ideas, teach each other, and collaborate.

We will not be covering the nitty-gritty of Power HA configuration. What I will relay is how DB2 comes into play with failover – from a perspective of setting up DB2 for failover, to setting up filesystems, and using scripts to gracefully bring DB2 up and down.

I will be covering how Power HA is set up in my shop for a High Availability OLTP banking application where transaction times are measured in milliseconds and uptime is critical. We are running DB2 v9.7 on an IBM 570, model 9117-MMA, frame with POWER version 6 processors (P6) running AIX v6.1 TL6. This is a dual node cluster with each logical partition (LPAR) defined in a separate frame. The LPAR profiles are configured with a desired setting of 4.0 physical processors and 30 GB of physical memory.

As we discuss how DB2 and Power HA interact, I will reference our methodology and plan of attack for our specific environment. I will also provide and reference a script to control DB2 during failover. This script was developed hand in hand with a system administrator, tested in multiple environments, and deployed into production. The information provided here, including the script, is to be used at your own risk. Neither I nor my co-author guarantee the work or are responsible for its behavior in your environment.

Ok, now that legal is happy, let’s begin.

It’s all about the disk.
To over-simplify the process, Power HA listens to a heartbeat of the primary active server. When trouble arises and X amount of heartbeats are missed – Power HA yells “HANG ON”, initiates a failover, and swings defined volume groups from primary server to failover server. If you planned ahead, your application servers are already pointing to a Floating IP address, so the application continues to communicate during failover and is none-the-wiser when you come online on your standby server (which is now primary).

Now, it’s time to learn to speak geek of a different dialect. Want to impress your system administrator at a party? Drop big words like “Enhanced Concurrent Capable Volume Group”. You get geek points for that.In short, an “Enhanced Concurrent Capable Volume Group” is a very long description of what is “shared” or what disks fail over to the secondary server.

My counterpart and system administrator, Scott Robertson, described to me:

To build a volume group, you need physical disks.
To build a logical volume, you need volume groups.
*
To build a file system, you need logical volume.

*This is the level at which “sharing” between servers is defined.

In spending time with Scott, I learned that database administrators and system administrators look at this from opposite points of view. A SA looks at things from a bottom up perspective which starts at physical disks. A DBA looks at it from top down which starts at a filesystem. For example, from a DBA’s perspective we see.

Filesystem => Logical Volume => Volume Group (Enhanced Concurrent Capable) => Physical Disk

This means that when engaging the SA to figure out what “swings” between the servers you need to get your point across at the Volume Group level, and that may take a little one on one work to make sure you both understand each other clearly.

So how do we map this out? What swings over in failover and what doesn’t? Let’s take a closer look.

Red rover red rover, send the data disks on over.
In our shop, we designed our DB2 filesystems to a 1:1 match from filesystem to disk level (1 Isolated Filesystem to 1 Isolated Logical Volume to … you get the picture). This follows best practice for OLTP and gives us better speed, reliability, and reduces a single point of failure. Essentially, we look something like this (filesystem names are changed to protect the innocent)

Example HACMP ClusterExample of DB2 setup in a HACMP Cluster.

  • /opt/IBM/db2 – DB2 Binaries [Local]
  • /db2 – Where DB2 and Instances are held [Shared]
  • /db2data – Data is held here [Shared]
  • /db2log – Active Logs [Shared]
  • /db2logarchive – Archive Logs [Shared]
  • /db2backup – Database Backups [Shared]

Notice that /opt/IBM/db2 is NOT shared between active and passive. That is important because it means you have to be cognizant of a few things:

  • DB2 has to be installed individually on each server.
  • Licensing has to be handled individually on each server.
  • The database needs to be swung from active to passive server to upgrade DB2.
(Binaries, instance, and DB are upgraded on active; Binaries are the only upgrade on passive)

If you have come this far, you have won half the battle. Defining what swings over and managing DB2 logistics on two different servers is significant. Once done though, it’s easy to keep up with.

UNIX SA Note: 
If this is a new cluster, or even if you’re upgrading, take time at this point to test your Power HA configuration and ensure the “bones” of your failover are behaving as expected. Be diligent with your verification, try things such as, ifconfig down the primary Ethernet adapter from a console login, or try an immediate halt of the LPAR from the Hardware Management Console (HMC), or other actions that will simulate a failure of the primary node. You get the idea – just never assume it will work; test while you have “maintenance/build” time available.

What do you mean my scripts stopped running (and other “gotcha’s”)?
There are a few other “gotcha’s” to watch for when preparing for a Power HA setup. If you aren’t watching for these during the setup and maintenance phases you could run into performance issues upon failover. Worse yet, 30 days from failover you suddenly need to recover from a backup and realize that your backup script hasn’t been running.

First, the servers must be an exact match. This doesn’t mean kind of the same, or mostly the same, but an exact match. OS and DB2 versions down to the Tech Level and Fixpack should match. Local filesystems that don’t swing over should match in size and configuration. CPU, memory, and paging space should also mirror each other.

Learn from my fail (DBA):
 I had a production server swing during an outage, and then chased my own tail for two weeks on new performance problems. It wasn’t until the SA and I did a deep dive that we noticed OS and DB2 were not on matching Fixpacks, memory was slightly less on the failover box, etc. We wasted a lot of time and effort stabilizing a box that should have been an exact match.

UNIX SA Note: 
If your SA needs convincing about this, bribe them with doughnuts, bacon, and coffee, anything to help get the point across. Just as Mike stated, each AIX LPAR in the HACMP cluster should be identical in OS software version/revision/patches, filesystem and paging space sizing, as well as LPAR profile configuration for CPU/Memory, or you’ll find yourself chasing performance ghosts for days.

There are exceptions to this. For example, a company could make a strategic decision that the failover server is to limp along and “keep us afloat” as we get the other server fixed. The failover server is not meant to hold a full load for long and may have half the CPU and memory. However this is not common and I wouldn’t recommend it.

Your second concern is “Crontab” – Your Crontab is local to each machine and does not swing back and forth upon failover. This means you must maintain two sets of Crontab entries and keep them in sync. Unfortunately this is a necessary evil and a chore. However, my SA taught me a neat trick: If I edit each of my maintenance routine scripts to include one line in the beginning of the script, I don’t have to worry about commenting out Crontab on the failover server; I just make sure it is a duplicate.

In each script I was encouraged to add a line similar to this:

test -f /path/to/active/only/file || exit

If you test for something that exists only on the active server at the time – “db2profile” for example – the maintenance script will run on the active server but exit on the inactive server. With this method you won’t have to worry about what is commented out and what is active. You can say with confidence that your backups and maintenance routines are kicking off when you recover to the new server.

At this point, we have initial setup done. Now we need to tell Power HA how to handle DB2 in crisis. If you follow IBM’s recommendation you essentially force the database to a hard stop. So let’s look how I approached this scenario within my own shop.

Now, now … you two play nice.
Scott, my SA, can make Power HA do some pretty cool stuff. The failover capability and speed in which things can move are impressive. However, at some point, Power HA has to hook into DB2 to bring databases offline on the old server and online on the new server. If you ask your SA how Power HA is stopping DB2, they like Scott, will probably give you a confused look followed by ,“Well, uh … DB2 Off? No, Kill -9? Something stop?”

It’s not their fault – they are handling a complex setup with Power HA but rely on IBM to provide guidance on this. But IBM isn’t much better. Even if you look at example HACMP scripts provided by DB2 you see that in the end all that is issued is a “db2stop force”.

[Side note: Did you know IBM provides a ton of example scripts? Everything from useful administrative scripts to HACMP and HADR scripts. Check out “/opt/IBM/db2/V9.7/samples/” on your own server.]

This makes sense. From an SA point of view (and even IBM’s view), the server is “dorked” and probably not responding well. Because of this we need to bring down everything – we don’t really care how – and get over to the new server.

DB2STOP FORCE works fine and is not as detrimental as a db2_kill. It actually tries to force everyone off and do a rollback of work before stopping DB2. However, if your database was activated explicitly the database will never actually be deactivated via a DB2STOP FORCE and resources are not released naturally. This may – or may not – be the reason I have seen a few occasions of databases going into crash recovery on the new primary server even during a controlled failover.

I’ve also found that Power HA only fails over automatically a small fraction of the time. Often we see a failure coming and initiate failover ourselves (while the active server is still functional). Other times we decide we want to fix/upgrade one server so we manually fail to the other to buy us time.

If the server is functional most of the time, and failover is in a controlled manner, why do we not try to shut down gracefully? Let’s edit the DB2 shutdown scripts to force applications, deactivate databases, shutdown DB2 first. Then if all else fails issue a “db2stop force”?

Everyone in the lifeboat – the ship is going down!
Remember that HACMP “hook” into DB2? This is where you work with your SA to bring DB2 down gracefully. Essentially, Power HA operates under root, which can be defined to “su – “ to the proper instance ID, and execute a “Stop DB2” script and a “Start DB2” script. You can edit these DB2 scripts to include logic beyond the sample scripts which use only a “db2stop force”.

Here is how we manipulated our scripts – now, our scripts have been made to be more robust to handle multiple instances and multiple databases as well as some error checking, but this is the gist of our methodology.

Stop DB2 – stop_db2.ksh

  • Force Applications All
  • Deactivate each database
  • Force a DB2 Stop -db2stop force
  • Kill Straggling db2bp processes
  • Issue IPCLEAN to clear memory
    (Essentially, we try a clean shutdown; if we can’t, then force DB2 down).

Start DB2 – start_db2.ksh

  • Update sqllib/db2nodes.cfg to reflect new server name
  • Start DB2 – db2start
  • Activate Database – activate database

Updating the db2nodes.cfg file can be done a few ways. Because of limitations placed on us in our environments we have to physically change the hostname (see code below). However, I have seen virtual IP’s and HACMP Labels referenced in the db2nodes.cfg file so no alteration has to take effect. I have not done this explicitly in our environment but am aware of others that have.

Example Code to extract Hostname:
local_HOST=$(hostname | cut -d”.” -f1)
 echo “0 ${local_HOST} 0″ >db2nodes.cfg

Explicit activation of the database may seem pointless when the application or user can connect and bring the database online. However, this step is important for two reasons. First, some DB2 features require explicit activation of the database to function. An implicit activation doesn’t cut it. Second, explicit activation can improve performance by reducing startup time by initializing the database. The need for explicit activation is dependent on multiple factors, but in short explicit activation can’t hurt.

When developing your own shutdown/startup scripts you don’t have to reinvent the wheel. As I suggested, check out DB2’s sample directory which provides free example scripts to use for various scenarios ranging from single node to multi-node databases.

Sample Script HACMP/Power HA Directory:
/opt/IBM/db2/V9.7/samples/hacmp

You can also download a copy of the script developed by Scott Robertson and I which we use in our own environments. For the most part, this script should be “plug and play” for any single node distributed server. Our scripts contain basic error checking and can work with multiple instances, databases, and versions of DB2 residing on one server or LPAR.

Example HACMP Scripts can be downloaded here – Downloadable Zip

As stated before, use this script at your own risk. We do not guarantee the script nor are we responsible for any damage caused. This is a starting place for you to develop your own script and methodology.

Before I go on, I would like to take a second to thank Scott Robertson. This script is the result of locking ourselves in a small meeting room, putting thoughts to paper, ultimately coding these scripts, and days of testing. His scripting ability is much stronger than mine and this script could not have been developed without a collaborative effort with him. Well … and coffee – lots of it. I don’t know about you, but I bribe my SA with coffee to help me.

Final UNIX SA Note: 
If coffee is your preferred “incentive” for requests like this, insist on quality flavors from one of the nearby name brand coffee houses, not the break room.

Attaining the “Five 9’s”
In the end, an uninterrupted service time is almost unattainable. However, many times it is about progress, not perfection, and proactive planning will help you get closer to that goal. Power HA or HACMP is only one tool in your arsenal of many to help keep your system online. Hopefully, this article gets you a little closer to that goal.

Good luck with your own setup. I encourage you to write feedback below (or send e-mail) letting us know your successes and failures with your Power HA setup. As you work your own environments, please feel free to contact Scott or I for any follow-up questions you may have. You have resources available to help you here – take advantage of them.

Finally, I would like to thank my good friend Ember for allowing me to share her little section of the internet. Without her blog we would be unable to pass on lessons learned and help others through our writing.


About the Authors:

Picture of Mike Krafick Michael Krafick has been a production support DBA for over 12 years in data warehousing and highly transactional OLTP environments. He was acknowledged as a top ten session speaker for “10 Minute Triage” at the 2012 IDUG Technical Conference and recent guest blogger for http://db2commerce.com. Michael also has extensive experience in setting up monitoring configurations for DB2 Databases as well as preparing for high availability failover, backup, and recovery. He can be reached at “Michael.Krafick (at) icloud (dot) com”. Linked-in Profile: http://www.linkedin.com/in/michaelkrafick . Twitter: mkrafick
Mike’s blog posts include:
10 Minute Triage: Assessing Problems Quickly (Part I)
10 Minute Triage: Assessing Problems Quickly (Part II)
Now, now you two play nice … DB2 and HACMP failover
Technical Conference – It’s a skill builder, not a trip to Vegas.
Why won’t you just die?! (Cleaning DB2 Process in Memory)
Attack of the Blob: Blobs in a Transaction Processing Environment

Picture of Scott Robertson Scott Robertson has been a Unix Systems Administrator for over 24 years in production support of anything from small applications to very large database warehouses. His experience over the years includes many Unix aspects such as systems installation, routine maintenance, day-to-day user support, filesystem management, network management, security management, and is always trying to replace repetitive tasks with a shell script. He can be reached at “unxscorob @ gmail.com” Linked-in profile: http://www.linkedin.com/in/unxscorob

WebSphere Commerce Instance Creation Creates Database as Wrong User

$
0
0

This post is specific to WebSphere Commerce.

We’ve reported this issue to IBM, but since we’ve run into it several times across more than a year, and in multiple different Fix Packs of Commerce, I thought I’d share it in case someone else runs into it. The main way it manifests initially is like this:

/configureWorkspaces.xml:245: com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-551, SQLSTATE=42501, SQLERRMC=DB2INST1;SELECT;WSCOMUSR.KEYS, DRIVER=4.14.122

The user ‘DB2INST1′ in the above may change, but basically an error like this comes up somewhere along the line saying that your DB2 instance owner does not have permissions on the database.

We only see this for an instance creation where isRemote is set to false.

I’m not sure that anyone cares about the root cause of the issue, but our engineers narrowed it down to a single line that fails in one of the Commerce scripts – COMMERCE_HOME/bin/createdb.db2.sh in Fixpack 5, line 155(also in later fixpacks, at least to FP7):

db2 -v attach to $DB2INSTANCE user $USER using $PASSWORD >> $LOG 2>&1

$DB2INSTANCE is undefined anywhere else during this process. It results in a minor error during DB creation:

attach to user db2inst1 using db2inst1
SQL0104N  An unexpected token "db2inst1" was found following "USER".  Expected tokens may include:  "USER".  SQLSTATE=42601

The underlying problem is that the db2profile was not sourced for the user id running the instance creation prior to running the instance creation.

This issue is only seen if you are using separate ids for DBAuser, DBuser, and running the instance creation (which you should be!). It appears to me that WebSphere Commerce is assuming you are using the same ID for everything, so you would already have the db2profile sourced.

The key to preventing this is to ensure that the db2profile is sourced by the user in question prior to executing the instance creation. You may have to do this in the .profile, .bash_profile or .bashrc, but it is easy to add lines like this (changing paths depending on where your $INSTANCEHOME is):

if [ -f /db2home/db2inst1/sqllib/db2profile ]; then
    . /db2home/db2inst1/sqllib/db2profile
fi

Problem with DB2 Federation to an Informix Source when Applying a Fixpack

$
0
0

I can’t say that I work with federation on a daily basis. I have, however, set up federation for an Oracle data source from top to bottom, and support at least one system on a daily basis that uses federation to access Oracle, Informix, and DB2 for AS/400. This database also happens to be a BLU database, and as such, we want to stay really current on the fix pack. Currently with BLU being so new, there can be some drastic differences with just a fix pack.

The Problem

After applying Fix Pack 6 of 10.5, querying any Informix nickname received this error:

SQL1416N  Wrapper library "libdb2informixU.a" is not  compatible with the
release of DB2 installed at the federated server. The wrapper library is
compatible with  the following DB2 releases "10.5.4.0".  SQLSTATE=560CN

All of the other nicknames (Oracle and AS400) worked just fine. I called IBM DB2 support fairly quickly on this issue. After attempting to reinstall the fix pack about 4 times. Luckily this particular data was some that the client only uses about quarterly, so there was little urgency behind solving the problem. Between waiting on IBM DB2 support and waiting on the client to schedule the multiple outage windows needed, the PMR was opened on January 25th, and the problem was not finally solved until March 12th.

Timeline

Things I tried before calling IBM support:

  • Re-installing the fix pack (several times)
  • Running djxlinkInformix and djxlink from /opt/IBM/db2/V10.5/bin, as root, with DB2 down
  • Downloading the fix pack specific to federation, running db2_install -p rcon, to attempt to install Informix federation libraries from scratch.

Support’s fist suggestion included following the shut-down instructions from the IBM DB2 Knowledge Center and trying fix pack 7. While I think I’m pretty decent at stopping DB2 for fix packs and upgrades, I humored support and followed the shutdown instructions in order, and the client was happy to go with the most recent fix pack. When I had originally recommended fix pack 6, 7 was not out yet, and by this time it had been out for enough time that I was comfortable going with it. I didn’t think going with the most recent fix pack was likely to help, but I also didn’t think it would hurt anything. I tend to err on the side of accepting IBM support’s recommendations unless I think they will actually be harmful or if it’s a system-down situation and I think they’re a complete waste of time. These initial suggestions did not solve the problem. On one of the attempts at installing fixpack 7, I took an installation trace using:

./installFixPack -l <log-file-name> -t <trace-file-name>

This generated some additional data, which I sent off to IBM support.

Support also asked for the following information:

$ cd /opt/IBM/db2/V10.5/install
$ ./db2ls -q -b /opt/IBM/db2/V10.5

Install Path : /opt/IBM/db2/V10.5

Feature Response File ID             Level   Fix Pack   Feature Description
---------------------------------------------------------------------------------------------------------------------
BASE_CLIENT                        10.5.0.7          7   Base client support
JAVA_SUPPORT                       10.5.0.7          7   Java support
SQL_PROCEDURES                     10.5.0.7          7   SQL procedures
BASE_DB2_ENGINE                    10.5.0.7          7   Base server support
CONNECT_SUPPORT                    10.5.0.7          7   Connect support
DB2_DATA_SOURCE_SUPPORT            10.5.0.7          7   DB2 data source support
JDK                                10.5.0.7          7   IBM Software Development Kit (SDK) for Java(TM)
LDAP_EXPLOITATION                  10.5.0.7          7   DB2 LDAP support
INSTANCE_SETUP_SUPPORT             10.5.0.7          7   DB2 Instance Setup wizard
ACS                                10.5.0.7          7   Integrated Flash Copy Support
COMMUNICATION_SUPPORT_TCPIP        10.5.0.7          7   Communication support - TCP/IP
DB2_UPDATE_SERVICE                 10.5.0.7          7   DB2 Update Service
REPL_CLIENT                        10.5.0.7          7   Replication tools
DB2_SAMPLE_DATABASE                10.5.0.7          7   Sample database source
ODBC_DATA_SOURCE_SUPPORT           10.5.0.7          7   ODBC data source support
TERADATA_DATA_SOURCE_SUPPORT       10.5.0.7          7   Teradata data source support
JDBC_DATA_SOURCE_SUPPORT           10.5.0.7          7   JDBC data source support
ORACLE_DATA_SOURCE_SUPPORT         10.5.0.7          7   Oracle data source support
SQL_SERVER_DATA_SOURCE_SUPPORT     10.5.0.7          7   SQL Server data source support
CUSTOM_DATA_SOURCE_SUPPORT         10.5.0.7          7   Custom data source support
FIRST_STEPS                        10.5.0.7          7   First Steps
GUARDIUM_INST_MNGR_CLIENT          10.5.0.7          7   Guardium Installation Manager Client
SYBASE_DATA_SOURCE_SUPPORT         10.5.0.7          7   Sybase data source support

After this, support determined that INFORMIX_DATA_SOURCE_SUPPORT was not installed. This is odd, as we had been using it successfully for months. The fix for this was to manually untar and copy some files:

/bin/gunzip -c /db2home/db2inst1/fixpack7/universal/db2/aix/install/../../../db2/aix/FILES/INFORMIX_DATA_SOURCE_SUPPORT_10.5.0.7_aix64_ppc.tar.gz | (cd /opt/IBM/db2/V10.5; /bin/tar xvf -)

This required another outage as it had to be done while this instance was down, and then updates for the instance needed to be run (as root), specifically:

cd /opt/IBM/db2/V10.5/bin
./djxlinkInformix
cd /opt/IBM/db2/V10.5/instance
./db2iupdt -k db2inst1

This is what finally worked. I’m told that there’s a .metadata file where the installed DB2 componnents are listed. In this file, INFORMIX_DATA_SOURCE_SUPPORT was NOT listed. This meant that DB2 did not know to update it when a fix pack was installed. This seems to be chalked up to some sort of silent failure either when DB2 was first installed, when fix pack 4 was installed, or when someone added Informix support. None of these actions were performed by me. The error was limited to only the .metadata file, though, because we have been successfully using Informix support all year.

I can also now see INFORMIX_DATA_SOURCE_SUPPORT in the db2ls output, which I hope means this won’t occur the next time I go to apply a fix pack:

$ ./db2ls -q -b /opt/IBM/db2/V10.5

Install Path : /opt/IBM/db2/V10.5

Feature Response File ID             Level   Fix Pack   Feature Description
---------------------------------------------------------------------------------------------------------------------
BASE_CLIENT                        10.5.0.7          7   Base client support
JAVA_SUPPORT                       10.5.0.7          7   Java support
SQL_PROCEDURES                     10.5.0.7          7   SQL procedures
BASE_DB2_ENGINE                    10.5.0.7          7   Base server support
CONNECT_SUPPORT                    10.5.0.7          7   Connect support
DB2_DATA_SOURCE_SUPPORT            10.5.0.7          7   DB2 data source support
JDK                                10.5.0.7          7   IBM Software Development Kit (SDK) for Java(TM)
LDAP_EXPLOITATION                  10.5.0.7          7   DB2 LDAP support
INSTANCE_SETUP_SUPPORT             10.5.0.7          7   DB2 Instance Setup wizard
ACS                                10.5.0.7          7   Integrated Flash Copy Support
COMMUNICATION_SUPPORT_TCPIP        10.5.0.7          7   Communication support - TCP/IP
DB2_UPDATE_SERVICE                 10.5.0.7          7   DB2 Update Service
REPL_CLIENT                        10.5.0.7          7   Replication tools
DB2_SAMPLE_DATABASE                10.5.0.7          7   Sample database source
INFORMIX_DATA_SOURCE_SUPPORT       10.5.0.7          7   Informix data source support
ODBC_DATA_SOURCE_SUPPORT           10.5.0.7          7   ODBC data source support
TERADATA_DATA_SOURCE_SUPPORT       10.5.0.7          7   Teradata data source support
JDBC_DATA_SOURCE_SUPPORT           10.5.0.7          7   JDBC data source support
ORACLE_DATA_SOURCE_SUPPORT         10.5.0.7          7   Oracle data source support
SQL_SERVER_DATA_SOURCE_SUPPORT     10.5.0.7          7   SQL Server data source support
CUSTOM_DATA_SOURCE_SUPPORT         10.5.0.7          7   Custom data source support
FIRST_STEPS                        10.5.0.7          7   First Steps
GUARDIUM_INST_MNGR_CLIENT          10.5.0.7          7   Guardium Installation Manager Client
SYBASE_DATA_SOURCE_SUPPORT         10.5.0.7          7   Sybase data source support

IBM support tells me that simply running db2_install over again would have fixed this issue, too.

Summary

It took six weeks to get from problem to resolution. Part of that is that it was not critical to the client to have this functionality working, since this client only uses the Informix nicknames about once per quarter. The severity with IBM Support was somewhat lessened because of this. Also, at least two complete weeks of that was waiting to get an outage window that I needed. So the main question this whole thing raises for me is why a very obvious error was not generated either at the time of initial install of fix pack 4 or later with fix pack 6 that something was not right. This is the first time since the bad old days when special builds came as a few files to be carefully copied that I’ve had to mess with manually copying a file to the DB2 install directory. Somewhere along the line there was a silent failure here, and no one can tell me where or why. Hopefully if someone else runs into a similar issue, this blog entry will help them. On the positive side, I now have a new skill in my toolbox.

This is also a reminder to test all functionality including federation after any fix pack. Even if there are no error messages and if core functionality seems to work fine, there can be areas like this where something is wrong.

DB2 Basics: Patching DB2

$
0
0

Like any software, DB2 requires frequent patching. A database should be one of the most secure parts of any enterprise, and keeping it secure means keeping up with the fixes that are delivered in fix packs.

Fix Packs

DB2 delivers many things through fixpacks, including:

  • Security Fixes
  • Bug Fixes
  • New Functionality – though IBM goes back and forth on this

IBM delivered Native Encryption in Fix Pack 5 of DB2 10.5. This was a pretty new feature to be delivered in a fix pack. However, I hear rumors that they’re going to stop delivering new features in fix packs. They seem to go through cycles of either delivering significant functionality via fix pack, then a few years later, reserving all functionality for version-level releases.

How Current is it Wise to be?

In the past, there have been several situations where IBM has released a fix pack, only to withdraw it 24 or 48 hours later, to be replaced with a new version of the fixpack (differentiated with an ‘a’ or ‘b’ after the fix pack number). I think they once even got to ‘c’. This means that at some time after releasing the fix pack, they found a problem so significant that they felt it too dangerous to just let it be. I have also waited with bated breath for some fix packs when a fix was to be included that was not previously available.

While I would never advocate moving to a new full version so soon, I am comfortable recommending any new fix pack that has been out a week or longer. Fix packs far more frequently solve problems than they cause problems. There is no need to wait a quarter or to always be down by one in my experience.

Justifying a Fix Pack

If you have ever worked for a company with an “If it ain’t broke, don’t fix it” mentality, you know how hard it can be to get even the most minor change approved. In many cases, that mentality may also apply to patching software. That may mean you have to have a very specific reason to apply a fix pack. I find that the best justification often comes from the page that lists all security and HIPER (High Impact/PERvasive) APARS. There are usually scary enough APARs listed for any fix pack to justify applying the fix pack.

A Few Important Terms

PMR

A PMR is a Problem Management Record. It is the case that IBM opens up when you call in for support. Except for the free edition, DB2 Express-C, all editions of DB2 come with support – this is not an additional charge you have to pay on top of licensing. Like with most software, there is an annual fee to maintain licensing compliance, and this fee includes support as well.

APAR

An APAR is an Authorized Program Analysis Record. IBM creates these when they run across bugs or problems in the DB2 code. Sometimes an APAR is the result of a PMR that a customer opened with IBM, and other times it comes from internal IBM sources. APARs are grouped together into fix packs. DB2 does not offer individual patches for individual APARs in most situations.

Special Build

Sometimes if you are stuck at a particular fix pack for a good reason and really need the fix for a particular APAR, IBM will offer you a “special build” (why is this not an acronym, when everything else is?!?). A special build means that IBM is building a particular fix on top of a lower fix pack just for you. This means the code may be a little less tested, but it is usually still code that was already developed and tested by IBM long before you opened a PMR. I remember the bad old days when a special build was just a few files that came with instructions for manual replacement. These days, applying a special build is about like applying a fixpack.

Vendor Certification

Some vendors certify on a specific fixpack of DB2. If you are working with a vended database, please check to make sure your vendor supports the fixpack before applying it.

Testing

Fix packs should always be installed in a non-produciton enviornment first, and tested as thoroughly as possible there – including load testing, if possible.

High-Level Overview of Fix Pack Installation

Installing a fix pack is a time-worn and time-tested procedure. I haven’t seen a fixpack go really wrong in years, but I have seen enough in my career to take some preventative steps. Here are the general parts of the process:

  1. Ensure you have not just the code you are upgrading TO, but also the code you are upgrading FROM on the server
  2. Take a full database backup (offline if possible, online if not)
  3. Backup all configuration information and the database structure
  4. Stop DB2 completely
  5. Install the fixpack using the installFixPack command
  6. Update all DB2 instances using the db2iupdt command
  7. Start DB2
  8. Connect to each local and remote database and bind the cli and ubind lists and db2schema.bnd
  9. Verify all databases
  10. Collect all configuration information again in case changes are later noticed
  11. After you are sure the the fixpack will not be backed out, run the db2updvNNN command for the correct version to make any changes needed to the catalog data structures (this may be days or weeks later, or may be in the same outage window)

For any fix pack, you should read the readme provided with the fixpack to see if there are any new actions required.

High-Level Overview of Fix Pack Installation with HADR

With HADR, you can often apply a fix pack with 10 minutes or less of perceived outage. The steps are similar, but with actions performed on two different servers. For these steps, we start with the primary database residing on server1.

  1. Ensure you have not just the code you are upgrading TO, but also the code you are upgrading FROM on both servers
  2. (server1)Take a full online database backup
  3. (server1 and server2)Backup all configuration information. On the primary(server 1), also the database structure
  4. (server2)Verify that HADR is fully in sync and then stop HADR on server 2 only
  5. (server2)Stop DB2 completely
  6. (server2)Install the fixpack using the installFixPack command
  7. (server2)Update all DB2 instances using the db2iupdt command
  8. (server2)Start DB2
  9. (server2)Start HADR and wait for the servers to be fully in sync
  10. (server2)Issue the takeover command to make server2 the primary – without forcing it – Potential perceived outage during the takeover
  11. (server2)Connect to each local and remote database and bind the cli and ubind lists and db2schema.bnd
  12. (server2)Verify all databases
  13. (server1)Stop DB2 completely
  14. (server1)Install the fixpack using the installFixPack command
  15. (server1)Update all DB2 instances using the db2iupdt command
  16. (server1)Start DB2
  17. (server1)Start HADR and wait for the servers to be fully in sync
  18. <IF DESIRED>(server1)Issue the takeover command to make server1 the primary – without forcing it – Potential perceived outage during the takeover
  19. (primary server)Collect all configuration information again in case changes are later noticed
  20. (primary server)After you are sure the the fixpack will not be backed out, run the db2updvNNN command for the correct version to make any changes needed to the catalog data structures (this may be days or weeks later, or may be in the same outage window)

The biggest risk when doing a fix pack on HADR in my experience is that you may not have tested application connectivity to the standby previously – if this is the case, your applications may not function while the database is running on server2.

Back Out

Every good change comes with a back out plan, and fix packs should be no exception. My very first weekend on pager duty at IBM as a DB2 DBA with three months of experience, straight out of college, I had to back out a fix pack on a teammate’s account. The teammate was also three months out of college and had not documented a back out plan. I managed to back it out, but it was very painful. This was DB2 version 7, most likely, and looking back, I think I did not stop DB2 before getting the AIX SA to use smit to remove the applied code. Yes, that big of a mistake I made because I had NO clue. I was trying my best with three months of on-the-job training. I eventually got the thing backed out, but it took the better part of a day. The reason the back out was needed in that case? It was a vended database, and the vendor had not certified the fix pack in question. Because of early experiences like this, I have meticulous back out plans. Generally a fix pack back out looks like this:

  1. Take a full database backup (offline if possible, online if not) – sometimes where you were is better than where you get to, even if it seemed pretty bad to start with
  2. Backup all configuration information and the database structure – again, sometimes where you were is better than where you get to, even if it seemed pretty bad to start with
  3. Stop DB2 completely
  4. Install the original, old fix pack using the installFixPack command with the `-f level` option
  5. If the above does not work, uninstall and reinstall db2 entirely using the db2_deinstall and db2_install commands – be prepared to fully reconfigure
  6. Update all DB2 instances using the db2iupt command
  7. Start DB2
  8. Connect to each local and remote database and bind the cli and ubind lists and db2schema.bnd
  9. Verify all databases
  10. Collect all configuration information again in case changes are later noticed

Does that look familiar? Backing out a fix pack is almost the same procedure as applying a new fix pack, assuming you have not run the db2updvNNN command. If you have already run that command, and it made any changes, you will not be able to back out that fix pack.

Different Editions

The only difference I am aware of for any edition is that you cannot apply a fix pack to DB2 Express-C.
These instructions do not cover PureScale environments.

Strange Problem Installing DB2 11.1, Fix/Mod Pack 1 on Ubuntu

$
0
0

I ran into an interesting problem installing 11.1, fix/mod pack 1 on Ubuntu, and thought I would share. Please read to the bottom before trying anything, as this entry goes through things I tried that did not work before I got to what did work.

The Problem

I needed to rebuild a sandbox VM, and use Ubuntu for my sandboxes most of the time. I installed DB2 from fix/mod pack 1 of DB2 11.1. Running my favorite install method (db2_install), I received this error message, after step 48:

Segmentation fault (core dumped)
/db2home/db2inst1/universal/db2/linuxamd64/install/db2setup: 1: /db2home/db2inst1/universal/db2/linuxamd64/install/db2setup: /usr/local/bin/db2ls: not found

I even rebuilt the VM to see if I had made a mistake somewhere. I ran db2prereqcheck again to ensure I had all the prerequisite packages.

The next thing I tried was installing using db2setup. As much as I hate working with a GUI, IBM has been pushing it for a while now. db2setup received this error:

./db2setup: 1: ./db2setup: /usr/local/bin/db2ls: not found

When I tried to create an instance on either of these installations, it failed with an error:

# ./db2icrt -u db2fenc1 db2inst1
DBI1446I  The db2icrt command is running.


DB2 installation is being initialized.

 Total number of tasks to be performed: 4 
Total estimated time for all tasks to be performed: 309 second(s) 

Task #1 start
Description: Setting default global profile registry variables 
Estimated time 1 second(s) 
Task #1 end 

Task #2 start
Description: Initializing instance list 
Estimated time 5 second(s) 
Task #2 end 

Task #3 start
Description: Configuring DB2 instances 
Estimated time 300 second(s) 
Task #3 end 

Task #4 start
Description: Updating global profile registry 
Estimated time 3 second(s) 
Task #4 end 

A minor error occurred during the execution.

For more information see the DB2 installation log at "/tmp/db2icrt.log.16398".
DBI1264E  This program failed. Errors encountered during execution were
      written to the installation log file. Program name:
      db2icrt. Log file name: /tmp/db2icrt.log.16398.

Explanation: 

This message is returned when some processes and operations have failed.
Detailed information about the error was written to the log file.

User response: 

Contact IBM support to get assistance in resolving this issue. Keep the
log file intact as this file is an important reference for IBM support.

Looking at the log file for the db2icrt, I saw this:

# cat /tmp/db2icrt.log.16398

DB2 Setup log file started at:  Wed Jan 04 06:45:39 PM 2017 PST
============================================================

Operating system information: Linux 4.4.0-31-generic.#50-Ubuntu SMP Wed Jul 13 00:07:12 UTC 2016 x86_64 
                                        
                                        
New instances:                          
    Instance name:                          db2inst1
        Instance user information:          
            User name:                      db2inst1
        Fenced user information:            
            User name:                      db2fenc1
                                        
                                        
                                        
                                        

Setting default global profile registry variables :.......Success 
The maximum number of logical nodes was not specified for the instance
"db2inst1". Default parameters will be used.

Initializing instance list :.......Success 
ERROR: ERROR:  The embedded runtime path in /opt/ibm/db2/V11.1/bin/db2 is incorrect:
        /DoNotCreateThisPath_marker1_for_chglibpath:/view/db2_v111m1fp1_linuxamd64_s1612051900/vbs/INST/lib:/view/db2_v111m1fp1_linuxamd64_s1612051900/vbs/INST/lib/gskit:/view/db2_v111m1fp1_linuxamd64_s1612051900/vbs/engn/lib:/view/db2_v111m1fp1_linuxamd64_s1612051900/vbs/common/lib/Linux_AMD64:/view/db2_v111m1fp1_linuxamd64_s1612051900/vbs/das/lib/Linux_AMD64:/view/db2_v111m1fp1_linuxamd64_s1612051900/vbs/bldsupp/lib:/view/db2_v111m1fp1_linuxamd64_s1612051900/vbs/system/fm/lib/Linux_AMD64:/fillspacexxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:/fillspacexxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:/fillspacexxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:/fillspacexxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:/fillspacexxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:/fillspacexxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:/fillspacexxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:/marker2_for_chglibpath:/opt/ibm/db2/V11.1/lib64:/opt/ibm/db2/V11.1/lib64/gskit

ACTION: Please run /opt/ibm/db2/V11.1/install/db2chgpath and rerun the previous command.
        Contact IBM Support if the problem persists.
ERROR: An error occurred while configuring the instance "db2inst1".

Configuring DB2 instances :.......Failure 
Updating global profile registry :.......Success 

Following the instructions, I ran db2chgpath as root:

# /opt/ibm/db2/V11.1/install/db2chgpath
The output will be saved in /tmp/db2chgpath.log.16598
Starting the update of runtime path ...
Wed Jan  4 18:46:36 PST 2017

Changing the embedded runtime path for DB2 deliverables installed
under /opt/ibm/db2/V11.1 from /opt/ibm/db2/V11.1/ to /opt/ibm/db2/V11.1/
---> Please wait

Output was saved in the log file /tmp/db2chgpath.log.16598
Wed Jan  4 18:47:14 PST 2017
Program db2chgpath completed successfully.

After that, I was able to successfully create a db2 instance.

Before starting DB2, I had to find the default license file from the install code and apply it:

db2licm -a /db2home/db2inst1/universal/db2/license/db2ese.lic

Because everything was so odd with this, I then ran db2val to validate my DB2 installation. It failed on validating the instance I just started, saying:

DBI1342E  Instance db2inst1 does not exist in the current DB2
      copy.

Explanation: 

The specified instance does not exist in the current DB2 copy and will
not be validated.

When installing 11.1 from the GA code, I see 57 steps, and the above failures happened after only number 48, so there are clearly a significant number of things missing. It is clear that simply powering through and trying to address the errors one by one is probably not a good idea. The last issue could probably have been addressed by manually setting the one or more parameters at some level in the db2 registry. db2ilist from the code on /opt returned the instance name, while db2ilist from sqllib did not. But at some point the layers of errors point to the larger issue that needs to be addressed instead.

I get exactly the same error if I first install the 11.1 base code and then try to apply FixPack 11, which is particularly perplexing:

Segmentation fault (core dumped)
./installFixPack: 1: ./installFixPack: /usr/local/bin/db2ls: not found

The Fix

Without IBM listing it as a prerequisite, rpm is required. It can be installed using this syntax:

apt-get install rpm

After adding this to my list of pre-install steps, the install from the fix/mod pack 1 code is successful.

The Cause

An APAR has been opened for this – IT18668. I’ll add the link for this when it is published.

It sounds to me like this is part of the TSAMP install requirements. The funny thing is that TSAMP is expressly not supported on Ubuntu. It sounds like IBM will have it fixed in a future fix/mod pack. I don’t think Ubuntu is used for DB2 in production scenarios very often, so the install process is likely less thoroughly tested, but this is just my conjecture. Most of the DB2 on Linux that I see is RedHat.

This is one of the most severe install defects I have seen introduced in a fix pack. While it doesn’t affect normal operations of a running database, if you were actually using Ubuntu in production, you might be surprised by this during an update outage and have to back out or take a longer outage to resolve it. I did not observe this problem in the 11.1 GA code. IBM tells us that DB2 is now more stable than ever because changes to DB2 are used in their cloud environment(s) before they are released to the public. However, that cloud environment is deployed on specific hardware and uses specific OSes. Less frequently used OSes like Ubuntu may not have their code as thoroughly tested. Again, this is just my guess – I have no inside knowledge on this topic.

It is also interesting to note that this is not the first DB2 Ubuntu install issue where the workaround is installing rpm. DB2 10.1 GA had an install issue that was solved by installing rpm. Thanks to @Muralichava for pointing that out.

Thanks, IBM!

IBM was wonderfully helpful and amazing while I was working on this issue. Since I was just installing a random sandbox and not a real, licensed, environment, I didn’t have the right to open a PMR on it. I tweeted about the issue right before logging off for the night around 9 PM, and just a half hour into my work day the next day, they were asking for more info. Before noon, they had a solution. Big thanks to Jessica Rockwood (@jrockwood) and Abhinav Goyal (@agoyal_DB2).

Building a Sandbox VM for DB2

$
0
0

There are plenty of things that I want to try in a sandbox VM before I let them anywhere near even a development environment. Even if I didn’t use it constantly for blogging, I would still need it for trying things to see how they work before advising clients. These instructions should never be used to build a development, test, qa, or any other environment. More robustness is required for any other kind of environment.

The first thing to know about building a VM is that you’re a user doing admin-level tasks with one or more pieces of software. Things are going to go wrong. You’re likely to have to Google errors and try again. Building a new VM can be frustrating – patience, troubleshooting, and perseverance are all called for.

First, Build a Linux VM

The instructions are going to vary here depending on your distribution. For sandboxes, Ubuntu is free and easy. You can download it here: https://www.ubuntu.com/download/desktop

This version comes with all the desktop stuff, but honestly, being able to run a web browser can be useful from time to time on a sandbox. The download comes as an .iso file. You can use your favorite (free or not) VM software to create a new VM. I used to use Oracle Virtual Box, but recently switched to VMWare Workstation Player, and am enjoying it a lot. You do not need a paid version of the VM software simply to create VMs for your own use. You may need it to do anything more advanced than that or to share VMs. You can download VMWare Workstation Player here: http://www.vmware.com/products/player/playerpro-evaluation.html

I’m keeping the instructions general so whatever software you have available can be used.

Once you have the VM software installed, you can create a new VM, and specify the ISO of Ubuntu or other Linux distribution to install on the VM. The choices are fairly simple for VMWare, and straight forward. You will also want to install the VMWare (or Virutal Box) tools on on the VM. This will make nifty things like easy resizing and copy/paste to/from the VM work well and mostly seamlessly. You will have to choose how much memory and disk to give the VM – your choices there will depend on what computer you’re installing it on and what else you’re running there. Remember to leave some memory for the host OS. I generally do 4 GB, but I think you could get by with 2. I have a laptop with 16 GB of memory and never really run more than 2 VMs at once (one Windows and one Linux) in addition to the host operating system.

Download DB2

There are several ways to go here. Note that any licensing statements are the author’s opinion at the time this article was written, and should be verified with IBM. They also may change over time.

DB2 Express-C

The first is completely free – DB2 Express-C. It has many of the features of DB2, but is limited to 2 cores, 16 GB of memory, and 15 TB of data. The nice thing about this is that you don’t have to pay for it, and it’s a permanent install. You can download Express-C here:
https://www.ibm.com/developerworks/downloads/im/db2express/

DB2 Trial Version (from Fix Pack)

DB2 Fix Packs are freely downloadable and include a full image of DB2. You can download the fixpack and install from it, but these are only try and buy licenses, meaning they expire after 90 days. And by expire, I mean become unusable other than to apply a license file. Fixpacks are available here, with your free IBM ID: http://www-01.ibm.com/support/docview.wss?uid=swg27007053

Entitled DB2 from Passport Advantage

If you have DB2 Developer Edition or other entitled versions from IBM that include the ability for you to use them in a sandbox environment, you can download them from Passport Advantage. You’re likely to also have to download the Quick Start/Activation kit as well and apply the license file.

Business Partner Software Access Catalog

If you work for an IBM business partner, there’s something called the Software Access Catalog. Make sure you’re using the software in an approved manner if you download it from this source. The nice thing about this is that you have access to complete versions of every edition of DB2. IBM relies on you, as a business partner, to ensure you’re using the software in a legal way.

Transferring Files to the VM

You can download directly to your VM using a web browser there, or download to the host machine (my laptop, in my case), and create a shared folder. I find a shared folder quite useful over and over again, so I create one whenever I create a VM. I have one that I share with all my VMs to keep things simple. It’s fairly easy to do this in the various VM softwares. Here is what it looks like for my VMWare player VM:
shared_folder

You’ll have to have the vm software’s tools installed on both the host and the VM for this to work.

Installing DB2

However you get it, the installation is really similar. I’m a command-line gal, so this is my preferred method:

  1. Create a user for the db2instance owner and a group to be the sysadm group:
    $ sudo groupadd -r db2iadm1
    $ sudo mkdir /db2home
    $ sudo mkdir /db2home/db2inst1
    $ sudo mkdir /db2home/db2fenc1
    $ sudo useradd -d /db2home/db2inst1 -g db2iadm1 -r db2inst1
    $ sudo useradd -d /db2home/db2fenc1 -g db2iadm1 -r db2fenc1
    $ sudo chown db2inst1:db2iadm1 /db2home/db2inst1
    $ sudo chown db2fenc1:db2iadm1 /db2home/db2fenc1
    
  2. Unzip and untar the DB2 install file, wherever you have it. Name may vary. In my case (installing from fixpack code):
    $ gunzip v11.1.1fp1_linuxx64_universal_fixpack.tar.gz
    $ tar -xvf v11.1.1fp1_linuxx64_universal_fixpack.tar
    
  3. Install prerequisite packages
    $ sudo apt-get update
    $ sudo apt-get install libaio1
    $ sudo apt-get install binutils
    $ sudo apt-get install libpam0g:i386
    $ sudo apt-get install libstdc++6:i386
    
  4. There’s a problem with the install for DB2 11.1 fix/mod pack 1 on Ubuntu. To prevent encountering it at all, install rpm (this is not a listed or checked-for dependency):
    $ sudo apt-get install rpm

    See my blog entry on this issue if you want more information about it.

  5. Run db2prereqcheck to verify no other packages are needed. The version number will need to be changed based on what you’re installing. I’m doing 11.1, fix/mod pack 1 (sample output included):
    sudo ./db2prereqcheck -v 11.1.1.1
    
    ==========================================================================
    
    Checking prerequisites for DB2 installation. Version "11.1.1.1". Operating system "Linux" 
       
    Validating "Linux distribution " ... 
       Required minimum "UBUNTU" version: "14.04" 
       Actual version: "16.04" 
       Requirement matched. 
       
    Validating "kernel level " ... 
       Required minimum operating system kernel level: "2.6.16". 
       Actual operating system kernel level: "4.4.0". 
       Requirement matched. 
       
    Validating "C++ Library version " ... 
       Required minimum C++ library: "libstdc++.so.6" 
       Standard C++ library is located in the following directory: "/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21". 
       Actual C++ library: "CXXABI_1.3.1" 
       Requirement matched. 
       
    
    Validating "32 bit version of "libstdc++.so.6" " ... 
       Found the 32 bit "/usr/lib/i386-linux-gnu/libstdc++.so.6" in the following directory "/usr/lib/i386-linux-gnu". 
       Requirement matched. 
       
    Validating "libaio.so version " ... 
    DBT3553I  The db2prereqcheck utility successfully loaded the libaio.so.1 file. 
       Requirement matched. 
       
    Validating "libnuma.so version " ... 
    DBT3610I  The db2prereqcheck utility successfully loaded the libnuma.so.1 file. 
       Requirement matched. 
       
    Validating "/lib/i386-linux-gnu/libpam.so*" ... 
       Requirement matched. 
    DBT3533I  The db2prereqcheck utility has confirmed that all installation prerequisites were met. 
    
  6. Switch to root, change to the directory where db2_install is, and run it (note that IBM says db2setup is a better choice, so you may want to use it instead)
    sudo su -
    ./db2_install

    It will ask you to verify agreement with the license, for the install directory (take the default), to specify SERVER installation, and whether to install pureScale (no).
    You want to run this as root instead of with sudo. There can be issues with installs when they’re run with sudo

  7. Review the install output carefully to see if it has succeeded.
  8. Once the install has completed successfully, create the instance (still as root):
    cd /opt/ibm/db2/V11.1/instance
    ./db2icrt -u db2fenc1 db2inst1
  9. Su to the instance, and set up profile, if it’s not already set up:
    su - db2inst1
    vi .bash_profile

    Add the following lines to the .bash_profile if they do not already exist:

    if [[ -f /db2home/db2inst1/sqllib/db2profile ]]
    then
      . /db2home/db2inst1/sqllib/db2profile 
    fi
    
  10. Perform basic validation and create the sample database:
    $ db2start
    01/05/2017 15:49:03     0   0   SQL1063N  DB2START processing was successful.
    SQL1063N  DB2START processing was successful.
    $ db2level
    DB21085I  This instance or install (instance name, where applicable: 
    "db2inst1") uses "64" bits and DB2 code release "SQL11011" with level 
    identifier "0202010F".
    Informational tokens are "DB2 v11.1.1.1", "s1612051900", "DYN1612051900AMD64", 
    and Fix Pack "1".
    Product is installed at "/opt/ibm/db2/V11.1".
    
    $ db2val
    DBI1379I  The db2val command is running. This can take several minutes.
    
    DBI1335I  Installation file validation for the DB2 copy installed at
          /opt/ibm/db2/V11.1 was successful.
    
    DBI1339I  The instance validation for the instance db2inst1 was
          successful.
    
    DBI1343I  The db2val command completed successfully. For details, see
          the log file /tmp/db2val-170105_154911.log.
    
    
    $ db2sampl
    
      Creating database "SAMPLE"...
      Connecting to database "SAMPLE"...
      Creating tables and data in schema "DB2INST1"...
      Creating tables with XML columns and XML data in schema "DB2INST1"...
    
      'db2sampl' processing complete.
    
    $ 
  11. Verify your licensing matches what you expect:
    $ db2licm -l
    Product name:                     "DB2 Enterprise Server Edition"
    License type:                     "License not registered"
    Expiry date:                      "License not registered"
    Product identifier:               "db2ese"
    Version information:              "11.1"
    
    
    
    

    If you have a separate license file, you can add it using the db2licm -a command.

The sample database created in these steps has sample objects in it that can be used for a variety of testing purposes. See DB2 Basics: The DB2 LUW Sample Database for more details.

Viewing all 43 articles
Browse latest View live