Oracle Data Pump supports moving Advanced Queues (AQ) using export/import and full transportable export/import. But there are some things to be aware of.
Data Pump Does Not Start Queues
Data Pump creates the queues during import but does not start the queues. At the end of the import, you must manually start the queues:
exec dbms_aqadm.start_queue(queue_name => ... );
Be sure to start all queue:
select owner, name, queue_table, enqueue_enabled, dequeue_enabled
from dba_queues;
This behavior is intentional. During a migration, you typically don’t want to use the queues. Depending on your use case, it can have unintended side effects. After the migration, when you confirm a successful migration and are ready to go live, you can manually start the queues.
If you forget to start the queues, your application will start to receive the following error:
ORA-25207: enqueue failed, queue string.string is disabled from enqueueing
ORA-25226: dequeue failed, queue string.string is not enabled for dequeue
The Database Does Not Create All Queue Objects
Data Pump creates the queues using the Advanced Queuing administration API DBMS_AQADM:
exec dbms_aqadm.create_queue_table( ...
The database then creates the essential parts of the underlying queue infrastructure: tables, views, IOTs, etc. This should include:
- <queue_table_name>
- AQ$_<queue_table_name>_E
- AQ$_<queue_table_name>_I
- AQ$_<queue_table_name>_T
- AQ$_<queue_table_name>_F
In the source database, depending on your configuration and use of Advanced Queueing, you might also see the following objects:
- AQ$_<queue_table_name>_C
- AQ$_<queue_table_name>_D
- AQ$_<queue_table_name>_G
- AQ$_<queue_table_name>_H
- AQ$_<queue_table_name>_L
- AQ$_<queue_table_name>_P
- AQ$_<queue_table_name>_S
- AQ$_<queue_table_name>_V
This is intentional. The database creates those objects when needed. You should never create them or otherwise touch the underlying queue objects.
Typically, as part of a migration, you compare the count of objects in the source and target database to ensure nothing is lost. This comparison must consider the above.
For queue tables, it is sufficient to compare using the following query:
SQL> select count(*)
from dba_objects
where owner='<schema>'
and object_type = 'QUEUE';
Definition Of Queue Tables Might Change
As stated, you should not worry about the underlying queue objects. However, if you compare the underlying queue objects, you might see that the definition of the object changes. I describe this situation in a different blog post.
Migrate Old Queues
If the queues are REALLY old, the queue compatibility setting might also be old. If so, I strongly recommend migrating the old queues to the newest version. You can learn more about that in this blog post.
