Feedback
Did this article resolve your question/issue?

   

Article

How to create a small test multi tenant database using SQL

Information

 
TitleHow to create a small test multi tenant database using SQL
URL NameHow-to-create-a-small-test-multi-tenant-database-using-SQL
Article Number000179373
EnvironmentProduct: OpenEdge
Version: 11.x
OS: All supported platforms
Question/Problem Description
How to create a small test multi-tenant database using SQL
Steps to Reproduce
Clarifying Information
Error Message
Defect/Enhancement Number
Cause
Resolution
To create a small test multi tenant database 

1. enableMultitenancy against a test database with the following structure file:
            
$   prodb testdb empty testdb.st
$   proutil testdb -C enableMultitenancy 

# testdb.st
b testdb.b1 
d "Schema Area":6,32;1 testdb.d1 
d "USdata":7,32;64 testdb_7.d1 
d "USidx":8,32;64 testdb_8.d1 
d "NLdata":9,32;64 testdb_9.d1 
d "NLidx":10,32;64 testdb_10.d1 
d "FRdata":11,32;64 testdb_11.d1 
d "FRidx":12,32;64 testdb_12.d1 
d "USdata Area":13,32;64 testdb_13.d1 
d "USidx Area":14,32;64 testdb_14.d1 
d "USlob Area":15,32;64 testdb_15.d1 
d "NLdata Area":16,32;64 testdb_16.d1 
d "NLidx Area":17,32;64 testdb_17.d1 
d "NLlob Area":18,32;64 testdb_18.d1 
d "FRdata Area":19,32;64 testdb_19.d1 
d "FRidx Area":20,32;64 testdb_20.d1 
d "FRlob Area":21,32;64 testdb_21.d1 

2. Start the test database and configure Tenants
   
$  proserve testdb -S 5555 
$  sqlexp -db testdb -S 5555 -char -infile sqlmt.txt


--  sqlmt.txt
CREATE TENANT UStenant TABLE AREA "USdata" INDEX AREA "USidx"; 
CREATE TENANT NLtenant TABLE AREA "NLdata" INDEX AREA "NLidx"; 
CREATE TENANT FRtenant TABLE AREA "FRdata" INDEX AREA "FRidx"; 
CREATE DOMAIN dom_US FOR TENANT UStenant; 
CREATE DOMAIN dom_NL FOR TENANT NLtenant; 
CREATE DOMAIN dom_FR FOR TENANT FRtenant; 
CREATE TABLE pub.Customer (CustNum integer, Name varchar (30), Address varchar (30), City varchar (30), State varchar (30)) 
MULTI_TENANT 
FOR TENANT UStenant 
USING TABLE AREA "USdata Area" 
USING INDEX AREA "USidx Area" 
FOR TENANT "NLtenant" 
USING TABLE AREA "NLdata Area" 
USING INDEX AREA "NLidx Area" 
FOR TENANT "FRtenant" 
USING TABLE AREA "FRdata Area" 
USING INDEX AREA "FRidx Area" 
FOR TENANT DEFAULT USING NO SPACE ; 
INSERT INTO PUB.Customer TENANT UStenant (CustNum, Name, Address, City, State) VALUES (1001, 'Global Fitness', '3rd Street', 'New York', 'NY') ; 
INSERT INTO PUB.Customer TENANT NLtenant (CustNum, Name, Address, City, State) VALUES (1002, 'Lekker bezig', 'Margrietlaan 21', 'Rotterdam', 'NL') ; 
INSERT INTO PUB.Customer TENANT FRtenant (CustNum, Name, Address, City, State) VALUES (1003, 'A fond la forme', '36 Rue Hugues Capet', 'Senlis', 'FR') ; 
CREATE USER 'sysprogress', 'sysprogress'; 
CREATE USER 'mike@dom_US', 'mike'; 
CREATE USER 'piet@dom_NL', 'piet'; 
CREATE USER 'yves@dom_FR', 'yves'; 
grant select ON PUB.Customer to mike@dom_US; 
grant select ON PUB.Customer to piet@dom_NL; 
grant select ON PUB.Customer to yves@dom_FR;
CREATE SUPER_TENANT tenantadmin;
CREATE DOMAIN dom_st FOR SUPER_TENANT tenantadmin;
CREATE USER 'st@dom_st', 'st';
grant resource,dba to 'st@dom_st'; 
commit; 
Workaround
Notes
Last Modified Date1/30/2020 8:18 AM
Attachment 
Files
Disclaimer The origins of the information on this site may be internal or external to Progress Software Corporation (“Progress”). Progress Software Corporation makes all reasonable efforts to verify this information. However, the information provided is for your information only. Progress Software Corporation makes no explicit or implied claims to the validity of this information.

Any sample code provided on this site is not supported under any Progress support program or service. The sample code is provided on an "AS IS" basis. Progress makes no warranties, express or implied, and disclaims all implied warranties including, without limitation, the implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample code is borne by the user. In no event shall Progress, its employees, or anyone else involved in the creation, production, or delivery of the code be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample code, even if Progress has been advised of the possibility of such damages.