Logon trigger - restrict acces using Toad, SQLPLUS...

Oracle 10.2.0.4
I have users who use oracle form - ifweb90.exe.
I want to restrict them to access database using SQL Developer, TOAD or any other tools. I create logon trigger:
CREATE OR REPLACE TRIGGER block_users
AFTER LOGON ON DATABASE
begin
FOR REC IN (SELECT USERNAME,PROGRAM
FROM V$SESSION
WHERE AUDSID = USERENV('SESSIONID'))
LOOP
if rec.username like ('X%')
and
rec.program not like ('ifweb90.exe')
then
RAISE_APPLICATION_ERROR(-20001,'ERROR MESSAGE');
end if;
end loop;
END;
This solution don’t work if the program executable is renamed (this can’t be done with SQL Developer).
1. Is there any way to solve this?
2. Whether this trigger will use resources, whether this trigger will check all connection? What is the cost to pay in terms of performance?
Thanks in advance!
Edited by: user9106065 on Nov 9, 2010 3:17 AM

This solution don’t work if the program executable is renamed (this can’t be done with SQL Developer).
1. Is there any way to solve this?Better alternative would be to change your own program, set the client_application_info and check for that using logon trigger. Anything else, can then be thrown off.
2. Whether this trigger will use resources, whether this trigger will check all connection? What is the cost to pay in terms of performance?There would be negligible usage of resources.
But this trigger won't stop any connections from any tool which come in as SYSDBA.

Similar Messages

  • 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

  • Insufficient privileges using execute immediate in after logon trigger

    I have an after logon trigger that executes a package/procedure in the schema it was created in.
    One of the procedures runs the following:
    EXECUTE IMMEDIATE 'AUDIT INSERT TABLE, UPDATE TABLE, DELETE TABLE, EXECUTE PROCEDURE BY ' || USER;
    The procedure is throwing an insufficient privileges error when executing this.
    However - the schema owner has audit any and audit system privileges and - the statement works fine independently.
    When I login as another user this issue arises. The package/procedure are created with definers rights... So - i'm not sure why this is happenening.
    Any help is appreciated.

    privileges acquired via ROLE do NOT apply within named PL/SQL procedures.
    SQL> SET ROLE NONE
    SQL> --issue AUDIT again now                                                                                                                                                                                                                                                               

  • Logon trigger setting nls_date_format over ridden by sql developer?

    Problem: Developers are inserting a Date record into a varchar field. I can't change this process right now. Non-Date info is stored here also. Would require a code change.
    To simplify this, I wanted to get all the developers to insert using the same 'nls_date_format'. I had hoped to be able to centralize this by having Oracle set it in the database. I tried this by setting the database nls_date_format and with a logon trigger.
    See test below. Seems to be over ridden.
    Test case is with SQL Developer. Noticed the same thing when developers use Websphere. I think we reduce the chance for errors, if I can handle this in the database. However, my nls_date_format settings are getting over ridden.
    1. s et database parameter nls_date_format to YYYY-MM-DD HH24:MI:SS , this gets over riden by SQL Developer/Websphere
    2. Created a trigger with an 'alter session', but this seems to get over ridden also.
    Please see test case below:
    Oracle 11.2.0.3
    test logging: SQLPLUS locally on the unix server, then log in using SQL Developer which is installed on my laptop.
    SQL Developer NLS_DATE_FORMAT : YYYY-MON-DD HH24:MI:SS , This is different for test purposes
    I have auditing turned turned on to db,extended with 'audit all by 'user' by access;' for test purposes to get more info.
    create table test (username varchar2(30),sid number,mytest varchar2(300),insert_date date);
    create or replace
    TRIGGER LOGINTRG
    AFTER LOGON ON DATABASE
    BEGIN
    insert into test select user,   sys_context('USERENV','SID') ,value,sysdate from v$parameter where name = 'nls_date_format';
    EXECUTE IMMEDIATE 'ALTER SESSION SET NLS_DATE_FORMAT=''YYYY-MM-DD HH24:MI:SS''';
    insert into test select user,   sys_context('USERENV','SID') ,value,sysdate from v$parameter where name = 'nls_date_format';
    commit;
    END LOGINTRG;
    /Results/Questions
    1. When I select from 'test', I confirm that my NLS_DATE_FORMAT is the same both before and after the alter session.
    2. select value from v$parameter where name = 'nls_date_format'
    output: YYYY-MON-DD HH24:MI:SS (so sql developer is over riding this);
    3. select * from dba_audit_trail where username = 'MYUSER' order by timestamp desc;
    The SQLs from the logon trigger are not captured. how do I capture logon trigger sqls? Not a huge deal, just curious
    4. I do not see any alter sessions issued by my user. shouldn't audit all by access capture that? how could my session nls_date_format change without an alter session?
    Edited by: Guess2 on Apr 22, 2013 10:44 AM

    >
    Problem: Developers are inserting a Date record into a varchar field.
    >
    No - they aren't. That is physically impossible. The only thing that can be stored in a 'varchar field' is a string. Oracle considers ANYTHING stored in a character column to be a string.
    Date values are stored in DATE columns. Perhaps you meant that developers are converting DATE values to strings and then storing the string in a 'varchar field'?
    >
    I can't change this process right now. Non-Date info is stored here also.
    >
    WONDERFUL! Why use a column to stored just one type of data? That is extremely wasteful. Hopefully you store strings that represent numbers in that same column also? It makes the data model so much easier to understand if developers only need to learn one datatype.
    >
    Would require a code change.
    >
    The horror!
    You should never, ever, EVER use a code change to fix a problem if there is even the slightest possibility that you can change the ENTIRE DATABASE instead.
    I've got good news though. You are now on version Oracle 11.2.0.3 and Oracle, after months of protests by some of their largest clients, has finally dropped the exhorbitant license fees for using some of the more esoteric datatypes like DATE and NUMBER.
    You should suggest to your manager that they use some of the license fee money saved to hire developers that already know how to design proper data models and use those new-fangled datatypes.
    Trust me - once you've made it up that steep learning curve your code will have fewer of those pesky 'dirty data' issues to deal with.
    Sure - it means less job security for your current developers. But sometimes you just have to 'take one for the team'!

  • AUTHENICATE SSO RAD INFO IN LOGON TRIGGER IN 10G FORM?

    I've been trying to add a LOGON Trigger to my Oracle 10g Form to check my RADs after logging into SSO.
    I'm having a problem setting up multiple Config's for multiple RADs. I have about 7different applications that I would like to log into but would like to log into the SSO just once. But for some reason each application is asking for a SSO log in.

    Hi!
    This is a webutil-restriction.
    You cannot use webutil in triggers that fires before the form has complete focus.
    Like pre-form, when-new-form-instance and on-logon triggers.
    In a when-new-form-instance trigger create a timer, let's say 200 millisconds long.
    In a when-timer-expired trigger you can call webutil.
    May you put your configuration-file on the server and use d2kwut !
    Regards.

  • Logon Trigger - Question

    Hi,
    I'm a beginner on the Oracle technology and I'm trying add a step on my logon trigger that avoids that the same user connects twice to the database using PL/SQL Developer.
    Here what I'm doing:
    VUSER := UPPER(SYS_CONTEXT('USERENV', 'SESSION_USER'))
    VPROGRAM := UPPER(SYS_CONTEXT('USERENV', 'MODULE'))
    SELECT COUNT(*) INTO N_SESSION
    FROM V$SESSION
    WHERE USERNAME = UPPER(SYS_CONTEXT('USERENV', 'SESSION_USER'));
    IF VUSER NOT IN ('SYS','SYSTEM') AND N_SESSION >= 2 AND VPROGRAM LIKE 'PLSQLDEV%' THEN
              RAISE_APPLICATION_ERROR(-20003,
                        'Access to database ' ||
                             UPPER(SYS_CONTEXT('USERENV', 'DB_NAME')) ||
                        ' denied for this application');
    END IF;
    For some reason, it's not working.
    Do you guys know what I should do?
    Thanks

    The trigger works fine in principle:
    CREATE OR REPLACE TRIGGER after_logon_trg
    AFTER LOGON
    ON DATABASE
    DECLARE
         n_session INTEGER;
    BEGIN
         SELECT COUNT ( * )
           INTO n_session
           FROM v$session
          WHERE username = UPPER (SYS_CONTEXT (
                                                       'USERENV',
                                                       'SESSION_USER'
         IF UPPER (SYS_CONTEXT (
                              'USERENV',
                              'SESSION_USER'
                         )) NOT IN ('SYS', 'SYSTEM')
      AND n_session >= 2
      AND UPPER (SYS_CONTEXT (
                              'USERENV',
                              'MODULE'
                         )) LIKE
                   'SQL%'
         THEN
              raise_application_error (
                   -20003,
                        'Access to database '
                   || UPPER (SYS_CONTEXT (
                                        'USERENV',
                                        'DB_NAME'
                   || ' denied for this application'
         END IF;
    END after_logon_trg;
    Session 1:
    SQL> connect scott/tiger@oracle
    Connect durchgeführt.
    Session 2:
    C:\>sqlplus scott/tiger@oracle
    SQL*Plus: Release 11.1.0.7.0 - Production on Fr Aug 28 19:05:25 2009
    Copyright (c) 1982, 2008, Oracle.  All rights reserved.
    ERROR:
    ORA-00604: Fehler auf rekursiver SQL-Ebene 1
    ORA-20003: Access to database ORACLE denied for this application
    ORA-06512: in Zeile 23But beware that for users with "ADMINISTER DATABASE TRIGGER" privilege the trigger will still allow the user to login !

  • Logon trigger to alter the session parameter

    Hi,
    I want to execute alter session set '_b_tree_bitmap_plans'=false;
    for a user once he logs in.
    I guess it is possible using logon trigger, pls let me know how to?
    Thanks,
    Kumar.

    Ensure that the usage of the statements or settings in the login files is necessary or correct before using it.
    For all users, use glogin.sql. This is located in $ORACLE_HOME/sqlplus/admin
    For each user, use[b] login.sql. This need to be created by the user from sqlplus using the default editor. e.g type ed login at the SQL prompt. This enables the file to be created at the correct home of the OS user(different between Unix and Windows). Note that it is per OS user and not per Oracle user. For instance, every user who connects to the Server as the OS user oracle will run the same login.sql.
    If you enter statements that require logon (just like yours), you will get "Not Connected" error if you normally do sqlplus /nolog. But you will not get it is you connect directly be specifying the username directly or when prompted.
    The scripts will be run at each logon (either by typing sqlplus from os command prompt or using connect command within sqlplus).

  • In which trigger can i use go_item() in oracle forms 6i?

    Hi,
        I have a problem with go_item.
    I tried executing go_item() in triggers like key_next_item, pre_text_item, post_text_item & when_validate_item.
    But none of them seemed to be working.
    I searched for other possibilities in the site, where i found a solution of using trigger ' when_timer_expired ' with ' when_validate_item ' ,
    but when i tried to create trigger, i did not find that trigger (when_timer_expired)  in the list at all.
    I'm using oracle form builder 6i.
    Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production.
    A trigger with go_item() must be created when tab is pressed.
    In which trigger can i use go_item() ??
    Thank You.

    from help:
    Restricted Built-in Subprograms
    Restricted Built-ins affect navigation in your form, either external screen navigation, or internal navigation. You can call these Built-ins only from triggers while no internal navigation is occurring.
    Restricted Built-ins cannot be called from the Pre and Post triggers, which fire when Oracle Forms is navigating from object to another.
    Restricted Built-ins can be called from the When triggers that are specific to interface items, such as When-Button-Pressed or When-Checkbox-Changed. Restricted Built-ins can also be called from any of the When-New-"object"-Instance triggers and from key triggers.
    Unrestricted Built-ins do not affect logical or physical navigation and can be called from any trigger.
    The Built-in descriptions include a heading, Built-In Type, that indicates if the Built-in is restricted or unrestricted.

  • Using toad

    Hello Guys,
    Please share your views based on your experience
    Oracle 10g on Linux or Unix in DBA's perspective is it worth using TOAD?
    Please let me know how much more resource toad session takes compare to sqlplus (command line session)
    so will it put extra load on database
    It has some helpful features but do have disadvantages as well?please list disadvantages as advantages mostly
    mentioned on toad websites or documentations
    I am concerned with some like resoure usage/utilization,security(can connect multiple db at a time so human error),
    hanged toad sessions when run large query etc
    Thanks in advance
    Dev

    user13152393 wrote:
    Hello Guys,
    Please share your views based on your experience
    Oracle 10g on Linux or Unix in DBA's perspective is it worth using TOAD?What are you going to be doing with TOAD? It's a tool, simple as that.
    Please let me know how much more resource toad session takes compare to sqlplus (command line session)
    so will it put extra load on databaseTOAD doesn't take extra database resources in a typical sense. A database session is a database session regardless of whether it's been instantiated throught TOAD, SQL*Plus, SQL Developer or a.n.other tool. Obviously SQL*Plus is a more basic command line tool and therefore takes less disk space to install, and TOAD takes more disk space, but TOAD has a GUI interface and other things to make your tasks easy and pretty, so you'd expect that.
    It has some helpful features but do have disadvantages as well?please list disadvantages as advantages mostly
    mentioned on toad websites or documentationsIt depends. Using SQL*Plus will teach you to use SQL and the database properly as you will have to understand things from a raw command level. TOAD hides a lot of the technicalities from you and does it all for you, but then you would become stuck if you had to get the same information etc. manually as you wouldn't know what to do. Everything has advantages and disadvantages, but it's purely subjective (i.e. it depends on an individual persons point of view)
    I am concerned with some like resoure usage/utilization,security(can connect multiple db at a time so human error),
    hanged toad sessions when run large query etcI can connect multiple SQL*Plus sessions to different databases if I like, and they all look like command windows, so still opportunity for human error. What's the difference?
    Why should a toad session hang on a large query as opposed to hanging in SQL*Plus? I think you're clutching at straws and worrying about nothing.
    At the end of the day, many people use SQL*Plus, many people use TOAD, many people use SQL Developer, many people use other tools and many people use combinations of them all depending on what they need to achieve. Just use what's right for you.

  • Sql server 2012 Logon trigger not working for certain logins

    Hello. I created a login trigger to insert data for each login in a table, and it works for all logins except one that is format domain\login
    and the login ends with the dollar sign(actual name is domain\CTXDEVDCSI1$).
    I had been using varchar, but after reading other forum posts, I changed the varchar's to nvarchar's, but it still fails for that id.
    The errors written to the sql server error log were the usual "login failed due to trigger execution".
    I had granted insert on the rvvlogindata table in dsa to public, and only one id wasn't able to login after that.
    Any suggestions would be much appreciated!
    Here's the modified table ddl:
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE TABLE [dbo].[rvvlogindata](
    [sessionId] [int] NULL,
    [LoginTime] [datetime] NULL,
    [HostName] [nvarchar](50) NULL,
    [ProgramName] [nvarchar](300) NULL,
    [LoginName] [nvarchar](50) NULL,
    [ClientHost] [nvarchar](50) NULL
    ) ON [PRIMARY]
    GO
    Here's the logon trigger code:
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    create trigger [LOGIN_IP_RESTRICTION] on all server for logon
    as
    Begin
    Declare @LogonTriggerData xml,
    @EventTime datetime,
    @LoginName nvarchar(50),
    @ClientHost nvarchar(50),
    @HostName nvarchar(50),
    @AppName nvarchar(300)
    Set @LogonTriggerData = eventdata()
    set @EventTime = @LogonTriggerData.value('(/EVENT_INSTANCE/PostTime)[1]', 'datetime')
    set @LoginName = @LogonTriggerData.value('(/EVENT_INSTANCE/LoginName)[1]', 'varchar(50)')
    set @ClientHost = @LogonTriggerData.value('(/EVENT_INSTANCE/ClientHost)[1]', 'varchar(50)')
    set @HostName = HOST_NAME()
    set @AppName = APP_NAME()
    insert into dsa.dbo.rvvlogindata
    sessionId,
    LoginTime,
    HostName,
    ProgramName,
    LoginName,
    ClientHost
    select @@spid,
    @EventTime,
    convert(nvarchar(50),@HostName),
    convert(nvarchar(300),@AppName),
    convert(nvarchar(50),@LoginName),
    convert(nvarchar(50),@ClientHost)
    END
    GO
    SET ANSI_NULLS OFF
    GO
    SET QUOTED_IDENTIFIER OFF
    GO
    ENABLE TRIGGER [LOGIN_IP_RESTRICTION] ON ALL SERVER
    GO

    Erland, I wanted to add more info to my reply earlier today.
    sp_who2 showed no blocking, activity monitor from my local PC SSMS showed no major waits or high i/o or cpu activity.
    I was wondering if you have any suggestions on how to find out what was the cause of the 5+ minute wait for SSMS on the remote desktop to respond and fully come up.
    I definitely can't put this in production with this hanging delay possibly occurring there.
    I was connecting as read_user when it hung.
    sp_who2 output at the time was:
    1     BACKGROUND                     sa   .   . NULL LOG WRITER       54631 0 04/10
    06:59:43                                              
     1     0   
    2     BACKGROUND                     sa   .   . NULL RECOVERY WRITER  8673 0 04/10 06:59:43                                              
     2     0   
    3     BACKGROUND                     sa   .   . NULL LAZY WRITER      300691 0 04/10
    06:59:43                                              
     3     0   
    4     BACKGROUND                     sa   .   . NULL RESOURCE MONITOR 1207010 0 04/10 06:59:43                                              
     4     0   
    5     BACKGROUND                     sa   .   . NULL XE TIMER         38828 0 04/10
    06:59:43                                              
     5     0   
    6     BACKGROUND                     sa   .   . NULL XE DISPATCHER    1404 0 04/10
    06:59:43                                              
     6     0   
    7     BACKGROUND                     sa   .   . master SIGNAL HANDLER   0 0 04/10 06:59:43                                              
     7     0   
    8     BACKGROUND                     sa   .   . NULL LOCK MONITOR     179978 0 04/10
    06:59:43                                              
     8     0   
    9     sleeping                       sa   .   . master TASK MANAGER     0 11 04/21
    08:37:04                                              
     9     0   
    10    sleeping                       sa   .   . master TASK MANAGER     0 0 04/10
    06:59:44                                              
     10    0   
    11    BACKGROUND                     sa   .   . master TRACE QUEUE TASK 546 0 04/10 06:59:44                                              
     11    0   
    12    BACKGROUND                     sa   .   . NULL SYSTEM_HEALTH_MO 4930 0 04/10 06:59:44                                              
     12    0   
    13    BACKGROUND                     sa   .   . NULL RECEIVE          422 0 04/10
    06:59:45                                              
     13    0   
    14    BACKGROUND                     sa   .   . master CHECKPOINT       79137 31811 04/10
    06:59:46                                              
     14    0   
    15    BACKGROUND                     sa   .   . master TASK MANAGER     1606 0 04/10
    06:59:46                                              
     15    0   
    16    BACKGROUND                     sa   .   . NULL UNKNOWN TOKEN    0 0 04/10 06:59:46                                              
     16    0   
    17    sleeping                       sa   .   . master TASK MANAGER     0 74 04/21
    08:37:04                                              
     17    0   
    18    sleeping                       sa   .   . master TASK MANAGER     0 0 04/21
    08:18:49                                              
     18    0   
    19    sleeping                       sa   .   . master TASK MANAGER     0 0 04/21
    08:30:29                                              
     19    0   
    20    sleeping                       sa   .   . master TASK MANAGER     0 1 04/21
    08:37:14                                              
     20    0   
    21    sleeping                       sa   .   . master TASK MANAGER     0 7 04/21
    08:30:59                                              
     21    0   
    22    sleeping                       sa   .   . master TASK MANAGER     16 4 04/21
    08:37:44                                              
     22    0   
    23    sleeping                       sa   .   . master TASK MANAGER     0 15 04/21
    08:39:24                                              
     23    0   
    25    BACKGROUND                     sa   .   . master BRKR EVENT HNDLR 0 95 04/10 06:59:48                                              
     25    0   
    30    BACKGROUND                     sa   .   . master BRKR TASK        0 0 04/10
    06:59:48                                              
     30    0   
    31    BACKGROUND                     sa   .   . master BRKR TASK        16926 0 04/10
    06:59:48                                              
     31    0   
    32    BACKGROUND                     sa   .   . master BRKR TASK        0 0 04/10
    06:59:48                                              
     32    0   
    34    BACKGROUND                     sa   .   . master BRKR TASK        10701 0 04/10
    06:59:48                                              
     34    0   
    51    sleeping                       edit_user INFADEVFS2      . dsa AWAITING COMMAND 0 0 04/21
    03:16:56                                              
     51    0   
    52    sleeping                       reports_adm REPORTSDEVSI2   . JBOSS_Cluster_CRServer2011 AWAITING COMMAND 0 0 04/21
    08:52:12 jTDS                                         
     52    0   
    53    sleeping                       NT AUTHORITY\SYSTEM SQLDEV2012      . msdb AWAITING COMMAND 0 0 04/10
    06:59:58 SQLAgent - Email Logger                        53    0   
    54    sleeping                       AMERICAS\CTXDEVDCSI1$ CTXDEVDCSI1     . CitrixXDFarm1 AWAITING COMMAND 0 0 04/21
    08:58:51 Citrix:Broker#1                                54    0   
    55    sleeping                       edit_user ASDEV1          . dsa AWAITING
    COMMAND 0 0 04/21 08:55:27 jTDS                                         
     55    0   
    56    sleeping                       reports_adm REPORTSDEVSI2   . JBOSS_Cluster_CRServer2011 AWAITING COMMAND 0 0 04/21
    08:52:12 jTDS                                         
     56    0   
    57    sleeping                       reports_adm REPORTSDEVSI2   . JBOSS_Cluster_CRServer2011 AWAITING COMMAND 0 0 04/21
    08:52:12 jTDS                                         
     57    0   
    58    sleeping                       reports_adm REPORTSDEVSI2   . JBOSS_Cluster_CRServer2011 AWAITING COMMAND 0 0 04/21
    08:52:12 jTDS                                         
     58    0   
    59    sleeping                       NT AUTHORITY\SYSTEM SQLDEV2012      . msdb AWAITING COMMAND 124 242 04/10
    06:59:59 SQLAgent - Generic Refresher                   59    0   
    60    sleeping                       NT AUTHORITY\SYSTEM SQLDEV2012      . msdb AWAITING COMMAND 2790 1160 04/21
    08:55:00 SQLAgent - Job invocation engine               60    0   
    61    sleeping                       reports_adm REPORTSDEVSI2   . JBOSS_Cluster_CRServer2011 AWAITING COMMAND 0 0 04/21
    08:52:12 jTDS                                         
     61    0   
    62    sleeping                       reports_adm REPORTSDEVSI2   . JBOSS_Cluster_CRServer2011 AWAITING COMMAND 0 0 04/21
    08:52:12 jTDS                                         
     62    0   
    63    sleeping                       reports_adm REPORTSDEVSI2   . JBOSS_Cluster_CRServer2011 AWAITING COMMAND 0 0 04/21
    08:52:12 jTDS                                         
     63    0   
    64    sleeping                       reports_adm REPORTSDEVSI2   . JBOSS_Cluster_CRServer2011 AWAITING COMMAND 0 0 04/21
    08:52:12 jTDS                                         
     64    0   
    65    sleeping                       reports_adm REPORTSDEVSI2   . JBOSS_Cluster_CRServer2011 AWAITING COMMAND 0 0 04/21
    08:52:12 jTDS                                         
     65    0   
    66    sleeping                       edit_user INFADEVFS2      . dsa AWAITING COMMAND 0 0 04/21
    03:16:56                                              
     66    0   
    67    sleeping                       reports_adm REPORTSDEVSI2   . JBOSS_Cluster_CRServer2011 AWAITING COMMAND 0 0 04/21
    08:52:12 jTDS                                         
     67    0   
    68    sleeping                       edit_user DCMA10685       . dsa AWAITING COMMAND 0 0 04/21
    08:56:47 jTDS                                         
     68    0   
    69    sleeping                       AMERICAS\CTXDEVDCSI1$ CTXDEVDCSI1     . CitrixXDFarm1 AWAITING COMMAND 0 0 04/21
    08:58:49 Citrix:Configuration                           69    0   
    70    sleeping                       rvanveen DCMA8460        . master AWAITING COMMAND 1794 7120 04/21
    08:51:37 Microsoft SQL Server Management Studio         70    0   
    71    sleeping                       xsp_user XSPDEVSI2       . xspv5 AWAITING COMMAND 0 0 04/21
    08:58:52 .Net SqlClient Data Provider                   71    0   
    72    sleeping                       AMERICAS\CTXDEVDCSI1$ CTXDEVDCSI1     . CitrixXDFarm1 AWAITING COMMAND 0 0 04/21
    08:56:01 Citrix:Monitor                                 72    0   
    73    sleeping                       AMERICAS\CTXDEVDCSI1$ CTXDEVDCSI1     . CitrixXDFarm1 AWAITING COMMAND 0 0 04/21
    08:58:30 Citrix:Monitor                                 73    0   
    74    sleeping                       rvanveen DCMA8460        . master AWAITING COMMAND 16 2 04/21
    08:53:37 Microsoft SQL Server Management Studio - Query 74    0   
    75    sleeping                       rvanveen DCMA8460        . loginaudit AWAITING COMMAND 0 22 04/21
    08:50:29 Microsoft SQL Server Management Studio - Query 75    0   
    76    sleeping                       edit_user INFADEVFS2      . dsa AWAITING COMMAND 0 0 04/21
    07:05:07                                              
     76    0   
    77    sleeping                       adm_jbossportal ASDEV1          . jbossportal AWAITING
    COMMAND 0 0 04/21 08:40:27 jTDS                                         
     77    0   
    78    sleeping                       rvanveen DCMA8460        . master AWAITING COMMAND 110 542 04/21
    08:46:17 Microsoft SQL Server Management Studio - Query 78    0   
    79    sleeping                       edit_user INFADEVFS2      . dsa AWAITING COMMAND 0 0 04/21
    07:05:56                                              
     79    0   
    80    sleeping                       AMERICAS\CTXDEVDCSI1$ CTXDEVDCSI1     . CitrixXDFarm1 AWAITING COMMAND 0 0 04/21
    08:58:54 Citrix:MachineCreation                         80    0   
    81    sleeping                       edit_user INFADEVFS2      . dsa AWAITING COMMAND 0 0 04/21
    08:08:29                                              
     81    0   
    82    sleeping                       edit_user INFADEVFS2      . dsa AWAITING COMMAND 0 0 04/21
    07:02:13                                              
     82    0   
    83    sleeping                       edit_user INFADEVFS2      . dsa AWAITING COMMAND 0 0 04/21
    07:02:15                                              
     83    0   
    84    sleeping                       AMERICAS\CTXDEVDCSI1$ CTXDEVDCSI1     . CitrixXDFarm1 AWAITING COMMAND 0 0 04/21
    08:58:44 Citrix:Monitor                                 84    0   
    85    sleeping                       edit_user INFADEVFS2      . dsa AWAITING COMMAND 0 0 04/21
    07:11:05                                              
     85    0   
    86    sleeping                       AMERICAS\CTXDEVDCSI1$ CTXDEVDCSI1     . CitrixXDFarm1 AWAITING COMMAND 0 0 04/21
    08:58:53 Citrix:AdIdentity                              86    0   
    87    sleeping                       DAIWA_USA\admsql SQLDEV2012      . master AWAITING COMMAND 15 2 04/21
    08:56:20 Microsoft SQL Server Management Studio - Query 87    0   
    88    sleeping                       AMERICAS\CTXDEVDCSI1$ CTXDEVDCSI1     . CitrixXDFarm1 AWAITING COMMAND 0 0 04/21
    08:58:36 Citrix:SiteServices                            88    0   
    89    sleeping                       AMERICAS\CTXDEVDCSI1$ CTXDEVDCSI1     . CitrixXDFarm1 AWAITING COMMAND 0 0 04/21
    08:58:42 Citrix:Host                                    89    0   
    90    sleeping                       AMERICAS\CTXDEVDCSI1$ CTXDEVDCSI1     . CitrixXDFarm1 AWAITING COMMAND 0 0 04/21
    08:58:47 Citrix:ConfigurationLogging                    90    0   
    91    RUNNABLE                       rvanveen DCMA8460        . master SELECT INTO    
     15 51 04/21 08:58:46 Microsoft SQL Server Management Studio - Query 91    0   
    92    sleeping                       rvanveen DCMA8460        . master AWAITING COMMAND 63 30 04/21
    08:52:34 Microsoft SQL Server Management Studio - Query 92    0   
    94    sleeping                       AMERICAS\CTXDEVDCSI1$ CTXDEVDCSI1     . CitrixXDFarm1 AWAITING COMMAND 0 0 04/21
    08:58:53 Citrix:DelegatedAdmin                          94    0   
    95    sleeping                       DAIWA_USA\admsql SQLDEV2012      . loginaudit AWAITING COMMAND 173 27 04/21
    08:56:10 Microsoft SQL Server Management Studio         95    0   
    96    sleeping                       xsp_user XSPDEVSI2       . xspv5 AWAITING COMMAND 0 0 04/21
    08:58:33 .Net SqlClient Data Provider                   96    0   
    97    sleeping                       edit_user INFADEVFS2      . dsa AWAITING COMMAND 0 0 04/21
    08:10:07                                              
     97    0   
    98    sleeping                       edit_user INFADEVFS2      . dsa AWAITING COMMAND 31 38 04/21
    08:00:31                                              
     98    0   
    99    sleeping                       edit_user INFADEVFS2      . dsa AWAITING COMMAND 0 0 04/21
    08:10:12                                              
     99    0   
    100   sleeping                       edit_user INFADEVFS2      . dsa AWAITING COMMAND 0 282 04/21
    08:10:14                                              
     100   0   
    101   sleeping                       DAIWA_USA\admsql SQLDEV2012      . master AWAITING COMMAND 0 8 04/21
    08:56:50 Microsoft SQL Server Management Studio         101   0   
    102   sleeping                       DAIWA_USA\admsql SQLDEV2012      . master AWAITING COMMAND 31 0 04/21
    08:54:57 Microsoft SQL Server Management Studio         102   0   
    103   sleeping                       read_user SQLDEV2012      . master AWAITING COMMAND 0 8 04/21
    08:57:09 Microsoft SQL Server Management Studio         103   0   
    104   sleeping                       read_user SQLDEV2012      . dsa AWAITING COMMAND 0 0 04/21
    08:57:09 Microsoft SQL Server Management Studio         104   0   
    105   sleeping                       rvanveen DCMA8460        . tempdb AWAITING COMMAND 8875 336 04/21
    08:58:54 Microsoft SQL Server Management Studio         105   0   
    106   sleeping                       read_user SQLDEV2012      . master AWAITING COMMAND 16 0 04/21
    08:57:39 Microsoft SQL Server Management Studio         106   0   
    107   sleeping                       AMERICAS\CTXDEVDCSI1$ CTXDEVDCSI1     . CitrixXDFarm1 AWAITING COMMAND 0 0 04/21
    08:58:47 Citrix:EnvTest                                 107   0   
    108   sleeping                       edit_user INFADEVFS2      . dsa AWAITING COMMAND 2200 8514 04/21
    08:00:31                                              
     108   0   
    109   sleeping                       edit_user INFADEVFS2      . dsa AWAITING COMMAND 0 0 04/21
    07:05:56                                              
     109   0   
    110   sleeping                       rvanveen DCMA8460        . master AWAITING COMMAND 0 0 04/21
    08:58:48 Microsoft SQL Server Management Studio         110   0   
    113   sleeping                       Citrix_adm CTXDEVSI1       . XenApp6 AWAITING COMMAND 284 777 04/21
    08:51:33 Citrix IMA                                     113   0   
    119   sleeping                       AMERICAS\CTXDEVDCSI1$ CTXDEVDCSI1     . CitrixXDFarm1 AWAITING COMMAND 0 0 04/21
    08:58:42 Citrix:ConfigurationLoggingData                119   0   
    120   sleeping                       AMERICAS\CTXDEVDCSI1$ CTXDEVDCSI1     . CitrixXDFarm1 AWAITING COMMAND 0 0 04/21
    08:58:26 Citrix:Storefront                              120   0   
    125   sleeping                       edit_user INFADEVFS2      . dsa AWAITING COMMAND 0 0 04/16
    13:55:16                                              
     125   0   
    126   sleeping                       edit_user INFADEVFS2      . dsa AWAITING COMMAND 16 0 04/16
    11:25:30                                              
     126   0   
    131   sleeping                       echouliak DCMA10685       . master AWAITING COMMAND 139 8 04/14
    15:26:55 Microsoft SQL Server Management Studio         131   0   
    135   sleeping                       echouliak DCMA10685       . dsa AWAITING COMMAND 0 0 04/14
    15:24:52 Microsoft SQL Server Management Studio - Query 135   0   
    136   sleeping                       echouliak DCMA10685       . dsa AWAITING COMMAND 0 0 04/14
    15:00:17 Microsoft SQL Server Management Studio - Query 136   0   
    140   sleeping                       edit_user INFADEVFS2      . dsa AWAITING COMMAND 0 0 04/21
    07:05:56                                              
     140   0   
    145   sleeping                       edit_user INFADEVFS2      . dsa AWAITING COMMAND 0 0 04/21
    07:05:56                                              
     145   0   

  • Problem with Logon Trigger

    The logon trigger written by me is nt returing either program or module from the V$session table. Here is my trigger
    create or replace trigger PROGME
    after logon on database
    declare
    v_SCHEMANAME varchar2(30);
    t_program varchar2(64);
    begin
         v_SCHEMANAME := SYS_CONTEXT('USERENV','SESSION_USER');
    sys_context(''userenv'',''SESSIONID'')' into t_program;
    logon_proc;
         select MODULE
         into t_program
         from v$session where username = (select
    (sys_context('userenv','session_user')) from dual) and
    audsid= (select(sys_context('userenv','sessionid')) from dual);
         RAISE_APPLICATION_ERROR (-20000,SQLERRM || T_PROGRAM);
         IF v_SCHEMANAME = 'REPADMIN' AND upper(t_PROGRAM) like '%TO%' THEN
              RAISE_APPLICATION_ERROR (-20000,SQLERRM || T_PROGRAM);     
         END IF;
    exception
    when others then
         RAISE_APPLICATION_ERROR (-20000,SQLERRM || v_PROGRAM);
    end PROGME;
    Thanks in advance
    Raghu

    Even tried rewriting like this
    create or replace trigger PROGME
    after logon on database
    declare
    v_SCHEMANAME varchar2(30);
    v_USERNAME varchar2(30);
    v_PROGRAM varchar2(30);
    v_SESSION NUMBER;
    v_SERIALNO NUMBER;
    V_ssql varchar2(100);
    v_count number;
    t_program varchar2(64);
    begin
         select program
         into t_program
         from v$session where username = (select
    (sys_context('userenv','session_user')) from dual) and
    audsid= (select(sys_context('userenv','sessionid')) from dual);
         RAISE_APPLICATION_ERROR (-20000,SQLERRM || T_PROGRAM);
         IF v_SCHEMANAME = 'REPADMIN' AND upper(t_PROGRAM) like '%TOAD%' THEN
              RAISE_APPLICATION_ERROR (-20000,SQLERRM || T_PROGRAM);     
         END IF;
    exception
    when others then
         RAISE_APPLICATION_ERROR (-20000,SQLERRM || v_PROGRAM);
    end trg_no_TOAD_logon;

  • Not able to connect to database using toad

    we have a 11.1.0.7 database on solaris machine.
    when the development team tries to connect to it using toad, it gives them ORA-01017: invalid username/password error.
    We are using TNS entries to connect. From the same client machine, we are able to connect using SQLPLUS and SQL Developer using the same TNS entry. However, its not working on TOAD.
    Toad Version is 9.0.1. Any help is much appreciated.
    Thanks.

    Hi Muneer,
    My answer is arriving to this forum late, but I'll tell you what is happening to benefit others who have this issue. Older versions of Toad convert the case of the password to upper case when they attempt to authenticate to Oracle. Versions of Oracle prior to 11G had case insensitive passwords so it did not matter. But when 11G came out with it's case sensitive passwords, Toad could no longer authenticate. You can test this yourself by modifying the password for your Oracle account (usnig sqlplus) so that the password is completely upper case.....Toad will suddenly be able to authenticate.
    You will find that sqlplus and SQL Developer don't have a problem. That is because they don't convert the password to upper case, they just leave it as it is. I don't know why older versions of Toad convert the password to upper case, but that is what they do. Newer versions of Toad fix the issue. I believe that Toad versions 9.5 and later should work. I've also read, however, that 9.5 had issues with Oracle 11G client libraries so you might just want to upgrade to the latest/greatest version of Toad.

  • Remote connection to a database using TOAD, but without Oracle db on PC

    I want to connect to a remote database using TOAD from my PC but without having to install Oracle database on my PC.
    Is it possible?
    If yes, where do I enter the database IP address & port number?
    I am using TOAD Freeware version 8.5.0.50g
    (I want to achieve the exact thing with TOAD as it can be done with "OraCmd" program.)

    How did you create your tns entry? Manually or via netca?
    If netca is not used, I would recommend to delete the old tns entry from tnsnames.ora file manually and add the same entry back via netca utility.
    PartA.
    1) Make sure listener is up (for example on the server 192.168.0.33 you are trying to connect) before you start netca. Most probably it is on 1521 port unless you changed it.
    Assuming your server on *NIX:
    $ ps -ef |grep lsnr
    the above command will give you all the listeners which are up and running.
    If listener is not up, bring it up.
    $ lsnrctl start listener
    the above command will start listener called "LISTENER" on default port 1521. Ignore this if the listener is already up.
    PartB
    Assuming your client machine is on Windows,
    1) start --> run --> cmd --> netca
    2) You will see "Oracle Net Configuaration Assistant: Welcome" window. --> next
    3) Pick the 3rd radio button "Local Net Service Name Configuartion" --> next
    4) Pick the "ADD" button. --> next
    5) Provide the service name. (It is usually database name). Assuming my database name is FCMAT, I will give FCMAT --> next
    6) Pick "TCP" --> next
    6) Instead of the hostname, add the ip address of the host (for example 192.168.0.33 and
    "Use the standard port of 1521"--> next
    7) "Yes, perform a test" (this is why you have to have the listener up to test it) -->next
    8) It will fail as it doesn't have any password. Click on "Change Login" and provide the SYSTEM password and click "OK". If listener is up on the server and password is right and there are no connectivity issues going on, test will SUCCEED. --> next
    9) Here you will provide Net Service Name. You can give whatever you like to give here but usually giving instance name will help. AGain, I will give FCMAT. -->
    10) Click "NO" to configure another net service name. --> next
    11) click "Finish"
    The above steps will create a tnsnames.ora entry similar to this.
    FCMAT =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.33)(PORT = 1521))
    (CONNECT_DATA =
    (SERVICE_NAME = fcmat)
    Part3
    1) start your sqlplus utility
    2) provide username system
    3) provide password
    4) provide FCMAT in host string.
    and you should be able to connect via sqlplus and TOAD.
    If you are still getting the error, please provide us the exact error.
    --Moid M
    P.S. tnsnames.ora / listener.ora / sqlnet.ora can be found $ORACLE_HOME/network/admin directory.

  • Basic query on PLSQL using TOAD

    hi all,
    First of all thanks a lot to everyone for always helping and guiding me through all the doubts i had asked here.I have leasrned a lot and appreciate your help.
    So,my question is
    executing the STORED PROCEDURE in Toad 9.0
    execute assign_daily_plan('547615',null,null,'plan67063974107')
    I am getting an error showing LINE NO. and ISSUE  displayed.Now,when i cancel this ...it closes the window and execution over.
    I am not at all able to debug any more in this case.where can i see the values getting printed out in the program and the values for the dbms.output lines.
    I need to see all the inter-midate values during the run of the program till it gets the ERROR,possibly with BREAKPOINTS but...i am not able to do.Please help me
    I use toad 9.0 to connect to Oracle 10g Database
    * The stored procedure has dbms.output_lines for PRINT the flow of the program as well printing each variable data out during run time.
    *Also,set SERVEROUT ON is at the start of the editor as well as I used all the buttons like "STEP OVER","STEP INTO","TRACE" as well SQLPLUS too                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Hello,
    First this procedure syntax ain't look right but you might be giving an example. (Here I am using TOAD 9.5).
    You should following as is and create procedure and then execute as a script in TOAD and check in output and see if it's priniting it or not and post output if didn't work for you.
    CREATE OR REPLACE PROCEDURE myprocedure
    AS
    BEGIN
       DBMS_OUTPUT.put_line ('HELLO I AM TESTING');
    END;pl/sql block using sqlplus
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Production
    With the Partitioning, Oracle Label Security, OLAP and Data Mining Scoring Engine options
    SQL> set serveroutput on;
    SQL> BEGIN
      2    KLONDIKE.MYPROCEDURE;
      3    COMMIT;
      4  END;
      5  /
    HELLO I AM TESTING
    PL/SQL procedure successfully completed.Runing as script from TOAD
    set serveroutput on;
    DECLARE
    BEGIN
       MYPROCEDURE;
    END;
    HELLO I AM TESTING
    PL/SQL procedure successfully completed.Regards
    Edited by: OrionNet on Mar 14, 2009 6:52 PM

  • COMPARE DATABASE SCHEMA WITHOUT USING TOAD

    Hi all,
    I have always used toad to compare database schema ....
    Does anyone know about any other way to go about comaparing schema?
    e.g script etc.....

    There are many different ways of doing this, depending on how detailed you want to get and what is relevant to you.
    The first place to start is the "Oracle Reference" manual which describes the various DBA_ views. You can build up your won comparison routine fairly easily simply by running differences. Using SQLPlus, you could go down the road of
    Prompt Objects missing in &2 that are in &1
    SELECT object_type, object_name
    FROM DBA_OBJECTS
    WHERE OWNER=&1
    MINUS
    SELECT object_type, object_name
    FROM DBA_OBJECTS
    WHERE OWNER=&2
    Prompt Objects missing in &1 that are in &2
    SELECT object_type, object_name
    FROM DBA_OBJECTS
    WHERE OWNER=&1
    MINUS
    SELECT object_type, object_name
    FROM DBA_OBJECTS
    WHERE OWNER=&2
    etc.
    This has the advantage of allowing you complete control over what you see (as compared to giving that control to some other developer, such as the Toad Team). There are some disadvantages, including:
    you need to understand what you want and why;
    you need to be familiar with the documentation and the structure of the DBA_ views;
    you need to maintain the scripts
    You could always purchase Oracle's Change Management Pack add-on to Enterprise Manager or use tools like SQLDeveloper as well.

Maybe you are looking for

  • Trouble networking iBook G4 to Windows XP PC

    I'm a little ignorant on the subject of networking, but I've been trying/struggling to network (via a single cross-over Ethernet cable) my iBook G4 with my Windows XP desktop PC. Both computers tell me that the network connection is there, but I can'

  • Cost to repair ipod touch screen

    My iPod touch screen cracked a few months ago and has worked fine ever since, but now part of my screen has been cut off (the left side is blurred out). Now my screen won't respond to anyone's touch and can no longer be used. What's the cost to get i

  • Ref query / Reports 3.0

    Hi everybody, I want to create a ref cursor query question in Reports 3.0 and fetch the results to a variable. Then I want to call another ref query question and send my variable to it as a parameter. (select * from table_b where my_variable.field_a

  • Expand all and collapse all functionality in adf accordion

    Hi I need to implement a functionality where in there are two links "Expand All" and "Collapse All" on clicking these links the accordion should behave accordingly. Was wondering if this feature is possible by using <af:panelAccordion> component. Or

  • Where to train for OCMJD?

    Hello friends, I am from Bangladesh and recently I have started to shift my career towards Java. I am at the final stages of preparing for OCPJP and my future plan is to take the OCMJD as well. However, in Bangladesh, I can only train for the OCPJP;