Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.
CREATE TABLE my_table ( id NUMBER, description VARCHAR2(50) ); -- This table will have 131 million records. --Next we create a new partitioned table with a single partition to act as our destination table. CREATE TABLE my_table_2 ( id NUMBER, description VARCHAR2(50) ) PARTITION BY RANGE (id) (PARTITION my_table_part VALUES LESS THAN (MAXVALUE)); ---Next we switch the original table segment with the partition segment. ALTER TABLE my_table_2 EXCHANGE PARTITION my_table_part WITH TABLE my_table WITHOUT VALIDATION; --We can now drop the original table and rename the partitioned table. DROP TABLE my_table; RENAME my_table_2 TO my_table; --Finally we can split the partitioned table into multiple partitions as required and gather new statistics. ALTER TABLE my_table SPLIT PARTITION my_table_part AT (3) INTO (PARTITION my_table_part_1, PARTITION my_table_part_2); EXEC DBMS_STATS.gather_table_stats(USER, 'MY_TABLE', cascade => TRUE);
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
19 Experts available now in Live!