trigge on server erro [message #285322] |
Tue, 04 December 2007 04:28 |
Rafeek
Messages: 159 Registered: April 2007 Location: egypt
|
Senior Member |
|
|
hi all
i create trigger on server error .
when i create it get error say (PL/SQL: ORA-00942: table or view does not exist) the view is v$session ?
CREATE OR REPLACE TRIGGER log_errors_trig
AFTER SERVERERROR ON DATABASE
DECLARE
var_user VARCHAR2 (30);
var_osuser VARCHAR2 (30);
var_machine VARCHAR2 (64);
var_process VARCHAR2 (8);
var_program VARCHAR2 (48);
BEGIN
SELECT s.username, s.osuser, s.machine, s.process, s.program
INTO var_user, var_osuser, var_machine, var_process, var_program
FROM v$session s wHERE s.audsid = USERENV ('sessionid');
END;
|
|
|
|
Re: trigge on server erro [message #285353 is a reply to message #285324] |
Tue, 04 December 2007 05:13 |
Rafeek
Messages: 159 Registered: April 2007 Location: egypt
|
Senior Member |
|
|
when i run block
Quote: | SQL> DECLARE
var_user VARCHAR2 (300);
var_osuser VARCHAR2 (300);
var_machine VARCHAR2 (640);
var_process VARCHAR2 (80);
var_program VARCHAR2 (480);
BEGIN
SELECT s.username, s.osuser, s.machine, s.process, s.program
INTO var_user, var_osuser, var_machine, var_process, var_program
FROM v$session s 11 wHERE s.audsid = USERENV ('sessionid');
dbms_output.put_line( var_user||' '|| var_osuser||' '||var_machine||' '||var_process||' '|| var
_program);
null;
END;
/
RAFEEK rafeek INFOCUS\RAFEEK
PL/SQL procedure successfully completed.
|
procedure successfully and return values
[Updated on: Tue, 04 December 2007 05:16] Report message to a moderator
|
|
|
|
|
|