Example: Exchanging a table for a partition v16
This example swaps a table for the partition americas
of the sales
table. You can create the sales
table with this command:
Use this command to add sample data to the sales
table:
Querying the sales
table shows that only one row resides in the americas
partition:
This command creates a table n_america
that matches the definition of the sales
table:
This command adds data to the n_america
table. The data conforms to the partitioning rules of the americas
partition.
This command swaps the table into the partitioned table:
Querying the sales
table shows that the contents of the n_america
table were exchanged for the contents of the americas
partition:
Querying the n_america
table shows that the row that was previously stored in the americas
partition was moved to the n_america
table: