Shorten the undo retention, use temporary tables so that you can break up the query into smaller chunks.
Forum Rules