In oracle 18c, we can display the sql_id of the sql queries we are running using set feedback option.

– By default it will be OFF.

SQL> set feedback ON SQL_ID
SQL> select name from v$database;

NAME
———
ORA18C

1 row selected.

SQL_ID: 0ata065ztg2u0 –  > This is the sql_id of the query .