[DM_QUERY_E_CURSOR_ERROR] How to optimize select group members DQL query

Options

I have this following query where I want to select all users who are members of all the group of a specific user:

select i_all_users_names from dm_group where group_name in (select group_name from dm_group where any i_all_users_names = USER and group_name like 'rcc_user_%');

But the execution of this query is causing this error: [DM_QUERY_E_CURSOR_ERROR]error: "A database error has occurred during the creation of a cursor ('ORA-01652: unable to extend temp segment by 128 in tablespace TEMP')."

How can I optimize it ?

Tagged: