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

Thread: Trigger not working

  1. #1
    Join Date
    Apr 2003
    Location
    Hyderabad
    Posts
    40

    Trigger not working

    I have written a trigger to Prevent logon from a Computer with IP address 10.3.35.104
    But this trigger is not working .

    Create or replace trigger test
    After logon on Schema
    Begin
    if sys_context('USERENV','IP_ADDRESS') = '10.3.35.104' then
    raise_application_error(-20000,'U have no rights to Logon');
    End If;
    End ;

  2. #2
    Join Date
    Jul 2002
    Location
    Lake Worth, FL
    Posts
    1,492

    Question

    Did you try BEFORE logon?
    "The person who says it cannot be done should not interrupt the person doing it." --Chinese Proverb

  3. #3
    Join Date
    Dec 2000
    Location
    Ljubljana, Slovenia
    Posts
    4,439
    Originally posted by LKBrwn_DBA
    Did you try BEFORE logon?
    Ni such thing exists in Oracle as BEFORE LOGON trigger. You can crate only AFTER logon triggers.

    bk_raavi, are you sure you wan't the scope of this trigger to be SCHEMA, not DATABASE? In your case, for example, if you create your trigger logged as user SYSTEM, then the trigger will fire only if your application user will try to connect as oracle user SYSTEM. It will not fire if your application user will try to connect as oracle user SCOTT, for example. So as SCOTT you'll be able to connect to the database from any IP address, even from '10.3.35.104'. Only SYSTEM will not be able to connect from '10.3.35.104'.
    Jurij Modic
    ASCII a stupid question, get a stupid ANSI
    24 hours in a day .... 24 beer in a case .... coincidence?

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