How to use DB2 V8.2 in Solaris 10 Zones


This is more like an hands on on how-to use DB2 V8.2 in Solaris 10 Zones I have a Solaris 10 system which already has DB2 V8.2 fixpack 13 installed in /opt/IBM/DB2/V8.2. Currently there are no zones define on the system So we start by creating a local zone

# mkdir -p /export/zone/testbed
# chmod 700 /export/zone/testbed

# zonecfg -z testbed
testbed: No such zone configured
Use 'create' to begin configuring a new zone.
zonecfg:testbed> create
zonecfg:testbed> set zonepath=/export/zone/testbed
zonecfg:testbed> add net
zonecfg:testbed:net> set address=10.0.0.1
zonecfg:testbed:net> set physical=eri0
zonecfg:testbed:net> end
zonecfg:testbed> verify
zonecfg:testbed> commit
zonecfg:testbed> exit


# zoneadm -z testbed install
Preparing to install zone .
Creating list of files to copy from the global zone.
Copying <14661> files to the zone.
Initializing zone product registry.
Determining zone package initialization order.
Preparing to initialize <1018> packages on the zone.
Initialized <1018> packages on zone.
Zone  is initialized.
Installation of <110> packages was skipped.
The file  contains a log of the zone installation.
#

Please review the install_log file very carefully as it highlights all packages that could not be added to the local zone. This clearly indicates if that package was installed without any problems or not. For example in my install_log file I see

\*\*\* package <mqm> was not installed:

The package <mqm> is either not fully installed in the
global zone, or the package contains a request script. Only packages
that are fully installed in the global zone and that do not contain a
request script can be installed when a new zone is created. If this
package does not contain a request script, you can correct this
problem by removing and reinstalling the package in the global zone.

This indicates that since the WebSphere MQ package that was installed in the global zone uses a request script, it did not install it by default into the local zone. In this particular installation, I verified that all the 42 packages starting with "db2" were installed into the local zone without any problems.

NOTE: While this "inheritance" works, from my talks with the IBM DB2 support team, their recommendation is not to install DB2 on the global zone at all, but install it directly under the local zone, once the local zone is available)

# zoneadm -z testbed boot
# zlogin -C testbed
[Connected to zone 'testbed' console]

You did not enter a selection.
What type of terminal are you using?
 1) ANSI Standard CRT
 2) DEC VT52

..

Follow the prompts to complete the Zone initialization, otherwise the zone will not be fully available. When the system identification step is completed and you logout use ~. to exit from the console mode.

# zlogin testbed
[Connected to zone 'testbed' pts/4]
Last login: Tue Mar 13 07:09:25 on pts/4
Sun Microsystems Inc.   SunOS 5.10      Generic January 2005
# uname -a
SunOS testbed 5.10 Generic_118833-36 sun4u sparc SUNW,Sun-Blade-1000
# cat /etc/release
                       Solaris 10 6/06 s10s_u2wos_09a SPARC
           Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
                        Use is subject to license terms.
                             Assembled 09 June 2006

# cd /opt/IBM/db2/V8.1
# pwd
/opt/IBM/db2/V8.1

It inherited my DB2 V8.2 installation from global zone where it was already installed before I created the new local zone

NOTE AGAIN : While this works, from my talks with the IBM DB2 support team, their recommendation is not to install DB2 on the global zone at all, but install it directly under the local zone, once the local zone is available)

# mkdir /export/home
# groupadd db2iadm1
# useradd -g db2iadm1 -s /usr/bin/bash -d /export/home/db2inst1 -m db2inst1
64 blocks
# projadd -U db2inst1 user.db2inst1
# projmod -a -K "project.max-shm-ids=(priv,4k,deny)" user.db2inst1
# projmod -a -K "project.max-sem-ids=(priv,4k,deny)" user.db2inst1
# projmod -a -K "project.max-shm-memory=(priv,4G,deny)" user.db2inst1
# projmod -a -K "project.max-msg-ids=(priv,4k,deny)" user.db2inst1
# useradd -g other -s /usr/bin/bash -d /export/home/db2fenc1 -m db2fenc1
64 blocks
#

The recommended way to figure out the ballpark values for the above project parameters is to to run the db2osconf utility in Global zone and use the recommended values.

# cd /opt/IBM/db2/V8.1/instance
# ./db2icrt -w 64 -p 50000 -u db2fenc1 db2inst1
Sun Microsystems Inc.   SunOS 5.10      Generic January 2005
Sun Microsystems Inc.   SunOS 5.10      Generic January 2005
DBI1070I Program db2icrt completed successfully.


# su - db2inst1
Sun Microsystems Inc.   SunOS 5.10      Generic January 2005
-bash-3.00$ db2licm -a db2license.txt
DBI1402I License added successfully.

-bash-3.00$ db2start
03/13/2007 16:09:43     0   0   SQL1063N  DB2START processing was successful.
SQL1063N  DB2START processing was successful.
-bash-3.00$
-bash-3.00$ db2level
DB21085I  Instance "db2inst1" uses "64" bits and DB2 code release "SQL08026"
with level identifier "03070106".
Informational tokens are "DB2 v8.1.0.120", "s060801", "U808889", and FixPak
"13".
Product is installed at "/opt/IBM/db2/V8.1".
    
    
Now verifying the newly created instance
      
      
-bash-3.00$ db2sampl
-bash-3.00$ db2 connect to sample

   Database Connection Information

 Database server        = DB2/SUN64 8.2.6
 SQL authorization ID   = DB2INST1
 Local database alias   = SAMPLE

-bash-3.00$ db2 "select count(\*) from employee"

1
-----------
         32

  1 record(s) selected.

-bash-3.00$ db2 connect reset
DB20000I  The SQL command completed successfully.
-bash-3.00$

Hopefully this helps getting over the fear of using Zones and DB2. Again refer to previous blog entry for the white paper on DB2 Containers.
With this my more than two years old original entry of DB2 V8.1 (prior to release of DB2 V8.2) in Solaris 10 zones before Solaris 10 was released is now obsolute.


 

Comments:

Hi Jignesh,

I have installed DB2 V9.1 FP3a. on Global zone.
Then I have created a full root local zone and other normal zone.
For the first root zone I have inerited the /opt, /usr/, /platform and one other FS.and completed Zone installation successfully.
Similarly, I tried to inherit the above file systems in my second normal zone got a message the FS is already exists.
So i continued by skipping inheriting the 4 FS.

But In both the cases I did not inherited DB2 on both the cases as you said in above article.
I was forced to install DB2 again on both the zones.

please let me know if you need any information.
Can you please let me know if there is any thing missing in my Zones setup.

Posted by Srinivas Somavarapu on April 24, 2008 at 07:37 AM EDT #

Post a Comment:
Comments are closed for this entry.
About

Jignesh Shah is Principal Software Engineer in Application Integration Engineering, Oracle Corporation. AIE enables integration of ISV products including Oracle with Unified Storage Systems. You can also follow me on my blog http://jkshah.blogspot.com

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today