How to log the values that cause a unique constraint violation
You can use DML error logging

begin
  dbms_errlog.create_error_log( dml_table_name =&gt; 'MYTABLE' );
end;
/

insert into mytable
  &lt;&lt;your select statement&gt;&gt;
  log errors into err$mytable
  reject limit unlimited;


This will log all the rows that violated a constraint to the err$mytable table.