If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > question on DB2 8.1 and 7.2 upgrade

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-07-03, 12:57
mixxalot mixxalot is offline
Registered User
 
Join Date: May 2003
Posts: 369
question on DB2 8.1 and 7.2 upgrade

I am upgrading our DB2 7.2 database on AIX 5.2 to DB2 8.1.2 on AIX 5.2 (32bit).

Steps I have taken thus far:

1. Keep current DB2 7.2 database- db2inst1 under /home/db2inst1
2. Installed DB2 8.1 database- db2inst2 under /home/db2inst2

Question is: how do I use the db2ckmig and db2mig command to upgrade my db2inst1 on DB2 7.2 to a DB2 8.1 instance? I need to run the DB2 8.1 version of these commands but do I run them as db2inst1 under the new DB2 8.1 db2inst2 directory? Thanks
Reply With Quote
  #2 (permalink)  
Old 08-07-03, 13:09
chuzhoi chuzhoi is offline
Registered User
 
Join Date: Dec 2002
Posts: 134
Re: question on DB2 8.1 and 7.2 upgrade

I do not think you need step 2. Login as root (or user with sudo access) and run db2ckmig and db2imigr from v8 instllation path (/usr/opt/db2_08_01/instance/)

After instance migration, migrate dbs - "migrate db" command
Reply With Quote
  #3 (permalink)  
Old 08-07-03, 14:10
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
Re: question on DB2 8.1 and 7.2 upgrade

What I understand from the manuals :

1) Run the db2ckmig which has come with db2 v8 on the db2v7 db instance, db2inst1, in your case ...

2) Once it is successful, you can stop the db manager db2inst1 and then issue db2imigr and then the migrate database command.

You do not need another instance ...

Hope this makes sense .
Cheers
Sathyaram


Quote:
Originally posted by mixxalot
I am upgrading our DB2 7.2 database on AIX 5.2 to DB2 8.1.2 on AIX 5.2 (32bit).

Steps I have taken thus far:

1. Keep current DB2 7.2 database- db2inst1 under /home/db2inst1
2. Installed DB2 8.1 database- db2inst2 under /home/db2inst2

Question is: how do I use the db2ckmig and db2mig command to upgrade my db2inst1 on DB2 7.2 to a DB2 8.1 instance? I need to run the DB2 8.1 version of these commands but do I run them as db2inst1 under the new DB2 8.1 db2inst2 directory? Thanks
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #4 (permalink)  
Old 08-07-03, 15:35
mixxalot mixxalot is offline
Registered User
 
Join Date: May 2003
Posts: 369
question

Ok so I can log in to DB2 as db2inst1 the DB2 7.2 user and run the command from the DB2 8.1 instance directory? Here is what happens


1. login to DB2 v8.1 on unixtest system as user db2inst2

2. run db2ckmig command:

db2ckmig -eSAMPLE -l upgrade -u db2inst1 -p password

3. Failed

Version of DB2CKMIG being run: VERSION 8.

Accessing database directory failed. SQLCODE = -5005.


Our configuration:

We need to upgrade/migrate DB2 7.2 instance and database to DB2 8.1:

DB2 7.2 with Fixpack9 installed
db2inst1
db2inst1
/home/db2inst1
SAMPLE

DB2 8.1 Installed
db2inst2 user
db2inst2 instance created

Should I instead login as db2inst1, cd /usr/opt/db2_08_01/bin
run db2ckmig command? Thanks
Reply With Quote
  #5 (permalink)  
Old 08-07-03, 15:56
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
Re: question

Yes, you should login as db2inst1(v7 owner) ... Only then you will be having privileges to access the db2 related files apart from the environment setting

(I assume you have checked the command syntax)

Cheers

Sathyaram

Quote:
Originally posted by mixxalot
Ok so I can log in to DB2 as db2inst1 the DB2 7.2 user and run the command from the DB2 8.1 instance directory? Here is what happens


1. login to DB2 v8.1 on unixtest system as user db2inst2

2. run db2ckmig command:

db2ckmig -eSAMPLE -l upgrade -u db2inst1 -p password

3. Failed

Version of DB2CKMIG being run: VERSION 8.

Accessing database directory failed. SQLCODE = -5005.


Our configuration:

We need to upgrade/migrate DB2 7.2 instance and database to DB2 8.1:

DB2 7.2 with Fixpack9 installed
db2inst1
db2inst1
/home/db2inst1
SAMPLE

DB2 8.1 Installed
db2inst2 user
db2inst2 instance created

Should I instead login as db2inst1, cd /usr/opt/db2_08_01/bin
run db2ckmig command? Thanks
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #6 (permalink)  
Old 08-07-03, 16:00
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
Re: question

If you continue to get errors, I will suggest to add the -d option in the command to get debug information

Cheers

Sathyaram
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #7 (permalink)  
Old 08-07-03, 17:23
chuzhoi chuzhoi is offline
Registered User
 
Join Date: Dec 2002
Posts: 134
Re: question

Quote:
Originally posted by mixxalot
db2ckmig -eSAMPLE -l upgrade -u db2inst1 -p password
3. Failed
Version of DB2CKMIG being run: VERSION 8.
Accessing database directory failed. SQLCODE = -5005.
Should I instead login as db2inst1, cd /usr/opt/db2_08_01/bin
run db2ckmig command? Thanks
According to the message, it seems like your database directory is damaged. It seems like you've already run db2imigr and it failed.
Login as instance owner and try - list db directory

I do not know how to recover from such error, but I think you can
Drop db2inst1, create db2inst1 in v8, catalog your databases and migrate db

In general you need to be logged as root/(user with sudo access) for the db2imigr and as instance owner for the db2ckmig.
Reply With Quote
  #8 (permalink)  
Old 08-08-03, 10:53
mixxalot mixxalot is offline
Registered User
 
Join Date: May 2003
Posts: 369
it worked here is what I did

I was doing two things wrong that caused the migration/upgrade to fail

Login as the DB2 7.2 database instance owner, db2inst1
1. Run the DB2 8.1 DB2CKMKIG utility before starting migration
db2inst1> cd /home/db2inst2/sqllib/bin

or wherever you installed the new version of DB2 8.1 instance
also located under /usr/opt/db2_08_01/instance
HOWEVER do not run the db2ckmig utility nor db2imig from here it will not work!

2. Migration Check:

db2inst1> ./home/db2inst2/sqllib/bin/db2ckmig -eSAMPLE -l /home/db2inst1/upgrade -u db2inst1 -p db2
NOTE: the log file for the upgrade check must be unix filesystem writable or you will get the error message
"cannot open log file"

Check to make sure it ran successful and current version:

3. Migrate the current DB2 7.2 database instance to the 8.1 version of DB2


$ db2 list database directory

System Database Directory

Number of entries in the directory = 1

Database 1 entry:

Database alias = SAMPLE
Database name = SAMPLE
Local database directory = /home/db2inst1
Database release level = 9.00
Comment =
Directory entry type = Indirect
Catalog node number = 0


Syntax: /DB2DIR/instance/db2imigr -u db2fenc1 InstName
where DB2DIR is either /usr/opt/db2_08_01 on AIX

NOTE: db2fenc1 is only required when migrate from client instance to a server.

LOGIN AS DB2INST1 (v7.2 instance owner/user)

cd /usr/opt/db2_08_01/instance

CHANGE PERMISSIONS to allow db2inst1 to run the commands in this directory see Unix admin:

./db2imigr -u db2fenc1 db2inst1


$ ./db2imigr -u db2fenc1 db2inst1
DBI1052E You must be root to execute this program.

Explanation:

This program can only be run under the root user ID. Special
privileges are required to execute this program.

User Response:

Login as root and issue the command again.



root> cd /usr/opt/db2_08_01/instance
root> ./db2imigr -u db2fenc1 db2inst1

db2ckmig was successful. Database(s) can be migrated.

DBI1070I Program db2imigr completed successfully.


NOW check to make sure the instance has been upgraded to new DB2 version:

$ db2level
DB21085I Instance "db2inst1" uses "32" bits and DB2 code release "SQL08010"
with level identifier "01010106".
Informational tokens are "DB2 v8.1.1.0", "s021023", "", and FixPak "0".
Product is installed at "/usr/opt/db2_08_01".


Check database directory for db2inst1 to ensure it has been upgraded to new version of DB2:


$ db2 list db directory

System Database Directory

Number of entries in the directory = 1

Database 1 entry:

Database alias = SAMPLE
Database name = SAMPLE
Local database directory = /home/db2inst1
Database release level = a.00
Comment =
Directory entry type = Indirect
Catalog database partition number = 0



$ db2start
08-07-2003 15:23:35 0 0 SQL1063N DB2START processing was successful.
SQL1063N DB2START processing was successful.


NOTE: you still need to run the database migration to complete the rest of the database upgrade:

$ db2 connect to sample user db2inst1 using db2
SQL5035N The database requires migration to the current release.
SQLSTATE=55001

The database migration has to still be completed

Migrate the database to new release of DB2 8.1:

Syntax:
db2 migrate database {database alias} user {username} using {password}

db2 migrate database SAMPLE user db2inst1 using db2

options: update statistics, rebind packages, revoke execute privileges [ db2undgp -r ]
migrate db2explain tables

ALSO: Compare pre-migration DB2 configuration parameter settings, database manager config settings
tablespace records and packages records to newly upgrade database instance to ensure no errors
occurred in the upgrade and migration!!!

I will admit that this was a pain but a good challenge and the manuals leave some to be desired. It took a call to IBM DB2 Advanced support to resolve the upgrade issues. Guess I need to write a redpaper on complex upgrades!

Scott
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On