CPC G06F 16/2343 (2019.01) [G06F 16/2358 (2019.01)] | 20 Claims |
1. A method for copying tenant data in a multi-tenant system, comprising:
receiving a request to copy a tenant data of a tenant from a source database of a source database system to a target database of a target database system;
indicating in a tenant metadata that the tenant is write protected; and
copying the tenant data, comprising: performing a bulk copy of the tenant data in the source database to the target database and, after performing the bulk copy, transferring change logs from the source database system to the target database system by repeatedly performing by the target database system:
receiving a first database statement configured to perform a first set of row level database operations, the first database statement causing execution of a first statement level trigger;
executing the first statement level trigger causing refreshing of a cache of the tenant metadata; and
executing the first set of row level database operations, wherein execution of a row level operation includes: in response to determining that the cache of the tenant metadata indicates the tenant is write protected, causing execution of a row level trigger with instructions to rollback the row level operation; and
receiving a second database statement configured to perform a second set of row level operations, the second database statement causing execution of a second statement level trigger; and
executing the second statement level trigger causes checking that the cache of the tenant metadata is loaded and does not need to be refreshed.
|