Discussion:
Is it possible to have db2 alternate restore on different system with a different path
(too old to reply)
a***@gmail.com
2016-09-29 06:56:31 UTC
Permalink
Prod db (source db2) : hosted on linux 6.X : installation : /home/db2inst1
Dev db (target db2) : hosted on linux 6.X : installation :/home/db2/db2inst1

Our requirement is to perform an alternate db2 restore from Sourcedb2 (/home/db2inst1) to target db2 (/home/db2/db2inst1).

Is such a restore supported by db2 as we are seeing following error?


SQL1277W A redirected restore operation is being performed. During a table
space restore, only table spaces being restored can have their paths
reconfigured. During a database restore, storage group storage paths and DMS
table space containers can be reconfigured.
DB20000I The RESTORE DATABASE command completed successfully.

[***@XXX scripts]$ db2 restore db sample continue
SQL1051N The path "/home/db2inst1" does not exist or is not valid.
SQLSTATE=57019


Thanks
Aarti
ox1d0
2016-09-29 18:50:29 UTC
Permalink
Post by a***@gmail.com
Prod db (source db2) : hosted on linux 6.X : installation : /home/db2inst1
Dev db (target db2) : hosted on linux 6.X : installation :/home/db2/db2inst1
Our requirement is to perform an alternate db2 restore from Sourcedb2 (/home/db2inst1) to target db2 (/home/db2/db2inst1).
Is such a restore supported by db2 as we are seeing following error?
SQL1277W A redirected restore operation is being performed. During a table
space restore, only table spaces being restored can have their paths
reconfigured. During a database restore, storage group storage paths and DMS
table space containers can be reconfigured.
DB20000I The RESTORE DATABASE command completed successfully.
SQL1051N The path "/home/db2inst1" does not exist or is not valid.
SQLSTATE=57019
Thanks
Aarti
Hello Aarti is complete possible even you can have several instance in several versions running into the same host

Are you sure that yours paths are correct during the redirect restore ?

or may you try something like this

db2 restore db <db> FROM "/some/CoOl/Path" taken at 2016blablablabla into <targetdb> with 4 buffers buffer 1024 parallelism 1 without rolling forward without prompting
a***@gmail.com
2016-09-30 09:46:45 UTC
Permalink
Thanks so much for your reply,
We have a different challenge for out of place restore, We followed similar restore as mentioned by you however this doesn't solve our problem which is described below which we need help for?

1. Take backup from source db2 installed on /home/db2inst1 and
2. backup saved on e.g. /some/CoOl/Path
3. Dropped the "Sample" Db
4. Created "newDb" on a different path e.g. /opt/db2inst1/newDb
5. Restore the backup form path mentioned in step 2 to see file at newly created db "newDb"
but the restore is creating new files at default directoy i.e /home/db2inst1

Is the a way to get the db installed on a newly created db in above example path /opt/db2inst1/newDb and NOT the /home/db2inst1

Thanks once again
Aarti
Post by a***@gmail.com
Prod db (source db2) : hosted on linux 6.X : installation : /home/db2inst1
Dev db (target db2) : hosted on linux 6.X : installation :/home/db2/db2inst1
Our requirement is to perform an alternate db2 restore from Sourcedb2 (/home/db2inst1) to target db2 (/home/db2/db2inst1).
Is such a restore supported by db2 as we are seeing following error?
SQL1277W A redirected restore operation is being performed. During a table
space restore, only table spaces being restored can have their paths
reconfigured. During a database restore, storage group storage paths and DMS
table space containers can be reconfigured.
DB20000I The RESTORE DATABASE command completed successfully.
SQL1051N The path "/home/db2inst1" does not exist or is not valid.
SQLSTATE=57019
Thanks
Aarti
a***@gmail.com
2016-09-30 09:47:47 UTC
Permalink
Post by a***@gmail.com
Prod db (source db2) : hosted on linux 6.X : installation : /home/db2inst1
Dev db (target db2) : hosted on linux 6.X : installation :/home/db2/db2inst1
Our requirement is to perform an alternate db2 restore from Sourcedb2 (/home/db2inst1) to target db2 (/home/db2/db2inst1).
Is such a restore supported by db2 as we are seeing following error?
SQL1277W A redirected restore operation is being performed. During a table
space restore, only table spaces being restored can have their paths
reconfigured. During a database restore, storage group storage paths and DMS
table space containers can be reconfigured.
DB20000I The RESTORE DATABASE command completed successfully.
SQL1051N The path "/home/db2inst1" does not exist or is not valid.
SQLSTATE=57019
Thanks
Aarti
a***@gmail.com
2016-09-30 16:55:15 UTC
Permalink
We managed to Take an out of place restore using ON = new restore loaction option on db2 Restore command

Thanks enveryone
Post by a***@gmail.com
Prod db (source db2) : hosted on linux 6.X : installation : /home/db2inst1
Dev db (target db2) : hosted on linux 6.X : installation :/home/db2/db2inst1
Our requirement is to perform an alternate db2 restore from Sourcedb2 (/home/db2inst1) to target db2 (/home/db2/db2inst1).
Is such a restore supported by db2 as we are seeing following error?
SQL1277W A redirected restore operation is being performed. During a table
space restore, only table spaces being restored can have their paths
reconfigured. During a database restore, storage group storage paths and DMS
table space containers can be reconfigured.
DB20000I The RESTORE DATABASE command completed successfully.
SQL1051N The path "/home/db2inst1" does not exist or is not valid.
SQLSTATE=57019
Thanks
Aarti
Jeremy Rickard
2016-10-01 01:43:41 UTC
Permalink
You didn't show your restore command. Did you want the database path moved into the new location as well or just the data storage paths?

You can see the database path (aka directory) by checking "Local database directory" entry from output of: db2 list db directory

Basically, it's a matter of understanding the restore command differences for the TO, ON and DBPATH ON clauses.

Regards, Jeremy
Post by a***@gmail.com
We managed to Take an out of place restore using ON = new restore loaction option on db2 Restore command
Thanks enveryone
Lennart Jonsson
2016-10-02 08:04:50 UTC
Permalink
Post by a***@gmail.com
Prod db (source db2) : hosted on linux 6.X : installation : /home/db2inst1
Dev db (target db2) : hosted on linux 6.X : installation :/home/db2/db2inst1
Our requirement is to perform an alternate db2 restore from Sourcedb2 (/home/db2inst1) to target db2 (/home/db2/db2inst1).
Is such a restore supported by db2 as we are seeing following error?
In general I find it easiest to let db2 generate a script from the
backup image:

db2 restore db aa redirect generate script aa.sql

and then modify aa.sql so that it corresponds to the target

/Lennart
a***@gmail.com
2016-10-03 12:46:12 UTC
Permalink
Post by a***@gmail.com
Prod db (source db2) : hosted on linux 6.X : installation : /home/db2inst1
Dev db (target db2) : hosted on linux 6.X : installation :/home/db2/db2inst1
Our requirement is to perform an alternate db2 restore from Sourcedb2 (/home/db2inst1) to target db2 (/home/db2/db2inst1).
Is such a restore supported by db2 as we are seeing following error?
SQL1277W A redirected restore operation is being performed. During a table
space restore, only table spaces being restored can have their paths
reconfigured. During a database restore, storage group storage paths and DMS
table space containers can be reconfigured.
DB20000I The RESTORE DATABASE command completed successfully.
SQL1051N The path "/home/db2inst1" does not exist or is not valid.
SQLSTATE=57019
Thanks
Aarti
Hi All

We have used a command to generate the script and then updated the "ON" param with destination directory path
db2 "restore db sample from /tmp/sample_Local/backup taken at 20160930022308 into test redirect generate script test.txt

and then re-run a command
db2 -tvf test.txt

Things to keep in mind are:
1. ensure the backup has been taken with the - permission = any
2. ensure the destination folder has permissions as that of the db2inst1 example:
ls -lrt /tmp/destination_restore/
total 4
drwxrwxr-x 3 db2inst1 db2iadm1 4096 Oct 3 13:33 db2inst1

Continue reading on narkive:
Search results for 'Is it possible to have db2 alternate restore on different system with a different path' (Questions and Answers)
5
replies
can i get question answer of asp.net ?
started 2006-10-11 00:02:47 UTC
software
7
replies
How to control sound energy/waves?
started 2007-05-24 11:00:29 UTC
physics
Loading...