472,805 Members | 1,584 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,805 software developers and data experts.

move a tablespace (sms containers) to different location

Hi folks,
we have 3 instances where a table space (good old SMS) lives in the
wrong directory.
Normally I simply would create a new one and do a INSERT ... SELECT
for all tables (or a load ... from cursor). But we have different
tables in the table space and I want to use the same "script" for all
instances.
So I had a look at db2relocate, which should do the trick. I have the
following plan to do this:
0) backup -- always good
1) quiesce tablespace for table ONE.OF_THEM exclusive
2) cp -p OLD_CONT_DIRs NEW_CONT_DIRs
3) rename OLD_CONT_DIRs
4) db2relocate -f reloc.cfg
5) quiesce tablespace for table ONE.OF_THEM reset

Does anybody have any experience with this? Or any further
suggestions?
Thanks in advance,
Stefan
Mar 18 '08 #1
1 3314
On Mar 18, 10:26*am, "stefan.albert" <stefan.alb...@spb.dewrote:
Hi folks,
we have 3 instances where a table space (good old SMS) lives in the
wrong directory.
Normally I simply would create a new one and do a INSERT ... SELECT
for all tables (or a load ... from cursor). But we have different
tables in the table space and I want to use the same "script" for all
instances.
So I had a look at db2relocate, which should do the trick. I have the
following plan to do this:
0) backup -- always good
1) quiesce tablespace for table ONE.OF_THEM exclusive
2) cp -p OLD_CONT_DIRs NEW_CONT_DIRs
3) rename OLD_CONT_DIRs
4) db2relocate -f reloc.cfg
5) quiesce tablespace for table ONE.OF_THEM reset

Does anybody have any experience with this? Or any further
suggestions?
Thanks in advance,
Stefan
Here my results :

Step 2) failed - because DB2 holds a lock on the files.
Step 1) db2stop (force)
Step 5) db2start

The file reloc.cfg defines the old and new locations.

It worked fine for me.
Mar 25 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
by: zebi | last post by:
hello, What's your opinion : The best type of temporary tablespace (DB2V7.2 SP 7 in AIX 4.3 / multiprocessor ) is DMS ou SMS ? Thanks ZEB
4
by: Ulrich Sprick | last post by:
Hi all, (DB2 V7.1 for WinNT) I am looking for a way to determine the free space in my tablespace (containers), but I can't find out. The tablespace in question is a system managed tablespace in...
1
by: Eugene | last post by:
Is there a way to capture I/O statistics per tablespace container? Or, as long as DB2 normaly stripes/rebalances data pages across containers, the number of physical reads and/or writes from a...
2
by: Stanley Sinclair | last post by:
About to create a table which will "include" a BLOB. Am not sure how large to make the container and the tablespace. What I see says that BLOB is stored "separately." However, I don't know...
13
by: Jean-Marc Blaise | last post by:
Hi there, I would like to know the meaning of direct_writes in a tablespace snapshot on a tablespace that is: * SMS (db2empfa ON) * Only 1 table is accessed in INSERT - Z locked (Not logged...
7
by: CCC via DBMonster.com | last post by:
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...
4
by: Buck Turgidson | last post by:
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?
5
by: Mark A | last post by:
I have an OLTP database that has a tablespace that will start out at about 1 TB, but may grow to 75 TB's in size over the next 5 years. When I add new containers (on a new mount point), I want to...
3
by: Justin | last post by:
What is the difference between automatic and DMS Auto-resize tablespace?
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.