In Oracle Database 23ai, Oracle has enhanced Data Pump to create indexes more efficiently. This can significantly reduce the time it takes to create indexes during a Data Pump import.
Oracle also backported the enhancement. You find the new features in:
- 23.8 with Data Pump Bundle Patch
- 19.26 with Data Pump Bundle Patch
In any case, the new feature is on by default. No configuration is needed; just enjoy faster imports.
Benchmark
I made a benchmark using a schema with:
- 100 small tables (125 MB)
- 50 medium tables (1,5 GB)
- 10 big tables (25 GB)
- 1 huge table (100 GB)
- Each table had three indexes – 483 indexes in total
Using the new index method, the import went from almost 18 minutes to 11 minutes.
Here are extracts from the import log file:
# The old method
10-MAY-25 16:36:46.902: W-30 Completed 483 INDEX objects in 1071 seconds
# The new method
10-MAY-25 15:59:17.006: W-3 Completed 483 INDEX objects in 686 seconds
Details
So far, I haven’t seen a case where the new method is slower than the former method. However, should you want to revert to the old way of creating indexes, you can do that with the Data Pump parameter ONESTEP_INDEX=TRUE.
What Happens
To understand what happens, let’s go back in time to Oracle Database 11g. Imagine an import with PARALLEL=16. Data Pump would use one worker process to create indexes one at a time using CREATE INDEX ... PARALLEL 16. This is efficient for large indexes.
In Oracle Database 12c, the algorithm changed to better fit schemas with more indexes and especially many smaller indexes. Now, Data Pump would use all 16 workers, and each would create indexes using CREATE INDEX ... PARALLEL 1. However, this turned out to be a performance-killer for large indexes.
In Oracle Database 23ai (and 19c), you get the best of both worlds. Data Pump uses the size of the table to determine an optimal parallel degree. It creates smaller indexes in large batches with PARALLEL 1, and larger indexes using an optimal parallel degree up to PARALLEL 15.
Happy importing!
I’m afraid this option or feature is not applicable to Standard Edition databases. Please confirm.
LikeLike
Hi,
Data Pump on Standard Edition 2 databases are limited to just one worker process, so no parallel possible there.
Regards,
Daniel
LikeLike
Hi,
the issue I ran into with the new method is that 2 processes started the index creation and ran into ORA-31684: Object type INDEX:”OBJECT_OWNER”.”INDEX_NAME” already exists . The datapump process did not fail but error checking on the output got triggered.
Knut
LikeLike
Hi Knut,
Oh, that’s really strange. That’s not suppose to happen? Does it reproduce or do you by any chance had tracing turned on? I’d like to see the details of what went wrong.
Regards,
Daniel
LikeLike
It did reproduce; my solution was to use onestep_index=true I think what would help to use “if not exists” …
Knut
LikeLike
Hi Knut,
Using ONESTEP_INDEX=TRUE will disable the new feature, so it makes sense that the error doesn’t occur. But indexes will create slower.
If you enable Data Pump trace and provide us with the trace file, we’ll be able to pinpoint the error and fix it.
Regards,
Daniel
LikeLike