Hi, I have a LOGON trigger with the code bellow which causes me error. I will appreciate it vey much if you could give some advices ..
Oracle 11.2
PHP Code:
create or replace TRIGGER SYSTEM.LOGIN_OMEGA_RISK
AFTER LOGON ON OMEGA_RISK.schema
declare
prog VARCHAR2(200);
BEGIN
SELECT program INTO prog FROM sys.v_$session WHERE audsid=USERENV('sessionid') and rownum<=1;
if(prog in ('JDBC Thin Client')) then
RAISE_APPLICATION_ERROR(-20001, 'The program '||prog||' is not allowed to login to '||user||' Oracle Schema.');
else
execute immediate 'alter session set current_schema = OMEGA_RISK_OWN';
end if;
END;
/
show errors;
Errors for TRIGGER SYSTEM.LOGIN_OMEGA_RISK:
LINE/COL ERROR
-------- -----------------------------------------------
6/5 PL/SQL: SQL Statement ignored
6/35 PL/SQL: ORA-00942: table or view does not exist
19:17:46 OMEGA_RISK @SPH as > select table_name,PRIVILEGE from user_tab_privs where owner='SYS';
TABLE_NAME PRIVILEGE
------------------------------ ----------------------------------------
V_$SESSION SELECT
1 row selected.
19:18:02 OMEGA_RISK @SPH as > show user
USER is "OMEGA_RISK"