DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: Schema trigger

  1. #1
    Join Date
    Apr 2002
    Posts
    36

    Question Schema trigger

    This is what I did to create schema/user trigger:
    =================================================
    a. connect scott/tiger.

    b.
    create or replace trigger tr_after_logon
    after logon on schema
    begin
    raise_application_error(-2001, 'You Cannot Login as a scott');
    end;
    c. I log off scott.

    d. shutdown database and restarted to make sure that scott could not login--I know I donot have to do that.

    E. connect scott/tiger.
    connected.

    1. Why is SCOTT allowed to login?
    2. why the Trigger didnot FIRE?
    ..
    Please help...
    ===============================================================

    NOTE:
    =========
    If I do:
    a. connect scott/tiger.

    b.
    create or replace trigger tr_after_logon
    after logon on database
    begin
    raise_application_error(-2001, 'You Cannot Login as a scott');
    end;
    c. I log off scott.

    If I try this :
    ========
    connect scott/tiger ...It would fail with this error:

    ERROR:
    ORA-00604: error occurred at recursive SQL level 1
    ORA-21000: error number argument to raise_application_error of -2001 is out of range
    ORA-06512: at line 2
    xuduro_2000

  2. #2
    Join Date
    Jan 2003
    Location
    india
    Posts
    175
    hi,

    i think; i am not sure.


    create or replace trigger tr_after_logon
    after logon on schema
    begin
    raise_application_error(-2001, 'You Cannot Login as a scott');
    end;
    the code does not seem to have a check to see
    whether the logon user is 'SCOTT'.

    i think this will not allow any user to login.
    is this not a danger?

    -Raja

  3. #3
    Join Date
    Oct 2002
    Location
    Ljubljana,Slovenia
    Posts
    28
    ERROR:
    ORA-00604: error occurred at recursive SQL level 1
    ORA-21000: error number argument to raise_application_error of -2001 is out of range
    ORA-06512: at line 2
    You should not use error number greater as -20000 for command raise_application_error.
    Aleš Orehek

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width