The CREATE TENANT statement:

  • Defines a tenant for a multi-tenant database
  • Allocates database resources in the existing multi-tenant tables
  • Adds a new tenant to an existing multi-tenant group that is defined for a multi-tenant table

Syntax

CREATE TENANT tenant_name TABLE AREA area_name   
  [ INDEX AREA area_name_2]    
  [ LOB AREA area_name_3] 
  [ PRO_DESCRIPTION value] 
  [ FOR TABLE [owner_name]table_name_1 
   {[ USING TABLE AREA table_area_name]      
      [ USING INDEX AREA index_area_name]           
      [ USING LOB AREA lob_area_name]    ]
         | USING NO SPACE | JOIN GROUP group_name}]... 
      [ FOR TABLE [owner_name]table_name_2[ USING NO SPACE ]] 
;

Example: CREATE TENANT statement

The following example shows how to create a tenant by overriding an area for the selected table partition and how to add the tenant to a group:


CREATE TENANT  Consolidated_Freightways TABLE AREA "CF Data area"
                                        INDEX AREA "CF index area"
		FOR TABLE pub.customer USING TABLE AREA "CF cust area"
                       USING INDEX AREA "CF cust idx area"
		FOR TABLE pub.acct_payable USING TABLE AREA "CF Financial area"
                           USING INDEX AREA "CF Fin idx area"
		FOR TABLE pub.farm_location USING NO SPACE
		FOR TABLE pub.archive_10yr  JOIN GROUP Joint_Archives;

Example: Creating a tenant and adding it to groups

The following example shows how to create a tenant and add it to multiple groups:

CREATE TENANT Consolidated_Freightways TABLE AREA "CF Data area"
		FOR TABLE pub.farm_location JOIN GROUP AgriDataGroup
		FOR TABLE pub.archive_10yr JOIN GROUP Joint_Archives;

For more on the CREATE TENANT statement, see OpenEdge SQL Reference.