Links
Home
Oracle DBA Forum
Frequent Oracle Errors
TNS:could not resolve the connect identifier specified
Backtrace message unwound by exceptions
invalid identifier
PL/SQL compilation error
internal error
missing expression
table or view does not exist
end-of-file on communication channel
TNS:listener unknown in connect descriptor
insufficient privileges
PL/SQL: numeric or value error string
TNS:protocol adapter error
ORACLE not available
target host or object does not exist
invalid number
unable to allocate string bytes of shared memory
resource busy and acquire with NOWAIT specified
error occurred at recursive SQL level string
ORACLE initialization or shutdown in progress
archiver error. Connect internal only, until freed
snapshot too old
unable to extend temp segment by string in tablespace
Credential retrieval failed
missing or invalid option
invalid username/password; logon denied
unable to create INITIAL extent for segment
out of process memory when trying to allocate string bytes
shared memory realm does not exist
cannot insert NULL
TNS:unable to connect to destination
remote database not found'>ora-02019
exception encountered: core dump
inconsistent datatypes
no data found
TNS:operation timed out
PL/SQL: could not find program
existing state of packages has been discarded
maximum number of processes exceeded
error signaled in parallel query server
ORACLE instance terminated. Disconnection forced
TNS:packet writer failure
see ORA-12699
missing right parenthesis
name is already used by an existing object
cannot identify/lock data file
invalid file operation
quoted string not properly terminated
AFTER LOGON System Trigger

AFTER LOGON System Trigger

2004-07-12       - By Mladen Gogala
Reply:     1     2     3     4  


On 07/12/2004 10:32:54 PM, Mark Burgess wrote:
> Hi,
>
> I am trying to record the logon even for a certain
> user with the following trigger code:
>
> CREATE OR REPLACE TRIGGER SESS_JOB_QUEUE AFTER LOGON
> ON DATABASE
>
> BEGIN
>
> IF sys.login_user = 'DISCO_SCH ' THEN
> do something;
> end if;
>
> END;

Without the slightest intention of being fresh, may I ask why
SYS_CONTEXT ( 'USERENV ', 'SESSION_USER ') or simple "USER " function/variable
aren 't sufficient in this case? Here is your example, revorked a
bit:
SQL > select user from dual;

USER
-- ---- ---- ---- ---- ---- --
OPS$MGOGALA

SQL > create table logon_something( something varchar2(256));

Table created.

SQL > create public synonym logon_something for logon something;
create public synonym logon_something for logon something
*
ERROR at line 1:
ORA-00933 (See ORA-00933.ora-code.com): SQL command not properly ended


SQL > create public synonym logon_something for logon_something;

Synonym created.

SQL > grant insert,select on logon_something to public;

Grant succeeded.

SQL > ed
Wrote file /tmp/buffer.sql

1 CREATE OR REPLACE TRIGGER TEST_USR AFTER LOGON
2 ON DATABASE
3 BEGIN
4 insert into logon_something
5 values(user|| ' ' 's mama wears army boots! ');
6* END;
7 /

Trigger created.

SQL > select * from logon_something;

SOMETHING
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
SCOTT 's mama wears army boots!

SQL >

Of course, I logged in as scott in another window.


--
Mladen Gogala
Oracle DBA
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
To unsubscribe send email to: oracle-l-request@(protected)
put 'unsubscribe ' in the subject line.
--
Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --