Logon Trigger to stop user logging in (Oracle 9i)

Hi,
In 9.2.0.8, how can i stop a user logging into my database if it connectes through a user let say "A" using program "EXECL.EXE". I found a trigger code on the net but it uses SYS_CONTEXT to find out the module which user is using to login but in 9i, this functionality is not available. any other method?
Thanks
Salman

An easier way might be to ensure that the ODBC software is not installed on the user's pc, although the TYPICAL end user probably wouldn't think of renaming Excel before running it. On the other hand if they have an application for accessing the database, make sure that all other means such as SQL*Plus are disabled by if nothing else not installing the software and possibly having a trigger that checks that the name of the application which has connected to the database is your application.

Similar Messages

  • Multiple logon trigger for a user

    Hi,
    can I create two (or more) distinct logon trigger for a user? If yes, this situation is "clean"? Both triggers are executed on logon time?

    If you don't know what the wrapped source does
    and you don't care about the order
    then
    clean := false ;-)
    You filter access, but what if the unknkown wrapped source logs database access in some table on a user before your trigger DENIES access for that user/program?
    You would try to find out what the already existing trigger does (third party software?), if you really want to be clean.

  • Display current user logged into Oracle DB

    Is there any way to display current user logged into our Oracle DB using this version. We don't have the Enterprise solution.
    thanks

    Hi, I am new to this in Crystal but created a SQL expression such as:
    SELECT USER FROM DUAL
    and tried
    SELECT USER FROM DUAL;
    and received a compile error (failed to retrieve data) in Crystal?
    any help is appreciated!

  • Retrieving Local User Logged In to Oracle Apps

    Hi,
    I have a report that issues Employee Payslips. I need to modify it so the user submitting the request will only be able to view his/her payslip.
    I have the following bit of code:
    SELECT distinct user_id
    FROM v$session vs, v$process vp, fnd_logins fl
    WHERE vp.addr = vs.paddr
      AND fl.spid = vs.process
      AND vs.sid=(select distinct sid from v$mystat)I also tried linking V$SESSION, V$PROCESS, and FND_CONCURRENT_REQUESTS using oracle_process_id and oracle_session_id.
    The problem is neither is returning any results. When linking V$SESSION and V$PROCESS alone, I get one record, which is what I need. But upon adding FND_LOGINS to the equation, no records are retrieved.
    So my question is, is there another way to be able to get the User_ID (that can be linked in FND_USER) of the session? I've looked up previous threads and articles but none of the solutions worked.
    Thanks.

    The main idea of the report is that a user logs into Oracle Applications and submits a request. The code in the report linked to this request has to get the username that the user logged in with and use it to retrieve only information that are related to that user.
    When taking the record with SID from sys_context, the data in V$SESSION are actually related to the server not the user so they're the same for all users.
    Executing the following query:
    select username, osuer, machine, user#
    from v$session
    where SID = sys_context('USERENV', SID);Returns the following:
    USERNAME: APPS
    OSUSER: applqa
    MACHINE: ebusdev1
    USER#: 183Same with sys_context('USERENV', SESSIONID'). And linking it to FND_LOGINS using the PROCESS column returns no data.

  • Autotrace with logon trigger?

    Hi,
    I've a view and the view is be reading by an external program.
    How can i see how and how long do they communicate ?
    Thanks in advance.
    With best regards
    Nicole

    Hi:
    If you have a testing environment (that is definitely a must have) and can modify sources the simplest way to activate trace is add a 'alter session set sql_trace=true' at the beginning of the application, then run it, and then evaluate results.
    Using a logon trigger for the user the application is connecting to is another way to accomplish the same, useful when the application cannot be modified. This is an example of the same:
    CREATE TRIGGER
    schema_owner.logon_tg AFTER LOGON ON schema_owner.SCHEMA
    BEGIN
    EXECUTE IMMEDIATE 'alter session set sql_trace=true';
    END;
    This will produce a trace file containing all of the statements executed by the session:
    Trace files go to USER_DUMP_DEST, and need to be parsed with TKPROF in order to produce readable output.
    Also, check to have timed_statistics=true, so it will report timing in the trace files.
    Try to produce trace files, and post if you need assistance in interpreting results.
    ciao
    Andrea

  • Simple trigger to allow users to log on at certain times

    I am trying to create a trigger that will allow certain users to only log into the database between 12am - 4 am.
    Can I assign a trigger to a user or to a role or how do I parse it out. I dont think I have this trigger just right yet...
    Or can this be set in the database it self? I looked at the user accounts, profiles, roles and dont see anything about connection times.
    Oracle 10.2.0.4
    I want to create a trigger that will only allow the user to log into the database between 12 and 4 am.
    My next question is can I assign this trigger to the role that the user has been assigned to?
    I have pulled some similar code that I would like to use but do not know how to modify it to be either assigned to a user: npq or to the role ntq_ro.
    create or replace trigger logon_time after logon on database
    begin
    if to_char(sysdate,'HH24') between 4 and 24
    then
    raise_application_error(-20001,'Not allowed to logon database during this time');
    end if;
    end
    /

    yes, I would love to all by command line...
    Bere in mind I change to to test...
    SQL> CREATE OR REPLACE TRIGGER "SYS".LOGON_TIME_RESTRICTION_NPQ AFTER
    2 LOGON ON DATABASE
    3 BEGIN
    4 if to_char(sysdate,'HH24') between '14' and '16' AND USER='NPQ' THEN
    5 raise_application_error(-20001,'Not allowed to logon database during this time');
    6 end if;
    7 end;
    8 /
    Trigger created.
    SQL> exit
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    [oracle@kali ~]$ sqlplus
    SQL*Plus: Release 10.2.0.4.0 - Production on Mon Jan 10 14:41:02 2011
    Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
    Enter user-name: npq
    Enter password:
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    Alert log triggered errors:
    Mon Jan 10 14:41:10 2011
    Errors in file /u01/app/oracle/admin/NASARPT/udump/nasarpt_ora_17508.trc:
    ORA-00604: error occurred at recursive SQL level 1
    ORA-20001: Not allowed to logon database during this time
    ORA-06512: at line 3
    /u01/app/oracle/admin/NASARPT/udump/nasarpt_ora_17508.trc
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1
    System name: Linux
    Node name: kali.mtsallstream.com
    Release: 2.6.18-164.6.1.el5
    Version: #1 SMP Tue Oct 27 11:28:30 EDT 2009
    Machine: x86_64
    Instance name: NASARPT
    Redo thread mounted by this instance: 1
    Oracle process number: 31
    Unix process pid: 17508, image: [email protected] (TNS V1-V3)
    *** ACTION NAME:() 2011-01-10 14:41:10.293
    *** MODULE NAME:([email protected] (TNS V1-V3)) 2011-01-10 14:41:10.293
    *** SERVICE NAME:(SYS$USERS) 2011-01-10 14:41:10.293
    *** SESSION ID:(54.49496) 2011-01-10 14:41:10.293
    Skipped error 604 during the execution of SYS.LOGON_TIME_RESTRICTION_NPQ
    *** 2011-01-10 14:41:10.293
    ksedmp: internal or fatal error
    ORA-00604: error occurred at recursive SQL level 1
    ORA-20001: Not allowed to logon database during this time
    ORA-06512: at line 3
    I also tried the setting for the to_num but it would not even compile:
    SQL> CREATE OR REPLACE TRIGGER "SYS".LOGON_TIME_RESTRICTION_NPQ AFTER LOGON ON DATABASE
    2 BEGIN
    3 if to_num(to_char(sysdate,'hh24miss')) between '000001' and '040000' AND USER='NPQ' then
    4 raise_application_error(-20001,'Not allowed to logon database during this time');
    5 end if;
    6 end;
    7 /
    Warning: Trigger created with compilation errors.
    SQL>

  • Trying to create trigger for some action to take place after a user logs on

    Hello,
    I want to create a trigger to fire after a user logs on. How to write this trigger.
    I am getting an error with syntax below. Thank you.
    create or replace trigger after_logon_xxtestuser
    after logon
    on xxtestuser.xxtestuser
    begin
    alter session set nls_territory = France;
    end;
    /

    I figured it out...
    create or replace trigger after_logon_xxtestuser
    after logon
    on xxtestuser.schema
    begin
    execute immediate 'alter session set nls_territory = France';
    end;
    /

  • User change password after first logging in Oracle 11g

    Hi
    Can you help someone in connection with this problem:
    user can not change password after first logging in Oracle 11g
    All the best
    Ragip Avdijaj

    Sounds like they are not getting logged in at all, so they are never getting to the point where they can change the password, but we need to see more detail to give a better answer (an example or copy-paste of a sqlplus session might help)

  • How-to trigger an ABAP program after a user logs on?

    Does anybody know if it is possible to trigger an ABAP program just after a users logs into the system?
    Thanks
    Ioan

    The function module is EXIT_SAPLSUSF_001.  The include program is ZXUSRU01. 
    Just put your SUBMIT statement in this include program.
    Regards,
    Rich Heilman

  • Identify user logged in discoverer as a oracle apps user

    Hi Guys,
    I am using web based to log in to discoverer as a oracle applications user. there is a report in one responsibility related to PO. My question is, can i catch the user who is logged in (his username or user ID) to be printed on the report.
    or
    I created a report which can see the details of the requisition (req ID, line number, Requestor, Approver, Requestor Dept, PO Number, etc). My report should display only the requisitions created by the user who is logged in who will be the requestor here in this case. I cant pass requestor as the parameter. It should automatically take the user logged in as requestor and display only his requisitions on to the output.
    Help Appreciated.
    Thanks

    use FND_GLOBAL.USER_NAME to get current user and pass it as parameter

  • I cannot log into oracle using the user scott

    I installed oracle, but I did not go through the underlined step. I am not sure if I skipped or it was not there during the installation
    The Database Configuration Assistant will provide installation summary
    and list the accounts that are unlocked. It will ask you for password management. Sys
    and System accounts would be already unlocked.  Unlock HR and Scott accounts,
    and for these two accounts also specify the same password that you had given before.
    When I test logging into Oracle using the user Scott, it shuts down.
    I am using windows 7, and I installed Oracle Database 10g Release 2 (10.2.0.1.0)
    Enterprise/Standard Edition for Microsoft Windows (32-bit)
    How can I log into oracle using the user Scott?

    Hi,
    Welcome to the forum,
    After installing Oracle 10g SCOTT user will be in locked, you should unlock it.
    Login as sysdba using the below command
    sqlplus sys as sysdba
    password:<ur password>
    after connecting as sysdba use the below command to unlock the SCOTT user
    ALTER USER SCOTT ACCOUNT UNLOCK;
    Now connect as scott you will bw able to connect.
    hari

  • Need to find Logon Group in which the user Logged in

    Dear Experts,
    I have a issue to find the logon group while logging into the SAP
    For example
    One server having three LogonGroups
    1) MFSTRESS
    2) TEST
    3) HQSTRESS
    in that I want to find out the logon group in which the user logged in. I am not able to find in the transaction SMLG or AL08
    Is ther any function module is available  or any other way to find the logongroup.
    Please help on that its very urgent . I will reward the points immediately.

    hi,
    TH_USER_INFO – Returns information about user
    TH_USER_LIST – Displays users logged onto server
    Hope this helps, Do reward.

  • Restrict User Connections Using Logon Trigger

    Hi all,
    Now I am restricting user connections from selected terminals, using following logon trigger.
    It allows users with DBA privileged user.
    How to restrict DBA Privileged users users ?
    Note:- As per my application needs DBA privilege.
    CREATE OR REPLACE TRIGGER on_logon
    AFTER LOGON
    ON DATABASE
    DECLARE
    VPROGRAM VARCHAR2(30);
    Vusername VARCHAR2(30);
    VTERMINAL VARCHAR2(30);
    CURSOR user_prog IS
    SELECT UPPER(program),UPPER(username),NVL(TERMINAL,'X') FROM v$session
    WHERE audsid=sys_context('USERENV','SESSIONID');
    BEGIN
    OPEN user_prog;
    FETCH user_prog INTO Vprogram,Vusername,VTERMINAL;
    IF VTERMINAL NOT IN ( 'APP1','APP2','APP3')+
    and Vusername='ABUL'+
    THEN
    RAISE_APPLICATION_ERROR(-20001, 'You are not allowed to login');
    END IF;
    CLOSE user_prog;
    END;
    Thanks i Advance
    Abk

    Your application needs the DBA role? That is a terrible design-- it violates every principle of secure coding.
    Login triggers don't fire for users with the DBA role, so you won't be able to use a login trigger here. You could ditch the login trigger and configure invited and excluded nodes in the listener's sqlnet.ora file, i.e.
    tcp.validnode_checking = yes
    tcp.excluded_nodes = (hostname1,hostname2,hostname3)You'll have to restart the listener after making that change.
    Justin

  • How to create a logon script to delete folder, subfolders and contents when a user logs on ?

    I need to create a logon script which will delete a folder, subfolder and contents when a user logs on. I have no experience with scripting so any pointers you can give would be much appreciated.
    Thanks

    depending on how you have thing set up, it might be easier to make a LaunchAgent to handle this.  do this:
    copy the text below into a text editor
    save it as a plain text file in /Library/LaunchAgents with the file name "user.startup.folderDeleter.plist" (the name doesn't matter so much, but the 'plist' extension is required)
    load the plist into launchd by restarting the machine or by opening terminal and running the command launchctl load /Library/LaunchAgents/user.startup.folderDeleter.plist
    This will delete the folder any time any user logs in.  You could also expand this to delete the folder periodically (once a day, for instance) if that would be helpful.
    Note, this file must be saved as plain text. apps like TextEdit sometimes default to making rich text files which will not work.  Either download a programmer's text editor like TextWrangler, or make sure that TextEdit is using plain text (if the window has a formatting toolbar it's using rich text;  select "Make Plain Text" from the Format menu).
    copy the text below:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
              <key>Label</key>
              <string>user.startup.folderDeleter</string>
              <key>RunAtLoad</key>
              <true/>
              <key>ProgramArguments</key>
              <array>
                        <string>osascript</string>
                        <string>-e</string>
                        <string>tell application "Finder" to delete folder "Final Cut Express Data" of folder (path to preferences from user domain)</string>
                        <string>-e</string>
                        <string>tell application "Finder" to empty trash</string>
              </array>
    </dict>
    </plist>

  • How to trigger a custom code when user log in?

    Hi my friends,
    We are using multiple sharepoint sites at work. Users log in with AD accounts, so they dont see any login page.
    I need to run a custom code when user login to website. Event receivers do not help at this point. Any suggestions?
    thanks in advance

    Hi Ahmet,
    From your description, my understanding is that you want to trigger some custom code when users log in SharePoint.
    As a solution, you could customize a login page for your SharePoint, then you could trigger your code.
    You could also use httpmodule to monitor user login. Please refer to this article about how to use httpmodule:
    http://sharepoint.stackexchange.com/questions/100976/get-the-current-logged-in-user-in-sharepoint-added-httpmodule
    Best Regards,
    Vincent Han
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

Maybe you are looking for

  • How to Call  fnd_submit.submit_program  in a custom Form ?

    Hi, Im creating a custom form based on TEMPLATE.fmb in Oracle EBS R12. I want to call a concurrent program (called: RVCTP) through trigger WHEN_WINDOW_CLOSED or WHEN_BOTTON_PRESSED whatever.. I'm using this function: fnd_submit.submit_program How i c

  • Log file not generated

    i follow the steps 1.In Application Set profile FND: Debug Log Level to "Statement" 2.restart apache 3.Run debug from help-->diagnostics-->debug 4.Secure debug log file which should be in select value from v$parameter where name like 'utl_file%' but

  • Why are my RMAN backup files still around?

    Environment: Oracle 11.2.0.3 EE on Solaris 64-bit Good Morning (at least it's morning here at the moment), I have a test database that I currently have set up to do an Incremental Level 0 backup every morning at about 03:00. I also do an 'archivelog

  • Camera App not working

    Hi guys, I have been having problems with my camera after the latest update ( 2nd update for 8.1). The pictures come out very small, less than 40KBs. I have tried camera settings but to no avail. Anyone having the similar problem and any fixes for th

  • Delta problem in PLM datasource

    Hi experts, i have a datasource 0DPR_PROJECT_DATE from Cprojects PLM. the problem is that eventhough this datasource is delta enabled and sometimes for some projects this is not bringing the changes for example i have a project No 10001 which is in m