Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2008
    Posts
    25

    Unanswered: Backup and restore database

    Hi!
    I did a backup of my database "Test" with the following command
    Code:
    db2 backup database test to c:\
    The Command created a backup of the database called "test.0.db2......".

    Now, i wanted to restore the backup on another computer (same db2-distribution) with command:
    Code:
    db2 restore database test from test.0.db2....
    But I get the error message (the message is translated from german to english)
    Code:
    SQL2036N: Path of data file test.0.db2.... not valid
    What am I doing wrong?

    Regards,
    Martin

  2. #2
    Join Date
    May 2007
    Location
    somewhere in dbforums
    Posts
    221
    when you do restore in your new computer type in the full path to the file.... basically the restore command is unable to find your backup file

    so your command will be something like
    db2 restore database test from full path of the backup file

    e.g if my backup file (ABC) is in C:/backup then your command will be
    db2 restore database test from c:/backup/ABC

  3. #3
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Quote Originally Posted by nick.ncs
    when you do restore in your new computer type in the full path to the file.... basically the restore command is unable to find your backup file

    so your command will be something like
    db2 restore database test from full path of the backup file

    e.g if my backup file (ABC) is in C:/backup then your command will be
    db2 restore database test from c:/backup/ABC
    This is incorrect. Given the command
    Code:
    db2 backup database test to c:\
    the restore command should look like
    Code:
    db2 restore database test from c:\
    ---
    "It does not work" is not a valid problem statement.

  4. #4
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    With WIndows on version 8, you do not specify the full path. Not sure which version you are using. Also, you need to mention the path (FROM clause) and timestamp (TAKEN AT clause) of the backup file, not the file name.

    Your best bet is to do a backup and restore using the Control Center and do a "show SQL" to see what the syntax is for the restore.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  5. #5
    Join Date
    Feb 2008
    Posts
    25
    Hi!
    Thanks for you replies!
    The correct command was
    Code:
    db2 restore database test from c:\
    Regards,
    Martin

Posting Permissions

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