Results 1 to 13 of 13
  1. #1
    Join Date
    Nov 2007
    Posts
    13

    Unanswered: 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.

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    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

  3. #3
    Join Date
    Nov 2007
    Posts
    13
    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.

  4. #4
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    Did you run this command before the upgrade: db2ckupgrade?

    Andy

  5. #5
    Join Date
    Nov 2007
    Posts
    13
    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.

  6. #6
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    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

  7. #7
    Join Date
    Aug 2008
    Location
    Toronto, Canada
    Posts
    2,367
    Try increasing agent_stack_sz dbm cfg to 256, restart the instance and then redo the restore.

  8. #8
    Join Date
    Nov 2007
    Posts
    13
    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.

  9. #9
    Join Date
    Nov 2007
    Posts
    13
    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.


  10. #10
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    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.

  11. #11
    Join Date
    Aug 2008
    Location
    Toronto, Canada
    Posts
    2,367
    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.

  12. #12
    Join Date
    Mar 2011
    Posts
    4
    can we take backup of db2 database from vb.net

  13. #13
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •