Error in after Logon trigger

Hello
I use the 11.2.0.3.0 Oracle version.

I created a trigger to restrict specific users (logging of specific program and having specific OSUSER) from loging in the database.
I created under triggers in the SYS schema.

CREATE OR REPLACE TRIGGER t1
AFTER
OPENING OF SESSION
WE DATABASE
DECLARE
trg_program varchar2 (4000);
trg_user varchar2 (4000);
trg_osuser varchar2 (4000);
v_killsession VARCHAR2 (4000);
v_sid VARCHAR2 (4000);
v_serial VARCHAR2 (4000);
BEGIN
SELECT TOP (program), SUPERIOR (USERNAME), SUPERIOR (OSUSER), SID, serial #.
IN trg_program, trg_user, trg_osuser, v_sid, v_serial
SESSION $ v
WHERE audsid = SYS_CONTEXT ('USERENV', 'SESSIONID') AND ROWNUM = 1;

IF trg_program IN ('SQLPLUS.) EXE ',' SQLPLUSW. EXE ',' TOAD. EXE')
AND trg_user in ("USER1", "User2")-, "SYS", "SYSTEM")
- AND trg_osuser not in ('O12345')
THEN
raise_application_error (-20001, "You are not authorized to connect directly to this pattern!'");
END IF;
END;
/


When I log in User1 by sqlplus/Toad, it works very well, I get the required message that is referred to as "raise the application error".

but when I'm compiling the relaxation by uncommenting additional condition for OSUSER IE trg_osuser not in ('O12345') in the code of the trigger, so that this will not affect the summer strongly user (i.e. OSUSER O12345). During the connection to the USER1 user I get below error

ERROR:
ORA-04045: errors during recompilation/revalidation of
XIGNCMN. RESTRICT_UNAUTH_ACCESS
ORA-01031: insufficient privileges

It would alow me to access because I'm OSUSER 'O12345', then why his does not work?

933257 wrote:

I created under triggers in the SYS schema.

Bad idea. Never create objects in the SYS schema.

933257 wrote:

ORA-01031: insufficient privileges

You must have the privilege to ADMINISTRATION the TRIGGERS of DATABASE to compile / recompile database trigger.

SY.

Tags: Database

Similar Questions

  • GotoWorkspace in after Logon trigger

    Our users want to switch automatically to the last workspace they use when they connect.  Because they can use one of several applications, I decided to put this feature in a logon after tripping on the database.

    The trigger, the tables and procedures are owned by the user WM_UTILS:

    ----------------------------

    create table wm_utils.recent_user_workspaces

    (username varchar2 (30 bytes) primary key

    nom_espace_de_travail varchar2 (30 byte));

    create or replace procedure wm_utils.goto_last_workspace authid current_user as

    pragma autonomous_transaction;

    last_workspace varchar2 (30);

    Start

    last_workspace: = get_last_workspace();

    If (last_workspace is not null) then

    dbms_wm. GotoWorkspace (last_workspace);

    end if;

    commit;

    end;

    create or replace procedure wm_utils. set_last_workspace (workspace in varchar2) as

    Start

    merge into recent_user_workspaces

    using double on (username = user)

    When not matched then insert (username, nom_espace_de_travail) values (user, workspace)

    when matched, then update set nom_espace_de_travail = workspace;

    end;

    create or replace function wm_utils. get_last_workspace return varchar2 as

    workspace varchar2 (30);

    Start

    Select nom_espace_de_travail

    in the workspace

    of recent_user_workspaces

    where username = user;

    Returns the workspace;

    exception

    When NO_DATA_FOUND then

    Returns a null value.

    end;

    create or replace procedure wm_utils.goto_workspace (workspace in varchar2) authid CURRENT_USER as

    PRAGMA AUTONOMOUS_TRANSACTION;

    Start

    dbms_wm. GotoWorkspace (workspace);

    set_last_workspace (Workspace);

    commit;

    end;

    create or replace trigger wm_utils.on_login

    After logon on database

    Start

    goto_last_workspace(); 

    exception

    while others then

    null;

    end;

    ------------------------------------------------------

    Call wm_utils.goto_workspace instead of dbms_wm. GotoWorkspace if they want to remember their choice for their next login.

    The problem is that this operation fails with the error "ORA-20073: sufficient privileges to ACCESS the workspace: 'TEST_WORKSPACE'."  It is a work space owned by the user attempting to log on, but there no privileges granted explicitly.  The user can call wm_utils.goto_last_workspace () to be identified and it works.  Y at - it something on the way in which work orders that would prevent from working in a trigger AFTER logon?

    Hello

    Triggers have the same privileges as a DEFINER procedure/function.  So, once the wm_utils.on_login trigger is executed when a user connects to the database, all the procedures performed as a result of the trigger are executed with the privileges of the wm_utils schema.  This includes even those defined as authid current_user, since at this moment in time wm_util is essentially the user that executes the procedure.  So, you can create a DEFINER rights procedure in the scheme of each user to manage dbms_wm of execution. GotoWorkspace which will remove the privileges of the user running, or give the privilege of system ACCESS_ANY_WORKSPACE wm_utils schema using dbms_wm. GrantSystemPriv.

    Kind regards

    Ben

  • Table is the mutation of error in after the update trigger

    Hello

    In all of my table, I have columns EDITDATE and EDITUSER. So whenever a table is updated I need to update these two fields with the USER and SYSDATE. For this I use a BEFORE UPDATE trigger. This trigger is activated, but I get "ORA-04091: table %s.%s is changing, function of triggering/can not see" error every time I update the table. I used this method in SQL Server. I understand that Oracle doesn't have to be the same as SQL Server but I do not know there is a way to do this. Do you know what it is?

    EDIT: Here is the Code of the trigger

    create or replace
    TR_LEGISLATION_CALCUL_AE RELAXATION
    BEFORE THE UPDATE
    ON LEGISLATION_CALCUL
    FOR EACH LINE
    DECLARE
    v_LEGISLATIONCALCULID NUMBER (10,0);

    BEGIN
    SELECT: NEW. LEGISLATIONCALCULID

    IN v_LEGISLATIONCALCULID
    FROM DUAL;
    UPDATE LEGISLATION_CALCUL
    SET EDITUSER_ID = UID,
    EDITDATE = SYSDATE
    WHERE LEGISLATIONCALCULID = v_LEGISLATIONCALCULID;
    END;

    Published by: Mikhail on 12 March 2012 23:54

    Mikhail says:
    Hello

    In all of my table, I have columns EDITDATE and EDITUSER. So whenever a table is updated I need to update these two fields with the USER and SYSDATE. For this I use the AFTER UPDATE trigger. This trigger is activated, but I get "ORA-04091: table %s.%s is changing, function of triggering/can not see" error every time I update the table. I used this method in SQL Server. I understand that Oracle doesn't have to be the same as SQL Server but I do not know there is a way to do this. Do you know what it is?

    EDIT: Here is the Code of the trigger

    create or replace
    TR_LEGISLATION_CALCUL_AE RELAXATION
    BEFORE THE UPDATE
    ON LEGISLATION_CALCUL
    FOR EACH LINE

    just put this in your before update (and not after the update as you mentioned) for each trigger line:

    BEGIN
    
    :new.EDITUSER_ID := UID;
    :new.EDITDATE := SYSDATE;
    
    END;
    
  • Trigger after logon

    Hi all
    I need to trigger for each logon after, change the profile to test.
    CREATE OR REPLACE TRIGGER TESTE_LOGON
    AFTER LOGON ON DATABASE
    BEGIN

    EDIT the PROFILE USER X test;

    END;

    What I'll put in variabile x to effect each user who will connect?

    tnhaks
    Paulo

    Yes each connection the altar of user x will be held,
    You should take the user to the help:

    CREATE OR REPLACE TRIGGER TESTE_LOGON
    AFTER LOGON ON DATABASE
    DECLARE
    
    current_usr varchar2(100);
    
    BEGIN
    
    current_usr := sys_context('USERENV', 'SESSION_USER');
    
    execute immediate 'ALTER USER'|| current_usr ||'PROFILE test';
    
    END;
    

    Oded
    [www.dbsnaps.com]
    [www.orbiumsoftware.com]

    Published by: Oded Raz July 2, 2009 21:18

  • Logon trigger does not not on DB-Link?

    Hi all

    I have a serious question on the table access via a database link.

    I have three schemas:

    DATA@SOURCE

    INTERFACE@SOURCE

    WORK@TARGET

    DATA schema has a table called T1

    The scheme of the INTERFACE has select privileges on all the DATA tables. In addition, INTERFACE schema has a logon trigger change the "current schema" data:

    CREATE OR REPLACE TRIGGER TRG_A_LOGIN_SET_SCHEMA AFTER LOGON
    ON INTERFACE.SCHEMA
    BEGIN
    execute immediate 'ALTER SESSION SET CURRENT_SCHEMA = DATA';
    END;
    

    The scheme of WORK has a link database to the schema of the INTERFACE called INT_DB_LINK.

    I am now logged in the scheme of WORK on the TARGET database and I will execute following statement:

    select a from T1@INT_DB_LINK
    

    -> it works

    Then I run

    declare
      cursor c is  
      select a
        from T1@INT_DB_LINK
       where rownum<2;
    begin
      for r in c loop
        null;
      end loop;
    end; 
    

    It does not work. Error message is ORA-000942: table or view does not exist.

    But why?

    Can someone help me?

    Thanks in advance

    Py

    Hi all

    After a long, very long search I found what caused this strange behavior.

    The error ORA - was not triggered by the SQL execution engine, but by the SQL-parser/SQL-Validation.

    The second statement is that an anonymous block of SQL Oracle parser checks all the dependencies of objects before execution.

    This means that a connection is established to the TARGET to SOURCE checking if table T1 is available. The strange thing is

    that, in this respect the "ALTER SESSION" trigger is not fired. If the Analyzer does not find the object T1 in schema INTERFACE.

    If I create an empty table T1 in INTERFACE the anonymous block gets analysis/validated and the statement is executed. But this

    time the block made a normal life 'connect session' and the trigger is triggered. This means that statements access table T1

    DATA schema. (But T1 in the INTERFACE should be existing this analysis/validation works)

    I don't know if it's a bug or a feature.

    To work around this I created private synonyms in the diagram pointing to DATA objects INTERFACE.

    Thanks for your help!

    Py

    ------

    regarding the other question:

    Yes, the permissions are granted on a role.

  • PL/Sql error when creating a trigger

    Hello everyone m trying to set a trigger whose goal is to not allow any update insert or remove on the work table, if the day is Sunday. I tried this code but it gives me error
     create or replace trigger No_work_on_Sunday
     After insert or update or delete
    on Work When owner='MAX'
    for each row
    begin
            if (select to_char(sysdate,'D')=1) then
                     raise_application_error(-20001,'no work on sunday');
          end if;
     end;
    
     
     on Work when owner='MAX'
             *
    ERROR at line 3:
    ORA-04077: WHEN clause cannot be used with table level triggers
    Pls help

    Published by: 781207 on July 16, 2010 07:43
    create or replace trigger No_work_on_Sunday
     After logon on DATABASE
     begin
           if to_char(sysdate,'D')=1 then
                     if ora_login_user IN ('Jake','MAX') THEN
                         RAISE_APPLICATION_ERROR(-20001,'No work on sunday');
                   end if;
          end if;
    end;
    /
    

    SY.

  • Activation level-12 record in the SYSTEM. LOGON trigger

    I try to activate the trace level-12 for a user as soon as it to connect to the database.

    CREATE OR REPLACE TRIGGER SYSTEM. LOGON_ASPIRE
    AFTER LOGON
    WE DATABASE
    BEGIN
    If (Upper (User) = "U_DATAHUB") then
    RUN IMMEDIATELY 'ALTER SESSION SET EVENTS "TRACE NAME CONTEXT FOREVER, LEVEL 12 10046" ';
    run immediately "alter session set current_schema = DATAHUB';"
    end if;

    I Grant DBA user U_DATAHUB and I'm able to generatr trace for all sessions... but all trace files will appear this error

    PARSING IN CURSOR #4 len = dep 68 = 2 uid = 5 oct 42 lid = 5 = tim = hv 14297715680259 = ad 753686485 = ' 0'
    ALTER SESSION SET EVENTS 10046 TRACE NAME CONTEXT FOREVER, LEVEL 12'
    END OF STMT
    ANALYSIS # 4: c = 0, e = 18, p = 0, cr = 0, set cu = 0, = 0, r = 0, dep = 2, og = 0, tim = 14297715680254
    #2 ERROR: err = 1031 tim = 2228813739
    Ignored the error 604 while SYSTEM is running. LOGON_ASPIRE
    2008-10-24 16:09:40.272
    ksedmp: internal or fatal error
    ORA-00604: an error has occurred at the SQL level 1 recursive
    ORA-01031: insufficient privileges
    ORA-06512: at line 192

    Have you abandoned the previous trigger, under System? If not, maybe that's the problem, it is also running, the drop!

  • PCI-MIO-16-4 error 200329 after running a while

    I use a card PCI-MIO-16-4 for a combination signal generator and an oscilloscope for a student laboratory exercise.  I use ao0 to generate a variable frequency waveform (defined by the controls on the front panel) and ai6 to acquire the resulting signal.  To experience the two must be synchronized for the acquisition of scope starts simultaneously with the beginning of a generation analog.  Synchronization is performed using ctr0 in generation mode and set the same frequency as the analog output.  The meter output through rtsi0 for relaxation of beginning on the analog input.

    The application seems to work very well until the output frequency is changed "too quickly" while the analog input section will post 200329-error of the vi DAXmx Start Task.  After receiving this error, the computer must be restarted to resume operation of the Commission - even MAX panels will be simply repeat the same mistake on the analog inputs up to a reboot.

    If have tried the application on a Board of the USB-6221 BNC (using pfi9 to route the trigger start signal) and were unable to make the same error.

    It is on a computer running window 7 Enterprise sp1 with LabVIEW 2012 (32-bit) sp1 with the f5 patch installed.  DAQmx 9.6.2 has been installed for the original tests for both cards.  Installation DAQmx 9.8.0f0 does not change the behavior.  The PCI-MIO-16-4 passed the tests of the DAQ Diagnostic Utility 2.1.

    I tried using rtsi6 and rtsi0 as the routing without behavior change trigger signal.

    I have attached a stripped down version of the application that is always the problem.  There are 7 required files so that they are in a single .zip file.  With the frequency setting knob, it takes usually just a couple of "twists and turns" on the controller to cause the entry to the analog error.  The output of the DAQ Diagnostic Utility is also attached.

    Thanks for advice on what I can hurt in this application.

    The solution to the error:

    First attempt, the application had two structures of parallel events that have allowed the frequency be changed while there was also an acquisition that occur.  Modified to have a structure of single event so that the frequency changes may occur between acquisitions (risk of conflict Access Board?).  This made no difference to the error.  He would always get error-200329 after that the frequency has been changed several times.

    Discovered that just reset the jury would clear the error.  Considered catch the error and reset the jury whenever it happened.  Prefer something that will prevent the error from happening at all.

    Final solution was to erase the data acquisition task after each acquisition scan and reset.  It was only necessary erase the tasks of acquisition and not production jobs or a timer.  After several hours of change of frequency, amplitude and phase, no error had occurred.  I think that it has cured the problem.

    I now have two different copies of the application.  One is for use with the PCI-MIO-16-4 (new one that clears the task of acquisition after every scan) and one for use with the NI USB-6221, who uses still two parallel event structures, does never erase the task of acquiring and never shows the error when it is used with anything other than the PCI-MIO-16-4.

  • When clause is missing from the logon trigger

    I have a questions that looks very similar to 14840619 of Bug - FORUM - RELAXATION-CLAUSE WHEN NOT WATCH if ONLY a BASIC USER PRIVILEGES

    Assuming that SCOTT is a DBA and it issues the following command to create a logon trigger.

    CREATE OR REPLACE TRIGGER "SYSTEM". "SCOTT_LOGON_TRG" AFTER LOGON ON DATABASE.

    WHEN BEGIN (USER in ("SCOTT"))

    RUN IMMEDIATELY 'ALTER SESSION SET EVENTS "TRACE NAME CONTEXT FOREVER, LEVEL 12 10046" ';

    END;

    /

    ALTER TRIGGER 'SYSTEM '. "" SCOTT_LOGON_TRG "DISABLE;

    The trigger is created successfully.

    When you view the trigger of the developer sql code I don't see the WHEN clause.

    IM using sql developer version 4.0.1.14 (Build hand 14.48) 64-bit on Windows 7

    Is this a known bug?

    Thank you

    I created a service request with the support of the Oracle, and they were able to reproduce the issues.

    Here is the related bug number

    Bug 18603106 : WHEN CLAUSE is MISSING THE LOGON TRIGGER

  • AFTER LOGON ON DATABASE

    Hello

    I have create a trigger to kill the unwanted remote sessions to help AFTER logon ON DATABASE.

    But the session is killed after about 30 seconds. Until the time ' select distinct username, status from v$ session; "reflecting the situation as inactive instead of 'KILLED '.

    Once the State takes the session killed get immediately terminated.

    I can understand if the status is killed and waiting for a period of time as it will only mark he shot and async... killés the session in a few seconds.

    but I'm not able to follow why it shows almost 30 second INACTIVE status.

    Thank you

    Ajay

    Hello

    You should not need to kill just raise an exception in the logon trigger that will kick to it-see this example on asktom

    http://asktom.Oracle.com/pls/asktom/f?p=100:11:0:P11_QUESTION_ID:3236035522926

    See you soon,.

    Rich

  • ORA - 06502:numeric or of value errORA-04088: error during execution of trigger

    I received the following error message by entering a number in the maximum value (i.e. 9 999 999.) allowed in a data entry form that is distinct from the basic form:

    ORA-06502: PL/SQL: digital or error number precision value: ORA-06512 too big: "< owner >. < trigger >", line 194 ORA-04088: error during execution of trigger '< owner >. < trigger >.

    Where < owner > is the schema name and < Trigger > is the name of the trigger. The block of data in the application for participation is based on a database table, and the sum of all the values entered (with a maximum value of 99.999.999.) appears in the form of Basic. A grand total of this amount along w / other totals on the basic shape is also displayed with a maximum value defined as 999 999 999. Only, I get the above error message when the total is greater than 99999999. If the total is less than or equal to 99.999.999, the basic form works very well. Why?

    I checked all the attributes of the database columns and form fields and everything seems to be okay, and I'm out of my mind. I desperately need your help to solve this problem quickly because the pressure is on...

    Thanks in advance for any help.

    Orchid says:
    Hello Hamid,

    Thanks for your help. Yes, it works as suggested, after that I have increased the length of NUMBER data base table column (9) to NUMBER (11).

    gives you the correct answer, and you don't mark it ;)

    >

    Apparently, Oracle database truncates the decimal points and only update the value of 9 digits without giving errors, but the form of Oracle application is more picky and it generates forms and Oracle error messages when you run the application. It seems that there is a difference when executing the sql commands in the Oracle database and execution of these Oracle Forms application controls. Do you agree?

    Yes

    Thanks again for all the help.

    You can only give reward for it by checking the useful and correct answer.

  • In NLS_SESSION_PARAMETERS logon trigger does not

    Hello

    I have a problem with a logon trigger setting session parameters:
    create or replace
    TRIGGER standard.after_logon_trg
    AFTER LOGON ON STANDARD.SCHEMA
    BEGIN
      DBMS_APPLICATION_INFO.set_module(USER, 'Initialized');
      EXECUTE IMMEDIATE ('ALTER SESSION SET current_schema=standard');
      EXECUTE IMMEDIATE ('ALTER SESSION SET NLS_DATE_LANGUAGE=''AMERICAN''');
      EXECUTE IMMEDIATE ('ALTER SESSION SET NLS_TERRITORY=''AMERICA''');
      EXECUTE IMMEDIATE ('ALTER SESSION SET NLS_TIMESTAMP_FORMAT=''HH24:mi:ss''');
      EXECUTE IMMEDIATE ('ALTER SESSION SET NLS_DATE_FORMAT=''YYYY-MM-DD''');
      EXECUTE IMMEDIATE ('ALTER SESSION SET NLS_COMP=LINGUISTIC');
      EXECUTE IMMEDIATE ('ALTER SESSION SET NLS_SORT=BINARY_CI');
      insert into standard.testcc (bezeichnung, datum) values ('logontrigger', SYSDATE);
    END;
    After I connect, the new row is added to the table, but the session parameters are completely intact.
    Select * from NLS_SESSION_PARAMETERS says:
    NLS_LANGUAGE     GERMAN
    NLS_TERRITORY     GERMANY
    NLS_CURRENCY     €
    NLS_ISO_CURRENCY     GERMANY
    NLS_NUMERIC_CHARACTERS     ,.
    NLS_CALENDAR     GREGORIAN
    NLS_DATE_FORMAT     DD.MM.RR
    NLS_DATE_LANGUAGE     GERMAN
    NLS_SORT     GERMAN
    NLS_TIME_FORMAT     HH24:MI:SSXFF
    NLS_TIMESTAMP_FORMAT     DD.MM.RR HH24:MI:SSXFF
    NLS_TIME_TZ_FORMAT     HH24:MI:SSXFF TZR
    NLS_TIMESTAMP_TZ_FORMAT     DD.MM.RR HH24:MI:SSXFF TZR
    NLS_DUAL_CURRENCY     €
    NLS_COMP     BINARY
    NLS_LENGTH_SEMANTICS     BYTE
    NLS_NCHAR_CONV_EXCP     FALSE
    If I run the ALTER SESSION statements in the sql (standard user) console, they work perfectly, so this seems to be without end of permission.

    Which is wrong with the trigger?

    Thanks and greetings
    Christian

    Published by: 853536 on 20.04.2011 00:31

    OK, I traced the entire database and discovered that my settings are overwritten. So after that my trigger has been executed, the NLS Session parameters are changed, for example:
    =====================
    PARSING IN CURSOR #4 len=386 dep=0 uid=40 oct=3 lid=40 tim=4721509708 hv=302297662 ad='ab275c28'
    select parameter,value from nls_session_parameters 
     union all SELECT 'DB_TIMEZONE' name, DBTIMEZONE  value FROM DUAL 
     union all SELECT 'SESSION_TIMEZONE' name, SESSIONTIMEZONE value FROM DUAL
     union all SELECT 'SESSION_TIMEZONE_OFFSET' name, TZ_OFFSET(SESSIONTIMEZONE) value from DUAL
     union all SELECT parameter, value FROM nls_database_parameters WHERE parameter='NLS_CHARACTERSET' 
    END OF STMT
    PARSE #4:c=0,e=3962,p=0,cr=4,cu=0,mis=1,r=0,dep=0,og=1,tim=4721509705
    EXEC #4:c=0,e=21,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=1,tim=4721509816
    FETCH #4:c=0,e=111,p=0,cr=0,cu=0,mis=0,r=10,dep=0,og=1,tim=4721509976
    FETCH #4:c=0,e=132,p=0,cr=0,cu=0,mis=0,r=10,dep=0,og=1,tim=4721510598
    FETCH #4:c=0,e=204,p=0,cr=3,cu=0,mis=0,r=1,dep=0,og=1,tim=4721511118
    STAT #4 id=1 cnt=21 pid=0 pos=1 obj=0 op='UNION-ALL  (cr=3 pr=0 pw=0 time=264 us)'
    STAT #4 id=2 cnt=17 pid=1 pos=1 obj=0 op='FIXED TABLE FULL X$NLS_PARAMETERS (cr=0 pr=0 pw=0 time=128 us)'
    STAT #4 id=3 cnt=1 pid=1 pos=2 obj=0 op='FAST DUAL  (cr=0 pr=0 pw=0 time=1 us)'
    STAT #4 id=4 cnt=1 pid=1 pos=3 obj=0 op='FAST DUAL  (cr=0 pr=0 pw=0 time=0 us)'
    STAT #4 id=5 cnt=1 pid=1 pos=4 obj=0 op='FAST DUAL  (cr=0 pr=0 pw=0 time=1 us)'
    STAT #4 id=6 cnt=1 pid=1 pos=5 obj=96 op='TABLE ACCESS FULL PROPS$ (cr=3 pr=0 pw=0 time=194 us)'
    =====================
    PARSING IN CURSOR #3 len=41 dep=0 uid=40 oct=42 lid=40 tim=4721512239 hv=2321140216 ad='ab275184'
    alter session set NLS_TERRITORY='GERMANY'
    END OF STMT
    PARSE #3:c=0,e=329,p=0,cr=0,cu=0,mis=1,r=0,dep=0,og=1,tim=4721512236
    EXEC #3:c=0,e=48,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=1,tim=4721512424
    =====================
    PARSING IN CURSOR #2 len=35 dep=0 uid=40 oct=42 lid=40 tim=4721513208 hv=2785092162 ad='ab274e88'
    alter session set NLS_SORT='GERMAN'
    END OF STMT
    PARSE #2:c=0,e=283,p=0,cr=0,cu=0,mis=1,r=0,dep=0,og=1,tim=4721513205
    EXEC #2:c=0,e=20,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=1,tim=4721513370
    =====================
    ...
    This explains why they are crushed, but I still don't know why the session parameters are changed after my trigger at all. Any idea?

    Published by: 853536 on 20.04.2011 01:24


    Problem solved: I was using Oracle SQL Developer to change my trigger and try it - and Developer SQL seems ovewrite the NLS_Session settings. Duh.

    Published by: 853536 on 20.04.2011 02:04

    Yes, SQL Developer usually replace the settings. It should not do this if you go to tools-> Preferences-> database-> NLS and mark 'Skip NLS Settings'.

    But any program using JDBC OCI will also replace most of the settings. Therefore, don't rely on the database to set the NLS parameters. It's applications to properly prepare the environment of the NLS (if the standard initialization based on the settings of operating system and/or NLS_LANG is not satisfactory).

    -Sergiusz

  • Limit user connections using a Logon trigger

    Hi all

    I'm now restrict selected terminals user connections, using the following logon trigger.
    It allows users with user with DBA privileges.



    How to restrict privileged users DBA?

    Note:-by my application needs privileged DBA.

    CREATE OR REPLACE TRIGGER on_logon
    AFTER LOGON
    WE DATABASE
    DECLARE
    VPROGRAM VARCHAR2 (30);
    VUserName VARCHAR2 (30);
    VTERMINAL VARCHAR2 (30);
    CURSOR user_prog IS
    SELECT UPPER (program), UPPER (username), NVL (TERMINAL, 'X') OF v$ session
    WHERE the audsid = sys_context ('USERENV', 'SESSIONID');
    BEGIN
    OPEN user_prog.
    EXTRACT the user_prog IN Vprogram, Vusername VTERMINAL;
    IF VTERMINAL NOT IN ("APP1", "APP2", "APP3")+.
    and Vusername = "ABUL"+.
    THEN
    RAISE_APPLICATION_ERROR (-20001, 'you are not allowed to log');
    END IF;
    CLOSE User_prog;
    END;

    Thanks I advance

    -
    ABK

    Your application needs the role DBA? This is a terrible design - it violates all the principles of secure coding.

    Connection triggers trigger for users with the role of s/n, then you will not be able to use a connection here. You can leave the logon trigger and configure nodes invited and excluded in the listener sqlnet.ora file, i.e.

    tcp.validnode_checking = yes
    tcp.excluded_nodes = (hostname1,hostname2,hostname3)
    

    You need to restart the receiver after making this change.

    Justin

  • "404 - page not found" error message after downloading and installing Firefox 15

    "404 Page not found" error message after you download the latest version of Firefox.

    It is sometimes the result of a software firewall that protects you against modified applications. Or it could be something else. Can you look at this article and see if it helps: Firefox can not load websites, but can other browsers.

  • I received this error message after you remove the address something about Cloud.app

    I received this error message after you remove the address something Cloud.app.   Can you tell me how to fix this error message. "  '/'  "  ?

    Hello Phyllis,

    When you receive this error now?

    Let's run boot minimum troubleshooting to find the cause.

    Windows XP:

    http://support.Microsoft.com/kb/310353

    http://support.Microsoft.com/kb/316434

    Windows Vista and Windows 7:

    How to troubleshoot a problem by performing a clean boot in Windows Vista or in Windows 7

    Please note that after refine us the cause, it is important that we return to a normal startup and manually delete the startup program.

    Best regards

    Matthew_Ha

Maybe you are looking for