Connecting Tech Pros Worldwide Forums | Help | Site Map

Redirected Restores & Set tablespace container

CCC via DBMonster.com
Guest
 
Posts: n/a
#1: Nov 12 '05
We use redirected restore to refresh test from prod on different AIX 5.2
servers. The databases have the same number, size and names of cooked
containers. The only difference is the fully qualified path contains a
different "SID": eg. "/db2/PRD/data1/..." versus "/db2/TST/data1/...".
(Please note as an SAP installation I cannot change this layout).

We use "set tablespace container" statements to redefine the fully
qualified container names. During the restore the existing containers are
dropped and new containers are created. This process takes a long time.

My question is, can we somehow avoid re-creating these containers. For
example, what would happen if we just created a symbolic link PRD->TST so
that the restore would find the existing containers? (I've done this
successfully using Informix raw devices.)

Or, do the containers need to be re-created for a valid restore?

Thanks,
Chris

--
Message posted via http://www.dbmonster.com

Keith
Guest
 
Posts: n/a
#2: Nov 12 '05

re: Redirected Restores & Set tablespace container



CCC via DBMonster.com wrote:[color=blue]
> We use redirected restore to refresh test from prod on different AIX[/color]
5.2[color=blue]
> servers. The databases have the same number, size and names of cooked
> containers. The only difference is the fully qualified path contains[/color]
a[color=blue]
> different "SID": eg. "/db2/PRD/data1/..." versus[/color]
"/db2/TST/data1/...".[color=blue]
> (Please note as an SAP installation I cannot change this layout).
>
> We use "set tablespace container" statements to redefine the fully
> qualified container names. During the restore the existing containers[/color]
are[color=blue]
> dropped and new containers are created. This process takes a long[/color]
time.[color=blue]
>
> My question is, can we somehow avoid re-creating these containers.[/color]
For[color=blue]
> example, what would happen if we just created a symbolic link[/color]
PRD->TST so[color=blue]
> that the restore would find the existing containers? (I've done this
> successfully using Informix raw devices.)
>
> Or, do the containers need to be re-created for a valid restore?
>
> Thanks,
> Chris
>
> --
> Message posted via http://www.dbmonster.com[/color]


UDB does not allow links for restores. As a matter of fact, you cannot
even create a database using containers that are links.

"set tablespace containers...." command simply re-defines containers.
When you do a "restore db DBName continue", this is when the restore
process actually starts. Restore is still a restore and takes its sweet
time regardless -- whether it be regular or redirected restore. If UDB
were to allow links, I don't think you will see any significant
difference in restore time.

BTW, I agree with you -- Informix does have this flexibility.

Keith Ponnapalli
IBM Certified Advanced Database Administrator - DB2 UDB V8.1 for
Linux,UNIX, and Windows
INFORMIX Certified Database Administrator

CCC via DBMonster.com
Guest
 
Posts: n/a
#3: Nov 12 '05

re: Redirected Restores & Set tablespace container


Thank you. So "links" aren't a valid workaround. Maybe you could educate
me a bit. (I'm new to DB2, but do have Informix & Oracle experience).

When I simply restore a database (not "redirected"), I don't believe it
recreates the containers; it just starts restoring the data into the
existing containers. However, the redirected restore does rebuild DMS
containers. I can watch them being deleted and regenerated. I assume this
is a result of the "set tablespace containers". The transfer of data from
tape doesn't begin until all the containers are rebuilt. In fact we had to
increase TSM timeout settings to allow for this finish.

Am I doing something wrong here?

Chris

--
Message posted via http://www.dbmonster.com
Fan Ruo Xin
Guest
 
Posts: n/a
#4: Nov 12 '05

re: Redirected Restores & Set tablespace container



"CCC via DBMonster.com" <forum@nospam.DBMonster.com> wrote in message
news:08063820805c419f9e590fe671b32480@DBMonster.co m...[color=blue]
> We use redirected restore to refresh test from prod on different AIX 5.2
> servers. The databases have the same number, size and names of cooked
> containers. The only difference is the fully qualified path contains a
> different "SID": eg. "/db2/PRD/data1/..." versus "/db2/TST/data1/...".
> (Please note as an SAP installation I cannot change this layout).
>
> We use "set tablespace container" statements to redefine the fully
> qualified container names. During the restore the existing containers are
> dropped and new containers are created. This process takes a long time.
>
> My question is, can we somehow avoid re-creating these containers. For
> example, what would happen if we just created a symbolic link PRD->TST so
> that the restore would find the existing containers? (I've done this
> successfully using Informix raw devices.)[/color]
==============
Yes, you can use symbolic link, you can also use redirected restore, both
should work in your scenario.
[color=blue]
>
> Or, do the containers need to be re-created for a valid restore?[/color]
===========================
DB2 restore will check if the tbspaces/containers are existed, if not, db2
will build them first, then restore the data.
[color=blue]
>
> Thanks,
> Chris
>
> --
> Message posted via http://www.dbmonster.com[/color]


CCC via DBMonster.com
Guest
 
Posts: n/a
#5: Nov 12 '05

re: Redirected Restores & Set tablespace container


Please help me clarify a couple of questions:

Because I am cloning a source onto a target which has a different
DB2INSTANCE, database name, host, etc, I assume I must use a "redirected
restore". Just because I have links that make the target filesystem "look"
like the source system, I cannot do a regular restore. Is this correct?

Is the deletion and recreation of the exisiting containers I observe during
the redirected restore a result of the "set tablespace containers"
statements?

If this is true, given links that make the filesystems look the same, can I
do the redirected restore without using the "set tablespace constainers"
statements?

This would save me 2-3 hours on my 300GB database.

Thanks
Chris

--
Message posted via http://www.dbmonster.com
Keith
Guest
 
Posts: n/a
#6: Nov 12 '05

re: Redirected Restores & Set tablespace container



CCC via DBMonster.com wrote:[color=blue]
> Please help me clarify a couple of questions:
>
> Because I am cloning a source onto a target which has a different
> DB2INSTANCE, database name, host, etc, I assume I must use a[/color]
"redirected[color=blue]
> restore". Just because I have links that make the target filesystem[/color]
"look"[color=blue]
> like the source system, I cannot do a regular restore. Is this[/color]
correct?[color=blue]
>
> Is the deletion and recreation of the exisiting containers I observe[/color]
during[color=blue]
> the redirected restore a result of the "set tablespace containers"
> statements?
>
> If this is true, given links that make the filesystems look the same,[/color]
can I[color=blue]
> do the redirected restore without using the "set tablespace[/color]
constainers"[color=blue]
> statements?
>
> This would save me 2-3 hours on my 300GB database.
>
> Thanks
> Chris
>
> --
> Message posted via http://www.dbmonster.com[/color]


I guess I goofed on this one. Links will work. You can use 'restore
from ...into targetDB ... ' , so it doesn't matter if it it's in
another instance/db.

I'd make sure links are supported/recommeneded by both IBM/SAP just in
case if something were to go wrong.

K

Fan Ruo Xin
Guest
 
Posts: n/a
#7: Nov 12 '05

re: Redirected Restores & Set tablespace container



"CCC via DBMonster.com" <forum@DBMonster.com> wrote in message
news:574d022e7b5447f08fd676f53fc6192a@DBMonster.co m...[color=blue]
> Please help me clarify a couple of questions:
>
> Because I am cloning a source onto a target which has a different
> DB2INSTANCE, database name, host, etc, I assume I must use a "redirected
> restore". Just because I have links that make the target filesystem "look"
> like the source system, I cannot do a regular restore. Is this correct?[/color]
============================
No, that isn't quite correct. If you have two physical boxes, two physical
instances/databases, the regular restore still can work very well.
You can build all the containers on your target and create links and makes
them exactly look like the source server.
You can run the restore, just like you run the restore on the source server.
db2 restore db source_db ... into target_db ...

You don't must run redirect restore in order to clone a database onto
another physical database.
In fact you can even restore into the target from an online backup image
which taken from the source server, if both target and source server used
the same db2 udb version, and you can run the rollforward to the end of
logs.
[color=blue]
>
> Is the deletion and recreation of the exisiting containers I observe[/color]
during[color=blue]
> the redirected restore a result of the "set tablespace containers"
> statements?[/color]

I did redirect restore before. But never observe the whole process. I can't
understand why the restore need to delete something.
When you restore a database to the different place, you'd better build all
the necessary containers, instead of letting the restore process to build
them, which will impact the restore performance.
[color=blue]
>
> If this is true, given links that make the filesystems look the same, can[/color]
I[color=blue]
> do the redirected restore without using the "set tablespace constainers"
> statements?[/color]

Again, for your case, you can just run a restore, w/o redirect.
[color=blue]
>
> This would save me 2-3 hours on my 300GB database.
>
> Thanks
> Chris
>
> --
> Message posted via http://www.dbmonster.com[/color]


Tim
Guest
 
Posts: n/a
#8: Nov 12 '05

re: Redirected Restores & Set tablespace container


Another option you might want to consider is the use of raw partitions
(i.e. tablespace containers of type device) since they don't need to be
'created' in a similar fashion to file based containers. A create
tablespace or set tablespace containers command takes no time on these
types of containers. The last time I tried it, it was possible to
convert from file to device and vice versa with a redirected restore.

regards
tim

Closed Thread