Set your undo_retention equal to or greater than the length of the longest running query:

select max(maxquerylen) from v$undostat;