例子:
CREATE OR REPLACE TRIGGER modify_cursor_sharing_logon
AFTER LOGON ON DATABASE
BEGIN
FOR proname IN (SELECT DISTINCT UPPER (program) pron
FROM sys.v_$session
WHERE UPPER (program) = 'SQLPLUS.EXE' and UPPER (program) NOT LIKE 'ORACLE%' )
LOOP
IF (proname.pron = 'SQLPLUS.EXE')
THEN
EXECUTE IMMEDIATE 'alter session set cursor_sharing=force';
END IF;
END LOOP;
END;
/