Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / DB2 Topics / May 2006

Tip: Looking for answers? Try searching our database.

Moving Tables from SMS to DMS tablespace

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
db2dude - 25 May 2006 03:28 GMT
Hello all,

I have a database around 600GB and all tables were self-created by the
application. Hence, we have only one huge SMS tablespace where all the
tables are stored. To get better performance, we are planning to move
the tables to a DMS tablespace with multiple containers. There are LOTS
of tables and some tables have almost 40GB of data. Can you please
suggest and efficient way of doing this.

Also, I know that even a 32KB page size DMS tablespace can grow up to a
max of 512 GB, so since the current tablespace is already that big, I
wonder if I would be able to move to a  DMS tablespace.

Does having multiple SMS containers help in performance??

Thannks.
Shashi Mannepalli - 25 May 2006 16:02 GMT
Here are some thoughts

1. If you have space to create new tablespace do like this
   declare cursor/load from cursor
   Once the data load is successful then drop the OLD one.

2. If your tablespace is reaching 512 GB not a single table then you
are o.k
  Find the biggest tables in the Tablespace and then create seperate
tablespaces for these big tables.

cheers...
Shashi Mannepalli
Pierre Saint-Jacques - 25 May 2006 21:34 GMT
To the last part of your question: Yes.  Multiple containers will always
give you better performance for SMS and DMS. If the drives are in an RAID
configuration then one container per array.

As to moving your data from SMS to DMS there's probably only one way which
will lead you to alot of editing.
Use db2look to extract all the ddl for the database with the proper parms.
A db2look -h will help.
Edit the output file so that the create tablespace statements are changed to
create the proper DMS definitions.  You can add statements to the file.
Edit the create table statements to point the right table at the right
tablespace.
Since you will be using DMS tablespaces, think about separating the index
from the data.  Multiple DMS tablespaces can be used for this.

Once you have defined this. Backup your current db.
Use db2move command to extract the data to a target directory (big!!!).

Drop the current db.
Re-Create the db with normal defaults.
Run the output of the db2look file:
db2 connect to <dbname>
db2 -tf <oufilename>
Use db2move with a load option to load the data in the the newly created
tblspces and tables.

It may not be totally elegant, will require lots of keying, but it works.

Unfortunately, there's no way to alter SMS to DMS, nor is there to backup
from SMS to DMS. So, objects need to be re-created and data moved.
HTH,  Pierre.

Signature

Pierre Saint-Jacques
SES Consultants Inc.
514-737-4515

> Hello all,
>
[quoted text clipped - 12 lines]
>
> Thannks.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.