Hakan factor ORA-14642, ORA-14643

Hakan factor

The Hakan factor is used to unique map rows in a Bitmap Index to the rows in the base table. This factor is related to the max number of rows that can be stored in a single block of a table. Several factors like the column type and not null constraints influence the Hakan factor. The factor will also be recalculated when a table is modified until there is the first bitmap Index is created. Than the Hakan factor has to be protected for the existing bitmap indexes.

If a new table created to exchange data with the partitioned table, with a table layout, that include columns added after the bitmap index creation on the partitioned table, will most likely result in a different Hakan factor.

Errors

If the Hakan Factor do not match during exchange partitions, the prognosis is either of the error messages below:

  • ORA-14642: “Bitmap index mismatch for tables in ALTER TABLE EXCHANGE PARTITION”
  • ORA-14643: “Hakan factor mismatch for tables in ALTER TABLE EXCHANGE PARTITION”

The error can appear only if you exchange a partition with bitmap indexes

Continue reading

Autonomous Transaction

Autonomous transaction – is an independent transaction called from another transaction which is the main transaction.

Features of autonomous transaction

  • autonomous transaction doesn’t see uncommitted changes made by main transaction
  • committed changes in autonomous transaction are visible in main transaction
  • autonomous transaction can call other autonomous transaction. There are no limit how many levels of autonomous transaction can be called

Special pragma AUTONOMOUS_TRANSACTION is introduced in PL/SQL. The pragma instructs the database that executed code is to be executed as new autonomous transaction independent from main transaction.

Continue reading