.ora-code.com

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
Debug DDL trigger

Debug DDL trigger

2005-08-24       - By Wolfgang Breitling
Reply:     <<     11     12     13     14     15     16     17  

Looks to me like it's firing:

scott                          August 24, 2005
00:15:17 ora92.scott> select * from dba_role_privs where grantee=user;

GRANTEE                        GRANTED_ROLE                   ADM DEF
-- ---- ---- ---- ---- ---- -- -- ---- ---- ---- ---- ---- -- --- ---
SCOTT                          DBA                            NO  YES
SCOTT                          CONNECT                        NO  YES
SCOTT                          SELECT_CATALOG_ROLE            NO  YES

3 rows selected.

00:16:16 ora92.scott> select sys_context('USERENV','CURRENT_SCHEMA') from dual
00:17:38   2  /

SYS_CONTEXT('USERENV','CURRENT_SCHEMA')
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
-- --
SCOTT

1 row selected.

00:17:38 ora92.scott> CREATE OR REPLACE TRIGGER "LOGON_TRG"
00:17:51   2  after logon on schema
00:17:51   3  begin
00:17:51   4    execute immediate 'alter session set current_schema=sys';
00:17:51   5  end;
00:17:51   6  /

Trigger created.

00:17:52 ora92.scott> connect scott/tiger@(protected)
Connected.
00:18:19 ora92.scott> select sys_context('USERENV','CURRENT_SCHEMA') from dual;

SYS_CONTEXT('USERENV','CURRENT_SCHEMA')
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
-- --
SYS

1 row selected.

00:18:27 ora92.scott>


It also works as a database logon trigger:

sys                            August 24, 2005
00:25:58 ora92.sys> CREATE OR REPLACE TRIGGER "LOGON_TRG"
00:26:15   2  after logon on database
00:26:15   3  begin
00:26:15   4    dbms_application_info.set_client_info('Greetings from
the trigger');
00:26:15   5  end;
00:26:15   6  /

Trigger created.

00:26:15 ora92.sys> connect scott/tiger@(protected)
Connected.

00:27:06 ora92.sys> select sid from v$mystat where rownum=1;

       SID
-- ---- --
        11

1 row selected.

00:27:19 ora92.sys> select client_info from v$session where sid=11;

CLIENT_INFO
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
Greetings from the trigger

1 row selected.

00:27:35 ora92.sys>

At 12:07 AM 8/24/2005, Jared Still wrote:
>I believe the triggers that Raj was thinking of were logon triggers.
>
>Those do not fire for accounts with the DBA privilege.
>
>Jared

Regards

Wolfgang Breitling
Centrex Consulting Corporation
http://www.centrexcc.com

--
http://www.freelists.org/webpage/oracle-l