Document Type | Technical Information
Category | Administration
Applicable Product Versions | Tibero5, Tibero6, Tibero7
Document Number | TSETI010
Overview
This document describes the BMT scenario to verify the proper operation of the table management function in the TAC environment.
Method
Verification of Recovery Using Original Query for Dropped (DDL) Tables
Execution
| Execution Order | Scenario |
|---|---|
| 1 | Activate the parameter providing recovery function for dropped (DDL) tables in the environment file (TIP) (USE_RECYCLEBIN) |
| 2 | Create test table (TIBERO.FLASHBACK_TEST) |
| 3 | Insert data into test table (TIBERO.FLASHBACK_TEST) |
| 4 | Query row count of test table (TIBERO.FLASHBACK_TEST) |
| 5 | Drop test table (TIBERO.FLASHBACK_TEST) |
| 6 | Check dropped test table (TIBERO.FLASHBACK_TEST) in Recycle bin |
| 7 | Recover dropped test table (TIBERO.FLASHBACK_TEST) |
| 8 | Query row count of test table (TIBERO.FLASHBACK_TEST) |
| 9 | Deactivate the parameter providing recovery function for dropped (DDL) tables in the environment file (TIP) (USE_RECYCLEBIN) |
Result
| Execution Order | Scenario |
|---|---|
| 1 | Activate the parameter providing recovery function for dropped (DDL) tables in the environment file (TIP) (USE_RECYCLEBIN) |
conn SYS/TIBERO
| |
| 2 | Create test table (TIBERO.FLASHBACK_TEST) |
conn TEST/TEST
| |
| 3 | Insert data into test table (TIBERO.FLASHBACK_TEST) |
declare
| |
| 4 | Query row count of test table (TIBERO.FLASHBACK_TEST) |
| SELECT COUNT(*) FROM FLASHBACK_TEST; COUNT(*) ---------- 10000 1 ROW SELECTED. | |
| 5 | Drop test table (TIBERO.FLASHBACK_TEST) |
DROP TABLE TEST.FLASHBACK_TEST; TABLE 'TEST.FLASHBACK_TEST' DROPPED. SELECT COUNT(*) FROM FLASHBACK_TEST; TBR-8033: SPECIFIED SCHEMA OBJECT WAS NOT FOUND. | |
| 6 | Check dropped test table (TIBERO.FLASHBACK_TEST) in Recycle bin |
COL OBJECT_NAME FOR A20
| |
| 7 | Recover dropped test table (TIBERO.FLASHBACK_TEST) |
| FLASHBACK TABLE FLASHBACK_TEST TO BEFORE DROP; FLASHBACKED. | |
| 8 | Query row count of test table (TIBERO.FLASHBACK_TEST) |
| SELECT COUNT(*) FROM FLASHBACK_TEST; COUNT(*) ---------- 10000 1 ROW SELECTED. | |
| 9 | Deactivate the parameter providing recovery function for dropped (DDL) tables in the environment file (TIP) (USE_RECYCLEBIN) |
conn SYS/TIBERO
|
Range Partition Table Verification
Execution
| Execution Order | Scenario |
|---|---|
| 1 | Create partitioned table |
| 2 | Insert data |
| 3 | Add partition |
| 4 | Drop partition |
| 5 | Rename partition |
| 6 | Merge partitions |
| 7 | Split partition |
| 8 | Exchange partition |
| 9 | Change partition tablespace |
| 10 | Truncate partition data |
Result
| Execution Order | Scenario |
|---|---|
| 1 | Create partitioned table |
tbsql SYS/TIBERO ********************************* T A C ******************************** CREATE TABLESPACE TEST_PART1 DATAFILE '/DEV/RAW/RAW60' SIZE 100M;
CREATE TABLE TEST.RANGE_PART
| |
| 2 | Insert data |
INSERT INTO RANGE_PART VALUES(1, 2004, 06, 12, 'SCOTT', 2500); INSERT INTO RANGE_PART VALUES(2, 2005, 06, 17, 'JONES', 4300); INSERT INTO RANGE_PART VALUES(3, 2005, 12, 12, 'MILLER', 1200); INSERT INTO RANGE_PART VALUES(4, 2006, 06, 22, 'FORD', 5200); INSERT INTO RANGE_PART VALUES(5, 2005, 01, 01, 'LION', 2200); COMMIT;
Commit completed.
SQL> SELECT * FROM TEST.RANGE_PART; RANGE_NO RANGE_YEAR RANGE_MONTH RANGE_DAY RANGE_NAME RANGE | |
| 3 | Add partition |
CREATE TABLESPACE TEST_PART_MAX DATAFILE '/DEV/RAW/RAW64' SIZE 100M;
ALTER TABLE RANGE_PART
| |
| 4 | Drop partition |
ALTER TABLE RANGE_PART DROP PARTITION RANGE_MAX; TABLE 'RANGE_PART' ALTERED | |
| 5 | Rename partition |
| ALTER TABLE RANGE_PART RENAME PARTITION RANGE_Q4 TO RANGE_FOUR; TABLE 'RANGE_PART' ALTERED | |
| 6 | Merge partitions |
ALTER TABLE RANGE_PART MERGE PARTITIONS RANGE_Q1, RANGE_Q2 INTO PARTITION RANGE_Q2 UPDATE INDEXES; TABLE 'RANGE_PART' ALTERED. | |
| 7 | Split partition |
ALTER TABLE RANGE_PART SPLIT PARTITION RANGE_Q2 AT (2005, 01, 01) INTO (PARTITION RANGE_Q1, PARTITION RANGE_Q2);
TABLE 'RANGE_PART' ALTERED. | |
| 8 | Exchange partition |
** Create table to move partition data to a regular table ** CREATE TABLE RANGE_PART_EX (RANGE_NO NUMBER, RANGE_YEAR INT NOT NULL, RANGE_MONTH INT NOT NULL, RANGE_DAY INT NOT NULL, RANGE_NAME VARCHAR2(30), RANGE NUMBER) TABLESPACE TEST_PART1; TABLE 'RANGE_PART_EX' CREATED.
** Exchange partition data to regular table ** ALTER TABLE RANGE_PART EXCHANGE PARTITION RANGE_Q1 WITH TABLE RANGE_PART_EX; TABLE 'RANGE_PART' ALTERED.
** Query data of partition table ** SELECT RANGE_NO FROM RANGE_PART PARTITION (RANGE_Q1); 0 ROW SELECTED
** Query data of regular table where partition data moved ** SELECT RANGE_NO FROM RANGE_PART_EX; RANGE_NO ---------------- 1 1 ROW SELECTED. | |
| 9 | Change partition tablespace |
ALTER TABLE RANGE_PART MOVE PARTITION RANGE_Q3 TABLESPACE TEST_PART_MAX; TABLE 'RANGE_PART' ALTERED. | |
| 10 | Truncate partition data |
ALTER TABLE RANGE_PART TRUNCATE PARTITION RANGE_Q3; TABLE 'RANGE_PART' ALTERED.
SELECT * FROM RANGE_PART PARTITION (RANGE_Q3); 0 ROW SELECTED. |
Hash Partition Table Verification
Execution
| Execution Order | Scenario |
|---|---|
| 1 | Create partitioned table |
| 2 | Insert data |
| 3 | Drop partition (not supported) |
| 4 | Rename partition |
| 5 | Exchange partition |
| 6 | Change partition tablespace |
| 7 | Truncate partition data |
Result
| Execution Order | Scenario |
|---|---|
| 1 | Create partitioned table |
tbsql test/test tbSQL 7 TmaxTibero Corporation Copyright (c) 2020-. All rights reserved. Connected to Tibero.
CREATE TABLE TEST.HASH_PART Table 'TEST.HASH_PART' created. | |
| 2 | Insert data |
INSERT INTO TEST.HASH_PART VALUES(1, 2004, 06, 12, 'SCOTT', 2500); COMMIT; Commit completed.
SELECT * FROM TEST.HASH_PART; HASH_NO HASH_YEAR HASH_MONTH HASH_DAY HASH_NAME HASH 6 rows selected. | |
| 3 | Drop partition (not supported) |
ALTER TABLE TEST.HASH_PART DROP PARTITION HASH_PART4;
| |
| 4 | Rename partition |
| ALTER TABLE TEST.HASH_PART RENAME PARTITION HASH_PART4 TO HASH_PART_FOUR; Table 'TEST.HASH_PART' altered. | |
| 5 | Exchange partition |
** Create table to move partition data to a regular table ** CREATE TABLE TEST.HASH_PART_EX Table 'TEST.HASH_PART_EX' created.
** Exchange partition data to regular table ** ALTER TABLE TEST.HASH_PART EXCHANGE PARTITION HASH_PART2 WITH TABLE TEST.HASH_PART_EX; Table 'TEST.HASH_PART' altered.
** Query data of partition table ** SELECT COUNT(*) FROM TEST.HASH_PART PARTITION(HASH_PART2); COUNT(*) 1 row selected.
SELECT COUNT(*) FROM TEST.HASH_PART_EX; COUNT(*) 1 row selected. | |
| 6 | Change partition tablespace |
ALTER TABLE TEST.HASH_PART MOVE PARTITION HASH_PART3 TABLESPACE TEST_PART4; Table 'TEST.HASH_PART' altered. | |
| 7 | Truncate partition data |
SELECT COUNT(*) FROM TEST.HASH_PART PARTITION(HASH_PART_FOUR); COUNT(*) 1 row selected. ALTER TABLE TEST.HASH_PART TRUNCATE PARTITION HASH_PART_FOUR; Table 'TEST.HASH_PART' altered.
SELECT COUNT(*) FROM TEST.HASH_PART PARTITION(HASH_PART_FOUR); COUNT(*) 1 row selected. |
List Partition Table Verification
Execution
| Execution Order | Scenario |
|---|---|
| 1 | Create partitioned table |
| 2 | Insert data |
| 3 | Add partition |
| 4 | Drop partition |
| 5 | Rename partition |
| 6 | Exchange partition |
| 7 | Change partition tablespace |
| 8 | Truncate partition data |
Result
| Execution Order | Scenario |
|---|---|
| 1 | Create partitioned table |
CREATE TABLE TEST.LIST_PART Table 'TEST.LIST_PART' created. | |
| 2 | Insert data |
INSERT INTO LIST_PART VALUES(1, 'SMITH', 'CLERK', 7902, SYSDATE, 800, NULL,20); COMMIT;
SELECT LIST_NO FROM LIST_PART PARTITION (LIST_PART1); LIST_NO 3 rows selected.
SELECT LIST_NO FROM LIST_PART PARTITION (LIST_PART2); LIST_NO 4 rows selected.
SELECT LIST_NO FROM LIST_PART PARTITION (LIST_PART3); LIST_NO 2 rows selected. SELECT LIST_NO FROM LIST_PART PARTITION (LIST_PART4); LIST_NO 5 rows selected. | |
| 3 | Add partition |
ALTER TABLE LIST_PART ADD PARTITION LIST_PART_MAX VALUES ('DUMMY') TABLESPACE TEST_PART_MAX; Table 'LIST_PART' altered. | |
| 4 | Drop partition |
ALTER TABLE LIST_PART DROP PARTITION LIST_PART_MAX ; Table 'LIST_PART' altered. | |
| 5 | Rename partition |
| ALTER TABLE TEST.LIST_PART RENAME PARTITION LIST_PART4 TO LIST_PART_FOUR; Table 'TEST.LIST_PART' altered. | |
| 6 | Exchange partition |
** Create table to move partition data to a regular table ** CREATE TABLE TEST.LIST_PART_EX
SELECT COUNT(*) FROM TEST.LIST_PART PARTITION(LIST_PART3); COUNT(*) 1 row selected. ** Exchange partition data to regular table ** ALTER TABLE TEST.LIST_PART EXCHANGE PARTITION LIST_PART3 WITH TABLE TEST.LIST_PART_EX; Table 'TEST.LIST_PART' altered. ** Query data of partition table ** SELECT COUNT(*) FROM TEST.LIST_PART PARTITION(LIST_PART3); 1 row selected. ** Query data of regular table where partition data moved ** SELECT COUNT(*) FROM TEST.LIST_PART_EX; COUNT(*) 1 row selected. | |
| 7 | Change partition tablespace |
ALTER TABLE TEST.LIST_PART MOVE PARTITION LIST_PART1 TABLESPACE TEST_PART2; Table 'TEST.LIST_PART' altered. | |
| 8 | Truncate partition data |
SELECT COUNT(*) FROM TEST.LIST_PART PARTITION(LIST_PART2); 1 row selected. ALTER TABLE TEST.LIST_PART TRUNCATE PARTITION LIST_PART2; Table 'TEST.LIST_PART' altered.
SELECT COUNT(*) FROM TEST.LIST_PART PARTITION(LIST_PART2); COUNT(*) |