Results 1 to 6 of 6
  1. #1
    Join Date
    Sep 2014

    Unhappy Unanswered: issue with db2 backup and restore operation

    We have an application by name RationalAssetManager (RAM) configured in production environment which uses DB2 EE as the backend database.

    We have a similar RAM Development Instance which is installed newly with DB2 EE V10 as a backend.

    What we are trying to achieve here

    The team wants the PROD db2 database (UISRAMDB) to be restored on to the Dev instance.

    What we did

    - Copied the Database backup taken from production over to the development instance.
    - Created a new Database with the same name as UISRAMDB also with the same alias name in the Dev instance.
    - Using Data Studio we have chosen the restore command to point to the copied database.
    - When Clicked on Run button we are getting the error below

    RESTORE DATABASE UISRAMDB FROM "G:\ram_db_refresh\UISRAMDB backup12-08-2014" TAKEN AT 20140904075135 WITHOUT PROMPTING

    Failed to execute command. DAS returned the following error: sqlcode=-22220 output=SQL2542N No match for a database image file was found based on the source
    database alias "UISRAMDB" and timestamp "20140904075135" provided.

  2. #2
    Join Date
    Apr 2012
    Hello, it sounds like you are trying to do a redirected restore. I have not used Data Studio, so can't really speak to that. But, this is easy to do from the command line. Are all of your file systems identical on the source to your target? If not you will need to do a redirected restore. If they are the same do the following:
    1. Log on to the target host as the db2 instance id. I am assuming you are on windows , replace the spaces and dashes in the backup image name
    2. Run db2 list db directory, make sure the target db is found.
    3. Make sure the instance is started issue db2start
    4. Connect to the database, just be sure you your environment is correct
    db2 connect to UISRAMDB
    5. Terminate your db connection
    db2 terminate
    6. Deactivate the db
    db2 deactivate db uisramdb
    4. Run the backup from the command line as follows:
    db2 "RESTORE DATABASE UISRAMDB FROM G:\ram_db_refresh\UISRAMDB_backup12_08_2014 TAKEN AT 20140904075135 WITHOUT PROMPTING"

    My bet is your environment is not set up correctly via Data Studio so it is having trouble finding things, also the spaces and dashes have caused me issues in the past.

  3. #3
    Join Date
    May 2010
    Provided Answers: 2

    Value for "TAKEN AT" should be time of backup. You have not changed the value for "TAKEN AT" from default which is current time. If you do not know the time when backup was taken, use the command without "TAKEN AT" option.



  4. #4
    Join Date
    Sep 2014
    Let me make it clear

    Here UISRAMDB is from the PROD DB2 DB Instance which we have backed up using control center and copied the backed up image on to the QA server.

    On the QA Server I have created an new empty database by name UISRAMQA.

    Now I am trying to restore the backed up image of UISRAMDB on to the new database USIRAMQA.

    Not sure how to check the file systems identical on the source to your target?

  5. #5
    Join Date
    Sep 2014

    restore command failing

    Thanks for providing the information.

    Having gone through the same, I have tried to run the DB2 restore command from the Command Window using Administrator Option

    C:\Windows\system32>db2 restore database UISRAMDB from G:\ram_db_refresh\UISRAMDBbackup12-08-2014\UISRAMDB.0.DB2.NODE0000.CATN0000.201408121343 39.001 TO G:\ IN

    SQL0104N An unexpected token
    "backup12-08-2014\UISRAMDB.0.DB2.NODE0000.CATN0000.201" was found following
    "<identifier>". Expected tokens may include: "TO". SQLSTATE=42601


    Note Sure what does this mean .. may be a syntax issue ... logically if you see . we want to restore a Database from A to B ...

  6. #6
    Join Date
    Oct 2002
    Don't use the full backup image file name, just the datestamp reference portion.
    ie: db2 restore database UISRAMDB from G:\ram_db_refresh\UISRAMDBbackup12-08-2014 TAKEN 20140812134339 INTO UISRAMDB;

Posting Permissions

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