need to pass schema name as firs script argument
select table_name, column_name from ( select c.table_name, cc.column_name, cc.position column_position from all_constraints c, all_cons_columns cc where c.constraint_name = cc.constraint_name and c.constraint_type = 'R' and c.owner=cc.owner and c.owner='&1' minus select i.table_name, ic.column_name, ic.column_position from all_indexes i, all_ind_columns ic where i.index_name = ic.index_name and i.owner=ic.table_owner and i.owner='&1');