Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2015
    Posts
    2

    Unanswered: Error restoring backup 9.7 to 10.5

    Hi guys,

    I am restoring a backup from 9.7 to 10.5... The instance name of the 9.7 db2 is "db2inst1" and the instance of 10.5 is "db2inst2"... The installation is located in the same server... I'ts a migration, but i do not want to upgrade the original database.

    I im trying with this command:

    db2 restore db WPSDB from /opt/db2backup/ taken at 20150623101830 to "/home/db2inst2/db2inst2" without rolling forawrd without prompting
    The system answer is this :

    SQL0970N The system attempted to write to a read-only file. SQLSTATE=55009
    I was thinking that was a problem of permissions on "/home/db2inst2/db2inst2" but not... The folder owner is "db2inst2" and has all the permisions... So i check the db2diag.log file and i see this :

    Click image for larger version. 

Name:	Error.png 
Views:	3 
Size:	58.9 KB 
ID:	16417

    I do not know why this is trying to do the operation in the db2inst1 folder... i am explicit saying in the command that make all the restore in "/home/db2inst2/db2inst2".... Some help ?

    Thanks a lot.

  2. #2
    Join Date
    Jul 2013
    Location
    Moscow, Russia
    Posts
    666
    Provided Answers: 55
    Hi,

    it tries to write to
    /home/db2inst1/db2inst2
    and not to
    /home/db2inst2/db2inst2

    Try the 'redirect generate script' option to see what it wants to write there...
    Regards,
    Mark.

  3. #3
    Join Date
    Jun 2015
    Posts
    2

    Hey...

    Quote Originally Posted by mark.b View Post
    Hi,

    it tries to write to
    /home/db2inst1/db2inst2
    and not to
    /home/db2inst2/db2inst2

    Try the 'redirect generate script' option to see what it wants to write there...
    Hi Mark, thanks a lot for your answer...

    I try this command :

    db2 restore db WPSDB from /opt/db2backup/ taken at 20150623101830 to "/home/db2inst2/db2inst2" redirect generate script test.cpl
    The process ends very fastly and say it was "successfully" but later i try to connect to the db with "db2inst2" and say that it is not restored completely. This is te test.cpl file generated by "redirect generate script"

    Click image for larger version. 

Name:	error2.PNG 
Views:	4 
Size:	19.9 KB 
ID:	16421

  4. #4
    Join Date
    Jul 2013
    Location
    Moscow, Russia
    Posts
    666
    Provided Answers: 55
    This command doesn't do the db restore. It generates a restore script only based on paths found in the backup image.
    You must make necessary changes in this script an run it.
    For example, if your database has an automatic storage enabled, you should do like this:
    Code:
    ...
    ON /home/db2inst2
    -- DBPATH on /home/db2inst2
    NEWLOGPATH /some_writable_path_for_db2inst2
    ...
    Similarly you must change any absolute paths for the tablespace containsers if you have them in the script and if these paths are not writable for db2inst2 or already used by other databases.
    Finally, you must run this script.
    Regards,
    Mark.

  5. #5
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    You will also need to modify the containers in the restore script generated. You cannot put both databases in the same directory structure.

    Andy

Tags for this Thread

Posting Permissions

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