Try OpenEdge Now
skip to main content
SQL Development
OpenEdge SQL Data Definition Language : Working with SQL utilities : Using the SQLLOAD utility : Loading Multi-tenant tables
 
Loading Multi-tenant tables
The SQLLOAD utility is extended to support multi-tenancy. It allows you to load data onto the multi-tenant tables—depending on the user type from the formatted file(s) with the new (- n) command-line option. The following examples provide clarity on dumping multi-tenant tables:
The following example directs the SQLLOAD utility to load the data from the dump files in the tenant directories ten1 and ten2 to the mttab1 table. The user_name and password to connect to the database are supertenUser@superdom and superten. The supertenUser account in the superdom domain must have the authority to access the mttab1 table and the _tenant system table in the mtdb database.
The tenant directories are created for every defined tenant. The following example illustrates the creation of tenant directories when the tenants are dumped to a formatted file using SQLLOAD utility.
Example: SQLLOAD from multi-tenant tables
sqlload -u supertenUser@superdom -a superten -t mttab1 -n ten1,ten2 progress:T:localhost:9999:mtdb
Example: SQLLOAD by a regular tenant
If the regTenantUser is mapped to a regular tenant, then the following example directs the SQLLOAD utility to load the data of the partition of the tenant to mttab1 table.
sqlload -u regTenantUser@OpenEdgeA -a regTenant -t mttab1 progress:T:localhost:9999:mtdb
Example: SQLLOAD by a DBA
If the dbaUser is a DBA, then the following example directs the SQLLOAD utility to load the tenant-specific data for all the tenants from their respective directories for the table mttab1.
sqlload -u dbaUser -a dba -t mttab1 progress:T:localhost:9999:mtdb
If the superTenUser is a super-tenant, then the following example directs the SQLLOAD utility to load all the data associated with the tenants which start with the word ‘ten' of the table mttab1.
Examples: SQLLOAD using a % operator
sqlload -u superTenUser@superdom -a superten -t mttab1 -n ten% progress:T:localhost:9999:mtdb
If the dbaUser is a DBA, then the following example directs the SQLLOAD utility to load all data for the tables which start with the word ‘mttab' for all the tenants whose name starts with ‘ten'.
sqlload -u dbaUser -a dba -t mttab% -n ten% progress:T:localhost:9999:mtdb
Example: SQLLOAD to load data for all tenants for a table
If the dbaUser is a DBA, then the following example directs the SQLLOAD utility to load all the data for tenants for the table mttab.
sqlload -u dbaUser -a dba -t mttab progress:T:localhost:9999:mtdb