The syntax used to convert a table to a multi-tenant table using the ALTER TABLE statement is given below:
[ SET MULTI_TENANT
[ FOR TENANT {[owner_name]tenant_name_1|DEFAULT} [ USING TABLE AREA table_area_name] [ USING INDEX AREA index_area_name] [ USING LOB AREA lob_area_name] ]... [ FOR TENANT {[owner_name]tenant_name_2|DEFAULT} USING NO SPACE ]]
Examples
Altering a table to be a multi-tenant table with default space allocations
The following example changes the pub.mtcustomer table to a multi-tenant table with default space allocations:
ALTER TABLE pub.mtcustomer SET MULTI_TENANT;
Altering a table to be a multi-tenant table with overriding space allocations
The following example alters the pub.mtcustomer table to be a multi-tenant table with overriding space allocations:
ALTER TABLE pub.mtcustomer SET MULTI_TENANT
FOR TENANT "Consolidated_Freightways"
USING TABLE AREA "MMM Data area"
USING INDEX AREA "MM CF Fin idx area"
FOR TENANT Mega_Media_Networks
USING LOB AREA "MMM pix area" ;
FOR TENANT DEFAULT USING NO SPACE;
In general, the above example describes how to convert a regular table to a multi-tenant table. When a regular table is converted to a multi-tenant table, the table data is moved to the default partition. To move the data from the default partition to the tenant partitions, see the INSERT statement.