TENANT SEPARATION WITHIN A DATABASE INSTANCE
A method for a database instance associated with a database management system includes receiving a command to perform a copy or a move on a first tenant partition from a first database instance to a second database instance destination partition. The method shuts down the first tenant partition, packs tenant-dependent data into tenant-dependent tables, acquires a data definition lock that prevents changes to metadata describing the first tenant partition, obtains tenant-specific metadata of a catalog of the first database instance, packs the first database instance catalog tenant-specific metadata into the first tenant partition, locks write transactions on tenant-specific data in the first tenant partition, creates a tenant-specific snapshot of the first tenant partition, stores the tenant-specific snapshot in a storage device external to the first database instance, performs the received command, and releases both the write transaction lock and the data definition lock.
1 .- 19 . (canceled)
20 . A computer-implemented method for a database instance associated with a database management system, the method comprising:
receiving a command to perform at least one of a copy and a move on a first tenant partition from a first database instance to a destination partition in a second database instance;
shutting down the first tenant partition, wherein access by one or more users to tenant specific data within the first tenant partition is prevented;
packing tenant-dependent data in a common partition of the first database instance into tenant-dependent tables;
acquiring a data definition lock that prevents changes to metadata describing the first tenant partition;
obtaining tenant-specific metadata of a catalog of the first database instance;
packing the first database instance catalog tenant-specific metadata into the first tenant partition;
locking write transactions on tenant-specific data in the first tenant partition;
creating a tenant-specific snapshot of the first tenant partition;
storing the tenant-specific snapshot in a storage device external to the first database instance;
performing the received command; and
releasing both the write transaction lock and the data definition lock.
21 . The method of claim 20 , wherein if the received command is a move command, after the first tenant partition has been moved the method includes;
dismounting each data volume of the first tenant partition from the first database instance; and
processing undo information from the first database instance.
22 . The method of claim 21 , further including deleting undo information from the first database instance after the first tenant partition has been moved.
23 . The method of claim 20 , wherein if the received command is a copy command, the method includes restarting the first tenant partition.
24 . The method of claim 20 , further including:
confirming that the destination partition in the second database instance is operating; and
creating a backup of the second database instance.
25 . The method of claim 24 , wherein if the confirming step indicates that the destination partition is not operating, the method further includes:
recovering the destination database instance from the snapshot; and
re-running the destination database instance's redo log including copying or moving the first tenant partition from the first database instance.
26 . The method of claim 20 , wherein the first database instance and the second database instance are within the same data storage device.
27 . The method of claim 20 , wherein the tenant-dependent data includes client-specific table data and index data.
28 . The method of claim 20 , further including:
obtaining class container information of the first database instance; and
packing the class container information into the first tenant partition.
29 . A non-transitory computer-readable medium having stored thereon instructions which when executed by a processor cause the processor to perform the method of:
receive a command to perform at least one of a copy and a move on a first tenant partition from a first database instance to a destination partition in a second database instance;
shut down the first tenant partition, wherein access by one or more users to tenant specific data within the first tenant partition is prevented;
pack tenant-dependent data in a common partition of the first database instance into tenant-dependent tables;
acquire a data definition lock that prevents changes to metadata describing the first tenant partition;
obtain tenant-specific metadata of a catalog of the first database instance;
pack the first database instance catalog tenant-specific metadata into the first tenant partition;
lock write transactions on tenant-specific data in the first tenant partition;
create a tenant-specific snapshot of the first tenant partition;
store the tenant-specific snapshot in a storage device external to the first database instance;
perform the received command; and
release both the write transaction lock and the data definition lock.
30 . The non-transitory computer-readable medium of claim 29 , wherein if the received command is a move command, after the first tenant partition has been moved, further including instructions, to cause the processor to:
dismount each data volume of the first tenant partition from the first database instance; and
process undo information from the first database instance.
31 . The non-transitory computer-readable medium of claim 30 , further including instructions to cause the processor to delete undo information from the first database instance after the first tenant partition has been moved.
32 . The non-transitory computer-readable medium of claim 29 , wherein if the received command is a copy command, further including instructions to cause the processor to restart the first tenant partition.
33 . The non-transitory computer-readable medium of claim 29 , further including instructions to cause the processor to:
confirm that the destination partition in the second database instance is operating; and
create a backup of the second database instance.
34 . The non-transitory computer-readable medium of claim 33 , wherein if the confirm step indicates that the destination partition is not operating, further including instructions to cause the processor to:
recover the destination database instance from the snapshot; and
re-run the destination database instance's redo log including copying or moving the first tenant partition from the first database instance.
35 . The non-transitory computer-readable medium of claim 29 , further including instructions to cause the processor to:
obtain class container information of the first database instance; and
pack the class container information into the first tenant partition.