Start with your Requirements
Not all queries need to be fast. Some run in the background or during batch windows. Others support REST services, dashboards, or interactive user flows—and those do have time limits. If you’re running in a REST service (including Oracle REST Data Services, APEX APIs, or external integrations), Oracle enforces a 300-second (5 minute) timeout. That includes SQL or PL/SQL blocks.
Rule of thumb:
If your query supports a REST service or user interaction, it must complete in under 300 seconds. Otherwise, it will fail.