SQL> alter system set cursor_sharing='force';
SQL> select NAME,value from v$sysstat where name='parse count (hard)';
NAME VALUE
---------------------------------------- ----------
parse count (hard) 10207
SQL> select empno,ename,sal from emp where empno=7369;
---------- ------------------------------ ----------
7369 SMITH 800
---------- ------------------------------ ----------
7499 ALLEN 1600
---------- ------------------------------ ----------
7521 WARD 1250
执行上述sql语句之后,使用select NAME,value from v$sysstat where name='parse count (hard)'查询,其硬解析的值依然是10207,这个就是将cursor_sharing的值为force 的作用,只要sql语句相同,不管谓词值是否相同,都会当成相同的sql,重用之前的cursor,不会进行硬解析。