How to remove these duplicate records in an Oracle Database 12c?
A lesser-known feature of Oracle databases- every row has a [hidden] column, called ROWID. 

These meaningless,, character values can be used to isolate duplicates like this and get rid of them.  

This query should get you candidates rows to be deleted: 

select user_id, message_date, max(ROWID)
from messages m 
inner join user_messages um 
      on   m.id = um.message_id
group by user_id, message_date 
having count( * )  &gt; 1 
order by 1, 2 ; 

user_id | message_date | rowid 
      1 | 2019-01-01   | AB12CD34EF...56
      1 | 2019-02-01   | AB12CD34EF...78
      1 | 2019-03-01   | AB12CD34EF...89


You can then delete rows using the ROWID directly. 

delete from user_messages
where rowid = 'AB12CD34EF...56' ; 


All that said, do not be tempted to use them for anything else!!
ROWID's are potentially volatile and so can change on you over time.