Document Type | Technical Information
Field | Management/Configuration
Applicable Product Version | Tibero7.2.4
Document Number | TADTI188
Overview
This document describes the method and precautions for data exchange (Partition Exchange) between Partition Tables and Non-Partition Tables in Tibero. For reference, 'General Table' means a Non-Partition Table.
Method
Partition Exchange
This is an operation that swaps data between Partition Tables and Non-Partition Tables at the metadata level without row-level copying.
Partition Exchange Constraints
- The general table structure must be exactly the same as the Partition Table (columns, column order, type).
- Indexes or constraints present in the general table must be identical to those in the Partition Table.
- Data included in the general table must correspond to only one partition condition.
Basic Syntax for Partition Exchange
| Category | Description |
|---|---|
| Basic Syntax | ALTER TABLE [Partition Table Name] EXCHANGE PARTITION [PARTITION|SUBPARTITION] [Partition Name] WITH TABLE [General Table Name] [INCLUDING | EXCLUDING INDEX] [WITH | WITHOUT VALIDATION]; |
| PARTITION / SUBPARTITION | Specify the name of the partition or subpartition |
| WITH TABLE | Specify the name of the general table to exchange metadata with the partition table |
| INCLUDING INDEXES | Exchanges the local indexes of the partition or subpartition indexes along with the indexes of the general table (excluding global indexes not present in the partition) |
| EXCLUDING INDEXES (default) | Excludes all indexes related to the specified partition (including local indexes) from the exchange |
| WITH VALIDATION (default) | Validates that rows in the general table exactly match the partition conditions and constraints (if conditions are not met, an error occurs and exchange fails) |
| WITHOUT VALIDATION | Performs the exchange without validating whether the general table's data matches the partition condition (used when the user can already guarantee the partition condition) |
Partition Exchange Execution Test
Please refer to the attached file '[Tibero7] Partition Exchange_v1.0' for the test scenario below.
2.3.1. Test Preparation
2.3.2. Partition Exchange Execution Scenario and Test (Local Index case Excluding Indexes)
2.3.3. Partition Exchange Execution Scenario and Test (Local Index case Including Indexes)
2.3.4. Test Preparation
2.3.5. Partition Exchange Execution Scenario and Test (Global Index case Excluding Indexes)
2.3.6. Partition Exchange Execution Scenario and Test (Global Index case Including Indexes)
2.3.7. Partition Exchange Execution Test (WITH VALIDATION when Partition key violation)
2.3.8. Partition Exchange Execution Test (WITHOUT VALIDATION when Partition key violation)