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 > Restoring Database with different version and edition

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-03-11, 07:20
muklee muklee is offline
Registered User
 
Join Date: Nov 2007
Posts: 12
Restoring Database with different version and edition

Hi, I am trying to restore a database from development server to my local PC, using a backup file (offline backup). Here is some information of the DB2 and server environment:

Development
DB2 Workgroup Server Edition, version 8.2
Windows Server 2003 32-bits


Local PC
DB2 Express-C, version 9.7
Windows XP 32-bits


Restoring database from a lower version (2 levels) to higher version is alright. But my concern is, can I do so in my case since I am using Express-C edition and the server is using workgroup server edition?

Appreciate if anyone could help. Thanks.
Reply With Quote
  #2 (permalink)  
Old 03-03-11, 09:07
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
The differences in editions will only matter if you used a feature in the Workgroup edition that is not available in Express-C. Other than that it should work.

Andy
Reply With Quote
  #3 (permalink)  
Old 03-04-11, 06:37
muklee muklee is offline
Registered User
 
Join Date: Nov 2007
Posts: 12
Thanks for the answer. However, I was getting this error when I am trying to perform the DB restored.


Code:
SQL2519N  The database was restored but the restored database was not upgraded
to the current release.  Error "-1224" with tokens "-2029060040 * * * *
SEMAPHORE WAIT                            " is returned.

Below are the command I used in DB2 CLP. What I am trying to do is, first I created a empty database with the same DB name as the backup. Then, replace the whole DB using the backup.

Code:
db2 => db2start
DB20000I  The DB2START command completed successfully.
db2 => attach to DB2

   Instance Attachment Information

 Instance server        = DB2/NT 9.7.2
 Authorization ID       = ADMIN01
 Local instance alias   = DB2

db2 => connect to COMDB

   Database Connection Information

 Database server        = DB2/NT 9.7.2
 SQL authorization ID   = ADMIN01
 Local database alias   = COMDB

db2 => RESTORE DATABASE COMDB FROM "C:\backup" TAKEN AT 20110301162745 TO "C:" INTO COMDB REDIRECT
SQL2523W  Warning!  Restoring to an existing database that is different from
the database on the backup image, but have matching names. The target database
will be overwritten by the backup version.  The Roll-forward recovery logs
associated with the target database will be deleted.
Do you want to continue ? (y/n) y
SQL1277W  A redirected restore operation is being performed.  Table space
configuration can now be viewed and table spaces that do not use automatic
storage can have their containers reconfigured.
DB20000I  The RESTORE DATABASE command completed successfully.
db2 => SET TABLESPACE CONTAINERS FOR 0 REPLAY ROLLFORWARD CONTAINER OPERATIONS USING (PATH "C:\DB2\COMDB_DB\CATTBS")
DB20000I  The SET TABLESPACE CONTAINERS command completed successfully.
db2 => SET TABLESPACE CONTAINERS FOR 1 REPLAY ROLLFORWARD CONTAINER OPERATIONS USING (PATH "C:\DB2\COMDB_DB\TMPTBS")
DB20000I  The SET TABLESPACE CONTAINERS command completed successfully.
db2 => SET TABLESPACE CONTAINERS FOR 2 REPLAY ROLLFORWARD CONTAINER OPERATIONS USING (PATH "C:\DB2\COMDB_DB\USRTBS")
DB20000I  The SET TABLESPACE CONTAINERS command completed successfully.
db2 => SET TABLESPACE CONTAINERS FOR 3 REPLAY ROLLFORWARD CONTAINER OPERATIONS USING (PATH "C:\DB2\COMDB_DB\SYSTOOLSPACE")
DB20000I  The SET TABLESPACE CONTAINERS command completed successfully.
db2 => SET TABLESPACE CONTAINERS FOR 4 REPLAY ROLLFORWARD CONTAINER OPERATIONS USING (PATH "C:\DB2\COMDB_DB\SYSTOOLSTMPSPACE")
DB20000I  The SET TABLESPACE CONTAINERS command completed successfully.
db2 => RESTORE DATABASE COMDB CONTINUE
SQL2519N  The database was restored but the restored database was not upgraded
to the current release.  Error "-1224" with tokens "-2029060040 * * * *
SEMAPHORE WAIT                            " is returned.
db2 =>
While struggling to understand this error, I try to re-connect to the 'COMDB' database, I get the error message below:


Code:
db2 => terminate
C:\Program Files\IBM\SQLLIB\BIN>db2stop
C:\Program Files\IBM\SQLLIB\BIN>db2
db2 => db2start
db2 => attach to DB2
db2 => connect to COMDB
SQL5035N  The database must be upgraded to the current release.
SQLSTATE=55001
So, I decide to give a try and use the upgrade command below. But it was a bit disappointed.

Code:
db2 => upgrade database COMDB
SQL1224N  The database manager is not able to accept new requests, has
terminated all requests in progress, or has terminated the specified request
because of an error or a forced interrupt.  SQLSTATE=55032
db2 =>

I am not really sure what I need to do in order to fix this problem . Hopefully, some one could provide some suggestion.

Thanks.
Reply With Quote
  #4 (permalink)  
Old 03-04-11, 09:39
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
Did you run this command before the upgrade: db2ckupgrade?

Andy
Reply With Quote
  #5 (permalink)  
Old 03-07-11, 00:09
muklee muklee is offline
Registered User
 
Join Date: Nov 2007
Posts: 12
Really sorry for my late reply. This is the error message I get when running the command:

Code:
C:\Program Files\IBM\SQLLIB\BIN>db2ckupgrade COMDB -l db2ckupgrade.log
Message text file 'db2dbmig.txt' not found

C:\Program Files\IBM\SQLLIB\BIN>db2ckupgrade -e -l db2ckupgrade.log
Message text file 'db2dbmig.txt' not found
But I wonder did I need to run this command? Reason being is, the DB2 Copy (v9.7.200.358, Fix Pack 2) in my local PC is a totally new installation. I am not upgrading from a version 8 to version 9.

I am just restoring a database from a backup file, which generated from a DB2 version 8. Sorry if I am asking a stupid question, cause I am not a DB2 admin person.

Looking to get some advise. Thanks.
Reply With Quote
  #6 (permalink)  
Old 03-07-11, 09:47
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
I thought I read that it had to be run prior to the UPGRADE command. I am wondering if the problem is that you are overwriting and existing DB during the restore. Try dropping the DB before the restore command.

Andy
Reply With Quote
  #7 (permalink)  
Old 03-07-11, 11:17
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
Try increasing agent_stack_sz dbm cfg to 256, restart the instance and then redo the restore.
Reply With Quote
  #8 (permalink)  
Old 03-08-11, 07:02
muklee muklee is offline
Registered User
 
Join Date: Nov 2007
Posts: 12
Quote:
Originally Posted by ARWinner View Post
I thought I read that it had to be run prior to the UPGRADE command. I am wondering if the problem is that you are overwriting and existing DB during the restore. Try dropping the DB before the restore command.

Andy
I try but still getting the same error.
Reply With Quote
  #9 (permalink)  
Old 03-08-11, 07:04
muklee muklee is offline
Registered User
 
Join Date: Nov 2007
Posts: 12
Quote:
Originally Posted by BELLO4KA View Post
Try increasing agent_stack_sz dbm cfg to 256, restart the instance and then redo the restore.
Thanks for the help, ARWinner and Andy. It finally work after increase the agent size.

Reply With Quote
  #10 (permalink)  
Old 03-08-11, 07:32
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
Bella, Just curious .. Is this documented anywhere and is there an APAR for this ?
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #11 (permalink)  
Old 03-08-11, 08:52
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
I suspect this is due to the following APAR:
https://www-304.ibm.com/support/docv...id=swg1IC69420


You can now reduce agent_stack_sz to its original value.
Reply With Quote
  #12 (permalink)  
Old 03-12-11, 02:27
saurabh.meher saurabh.meher is offline
Registered User
 
Join Date: Mar 2011
Posts: 4
can we take backup of db2 database from vb.net
Reply With Quote
  #13 (permalink)  
Old 03-12-11, 08:36
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Quote:
Originally Posted by saurabh.meher View Post
can we take backup of db2 database from vb.net
Sure, why not.

BACKUP DATABASE using ADMIN_CMD - IBM DB2 9.7 for Linux, UNIX, and Windows
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