I want to optimize the sql query. It internally performing Hash Join , so it going for full table scan to get the result .
alter session set "_hash_join_enabled" = false;
If I use the above command, oracle taking nested loop and there is no full table scan.
Can anyone suggest me the real time application use of this?
The problem is not the full table scan but the time to execute a query. The optimizer chooses hash join and FTS because it thinks it is faster than nested loops. Usually this is a problem with the statistics, or the way the query is written.
If your really want to do it by a hint like this, then use it at the statement level, like the comment said (e;g. opt_param('_hash_join_enabled','false'), or use_nl(put the table names here in the order you want)).