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 :
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 ?
it tries to write to
and not to
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"
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:
-- DBPATH on /home/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.