Feasibility of Partitioning existing tables with huge data in Oracle

dbms-redefinitionoracleoracle-11g-r2partitioning

We have a set of 24 tables that take up about 1tb+ data which is why DBA suggested to use partitioning to better handle usage.

The only issue being the partitioning of the existing tables is something they are not advising as data transfer from current to temp table will take a lot of time(dbms_redefinition), which is why they are suggesting to use a 2 table approach where old table will be static and new table will be partitioned, and select will be a union of the 2 tables as required.

I just wanted to explore if there is any other way of partitioning the existing tables without requiring significant down time

Best Answer

Oracle Database provides a mechanism to make table structure modifications without significantly affecting the availability of the table. The mechanism is called online table redefinition. Redefining tables online provides a substantial increase in availability compared to traditional methods of redefining tables.

You can redefine the table online and it will be accessible for DML. The table will be locked in an exclusive mode for a negligible period of time, where the size of the table doesn't matter.

The downside is you have to have extra space equal to the size of your table(1TB).

Update:

Online Conversion of a Nonpartitioned Table to a Partitioned Table

Nonpartitioned tables can be converted to partitioned tables online. Indexes are maintained as part of this operation and can be partitioned as well. The conversion has no impact on the ongoing DML operations.

In Oracle 12c Release 2, you can convert your non-partitioned table to partitioned table using ALTER TABLE statement. But, as per your tagging, you are in 11g R2 and you don't have this option.

Documentation:

  • Redefining Tables Online
  • Oracle 12.2: Online Conversion of a Nonpartitioned Table to a Partitioned Table