468,115 Members | 2,103 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,115 developers. It's quick & easy.

Move Tablespace Datafile

In my haste, I added a datafile to a tablespace, but I got it in the
wrong directory. Can I move a datafile of a tablespace?
Nov 12 '05 #1
4 7574
aj
Buck Turgidson wrote:
In my haste, I added a datafile to a tablespace, but I got it in the
wrong directory. Can I move a datafile of a tablespace?


Short of a redirected restore, I don't know another solution.

For my SMS tablespaces, I always point DB2 at symbolic links that
then point at the actual container. I'm on Red Hat Linux - I'm
not sure if this can be done in Windows. This way, I can change
the container location by adjusting the symbolic link, and DB2
does not become irritated.

aj
Nov 12 '05 #2
Buck Turgidson wrote:
In my haste, I added a datafile to a tablespace, but I got it in the
wrong directory. Can I move a datafile of a tablespace?


You could try the (probably unsupported) idea of stopping DB2, moving the
file and setting a link in the wrong directory that points to the correct
place and, thus, makes the container logically available at the wrong
place.

I would do it this:
(1) add a container at the correct location
(2) remove the container at the invalid location
DB2 will take care of the rebalancing of the data.

--
Knut Stolze
DB2 Information Integration Development
IBM Germany
Nov 12 '05 #3
"Buck Turgidson" <jc***@hotmail.com> a écrit dans le message de
news:ok************@turf.coleman.com...
In my haste, I added a datafile to a tablespace, but I got it in the
wrong directory. Can I move a datafile of a tablespace?

Hi Buck,

You can do it with the db2relocatedb command, but you need to be offline.

HTH,

Jean-Marc
Nov 12 '05 #4
Isn't it true since version 8.x you can drop a container.
So I would cresate a new container in the right directory a drop the other.

Sample:

ALTER TABLESPACE TESTSPACE DROP ( FILE 'C:\DB2\NODE0000\CT1.cont' );

But look for rebalancing...

Best regards,
Joachim Müller

"Buck Turgidson" <jc***@hotmail.com> schrieb im Newsbeitrag
news:ok************@turf.coleman.com...
In my haste, I added a datafile to a tablespace, but I got it in the
wrong directory. Can I move a datafile of a tablespace?

Nov 12 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Srini | last post: by
1 post views Thread by Jens H. Hamann | last post: by
1 post views Thread by gecho | last post: by
1 post views Thread by mario dionne | last post: by
reply views Thread by Mats Kling | last post: by
8 posts views Thread by Mark D Powell | last post: by
5 posts views Thread by didacticone | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.