Want to get the list users with select access to v$ synonyms and v$ views

I've to write a sql (DB 11.1) to get the list of users who has select access to v$ synonym and v$ views. I've written the following sqls to do this but they both return the same result and I don't know how to verify it. It will be a great help if you could validate the sqls and let me know if something is wrong. Thanks for the help.
-- v$ views
select 'vview',
substr(SYS_CONNECT_BY_PATH(c, '->'),3,512) path, c
from (select null p, view_name c
from dba_views
where view_name like ('V$%')
union all
select -- users/roles and roles granted
granted_role p,
grantee c
from dba_role_privs
where granted_role != 'DBA'
union all
select -- users/roles with select on DBA views
table_name p, grantee c
from dba_tab_privs
where privilege = 'SELECT'
and table_name like ('V$%'))
where (c = 'PUBLIC' OR c in (select username from dba_users))
AND c NOT IN('MDSYS','DMSYS','CTXSYS','WMSYS','ORDSYS','OLAPSYS','DBSNMP')
start with p is null connect by p = prior c
-- v$ synonyms
select 'vsynonyms',
substr(SYS_CONNECT_BY_PATH(c, '->'),3,512) path, c
from (select null p, SYNONYM_NAME c
from ALL_SYNONYMS
where table_name like ('V$%')
union all
select -- users/roles and roles granted
granted_role p,
grantee c
from dba_role_privs
where granted_role != 'DBA'
union all
select -- users/roles with select on DBA views
table_name p, grantee c
from dba_tab_privs
where privilege = 'SELECT'
and table_name like ('V$%'))
where (c = 'PUBLIC' OR c in (select username from dba_users))
AND c NOT IN('MDSYS','DMSYS','CTXSYS','WMSYS','ORDSYS','OLAPSYS','DBSNMP')
start with p is null connect by p = prior c

I've modified the sql to include GV$ and all select [any] privs.
select 'vview',
substr(SYS_CONNECT_BY_PATH(c, '->'),3,512) path, c
from (select null p, view_name c
from dba_views
where view_name like ('V$%') OR view_name like ('GV$%')
union all
select -- users/roles and roles granted
granted_role p,
grantee c
from dba_role_privs
where granted_role != 'DBA'
union all
select -- users/roles with select on DBA views
table_name p, grantee c
from dba_tab_privs
where privilege like 'SELECT%'
and table_name like ('V$%') OR table_name like ('GV$%') )
where (c = 'PUBLIC' OR c in (select username from dba_users))
AND c NOT IN('MDSYS','DMSYS','CTXSYS','WMSYS','ORDSYS','OLAPSYS','DBSNMP')
start with p is null connect by p = prior c
union
select 'vsynonyms',
substr(SYS_CONNECT_BY_PATH(c, '->'),3,512) path, c
from (select null p, SYNONYM_NAME c
from ALL_SYNONYMS
where table_name like ('V$%') OR table_name like ('GV$%')
union all
select -- users/roles and roles granted
granted_role p,
grantee c
from dba_role_privs
where granted_role != 'DBA'
union all
select -- users/roles with select on DBA views
table_name p, grantee c
from dba_tab_privs
where privilege like 'SELECT%'
and table_name like ('V$%') OR table_name like ('GV$%') )
where (c = 'PUBLIC' OR c in (select username from dba_users))
AND c NOT IN('MDSYS','DMSYS','CTXSYS','WMSYS','ORDSYS','OLAPSYS','DBSNMP')
start with p is null connect by p = prior c

Similar Messages

  • How to get the list of site collections in wss 2.0 and wss 3.0

    Hi,
    How to get the list of site collections in wss 2.0 and wss 3.0
    Please provide related articles to me
    Thanks in advance

    Use 11 for wss 2.0 and 12 for wss 3.0
    Go to :\Program Files\Common Files\Microsoft Shared\web server extensions\11\BIN\”
    stsadm.exe -o enumsites -url <root url>
    to get the list  of site collections and 
    stsadm.exe -o enumsubwebs -url <root url>
    to get the list of sub sites.
    http://support.microsoft.com/kb/832807
    http://ServerName/_layouts/1033/Siteusrs.aspx to manage permissions

  • From JCO calling BAPI and want to get the list

    Friends,
            Using JCO i connected to SAP server and want the list of profitcenter and all creditors.
    For Creditors    : BAPI_CREDITOR_GETDETAIL
    For Profit center: BAPI_PROFITCENTER_GETLIST
    I am using both the bapi's but i am not getting the list of it. Basically this two bapi will return table so..will u pls. help me out to solve this problem.
    Thanks
    Hitz

    Hi,
    probably you work wiht wrong data (if is something wrong with connection to SAP, some exception will erased).
    First connect to SAP with SAP gui, go to transaction se37 and try run BAPI_CREDITOR_GETDETAIL. That is a test do you work wiht correct data (in BAPI_CREDITOR_GETDETAIL creditorid is mandatory).
    Other you can do is: get bapi's return table (also export table) and read message.

  • How to get the list (vector) of selected channels from the portal

    Hi,
    I try to retrieve the selected channels from the portal to use them in my script. I use "DataCheckChnls". Is it possible to convert it to a vector, to use it after in in for next structure.
    I would like to do specific calculus for each selected channel. Must I use another method ?
    Thank's in advance.

    Hello!
    Sorry, I trusted the DIAdem help and did not testetd it. But I'm not completly wrong
    What you get is an array of strings containing the channel name. In standard use these names are unique and could be transfered to a channel numbers with the CNo command. Try this code to understand this:
    Option Explicit
    Dim aoChannels
    Dim oChannel
    aoChannels = ChnStrToChnList(DataCheckChnls)
    For Each oChannel In aoChannels
    MsgBox CNo(oChannel)
    Next
    If you realy need the numbers as array you can build a function to do this based on this code:
    Option Explicit
    Dim i
    Dim aoChannels
    Dim anChannels
    aoChannels = ChnStrToChnList(DataCheckChnls)
    ReDim anChannels(UBound(aoChannels))
    For i=0 To UBound(aoChannels)
    anChannels = CNo(aoChannels(i))
    Next
    Matthias
    Matthias Alleweldt
    Project Engineer / Projektingenieur
    Twigeater?  

  • How get the best performances with a McBook Pro 2,3GHz and 16 Go of Ram ?

    Hi,
    I've recently bought a MacBook Pro and I want to optimize my After Effects preferences to enjoy the best performances.
    There's the specifications from Apple:
    2.3GHz quad-core Intel Core i7
    Turbo Boost up to 3.5GHz
    16GB 1600MHz memory
    512GB PCIe-based flash storage
    Intel Iris Pro Graphics
    NVIDIA GeForce GT 750M
    with 2GB GDDR5 memory
    Thanks in advance if one of you could help me to do this
    Maurice

    Optimizing for performance: Adobe Premiere Pro and After Effects | After Effects region of interest

  • Query to get objects list for which the current user has 'SELECT' privilege

    Hi,
    I want to get tables and views list for which the current user has 'SELECT' privilege excluding sytem tables and views. The privilege information for the current user is scattered in more than one system views. I have following system views
    USER_TAB_PRIVS_RECD - Object grants for which the current user is the grantee
    ROLE_TAB_PRIVS - describes table privileges granted to roles. Information is provided only about roles to which the user has access.
    If the object privilege is granted explicitly like "GRANT ALL ON TABLE_NAME TO "USERNAME" then this privilege entry goes to USER_TAB_PRIVIS_RECD
    If the object privilege is granted by ROLE. Role is created with certain object privileges. this role is assigned to user "GRANT ROLE_NAME TO "USERNAME"", then this entry goes to ROLE_TAB_PRIVS
    From these findings, I have composed below query
    (SELECT DISTINCT TABLE_NAME FROM USER_TAB_PRIVS_RECD) UNION (SELECT DISTINCT TABLE_NAME FROM ROLE_TAB_PRIVS WHERE PRIVILEGE = 'SELECT')
    Have I got user's all prvilege details? should I look some other system views?
    How to exclude system table privileges details?
    (SELECT DISTINCT TABLE_NAME FROM USER_TAB_PRIVS_RECD) UNION (SELECT DISTINCT TABLE_NAME FROM ROLE_TAB_PRIVS WHERE PRIVILEGE = 'SELECT' AND OWNER NOT IN ('SYS','SYSTEM') Is this right?
    What about Public role in Oracle? Should I consider public role here?
    Oracel Version :11g
    I want make this query to work on Oracle 8i or above version
    Thanks

    >
    I want to get tables and views list for which the current user has 'SELECT' privilege excluding sytem tables and views.
    >
    You will need a hierarchical query to do that.
    Try this script for Listing privileges recursively for Oracle users
    http://www.adp-gmbh.ch/ora/misc/recursively_list_privilege.html

  • How to get the list of IDM users in a workflow.

    Hi,
    I wanted to get the list of IDM users in a workflow into a list.Now I tried to use getObjects Method,I do not have the display session here,I passed the workflow context or WF_Context.But it is giving exception like context null .
    I used the same method in a form and it worked.How can I get the list of users in a workflow.It is for customizing reports.
    Thanks and Regards,
    Pandu
    Any Idea on how to customize reports including attributes from resources and auditing attributes etc.Any help would be really great.
    Thank you.

    Hi John,
    I get this exception WorkItemForm: no id.
    This comes when I click on the other column.I generate the data needed in a report and display it as a sorting table when I get the data.
    I want to give the user ability to sort data by different columns.But when I click any column I get the exception
    WorkItemForm: no id
    How can I save a workitem on a manual form before invoking it from a manual action.
    Here is the code snippet
    <Field name='tblUsers'>
            <Display class='SortingTable'>
              <Property name='selectEnable' value='false'/>
              <Property name='align' value='left'/>
              <Property name='linkEnable' value='false'/>
              <Property name='sortEnable' value='true'/>
              <Property name='width' value='400'/>
              <Property name='columns'>
                <List>
                  <String>Account id</String>
                  <String>First Name</String>                      
                </List>
              </Property>
            </Display>      
            <FieldLoop for='row' in='_searchList[*]'>
              <Field name='enduserId'>
                <Display class='Label'>
                  <Property name='value'>
                    <block trace='true'>
                      <invoke name='getAccountId'>
                        <ref>row</ref>
                      </invoke>
                    </block>
                  </Property>
                </Display>
              </Field>
              <Field name='lblfirstname'>
                <Display class='Label'>
                  <Property name='value'>
                    <invoke name='getAttribute'>
                      <ref>row</ref>
                      <s>firstname</s>
                    </invoke>
                  </Property>
                </Display>
              </Field>
         <FieldLoop>      I think I may need to save some workItem,That is why this may be giving the error.How can I correct this.
    Thanks,
    pandu

  • How to get the list of all running process in java

    hi all,
    i want to get the list of all running processes on my system. please let me know if it is possible to do with JAVA. which class i should use?
    waiting for reply
    bye

    Wrong forum. Just a hint.

  • How to get the list of imported Requests in client

    Hi All,
    We have two clients in Qas server , 300 and 400, i want to get the list of change requested in only in client 300 but not in 400.
    Please assist.
    Regards,
    SM

    Hi Shine
    Simply use transaction se01 then click display button, it will show all transport request in hierarchcally with differebt clients in the server.
    You can use one more t code scc3 to view all transport request
    Regards
    Vinay Paul

  • How to get the online user  who are browse some view?

    i want to get the current users who are browsing some view in EP6.additonal:which is developed as web dynpro project.

    Hi,
    Per my knowledge, we cannot get the SharePoint user context available in custom federated search connector with other methods.
    Here is a similar thread for your reference:
    https://answers.atlassian.com/questions/263735/atlassian-sharepoint-connector-federated-search-authentication-and-authorization
    Thanks,
    Linda Li                
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Linda Li
    TechNet Community Support

  • Get the connected users count from sql server using powershell

    Hi,
    I am working on SharePoint 2013,I am having SQL server 2012.
    I want to get the Connected Users count from  sql server using power shell.
    Can any one please let me know how to implement.
    Thanks in advance.
    Regards,
    Phani Kumar R

    Sorry Tom, I dont like to hear "There is no way" :-(
    There is always a way in computer to get what you need (at least it is good as Rule of thumb). I am not sure we will find it here (in a voluntary supporting forum).
    Now we (or better the architect of their system) should think of the way :-)
    Of course doing so in the forum, while we do know the system and only got a glimpse on what is needed, is not the best idea. I will point some issues which can be related to a solution. Those are not a solotions as it is but something we can use for a solution
    once something look in the right way.
    * A web connects counter is one of the easier thing to do. The basic idea is just to use the connect event and the disconnect event an adding 1 or removing 1 from the counter. This is best to do in the application using static variable as any way the second
    the application is down the counter can be go to hell as we know there is no one connect (there for a counter do not use database usually). Using a web dot-net (or asp 3) application this is done most of the time using the global.asa/global.asax file, which
    include the application and session events. for example using the method Session_Start
    protected void Session_Start(object sender, EventArgs e) {
    // Code that runs when a new session is started
    * IIS have a build-in loging system where we can log each and every request/response or only logins users. There is lot we can do with this log files including data mining. Using small bulk insert script we can use the SQL agent to insert those logs to the
    database and get the information we need.
    * any web developer i want to believe know about the Fiddler application which we use to monitor traffic. A proxy is not the only way to to monitor traffic (it is not good for our case as this is in the client side), there are several option in the server
    side.
    * SQL trigger on logon can be use to get information on who is loging on and can be logging only specific source (like our sharepoint IP or any sharepoint application). This information (what is the application which connect to the server can be retrive
    in several solution without using a trigger as well)
    *** (I'll be brief ... I'm getting bored... probably the reader feel the same)
    * using extended events and/or profiler we can monitor any connection and save the data or just remember it in shared (static) variable (this
    blog show how to do it by the way). Again we can monitor specific application or use any filter in order to get only the sharepoint users
    .... and i can continue for several days more :-) ...
    "If there is a willing, then there's a way"
    "If you can't do it, Then someone else probably can"
    "Never say never"
    I hope this help somehow :-)
    [Personal Site] [Blog] [Facebook]

  • How to get the Current User on the UI page?

    All,
    Could you please let me know how to get the Current user on the UI input page , i need to display the current user ID when some one clicks the submit button, i want o get the current user to display in the javascript alert box.
    Edited by: 951930 on Oct 24, 2012 12:21 PM

    lucky,
    my schema has already defined for
    <user mapField="USER_ID" default="%CurrentUser"/>
    and in my UI page
    <td oraLabel="user"></td><td oraField="user" id="userId" ></td>
    and my javascript
    function showUserId () {                        
    var curUser = document.getElementById('userId').value;
    alert(curUser);
    and i have called this function on my submit button, but i am not able to get Current Logged User ID value to show in the alert nor able to show the current logged user on the UI page.
    my requirement is on custom UI page i need to show Current Logged User in one corner of the page and also need to show the same user in alert when he submits the button.
    Appreciate for the help.
    Edited by: 951930 on Oct 25, 2012 8:42 AM
    Edited by: 951930 on Oct 25, 2012 9:06 AM

  • Get the pc name with domain name and add it to my properties file using commands

    i want to get the pc name with domain name and add it to my properties file using powershell  .
    sid

    function Get-Environment{
    [environment]|Get-Member -Static -MemberType Properties |
    ForEach-Object{
    if($_.Name -ne 'StackTrace'){
    $v=[scriptblock]::Create("[environment]::$($_.Name)").Invoke()
    New-Object PsCustomObject -Property ([ordered]@{Name=$_.Name;Value=$v[0]})
    Get-Environment
    Get-Environment | Out-String | Out-File environment.txt
    ¯\_(ツ)_/¯

  • How to get the contents associated with a component.

    How to get the contents associated with a component.
    Like i have 2 buttons and i want to get the contents associated with these button without clicking them i.e without firing the event.
    By Contents i mean, whatever things we get after firing the event,we get some other window and some thing is added to the current page and so on.

    grab all the code inside the actionPerformed(ActionEvent e) method

  • How to get the ep user information data in the web dynpro?

    Hi all
      I want to create a web dynpro application on EP.I want to get the ep user information data in the web dynpro.How can I do?Thanks.

    Lin,
    Two steps to achieve this:-
    <b>Step 1:</b> Add the following code in your view Controller:-
    IWDClientUser user = WDClientUser.getCurrentUser();
    IUser objUser = user.getSAPUser();
    wdContext.currentContextElement().setXXXX(objUser.getUniqueName());
    wdContext.currentContextElement().setYYYY(objUser.getFirstName());
    wdContext.currentContextElement().setZZZZ(objUser.getLastName());
    where XXXX, YYYY , ZZZZ are the context names.
    getUniqueName : Gives Login id of Portal user.
    getFirstName : Gives First Name of the Portal user.
    getLastname : Gives Last Name of the Portal user.
    <b>Step 2 : </b>Use "Organize imports" and make sure that you have the following two libraries added in the build path of your project. You can do these by right clicking on your project name ==> Properties ==> Java Build Path ==> Libraries ==> Add External jars.
    The external jars are :
    <b>com.sap.security.api.jar
    com.sap.security.api.perm.jar</b>
    Finally rebuild your project and deploy.
    Regards,
    <b>Chintan Virani.</b>

Maybe you are looking for

  • Error in Starting soa Managed server on WEBLOGIC 11g..Windows 7

    Hi All, I have an exception coming up while starting the soa_server1 managed soa server in Weblogic Domain. I have started the Admin server but while starting the soa managed server we are getting the following error : <Jul 26, 2010 9:29:04 PM PDT> <

  • Playlist isn't showing up on iTunes?

    I created a playlist on my iPod touch but when I plug it into my computer and open up iTunes, the playlist doesn't show up under the "on my device" panel. I'm not sure if iTunes has always been like this, where it does not recognize the playlist mayb

  • Is there a way to do batch watermark within iPhoto?

    I often upload my photos to pBase using the excellent iPhoto2pBase plugin. But due to the growing issue of photo thefts on the web, I would like to watermark them first. After doing a search on this site, I found recomendations for iWatermark. It's a

  • Quicktime cannot connect to YouTube

    I am trying to share a video created in Quicktime with Youtube.  My Youtube username and password are saved both in Safari/Keychain and 1Password. I've pasted both username and password into a text file, to make sure I'm not making a typo error. When

  • Mac book pro ran out of battery during install....powercut

    Hi, I currently have my old, MacBook Pro "Core Duo" 1.67 15" Model : a1150. 2006. It's sitting dead under my bed at the moment, as last year while doing a fresh install of OS X my power went down and it ran out of battery half way through the install