Patent ID: 8615503

Claim:
A method for attaching a partition online to a range partitioned table, comprising: beginning a child transaction; obtaining an exclusive lock on one or more source tables; obtaining an intent exclusive lock on a target table; acquiring a mutex controlling a dictionary partition list of the target table; setting an online alter flag indicating that an attach operation is in progress; attaching the source table to the target table as the new partition of the target table; updating a target table catalog to reflect the table structure of the modified target table; modifying indices for the target table in the catalog to reflect the new partition; removing catalog entries for the source table; updating the dictionary partition list with new partition information with a timestamp associated with the new partition; unsetting the online alter flag; releasing the mutex; committing the child transaction; and releasing the exclusive lock on the source table and the intent exclusive lock on the target table, wherein concurrently running queries over the target table continue to run without considering the new partition until the intent exclusive lock and the exclusive lock are released.