Selecting multiple grants on same object

Hi,
(The following SQl will be ran on 9i, 10g and 11g database versions)
Im trying produce a list of directory grants that are the same from 2 different users (but only display the details of grants from one user)
to clarify....
lets say we have 100 directories, and 2 users that have granted permissions on them, User A and User B.
Permissions can be granted on a directory by just user A, just user B or the same permission granted on the same directory by users A and B.
I want to produce a list that shows details of directories where user A and user B have granted the same permission (but in the list only display details of user A's grants)
so the following SQL will give me all directory permissions granted by user A
select p.table_name,p.grantee,p.owner,p.grantor,p.privilege, o.object_type
     from dba_tab_privs p
     inner join dba_objects o
     on o.object_name = p.table_name
     where o.object_type = 'DIRECTORY'
     and p.grantor = 'USERA';
so i want to produce the same list of grants by just USERA but only if those directories have also been granted the same permission by USERB
any ideas of the easiest way to do this?
Thanks

Not sure what you mean:
SQL> create user u1 identified by u1;
User created.
SQL> create user u2 identified by u2;
User created.
SQL> grant create session,create any directory to u1;
Grant succeeded.
SQL> grant create session,create any directory to u2;
Grant succeeded.
SQL> connect u1/u1
Connected.
SQL> create directory D1 as 'C:\Temp';
Directory created.
SQL> grant read on directory d1 to scott;
Grant succeeded.
SQL> grant read on directory d1 to u2 with grant option;
Grant succeeded.
SQL> connect u2/u2
Connected.
SQL> grant read on directory d1 to scott;
Grant succeeded.
SQL> connect scott
Enter password: *****
Connected.
select  p.table_name,
         p.grantee,
         p.owner,
         p.privilege,
         o.object_type
   from      dba_tab_privs p
         inner join
             dba_objects o
           on o.object_name = p.table_name
   where o.object_type = 'DIRECTORY'
   and p.grantor = 'U1'
intersect
select  p.table_name,
         p.grantee,
         p.owner,
         p.privilege,
         o.object_type
   from      dba_tab_privs p
         inner join
             dba_objects o
           on o.object_name = p.table_name
   where o.object_type = 'DIRECTORY'
   and p.grantor = 'U2'
TABLE_NAME                     GRANTEE                        OWNER
PRIVILEGE                                OBJECT_TYPE
D1                             SCOTT                          SYS
READ                                     DIRECTORY
SQL> SY.

Similar Messages

  • Finalize() method being called multiple times for same object?

    I got a dilly of a pickle here.
    Looks like according to the Tomcat output log file that the finalize method of class User is being called MANY more times than is being constructed.
    Here is the User class:
    package com.db.multi;
    import java.io.*;
    import com.db.ui.*;
    import java.util.*;
    * @author DBriscoe
    public class User implements Serializable {
        private String userName = null;
        private int score = 0;
        private SocketImage img = null;
        private boolean gflag = false;
        private Calendar timeStamp = Calendar.getInstance();
        private static int counter = 0;
        /** Creates a new instance of User */
        public User() { counter++;     
        public User(String userName) {
            this.userName = userName;
            counter++;
        public void setGflag(boolean gflag) {
            this.gflag = gflag;
        public boolean getGflag() {
            return gflag;
        public void setScore(int score) {
            this.score = score;
        public int getScore() {
            return score;
        public void setUserName(String userName) {
            this.userName = userName;
        public String getUserName() {
            return userName;
        public void setImage(SocketImage img) {
            this.img = img;
        public SocketImage getImage() {
            return img;
        public void setTimeStamp(Calendar c) {
            this.timeStamp = c;
        public Calendar getTimeStamp() {
            return this.timeStamp;
        public boolean equals(Object obj) {
            try {
                if (obj instanceof User) {
                    User comp = (User)obj;
                    return comp.getUserName().equals(userName);
                } else {
                    return false;
            } catch (NullPointerException npe) {
                return false;
        public void finalize() {
            if (userName != null && !userName.startsWith("OUTOFDATE"))
                System.out.println("User " + userName + " destroyed. " + counter);
        }As you can see...
    Every time a User object is created, a static counter variable is incremented and then when an object is destroyed it appends the current value of that static member to the Tomcat log file (via System.out.println being executed on server side).
    Below is the log file from an example run in my webapp.
    Dustin
    User Queue Empty, Adding User: com.db.multi.User@1a5af9f
    User Dustin destroyed. 0
    User Dustin destroyed. 0
    User Dustin destroyed. 0
    User Dustin destroyed. 0
    User Dustin destroyed. 0
    USER QUEUE: false
    INSIDE METHOD: false
    AFTER METHOD: false
    User Dustin destroyed. 1
    User Dustin destroyed. 1
    User Dustin destroyed. 1
    User Dustin destroyed. 1
    USER QUEUE: false
    INSIDE METHOD: false
    AFTER METHOD: false
    User Dustin destroyed. 2
    User Dustin destroyed. 2
    User Dustin destroyed. 2
    User Dustin destroyed. 2
    User Dustin destroyed. 2
    User Dustin destroyed. 2
    User Dustin destroyed. 2
    User Dustin destroyed. 2
    USER QUEUE: false
    INSIDE METHOD: false
    AFTER METHOD: false
    User Dustin destroyed. 3
    User Dustin destroyed. 3
    User Dustin destroyed. 3
    User Dustin destroyed. 3
    User Dustin destroyed. 3
    User Dustin destroyed. 3
    User Dustin destroyed. 3
    User Dustin destroyed. 3
    User Dustin destroyed. 3
    USER QUEUE: false
    INSIDE METHOD: false
    AFTER METHOD: false
    User Dustin destroyed. 4
    User Dustin destroyed. 4
    User Dustin destroyed. 4
    User Dustin destroyed. 4
    User Dustin destroyed. 4
    User Dustin destroyed. 4
    User Dustin destroyed. 4
    User Dustin destroyed. 4
    User Dustin destroyed. 4
    USER QUEUE: false
    INSIDE METHOD: false
    AFTER METHOD: false
    User Dustin destroyed. 5
    User Dustin destroyed. 5
    User Dustin destroyed. 5
    User Dustin destroyed. 5
    User Dustin destroyed. 5
    User Dustin destroyed. 5
    User Dustin destroyed. 5
    User Dustin destroyed. 5
    User Dustin destroyed. 5
    USER QUEUE: false
    INSIDE METHOD: false
    AFTER METHOD: false
    User Dustin destroyed. 6
    User Dustin destroyed. 6
    User Dustin destroyed. 6
    User Dustin destroyed. 6
    User Dustin destroyed. 6
    User Dustin destroyed. 6
    User Dustin destroyed. 6
    User Dustin destroyed. 6
    User Dustin destroyed. 6
    User Dustin destroyed. 6
    Joe
    USER QUEUE: false
    INSIDE METHOD: false
    AFTER METHOD: false
    User Dustin pulled from Queue, Game created: Joe
    User Already Placed: Dustin with Joe
    User Dustin destroyed. 7
    User Dustin destroyed. 7
    User Dustin destroyed. 7
    User Dustin destroyed. 7
    User Dustin destroyed. 7
    User Dustin destroyed. 7
    User Dustin destroyed. 7
    User Dustin destroyed. 7
    User Dustin destroyed. 7
    User Dustin destroyed. 7
    INSIDE METHOD: false
    INSIDE METHOD: false
    USER QUEUE: true
    INSIDE METHOD: false
    INSIDE METHOD: false
    User Dustin destroyed. 9
    User Joe destroyed. 9
    User Dustin destroyed. 9
    User Dustin destroyed. 9
    User Dustin destroyed. 9
    User Dustin destroyed. 9
    INSIDE METHOD: true
    INSIDE METHOD: false
    USER QUEUE: true
    INSIDE METHOD: false
    INSIDE METHOD: false
    INSIDE METHOD: true
    INSIDE METHOD: false
    USER QUEUE: true
    INSIDE METHOD: false
    INSIDE METHOD: false
    It really does seem to me like finalize is being called multiple times for the same object.
    That number should incremement for every instantiated User, and finalize can only be called once for each User object.
    I thought this was impossible?
    Any help is appreciated!

    Thanks...
    I am already thinking of ideas to limit the number of threads.
    Unfortunately there are two threads of execution in the servlet handler, one handles requests and the other parses the collection of User objects to check for out of date timestamps, and then eliminates them if they are out of date.
    The collection parsing thread is currently a javax.swing.Timer thread (Bad design I know...) so I believe that I can routinely check for timestamps in another way and fix that problem.
    Just found out too that Tomcat was throwing me a ConcurrentModificationException as well, which may help explain the slew of mysterious behavior from my servlet!
    The Timer thread has to go. I got to think of a better way to routinely weed out User objects from the collection.
    Or perhaps, maybe I can attempt to make it thread safe???
    Eg. make my User collection volatile?
    Any opinions on the best approach are well appreciated.

  • Selecting Multiple Clips from Same Angle in Multicam Project

    I edit motor sport events using up to 8 camera angles. Once I have edited the multicam I will generally reduce the overall audio level of the entire multicam edit. Invariably certain camera positions will have a higher audio level than others. In FCP 7 I would adjust the audio of one such clip angle, copy the clip, then simply cmd+f and input the name of the angle clips I want to adjust, then paste attributes and select audio as the attribute I want to adjust.
    In FCP X I cannot find a way of doing this..... It appears I have to scroll along the timeline and cmd select each clip.... which is a nonsense. I should be able to select every clip of one particular angle. Am I missing something? This should be really easy to select every clip from one particular angle, but I have yet to find a way to do it and it is vital I can do this to save time. Nothing in the help files.

    You can't select all the individual clips in the multicam edit.... All of the clips in the multicam are titled the same way...." Multicam xxxxxx". If they appeared as Angle 1, Angle 2, Angle 3 etc. You could select the individual angles as I need to do, but they are not listed that way.
    To adjust the audio in the angle editor so that the audio from each camera was the same maximum db level, I would need to be able to "normalise" the audio from each angle to, for example -18db. In FCP X they have removed the normalise audio feature, which is such a nuisance As I used that a lot in FCP 7 to get audio to max at the required level. I can't adjust the audio in one angle until I have them edited side by side and can see the difference in db between them.
    Any other ideas?

  • Multiple events on same object

    I am using SWT.
    I have a sash that seperates a tree and a browser and I need to be able to do the following...
    Drag the sash to any location within the view.
    Double click the sash to hide the contents on the left of the sash (make it return to 0 x cord.). When the sash is double clicked again, the sash will return to whatever x coordinate that it was drug too or return to it's original cord. from the FormLayout.
    I can do either fine, but I can't do both. When I do a sys.out.print and double-click the sash, it returns...
    13
    13
    8
    13 = SelectionEvent, 8 = MouseDoubleClick
    This means that MouseDoubleClick is itself a SelectionEvent. Is there a way that they can coexist?

    You might have better luck asking this in an SWT forum instead of in a Sun forum, since SWT doesn't have anything to do with AWT or Swing.

  • Can we have multiple transports for the same object.

    Hi guys,
    Can we have multiple transports for same object in dev system. Can anyone tell me how can this be done.
    Thanks

    Its not possible for the same development object. Only 1 person can access an object at a time and if mutiple users modify an object new TASKs are created under the same TRANSPORT.
    Only after releasing the tr you can create a new tr on the same object.
    Message was edited by:
            Abhishek Jolly

  • Multiple copies of same photo on same page seems to assume A4?

    I'm trying hard to work out how to print out multiple copies of the same picture. I want to get 2 copies on each 4x6" sheet of photo paper and have followed all the steps...
    Selected 1 picture, hit print, went to Settings, selected "Multiple of the same photo per page".
    I then went to Print Settings, selected Borderless 4x6 (yes, the printer works fine with that usually - HP Photosmart C4280) and set the Print Size to 2x3 and the preview shows the 2 copies of the same photo side-by-side no problem.
    So I hit OK, clicked on Print and...
    It's not aligning with the left hand side of the 4x6 - it's not respecting the selected paper size. If I put in a sheet of A4 to test, the 2 pictures come out in the centre of the page (in the requested size). So as a result I can't print on the 4x6 paper as most of the picture gets printed on nothing!
    Am I doing something wrong or is this some kind of bug in either iPhoto or the HP printer driver? Anyone had any success with this? If so, what kind of printer were you using?

    Jemster:
    Here's the workflow I used to get 2 2x3s on a 4x6:
    1 - select photo & click on print button
    2 - select 4x6 borderless and 2x3 print size
    3 - click Customize button
    4 - click on settings button
    5 - select "Multiple of same photo per page" (after clicking OK two photo are shown on the preview)
    6 - click on the Print button.
    Where I differ is that I don't go back to Print Settings to select the 4x6 paper size after Step 5. Give that a try.
    NOTE: Do a Print to PDF to check it out instead of printing on paper. That will save some paper in case it doesn't work.
    That gives me two photos on the 4x6. I'm using a Canon i850. I also get the same results with an Epson R280.
    TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto (iPhoto.Library for iPhoto 5 and earlier) database file and keep it current. If problems crop up where iPhoto suddenly can't see any photos or thinks there are no photos in the library, replacing the working Library6.iPhoto file with the backup will often get the library back. By keeping it current I mean backup after each import and/or any serious editing or work on books, slideshows, calendars, cards, etc. That insures that if a problem pops up and you do need to replace the database file, you'll retain all those efforts. It doesn't take long to make the backup and it's good insurance.
    I've created an Automator workflow application (requires Tiger or later), iPhoto dB File Backup, that will copy the selected Library6.iPhoto file from your iPhoto Library folder to the Pictures folder, replacing any previous version of it. It's compatible with iPhoto 6 and 7 libraries and Tiger and Leopard. Just put the application in the Dock and click on it whenever you want to backup the dB file. iPhoto does not have to be closed to run the application, just idle. You can download it at Toad's Cellar. Be sure to read the Read Me pdf file.
    Note: There's now an Automator backup application for iPhoto 5 that will work with Tiger or Leopard.

  • Selecting Multiple Objects with Output Preview Causing Problems

    I'm trying to edit a PDF and need to select multiple objects. Without Output Preview open, I can easily select all the items I need using the shift key. With Output Preview open, whenever I try to select the second object, Output Preview creates a sticky note, instead of selecting the second object.
    I am also using the PitStop Pro plug-in.
    Any idea how to correct this problem? Thanks!

    Unfortunately it seems that the new sticky note feature with the output preview in Acrobat XI uses the same keyboard shortcut as multiple selection tool in Pitstop (shift).
    Closing the output preview is the easiest way to get around this issue.
    We could consider changing the key for multiple selection in PitStop, but 'shift' is pretty much a default, so what could we change it too?
    If anyone has any thoughts could they email me, I am the product manager responsible for Pitstop at Enfocus and my email is '[email protected]'
    All feedback gratefully received.

  • CS6: Select multiple objects - Hide border?

    Hi!
    Lots of our layouters are bothered because of the same thing: If you select multiple objects in CS6, you'll get a border which surrounds all of the selected objects. That way it's quite difficult to see, which items are already selected and which aren't, especially if they are all aligned.
    I hope, you understand what I'm talking about. I displayed it in the following screenshot.
    The text frame and the yellow frame are selected. The red one isn't but you have to look closely to see that, because there is this thin border spanning over all of the objects, covering the red object, too.
    Is it somehow possible to hide / disable this "extra" border? If you have a lot of objects on the page (with backgrounds and everything), the layouters have some problems with seeing what they already selected and what they didn't select yet.
    Best,
    Anke

    @Bob: quite hard, if you have about 50 elements on one layer (the layouts are done with only two major layers .... don't ask me -.-)
    @pixxel schubser: nope, I mean the overall border, that covers all of them in one big frame...
    @Sandee: I know. But tell that to 20+ layouters, who want their program to work the same way as it did before (CS3...)... They are really confused by this extra border.
    @Ellis: Wow, I didn't try that! Great, no border!!! Only that seems to be a bit buggy. If you have a lot of objects, after time it seems to "lose" some of them you selected at the beginning. Still, I'll tell the layouters, maybe this will make them a little happier Thanks a lot!
    For all, who didn't quite know what I was talking about... this is Ellis' solution without the extra border:

  • Dragging to select multiple objects within a Pages document

    I am trying to select multiple, closely spaced objects (text boxes, lines, shapes, etc) within a Pages document. They are located ~1/3 of the way from the left margin of the document, and there are objects both to the left and the right of this group.
    I know that you can click outside of the Pages document with the mouse, then drag into the document to select multiple objects. However, is there any way to drag to select multiple objects without first clicking outside the document?
    Command click is a pain in the butt because I inevitably mis-click and have to start again to select all objects. I don't like having to drag in from the margin and then command-click to de-select objects I don't want.
    is there not an option to just shift-click to form a selection box around objects within the document? It seems like there should be a simple solution to this, but I have yet to find it.
    Thanks

    mattcass wrote:
    Command click is a pain in the butt
    Isn't it just! The people who created Pages should get a right spanking on this fundamental stuff up.
    All you can do is try again. I find myself repeating the same task over and over in Pages simply because you can't easily grab things.
    When you do +command click+ try and get the edges of objects, otherwise Pages thinks you are still trying to click inside the object.
    Once you have +command drag lassoed+ multiple objects you can +shift command click+ to unselect the ones you don't want. Again a problem if they are close to each other.
    Peter

  • Prompt user to select multiple objects within an action

    Hi there,
    In illustrator, is it possible to select multiple objects within an action or prompt the user to do so when needed ?
    I know about the note trick but I am not quite happy with this one. I would like another solution if there is any.
    Thanks !!

    In order for a macro (Action) or script to select something, it has to have access to some criteria by which to target the object(s). Actions are much more limited in this regard than scripts, but there are some "hooks" you can employ.
    For example, Actions will record the assignment of a Note in the Attributes palette. So if your Action at least starts with the object(s) of interest selected, you can take that opportunity to record the entry of a string in the Note field. Thereafter, if the object(s) become deselected, the Action (or another Action) can re-select them by means of the Select Object(s)... step. When manipulation of the target object(s) is done, you can record changing its note to nothing, to prevet its being seleced by the same Select Object(s)... step later.
    JET

  • How do I use multiple classes to access the same object?

    This should be staightforward. I have and object and I have multiple GUIs which operate on the same object. Do all the classes creating the GUIs need to be inner classes of the data class? I hope this question makes sense.
    Thanks,
    Mike

    public final class SingletonClass {
    private static SingletonClass instance;
    private int lastIndex = 10;
    public final static SingletonClass getInstance()
    if (instance == null) instance = new SingletoClass();
    return instance;
    public int getLastIndex() {
    return lastIndex;
    }1) This won't work since one could create a new SingletonClass. You need to add a private constructor. Also, because the constructor is private the class doesn't have to be final.
    2) Your design isn't thread-safe. You need to synchronize the access to the shared variable instance.
    public class SingletonClass {
        private static SingletonClass instance;
        private static Object mutex = new Object( );
        private int lastIndex = 10;
        private SingletonClass() { }
        public static SingletonClass getInstance() {
            synchronized (mutex) {
                if (instance == null) {
                    instance = new SingletonClass();
            return instance;
        public int getLastIndex() {
            return lastIndex;
    }if you are going to create an instance of SingletonClass anyway then I suggest you do it when the class is loaded. This way you don't need synchronization.
    public class SingletonClass {
        private static SingletonClass instance=new SingletonClass();
        private int lastIndex = 10;
        private SingletonClass() { }
        public static SingletonClass getInstance() {
            return instance;
        public int getLastIndex() {
            return lastIndex;
    }If you don't really need an object, then you could just make getLastIndex() and lastIndex static and not use the singleton pattern at all.
    public class SingletonClass {
        private static int lastIndex = 10;
        private SingletonClass() { }
        public static int getLastIndex() {
            return lastIndex;
    }- Marcus

  • Multiple Transports for the Same Object.

    I have ABAP program 123 and I make a change, create transport A and release the transport. I do not request transport A go to production.
    I then modify ABAP program 123 again, create transport B and release the transport. I do not request transport B go to production.
    Now I request transport A go to production.
    Can someone explain to me why the changes in transport B are included when transport A is moved to production?
    I thought each transport would be at its own change level.
    Thank-you.

    I can guarantee all of you that when Transport A was moved, it contained changes that were made in Transport B.
    Surely you understand that Thomas is correct and that there's a logical reason, not related to transport layer configuration, for the issue?   You CAN have multiple transports open for the same object without a lock by forcing it but check the dates as already suggested...

  • Is there a way to select multiple sequences and batch export them using the same settings in CS6?

    I am a current Final Cut Pro7 user and looking to switch over to Premiere Pro CS6.  We edit approx. 100 short (15 sec.) videos daily, and then select them all at the end of the day and batch export them over night using the same export recipe for all. I have having trouble finding an easy way to do this in Premiere pro CS6, as command +E is grayed out if i select more than one sequence at a time. 
    so far, it appears that i have to select each video individually and manually set encoding recipe and export location for each....  Not only would this be terribly time consuming, but it leaves a lot of room for error and missed videos.  I thought i would be able to send all of the sequences to Adobe Media Encoder,  but i dont see that option either.
    Any suggestions/
    thanks!

    Open Media Encoder and add your Sequences:
    File > Add Premiere Pro Sequence
    Navigate to your Premiere Project and select it in the list.
    You can then select multiple Sequences from the Project (Ctrl+Click)
    and load them all at once into Media Encoder and apply
    the same encoding preset to all Sequences at the same time.

  • Is there a way to select multiple audio tracks and make all of them stereo pair at the same time?

    I selected multiple tracks, pressed "option L" but was not able to make multiple clips stereo pair at the same time.

    If I remember correctly it is not possible modify a group of selected clips on the timeline with the Stereo Pair command - unless all the selected clips have exactly the same properties - such as being linked to  video clips, etc. So you have to manually go through and select the dual mono tracks you want to pair individually or in smaller groups to be able to apply the Stereo Pair command.
    If you select a bunch (a couple)  of clips, and go to the menu Modify, you will see if Stereo Pair is grayed out or not. If it is grayed out, then you can't apply it to those clips as a group, but you probably will be able to apply it if you make smaller selections of clips.
    MtD

  • Is there a way to shift select multiple objects in layer palette, not just highlight multiple object

    Hi,
    Is there a way to shift select multiple objects in layer palette, not just highlight multiple objects?
    I would want to do this when I have a bunch of objects hidden under some other objects on the artboard. This feature is available in PSD, so I assume Illustrator should have it.
    Thanks!

    Thanks for the reply, Harron.
    I'm using CS4 & below.
    Highlighting object - click on object in layers palette & it turns blue
    Select object - click on object in layers palette to the right of the circle, which creates a square, and selects the object on the artboard
    How do I shift-select multiple objects in the layers palette...select 50 objects with a click, then a shift-click? Shift-select works for highlighting, but not selecting. On most programs shift-select is used to grab a bunch of stuff...:0)
    In the past I have inadvertently selected multiple objects in the layers palette, by somehow alt?-dragging over the layers...or something...I can't re-create it.

Maybe you are looking for

  • How to Genarate a Unique ID for each Payload in XI

    Hi, My Question is How to Genarate Unique ID for each Paylod that we send in a particular Interface. Is that we can do it in Mapping...If Yes, How its possible... Thanks Amaresh

  • How to approach authorization taking data into account (?)

    hi I have been similar to "Introduction to ADF Security in JDeveloper 10.1.3.2" for an approach to authorization taking data into account. For example to solve something like this: Some users should be able to update SCOTT.EMP.SAL, but only for those

  • Create a Navigation Pane for a Page Hierarchy

    Hi, I am writing a Oracle ADF fusion web application using JDeveloper 11.1.2.0.0. I want to create a navigation pane. For that I hope to use a declarative component. Please give me a tip to create a tree model as follows URL : http://jdevadf.oracle.c

  • Hi all, I have just had an issue surface in Ai CS4 with the ability to save as a pdf...

    I had recently downloaded AICS5 trial to check out it's awesomeness ( too bad Adobe's customer care isn't ), upon completion of the trial I went ahead and uninstalled the program using the provided uninstaller.  After uninstalling the program, my CS4

  • How to Cache Data  from database for java mapping ?

    Hi   I have a scenario where  i have to dynamically query  a huge table in some other database from java mapping code. Therefore instead of making a new Database trip everytime is there a mechanism by which i can cache the entire table contents into