It does some pretty cool things actually. It coverts the entire statement to upper case, except for quoted strings of course, and it strips out all white space down to a single space. So carriage returns, line feeds, tabs and such all become a single space. Also comments are removed, but not HINTS.
Here is s simple example. I'm using MODULE and ACTION name here to identify these different runs. I'll run what is really the same query 4 times but each time the text is a little different and the last one has a hint:
SQL> exec dbms_application_info.set_module('PLSQL','LOWER');
PL/SQL procedure successfully completed.
SQL>
SQL> declare
2 cnt number;
3 begin
4 select count(*) into cnt from emp e;
5 end;
6 /
PL/SQL procedure successfully completed.
SQL>
SQL> exec dbms_application_info.set_module('PLSQL','UPPER');
PL/SQL procedure successfully completed.
SQL>
SQL> DECLARE
2 CNT NUMBER;
3 BEGIN
4 SELECT COUNT(*) INTO CNT FROM EMP E;
5 END;
6 /
PL/SQL procedure successfully completed.
SQL>
SQL> exec dbms_application_info.set_module('PLSQL','TWOLINES');
PL/SQL procedure successfully completed.
SQL>
SQL> declare
2 cnt number;
3 begin
4 select count(*) into cnt
5 from emp e;
6 end;
7 /
PL/SQL procedure successfully completed.
SQL>
SQL> exec dbms_application_info.set_module('PLSQL','HINT');
PL/SQL procedure successfully completed.
SQL>
SQL> declare
2 cnt number;
3 begin
4 select /*+ full (e) */ count(*) into cnt
5 from emp e;
6 end;
7 /
PL/SQL procedure successfully completed.
SQL>
SQL>
SQL> exec dbms_application_info.set_module(null,null);
PL/SQL procedure successfully completed.
SQL>
SQL> select action, executions, version_count, hash_value, sql_text
2 from v$sqlarea
3 where module = 'PLSQL' and command_type != 47
4 order by hash_value;
ACTION EXEC VERSIONS HASH_VALUE SQL_TEXT
---------- ----- -------- ------------ --------------------------------------------------
HINT 1 1 2245097906 SELECT /*+ full (e) */ COUNT(*) FROM EMP E
LOWER 3 1 2728343546 SELECT COUNT(*) FROM EMP E
2 rows selected.
Notice that for for 3 of them they all ended up being the same SQL statement. The hinted statement is different and notice that the hint text is not converted to upper case. This is pretty cool.
What this means is that you might want to put even simple code in a PL/SQL block since this will promote the reuse of cursors that only have slight differences in text but are really the same statement.
The PL/SQL engine has been doing this "forever".