Try OpenEdge Now
skip to main content
SQL Development
OpenEdge SQL Data Definition Language : Working with SQL utilities : Using the SQLDUMP utility : Dumping Multi-tenant tables
 
Dumping Multi-tenant tables
The SQLDUMP utility is extended to support multi-tenancy. This utility allows you to dump data from multi-tenant tables—depending on the user type—to an external file with the new (- n) command line option. The following examples provide clarity on dumping multi-tenant tables:
The following example directs the SQLDUMP utility to dump data from the tenants ten1 and ten2 to two SQL dump files respectively. 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 mtdb database.
To separate the tenant specific data the SQLDUMP utility creates separate directories for each tenant. ten1/<OWNER>.MTTAB1.DSQL and ten2/<OWNER>.MTTAB1.DSQL are the two directories that are created to dump tenant data.
Example: SQLDUMP from multi-tenant tables
sqldump -u supertenUser@superdom -a superten -t mttab1 -n ten1,ten2 progress:T:localhost:9999:mtdb
If the regTenantUser is mapped to a regular tenant, then the following example directs the SQLDUMP utility to dump the data for the regTenantUser tenant's partition.
Example: SQLDUMP by a regular tenant
sqldump -u regTenantUser@OpenEdgeA -a regTenant -t mttab1 progress:T:localhost:9999:mtdb
If the regTenantUser is mapped to a regular tenant, then the following example directs the SQLDUMP utility to dump the data for the regTenantUser tenant's partition.
sqldump -u regTenantUser@OpenEdgeA -a regTenant -t mttab1 -n ten1 progress:T:localhost:9999:mtdb
If regTenantUser is not mapped to ten1 tenant, the above statement throws an error.
Example: SQLDUMP by a DBA
If the dbaUser is a DBA, then, the following example directs the SQLDUMP utility to dump the tenant-specific data for all the tenants in their respective directory.
sqldump -u dbaUser -a dba -t mttab1 progress:T:localhost:9999:mtdb
If the superTenUser is a super-tenant, then, the following example directs the SQLDUMP utility to dump all the tenants which start with the word ‘ten' from the table mttab.
Example: SQLDUMP using a % operator
sqldump -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 SQLDUMP utility to dump all the tenants which start with the word ‘ten' from all the tables that start with mttab.
sqldump -u dbaUser -a dba -t mttab% -n ten% progress:T:localhost:9999:mtdb