Find Oracle DB Locking

First to find out the session that caused the locking. Use any of below two SQLs.

Once you have session id, query v$session to find SQL_ID or PREV_SQL_ID.

And get the query from v$sql