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.
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
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.
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.
RESTORE DATABASE UISRAMDB FROM "G:\ram_db_refresh\UISRAMDB backup12-08-2014" WITHOUT PROMPTING