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

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

  • 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

  • Without LAN connection after logon applied credentils it takes a lot of time to load items on the desktop

    Original title: startup problem

    during the priming of the laptop without LAN connection after logon credentils applied it takes a long time to load the items on the desktop, but by connecting the laptop with LAN a boot of the computer LAPTOP, all right, please provide a solution for this problem of starting.

    Hello

    I removed IE 8, now it works fine

  • Problems with sidebar after logon

    Hello

    We use the Windows with Windows Server 2008 Std R2 DC field. We currently have several offices of Vista that belong to the domain. DNS is configured as suggested by Ms. recommended and there is no other group policy in use than the default domain policy.

    After logon successful sidebar does'nt load completely (sidebar is displayed, but the clock is not displayed). Also, if you try to start Office MS Word it stuck in the loading screen. If you don't expect anything happens. Strange thing is that all other programs will be load normally (even other Office programs), but Word and Sidebar are stuck.

    All this happens completely random. You can open a successful session of 3 times, but then it happens again.

    This problem came just after computers, where joined to the domain. The proglem didn't happen while that computers in the workgroup.

    No idea what could be wrong?

    Please repost your question to the Discussion Windows Server group to: http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=microsoft.public.windows.server.general&cat=en_US_9741c575-ec92-42f8-85ba-00dfe1483cf5&lang=en&cr=US where the Windows Server experts will be happy to help you.  The fact that the Vista machines worked are in a working group suggests that the probllem is from the domain which means from the server.

    I hope this helps.

    Good luck!

    Lorien - MCSA/MCSE/network + / has + - if this post solves your problem, please click the 'Mark as answer' or 'Useful' button at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • Pwd change after logon

    Hello
    I used the custom basic auth on the employee table.
    I'd like to force change pwd user after logon
    Please help me on this case
    Thank you.

    Hi Hailt,

    Even now, you assign points to my answer.

    You can find the correct or relatively useful option in my reply post where I answered it at the top right, you can find it.

    Brgds,
    Mini

  • After alter on database Trigger

    I have a trigger of database that fires "after alter on database' and sent me an email so that I can take certain administrative measures. In this trigger, I see some system as variables:
    ora_dict_obj_type, ora_dict_obj_name, ora_sysevent
    I try to limit my trigger for email me only when the ALTER event is when someone is adding a column or dropping a column. However, I found that ora_sysevent is always equal to "ALTER" even for events such as enabling/disabling of the constraints. I want only the email to send when someone is adding or removing a column.

    Is there a system variable that I can use to find out if the event ALTER has been adding or dropping a column?
    CREATE OR REPLACE TRIGGER TTMS.altered_ttmsdb_tabs_trigger
    AFTER ALTER ON database
    DECLARE
      PSENDER VARCHAR2(200);
      PRECIPIENT VARCHAR2(200);
      P_CC_RECIPIENT VARCHAR2(200);
      P_BCC_RECIPIENT VARCHAR2(200);
      PSUBJECT VARCHAR2(200);
      PMESSAGE VARCHAR2(6000);
      auditTable_ind varchar2(1);
      BEGIN
      
        select nvl(count(table_name),0)
        into auditTable_ind
        from all_triggers
        where substr(trigger_name,1,9) = upper('tr_audit#')
        and table_name=ora_dict_obj_name;
    
        if auditTable_ind > 0 then
          INSERT INTO altered_tabs
          VALUES
          (ora_dict_obj_type, ora_dict_obj_name, SYSDATE, user, ora_sysevent);
          PSENDER := '[email protected]';
          PRECIPIENT := '[email protected]';
          P_CC_RECIPIENT := '[email protected]';
          P_BCC_RECIPIENT := '[email protected]';
          PSUBJECT := 'TTMS Audit - Altered Audit Table Alert - Action Required';
          PMESSAGE := ora_dict_obj_name||' was altered on '||sysdate||' by '||user||'.  Please rebuild the audit index immediately.';
          TTMS.SEND_MAIL ( PSENDER, PRECIPIENT, P_CC_RECIPIENT, P_BCC_RECIPIENT, PSUBJECT, PMESSAGE );
        end if;
      END;
    /

    It is a collection of strings (although most DDL will be short enough to be represented in a single item in the collection). There is an example of using this in the documentation

    sql_text ora_name_list_t;
    stmt VARCHAR2(2000);
    ...
    n := ora_sql_txt(sql_text);
    FOR i IN 1..n LOOP
     stmt := stmt || sql_text(i);
    END LOOP;
    INSERT INTO event_table ('text of triggering statement: ' || stmt);
    

    Just to point out, however, please make sure that you are not re - reinventing the wheel for something you can do with the audit of the actual database.

    Justin

  • Is there a quick way to regain access to a windows 7 PC after logon username/password forgotten?

    Currently have great difficulty to regain access to my PC after the problem above with the logon screen.

    Have you heard of <> software delivery to zero/cracking of password name deleted by CM > software recovery but would it work for a username forgotten password?

    It is a strict rule of the forum that we are not allowed to help users to bypass the security of Windows itself, there is no recognized option backdoor.

    You can try to restart in safe mode and log in as an administrator without password.

    If you have to use a password reset disk

    Reinstall Windows but recovery utility will probably administration user name and password.

    As a last resort, remove the drive from the computer, using a USB adapter to connect to another and copy off important files.

  • After the update automatic, could not load desktop under the screen turns off after logon

    Original title: computer running Windows 8 will not correctly restart after automatic updates & close

    I have Windows 8 my computer does not start correctly after it has automatically closed for the automatic updates last night. When I turn on the computer I can connect as user, however once I do it says welcome and the screen turns white. The only thing visible is the cursor if I move the mouse. There is no Apps and I can't get to my desk or anything else. I tried to restart again and press F8 and nothing. However, I can bring up the Task Manager, but that's all. Help, please.

    Hi Patricia,

    I understand that you get a black screen after that it was closed automatically for automatic updates. It might be difficult when things don't work the way it should be on your computer. This problem might have occurred because of the conflicted with the system files update or could be a problem with the display card drivers may be due to the virus/malware infection.

    Many users complain about the issue with a black screen to logon Windows. Microsoft has not yet determined the exact cause of this problem.

    However; I suggest you to please follow the steps suggested by Scott Atk began August 30, 2014 in the following link and check if this can help:

    http://answers.Microsoft.com/en-us/Windows/Forum/windows8_1-performance/black-screen-when-logging-into-Windows-80-or/93bb4530-C31C-4a2d-91e6-7ec2fc420379

    Please answer us on the State of the question to help you further.

  • How Controlfile SNA remain synchronized after moving the database with the cold backup

    Hello DBAs,

    I doubt that:

    Every time you pass a cold backup database. We create a new controlfile with new locations of data/redologs etc.

    And then we execute "create controlfile reuse...". noresetlogs...; "to create the controlfile.

    After that, we will open the database as > > alter database open;

    Now the question is:

    We are able to open the database without clause "resetlogs.

    Here, we create a new controlfile so SNA to controlfile will not be synchronized with the SCN of the datafile and redo the file.

    Please let me know how the new controlfiles' SNA is synchronized with the data file and redofile and wea are able to open the database without resetlogs clause.

    Oracle: 11.2.0.4

    OS: Linux

    If your cold backup also includes online redo logs, a RESETLOGS is not necessary.

    The controlfile is created if it does not have a SNA, it reads the data file headers the YVERT database. For a cold backup, all the headers of data file are consistent.  (This is also the reason why a RECOVERY is not required).

    Hemant K Collette

  • 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.

  • Data synchronization after restoring the database to the Source or target

    Hi DBAs,

    I've implemented replication unidirectional flow at the level of transactional database to the database schema (excluding some tables). It works very well without any problems after doing the tuning of flow with the help of health check scripts. My question is if some reasons, if I have to recover to the level of the database on the database Source then I need rebuild flows from scratch? Database size is close to 2 TB and after recovery, even using the pump data at the same time, it could take hours and also the source won't be available even after the recovery (data pump running job - if the source is online, then I was getting ORA-01555 errors and work was not).

    Please notify by above circumstances what is the best way to re - synchronize data between the source and target.

    Thank you
    -Samar-

    I would export of the datadict (build) once again, just to avoid any MVDD, something to do directly after the restoration of the DB,.
    because I'm not sure from the perception of this restoration DB in terms of DBID. Have you checked in rman if source db is considered to be the epitome?

    Then restart what are the messages in the target error queues. I think that you will have problems to move the first_scn
    due to differences on some YVERT in source/target system.logmnr_restart_ckpt$. system will think it has holes.
    You may need to manually remove a bunch of lines to allow the flow to jump on the fate of the YVERT
    that have been sent and are not present in the source system.logmnr_restart_ckpt$

  • How to refresh the items in selectOneChoice after change of database items

    WWW the JPA and ADF application, but without BC.
    In the present draft of the table T1 (long tid, tNom string) model. Current methods of JPA for work with the table. They are built automatically from table.
    His presentations via block EJB and data controls.
    In the project view this page where is used.
    ....
    < af:popup id = "idDlgAddType" >
    < af:dialog title = "New type" id = "d3" dialogListener = "#{TypeBean.handleAddDialog}" >
    < af:inputText label = "Type" id = "idDlgInputTypeName" value = "#{TypeBean.typename}" / >
    < / af:dialog >
    < / af:popup >
    < af:selectOneChoice id = value = "#{bindings.t1FindAll.inputValue"idTypeList"} ' simple 'true' shortDesc = 'Type' = >"
    < f: selectItems value = "#{bindings.t1FindAll.items}" id = "idTypesNames" / > "
    < / af:selectOneChoice >
    < af:spacer width = "5" id = "sp2" / >
    < af:commandButton immediate = "true" text = "Adding a type" clientComponent = "true" id = "idBtnAddType" >
    < af:showPopupBehavior popupId = "idDlgAddType" alignId = "idBtnAddType" align = "afterStart" / >
    < / af:commandButton >
    ......

    This supported beans class CType synonymous TypeBean. In this class this method handleAddDialog.
    Bean saved:
    public class CType {}
    private String typename;
    ....
    {} public void handleAddDialog (DialogEvent event)
    If (event.getOutcome () .equals (DialogEvent.Outcome.ok)) {}
    AdfFacesContext.getCurrentInstance () .getViewScope () .put ("T1", new T1 (null, this.typename));
    BindingContainer bc is BindingContext.getCurrent () .getCurrentBindingsEntry ();.
    Method JUCtrlActionBinding = (JUCtrlActionBinding) bc.getOperationBinding ("persistT1");
    Method.Execute ();

    RichSelectOneChoice cid = (RichSelectOneChoice) FacesContext.getCurrentInstance () .getViewRoot () .findComponent ("idTypeList");
    AdfFacesContext.getCurrentInstance () .addPartialTarget (cid);

    }
    }
    }

    Question:
    How to force the object selectOneChoice to read items from a database?
    The selected channels do not lead to the necessary result. New record in the table is displayed. But it is not displayed in the list on the screen.
    Moreover, the regeneration of the page through a browser control also does not lead to the appearance of the record added in the list.

    Hello

    Re-run the iterator, which depends on the list of selectOneChoice. You can do so after completing the update. The reason why you don't see a change in your current implementation is that you do not change the collection of the iterator that fills the list

    Frank

  • Invalid objects after upgrade of database 11g

    Hello

    I've updated 11i EBS 10.2.0.3 for 11.1.0.7 database.

    Prior to upgradation all invalid objects have been compiled, and there is no invalid object
    After upgradation I 329 invalid objects, I tried the script utlrp.sql running but no luck, they are still non valid and County remains the same. Please can someone guide me to this point.

    Thanks in advance...

    Concerning

    Hello

    You can use the ADCOMPSC.pls script for other schemas (such as sys and system). See these documents for more details.

    Note: 104457,1 - invalid objects in Oracle Applications FAQ
    Note: 143734.1 - how to compile invalid objects

    Kind regards
    Hussein

  • Explorer.exe is not running after logon

    XP Home SP3, Microsoft updates current running.  Also running avast! 6 free 3.54 Sandboxie, Windows Defender, COMODO Firewall (free) Malwarebytes Anti-Malware free, SUPERAntispyware Free Edition, PC Tools ThreatFire.  Firefox 4.0.1 and also installed IE8.

    Only three of these programs are running real time: avast!, COMODO, ThreatFire and Sandboxie when running a browser.

    Updated definition files scanning shows the system to be clean.  System runs very quickly and smoothly.

    Problem: Explorer.exe will not start after login.  Desktop is missing, taskbar, tray system, clock, start button and desktop icons and system stalls.  Check the Task Manager shows explorer.exe has not been loaded.  The first couple of times this happened it, CTRL + ALT + DELETE is the Task Manager, and I chose restart from, even when you are connected, and then explorer.exe should boot and load.

    I have not checked yet to see, if and when this condition occurs again, if explorer.exe is going to load by clicking New Task Manager tasks.

    Safe mode and running last last known good configuration worked the last time.

    What should I look for in the registry?

    mchain

    Please let us know.

    John

Maybe you are looking for