If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > How can we convert SMS tablespace to DMS Tablespace (Automatic Storage)

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-05-09, 22:44
deshaipet deshaipet is offline
Registered User
 
Join Date: Aug 2008
Posts: 76
Thumbs up How can we convert SMS tablespace to DMS Tablespace (Automatic Storage)

Hi Friends,

Is it possible to convert SMS tablespace to a DMS tablespace with Automatic Storage ? Please, let me know the chances.

Thanks
Pandith
Reply With Quote
  #2 (permalink)  
Old 02-06-09, 01:43
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
You can't convert from SMS to DMS using alter or restore. You will need to create a new DMS tablespace and copy the objects/data manually.

Last edited by db2girl; 02-06-09 at 01:50.
Reply With Quote
  #3 (permalink)  
Old 02-06-09, 09:55
deshaipet deshaipet is offline
Registered User
 
Join Date: Aug 2008
Posts: 76
Thanks a lot db2girl.

Can you please explain a bit more about this??
Reply With Quote
  #4 (permalink)  
Old 02-06-09, 14:35
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
You can use db2look to generate the DDL for tables and dependent objects. Then, create the tables only (names have to change) in the new tablespace and copy the data. To copy the data, you have a choice:
load from a cursor
export/load
db2move

Once the new tables have been populated, you can drop the old tablespace, rename new tables to their original names and then create their dependent objects (indexes, etc...)

If you're on v9, there is an easier way to accomplish this using the admin_copy_schema procedure. Here is an example:

$ db2 "call sysproc.admin_copy_schema ('TEST','TEST2','COPY',NULL,'TEST','TEST2','COPYSC HEMA2','COPYERROR')"

Value of output parameters
--------------------------
Parameter Name : ERRORTABSCHEMA
Parameter Value : COPYSCHEMA2

Parameter Name : ERRORTABNAME
Parameter Value : COPYERROR

Return Status = 0


Where:
test - the source schema and also source tablespace name
test2 - the target schema and also target tablespace name


This will copy the object from one tablespace into another within the same database. The schema will be changed.

Take a database backup before dropping anything... just in case.
Reply With Quote
  #5 (permalink)  
Old 02-07-09, 00:36
deshaipet deshaipet is offline
Registered User
 
Join Date: Aug 2008
Posts: 76
Cool Thank you very very much

Your answer would really help me a lot. Thanks again for your very explanative
description.....


Thanks
Pandit
Reply With Quote
  #6 (permalink)  
Old 02-07-09, 18:27
arandomfrog arandomfrog is offline
Registered User
 
Join Date: Jan 2006
Posts: 23
this was what i was searching for..
Reply With Quote
  #7 (permalink)  
Old 02-08-09, 02:40
stephen.song stephen.song is offline
Registered User
 
Join Date: Aug 2004
Posts: 24
backup the table in this tablespace and then drop and recreat the tablespace and import the table.
__________________
I am a java and database developer.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On