Skip to Content

How to rename tablespaces in DB2 with SAP

Recently I had many problems with renaming tablespaces. So I decided to share my experience!

Pre: materialize all virtual tables!


You can use the db2 command:


and execute it for every tablespace. It is better to make a script!


After that you have to alter tables:


with the new tablespace names.

I used the DB2 client (DB2 control center) for that because I couldn’t make it through SAP.

That should do it!

The Problems!

1. If you have virtual tables when renaming, you will realize that they can’t materialize after you renamed all the tablespaces.

To solve that follow note 1227165, which is: execute in command prompt:

db6util -rtvt {old tbs} {new tbs}

for every tablespace.

2. If you have run SPAM or SAINT before altering the three tables (TADB6, TSDB6 and IADB6), you will see that it will halt at phase IMPORT_PROPER, and will give you an error, because it is trying to connect to the old tablespaces.

To solve that, you have to alter the three tables of course, but it is not enough. Because SPAM/SAINT already created commands using the data from the three tables (i.e. old tablespace names).

You have to alter table:


and replace all old names with the new ones.

Many thanks to these people here:

1 Comment
You must be Logged on to comment or reply to a post.