Sql Query To Find Out list of users not having a particular resource provisioned

Hi,
I know the query for all the resources tagged to user with their account status.
Can anybody help me with a query to fetch just the user details for the following scenario:
1)Active users having  having no instance of a particular resource.
Condition: Exclude Active users having one provisioned instance of the resource and fetch user details having no provisioned account for that resource .
it is just for report purposes.So format is not of concern.Just need the list of users not having a single provisioned account for a particular resource.

Hi,
Please try the below query :
select distinct usr.usr_login from USR,OIU where USR.USR_KEY not in (select OIU.USR_KEY from OIU)
and OIU.APP_INSTANCE_KEY= (select APP_INSTANCE_KEY from APP_INSTANCE where APP_INSTANCE_NAME='ADResource');
Change the app instance name acording to you need.
-Saurabh

Similar Messages

  • SQL Query to Find out User has what all resources provisioned !

    Hi Guys ,
    Does any one have a SQL query to find out what resources are provisioned to a particular user ?
    Thanks
    Suren

    Hi,
    Hope this will help you.
    SELECT distinct usr_login as "IdM User ID",
    usr_employeeID as "Employee ID",
    usr.USR_FIRST_NAME as "First Name",
    usr.USR_LAST_NAME as "Last Name",
    usr_status
    as "User Status",
    USR_EMP_TYPE as "Employee Type",
    obj.obj_name as "Application Resource",
    ost_status as "Application Resource Status",
    FROM ost,oiu,obj,usr,obi
    WHERE oiu.ost_key = ost.ost_key AND obj.obj_key = obi.obj_key AND oiu.usr_key = usr.usr_key
    AND ost_status in ('Provisioned','Revoked','Disabled', 'Provisioning')
    AND oiu.obi_key=obi.obi_key
    AND usr_EmployeeID like '11111'
    This query will provide all the resources to which the user is linked with and the resource status is in 'Provisioned','Revoked','Disabled', 'Provisioning' status for a particular employeed ID, I am not completely sure whether I have given the Employee ID column from USR table as correct or not. Verify once and query the DB

  • Query to find the list of users having access to a particular scenario

    Hi,
    I am learning Hyperion Planning 9.2 x version. I wanted to know the query to find the list of users having access to Plan Iteration - 1 scenarion.
    As I am new to Hyperion Essbase and Hyperion Planning, I am assuming these ideas work out to get the desired result.
    1) As Hyperion Planning uses Relational DB to store the User Security information, we can query the list of users who is having access to Plan Iteration - 1 Scenario.
    I am not sure if this solution works. Please correct me If I am wrong.
    2) We can also query from the essbase editor to find out who all having access to this scenario.
    If the above is correct, can you please provide me the query.
    I am really need of this and I will be happy if any one provide the solution.
    Thanks & Regards,
    Upendra. Bestha

    Hi,
    If you are looking for some SQL to retrieve the access rights by member then you can use something like (SQL Server code though can easily be modified for Oracle)
    SELECT usr.object_name as Username,mem.object_name as Member,
    'Access Rights' = CASE acc.access_mode
    WHEN -1 THEN 'None'
    WHEN 1 THEN 'Read'
    WHEN 2 THEN 'Write'
    WHEN 3 THEN 'Write'
    ELSE 'Unknown' END,
    'Relation' = CASE acc.flags
    WHEN 0 THEN 'Member'
    WHEN 5 THEN 'Children'
    WHEN 6 THEN 'Children (inclusive)'
    WHEN 8 THEN 'Descendants'
    WHEN 9 THEN 'Descendants (inclusive)'
    ELSE 'Unknown' END
    FROM
    hsp_access_control acc, hsp_object mem, hsp_object usr
    WHERE acc.object_id = mem.object_id
    AND acc.user_id = usr.object_id
    AND mem.object_name = 'Plan Iteration - 1'
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • How to find out list of users and their access on Sharepoint

    Hello Everyone
    How can i find out list of users and what access they have on SharePoint site? I want to create table with list of the users and their access?
    Thanks

    you can get the report using below powershell scripts. first one gives list of users in a site collection level.
    The second link generates the permissions reports for each user.
    http://techtrainingnotes.blogspot.com/2010/12/sharepoint-powershell-script-to-list.html
    https://sp2010userperm.codeplex.com/
    My Blog- http://www.sharepoint-journey.com|
    If a post answers your question, please click Mark As Answer on that post and Vote as Helpful

  • Query to find out list of the tables getting selected frequently

    Hi All,
    Please tell me Is there any way to find out list of the tables getting selected frquently, ( please exclude the insert+updates+deletes+truncate+drop).
    Regards

    Hi Sameer
    You can check V$SQL_PLAN to see the objects being accessed by your SQL statements. If you have diagnostic licence, you can also check DBA_HIST_SQL_PLAN
    select distinct object_owner, object_name from v$sql_plan;
    select object_name, count(*) from v$sql_plan group by object_nameRemeber, this is only a crude way of finding this information.
    Regards
    Venkat

  • SQL query to find out last login for each database

    Hi everybody,
    I have a view with following columns:
    DatabaseSid, lastLogin, firstLogin.
    I want to now the newest last_login date for every database.
    SID First Login Last Login
    e.g. Database1, 11.11.2011, 01.12.2011
    Database1, 01.04.2012, 01.05.2012
    Database3, 03.03.2004, 03.06.2005
    Database 3 07.09.2012, 12.10.2012
    How can I do a query to find out for eacht DB (DB1, DB2 and so on) the Last_Login Date?
    Thank you in advance
    Steve

    Steve wrote:
    Hi everybody,
    I have a view with following columns:
    DatabaseSid, lastLogin, firstLogin.
    I want to now the newest last_login date for every database.
    SID First Login Last Login
    e.g. Database1, 11.11.2011, 01.12.2011
    Database1, 01.04.2012, 01.05.2012
    Database3, 03.03.2004, 03.06.2005
    Database 3 07.09.2012, 12.10.2012
    How can I do a query to find out for eacht DB (DB1, DB2 and so on) the Last_Login Date?
    Thank you in advance
    SteveI'm curious as to how you collect this information from multiple databases into one database, and of what value the data is once you have it.

  • Query to find the list of BP without having Particular GL transactions.

    Hi Experts,
    I want the query to find the List of Business partner who is not having Journal entry for Certain General ledger.
    Scenario: we are creating JE for TDS posting.
    so, i want to know the list of BP , who and all not having particular TDS GL for the particular period.
    Thanks in advance,
    Dwarak

    Hi Dwarak,
    Sure, no problem
    DECLARE @AcctCode AS NVARCHAR(100)
    SELECT @AcctCode=T0.AcctCode FROM OACT T0 WHERE T0.AcctCode='[%0]'
    DECLARE @DateFrom AS DATETIME
    SELECT @DateFrom=T1.RefDate FROM JDT1 T1 WHERE T1.RefDate=[%1]
    DECLARE @DateTo AS DATETIME
    SELECT @DateTo=T2.RefDate FROM JDT1 T2 WHERE T2.RefDate=[%2]
    SELECT CardCode FROM OCRD WHERE CardType='S'
    AND CardCode NOT IN(
    SELECT DISTINCT ContraAct FROM JDT1
    WHERE Account=@AcctCode AND RefDate BETWEEN @DateFrom AND @DateTo)
    Ok, now, here's the problem that I just encountered. This query will work, but, no matter how we fill the parameter, it will show you the very same result. To be honest, I don't know what's wrong with this query.
    If you change all the variables ( @AcctCode and @DateFrom and @DateTo ) directly, it will give you the accurate result. Take this as an example:
    SELECT CardCode FROM OCRD WHERE CardType='S'
    AND CardCode NOT IN(
    SELECT DISTINCT ContraAct FROM JDT1
    WHERE Account='10030201' AND RefDate BETWEEN '2011-09-01' AND '2011-09-20')
    I hard-code the account code, date from and date to for selection. System will show you the accurate result, but using parameter as in first query, system show same result no matter how we fill the parameter.
    Sorry, it seems that I could only partially solved your problem here. I already tried to create a stored procedure and executing the stored procedure with parameter, but still, somehow SBO show very same result no matter if we change the parameter.
    So, my solution need user to manually change the parameter in query. I know, this is a stupid solution, I'm afraid I can't help you to achieve perfect solution here. Maybe anyone here in the forum could guide me to fix my mistake in first query and how to rectify it?
    Best Regards,
    Hendry Wijaya

  • How to find out list of users who have access to particulat SID

    HI
    How to find out the list of users who has access, to a particular SID?
    Satish.

    jurjen,
    Thanks for replying, actually i was trying to navigate and execute the report using, SUIM...
    could you help me to find out the list of users who has access to a particular system.. using SUIM.
    satish.

  • Need sql query to find out same item is used in open po and closed po

    Hi Experts,
    I have an requirement is that, i need to find out the item is used in open po and closed po.
      example: A is the item is used in closed PO and Open PO.
      i need to write down the scripts how many same items is used in open po and closed po.
    if any sql script is there please share.
    Please let us know if any concerns.
    Thanks
    bmn

    Hi
    Please try below query
    select
    distinct c.segment1
    from
    po_lines_all a,
    po_line_locations_all b,
    mtl_system_items_b c
    where
    a.po_line_id= b.po_line_id
    and a.item_id=c.inventory_item_id
    and b.closed_code='OPEN'
    and a.item_id in ( select 
    item_id
    from
    po_lines_all d,
    po_line_locations_all e,
    mtl_system_items_b f
    where
    d.po_line_id= e.po_line_id
    and d.item_id=f.inventory_item_id
    and e.closed_code in ('CLOSED','FINALLY CLOSED','CLOSED FOR INVOICE','CLOSED FOR RECEIVING'));

  • How  to find out list of users who has logged into webtools

    Hi All,
    From a database administration and monitoring traffic point of view we want to know who has logged into our web tools web site for a given period.  Is there a easy way to have this information. basically user ID , date and time are info we need. (need all users - with or without orders)
    any ideas welcome.
    Regards
    David

    Hello,
    The easiest way to accomplish this is by creating a report.
    Use the SQL query
    SELECT     UserID, LastVisitDate
    FROM         Users
    ORDER BY LastVisitDate DESC
    And a template that looks something like this:
    <html>
    <head>
    <title>%%ReportName%% - %%Today, {0:d}%%</title>
    %%StyleSheet%%
    </head>
    <body>
    <center>
    <h1>%%ReportName%%</h1>
    <table width=800 cellpadding=1 cellspacing=0 border=1>  
    <tr>
    <td><b>User ID</b></td>
    <td><b>Last Visit</b></td>
    </tr>
    <section name="uservisit">
    <tr>
    <td>%%UserID%%</td>
    <td>%%LastVisitDate%%</td>
    </tr>
    </section>
    </table>
    </center>
    </body>
    </html>

  • Sql query to find out the space issues in not able to allocate next extent

    hi,
    i have oracel 11g on linux.
    my datafiles are autoextend off. i am looking for query to make sure the segments does not stop growing by reaching the maximum segment allocated or no free contigous space available in allocating new extent,.
    i need to know periodically the owner,object_name and object type (table or index) which are suffocating for space.
    any ad-hoc sql query exists?
    thanks in advance.

    Connect as sysdba and try..
    To list all objects >100M in size.
    SQL> select owner, segment_type, segment_name, sum(bytes)/(1024*1021) from dba_segments
    group by owner, segment_type, segment_name
    having sum(bytes)/(1024*1021) > 100
    For tablespaces ..
    select tablespace_name, sum(bytes) tablespace_size
    from dba_data_files
    group by tablespace_name
    union all
    select tablespace_name, sum(bytes) tablespace_size
    from dba_temp_files
    group by tablespace_name
    order by tablespace_name

  • Need sql query to find out Joins attached with folders in Discoverer

    Hi,
    Can anyone let me know the sql query which can be used to identify the joins which are attached to the folders.
    Actually we have to identify all the joins conditions from folders those are migrated from one instance to others.
    Thanks
    abhishek

    I recommend that you implement the admin EUL supplied by oracle, you can get there a lot of repository information (metalink note: 556932.1).
    Try to use this (maybe you will need some pkg's):
    SELECT
    DECODE(KEYS.FK_MANDATORY,
    1,
    'Always exist in master folder',
    'Might not exist in master folder') "Detail Item values",
    EUL10G_US.EUL5_GET_JOIN(EXP.EXP_ID, 'N') "Join Master --> Detail",
    KEYS.KEY_DESCRIPTION JOIN_DESCRIPTION,
    KEYS.KEY_DEVELOPER_KEY JOIN_IDENTIFIER,
    KEYS.KEY_NAME JOIN_NAME,
    DECODE(SUBSTR(KEYS.KEY_NAME, 1, 19),
    'AUTO_GENERATED_NAME',
    'Yes',
    'No') "AutoGen",
    DECODE(DECODE(SUBSTR(KEYS.KEY_NAME, 1, 19),
    'AUTO_GENERATED_NAME',
    'Yes',
    'No') ,
    'Yes',
    EUL10G_US.EUL5_GET_JOIN(EXP.EXP_ID),
    KEYS.KEY_NAME) "Actual Join Name",
    KEYS.KEY_UPDATED_DATE JOIN_LAST_UPDATE,
    DECODE(KEYS.FK_ONE_TO_ONE, 1, 'One to one join', NULL) "One to One join",
    DECODE(KEYS.FK_MSTR_NO_DETAIL,
    1,
    'Outer join on detail' || CHR(10),
    NULL) "Outer Join on Detail",
    DECODE(KEYS.FK_DTL_NO_MASTER,
    1,
    'Outer join on master' || CHR(10),
    NULL) "Outer Join on Master",
    DECODE(KEYS.FK_MSTR_NO_DETAIL,
    1,
    'Outer join on detail' || CHR(10),
    NULL) || DECODE(KEYS.FK_DTL_NO_MASTER,
    1,
    'Outer join on master' || CHR(10),
    NULL) ||
    DECODE(KEYS.FK_ONE_TO_ONE, 1, 'One to one join', NULL) "Optional Join Configurations",
    OBJ.OBJ_NAME "MASTER_FOLDER",
    OBJ_DETAIL.OBJ_NAME "DETAIL_FOLDER"
    FROM EUL10G_US.EUL5_OBJS OBJ,
    EUL10G_US.EUL5_EXPRESSIONS EXP,
    EUL10G_US.EUL5_KEY_CONS KEYS,
    EUL10G_US.EUL5_OBJS OBJ_DETAIL
    WHERE ((KEYS.KEY_ID = EXP.JP_KEY_ID) AND
    (OBJ.OBJ_ID = KEYS.FK_OBJ_ID_REMOTE) AND
    (OBJ_DETAIL.OBJ_ID = keys.KEY_OBJ_ID));

  • Need sql query to find out Joins attached with folders

    Hi,
    Can anyone let me know the sql query which can be used to identify the joins which are attached to the folders.
    We dont want to see those from front end(disc admin).
    Thanks
    abhishek

    abhishek - This is the Application Express forum. I have no idea what you are asking but it may need to be directed to a different forum.
    Scott

  • Sql query to find out last update of 6 hours

    i have table emp . for Exp.
    create table emp
    (empno number(5),
    ename varchar2(20),
    last_update date );
    Now i want the all data which is update in last 6 hours

    Assuming an INDEX, WHERE Last_Update > SysDate - 6/24; is better and clearer.
    It is better because it allows INDEX use. That is because it does not manipulate the COLUMN value.
    It is clearer because it clearly states what we want, the records where Last_Update is after a value of six hours before. In the other query, we are checking for records where Last_Updated minus six hours is after current time. Personally, I find that harder to follow.
    SQL> CREATE TABLE Emp(EmpNo NUMBER(5), EName VARCHAR(20), Last_Update DATE);
    Table created.
    SQL> CREATE INDEX Emp_Last_Update ON Emp(Last_Update);
    Index created.
    SQL> INSERT INTO Emp(Empno, EName, Last_Update) SELECT 626, 'user626892', SysDate - Level FROM Dual CONNECT BY Level <= 10000;
    10000 rows created.
    SQL> exec DBMS_STATS.Gather_Schema_Stats(NULL);
    PL/SQL procedure successfully completed.
    SQL> EXPLAIN PLAN FOR SELECT * FROM Emp WHERE SysDate - Last_Update <= 6/24;
    Explained.
    SQL> SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY);
    PLAN_TABLE_OUTPUT
    Plan hash value: 3956160932
    | Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |      |   500 | 11500 |    15  (14)| 00:00:01 |
    |*  1 |  TABLE ACCESS FULL| EMP  |   500 | 11500 |    15  (14)| 00:00:01 |
    Predicate Information (identified by operation id):
       1 - filter(SYSDATE@!-"LAST_UPDATE"<=.25)
    13 rows selected.
    SQL> EXPLAIN PLAN FOR SELECT * FROM Emp WHERE Last_Update > SysDate - 6/24;
    Explained.
    SQL> SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY);
    PLAN_TABLE_OUTPUT
    Plan hash value: 38459689
    | Id  | Operation                   | Name            | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT            |                 |     1 |    23 |     3   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| EMP             |     1 |    23 |     3   (0)| 00:00:01 |
    |*  2 |   INDEX RANGE SCAN          | EMP_LAST_UPDATE |     1 |       |     2   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - access("LAST_UPDATE">SYSDATE@!-.25)
    14 rows selected.

  • SQL Query to find out similar names in two tables

    Hi,
    I want to write a query which will return the records by matching the two table with the similar name.
    that is I have two tables table1 and table2, and in table1 the column1 is having data like
    ABC INC
    The international Company
    and in the table2 has the column1 which has the data like
    ABC Corp
    The Financials Corporation
    So as per the requirement now my select query should return 1 row as ABC INC and ABC Corp are similer.
    and both the tables have around 50,000 reords so I cannot just take the first word by using substring and tryto match both, this will work only for names like ABC INC and ABC Corp but it will not return the names like
    "Instruments International Company" and "International Instruments Company"
    Please can any one help me?
    Regards,
    Chanda

    I don't have access to text here so I can't check.Almost. Better to use OR than AND:
    SQL> CREATE TABLE t (ID INTEGER, text VARCHAR2(2000))
      2  /
    Table created.
    SQL> INSERT INTO t
      2       VALUES (1, 'The international Company')
      3  /
    1 row created.
    SQL> INSERT INTO t
      2       VALUES (2, 'ABC INC')
      3  /
    1 row created.
    SQL> CREATE INDEX t_txt_idx ON t
      2  (text)
      3  INDEXTYPE IS ctxsys.CONTEXT
      4  /
    Index created.
    SQL> SELECT *
      2    FROM t
      3   WHERE contains (text,
      4                   REPLACE ('International Instruments Company', ' ', ' & ')
      5                  ) > 0
      6  /
    no rows selected
    SQL> SELECT *
      2    FROM t
      3   WHERE contains (text,
      4                   REPLACE ('International Instruments Company', ' ', ' | ')
      5                  ) > 0
      6  /
    ID TEXT
      1 The international Company
    BUT than also :(
    SQL> SELECT *
      2    FROM t
      3   WHERE contains (text,
      4                   REPLACE ('Company Instruments', ' ', ' | ')
      5                  ) > 0
      6  /
    ID TEXT
      1 The international Company

Maybe you are looking for