This forum is currently locked. You can't register or post questions at this time. (read more)

error ora-06512 while login to database

All posts relating to Oracle database administration.

Moderator: Tim...

me_lucky
Senior Member
Posts: 183
Joined: Tue Jun 02, 2009 11:40 am

error ora-06512 while login to database

Postby me_lucky » Fri Sep 14, 2012 10:42 am

Hi,

I have written a trigger as below:

CREATE OR REPLACE TRIGGER LOGONTRIG
AFTER LOGON ON DATABASE
DECLARE

v_temp NUMBER;
V_bypass_trg_flag VARCHAR2(1);
BEGIN
Begin
SELECT 1
INTO v_temp
FROM PARAMETER_TABLE A
WHERE A.PARAM_VAL = SYS_CONTEXT('USERENV', 'SESSION_USER')
AND A.PARAM_NM = 'TEST_USR' AND ROWNUM = 1;

V_bypass_trg_flag := 'Y';

Exception
When NO_DATA_FOUND then
V_bypass_trg_flag := 'N';
END ;
DBMS_SESSION.SET_CONTEXT('TOPS_APP_CTX', 'TRG_BYPASS_USER',V_bypass_trg_flag);
END ;

This trigger got successfully compiled. and when am trying to connect to the db with other user its giving me error "ora-06512 : at dbms_session".
When i grant dba privillage to that user am successfully able to login to db. Pl help me in resolving the issue.

Thanks in Advance,
Lucky.

Tim...
Site Admin
Posts: 18437
Joined: Mon Nov 01, 2004 5:56 pm
Location: England, UK
Contact:

Re: error ora-06512 while login to database

Postby Tim... » Fri Sep 14, 2012 1:32 pm

Hi.

I wouldn't advise granting DBA to them. That kinda gives them the keys to the cookie jar. :)

Revoke DBA from the user and experiment to see what privileges are required to get it to work. I would start with execute on DBMS_SESSION and ALTER SESSION privileges.

Cheers

Tim...
Tim...
Oracle ACE Director
Oracle ACE of the Year 2006 - Oracle Magazine Editors Choice Awards
OakTable Member
OCP DBA 7.3, 8, 8i, 9i, 10g, 11g
OCP Advanced PL/SQL Developer
Oracle Database: SQL Certified Expert
My website: http://www.oracle-base.com
My blog: http://www.oracle-base.com/blog

me_lucky
Senior Member
Posts: 183
Joined: Tue Jun 02, 2009 11:40 am

Re: error ora-06512 while login to database

Postby me_lucky » Mon Sep 17, 2012 7:01 am

Dear Team,

Thanks for the support.

I was able to resolve the issue, by handling exception.

Thanks,
Lucky.

Tim...
Site Admin
Posts: 18437
Joined: Mon Nov 01, 2004 5:56 pm
Location: England, UK
Contact:

Re: error ora-06512 while login to database

Postby Tim... » Mon Sep 17, 2012 7:09 am

OK. :)

Cheers

Tim...
Tim...
Oracle ACE Director
Oracle ACE of the Year 2006 - Oracle Magazine Editors Choice Awards
OakTable Member
OCP DBA 7.3, 8, 8i, 9i, 10g, 11g
OCP Advanced PL/SQL Developer
Oracle Database: SQL Certified Expert
My website: http://www.oracle-base.com
My blog: http://www.oracle-base.com/blog


Return to “Oracle Database Administration”

Who is online

Users browsing this forum: No registered users and 7 guests