Example - Exchanging a Table for a Partition v13
The example that follows demonstrates swapping a table for a partition (americas)
of the sales
table. You can create the sales
table with the following command:
Use the following command to add sample data to the sales
table.
Querying the sales
table shows that only one row resides in the americas
partition.
The following command creates a table (n_america)
that matches the definition of the sales
table.
The following command adds data to the n_america
table. The data conforms to the partitioning rules of the americas
partition.
The following command swaps the table into the partitioned table.
Querying the sales
table shows that the contents of the n_america
table has been exchanged for the content of the americas
partition.
Querying the n_america
table shows that the row that was previously stored in the americas
partition has been moved to the n_america
table.