Please tell me SQL to see, what tables are locked by which user

could you please tell me the query
so that I can see, what tables are locked by which user in a databse
Thanks

The only way you can ensure that only one transaction touches the data at any one time is to use a select .. for update nowait statement to select the rows to be updated.
Try this::
Where I select the data i want to update in a cursor Incase the row is locked due to any reason it will throw me an error as shown below;
SQL>DECLARE
  2   cursor c
  3   is
  4   select * from emp
  5   where empno = 10
  6   for update nowait;
  7  BEGIN
  8 
  9   for rec in c
10    Loop
11     update emp set ename ='J' where empno = 10;
12    End Loop;
13   
14  DBMS_OUTPUT.PUT_LINE('Record Updated');
15 
16  EXCEPTION
17 
18  WHEN OTHERS THEN
19 
20  DBMS_OUTPUT.PUT_LINE(sqlcode || sqlerrm);
21 
22  END ;
23  /
-54ORA-00054: resource busy and acquire with NOWAIT specified
PL/SQL procedure successfully completed.Edited by: J99 on Jul 28, 2009 4:57 PM

Similar Messages

  • Find out what tables are lock

    how do i find out what tables are lock and who is locking it? i am using 9i. also, i do i kill he session that is locking a table. thanks

    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:839412906735
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:368418111101

  • How to see what Tables are being used in all reports

    Post Author: tmashley
    CA Forum: Crystal Reports
    Hello,
    How can I see what database tables are used in all my online reports? I have around 1000 reports posted to Enterprise over 6 different datasources. If possible I would like to see the fields within those tables that are being used to.
    I am using Crystal Reports XI Release 2
    Any help is appreciated
    Thanks,
    Tom

    I don't think you can see the databases of the reports unless you download the report onto your pc as a Crystal Report format and then open it under Crystal Reports.
    This way it will open the report within Crystal Reports and will show you the datasource it is coming from.
    I doubt if you can see them online.
    Kind Regards
    Jehanzeb

  • Hello, I just bought a Snow Leopard and I have tried ti install this on my macbook pro 2008 (10.5.8) and I can not do it. I have to erase the hard drive before in order to succeed. Please tell me step by step what to do. I appreciate very much your help.

    Hello, I just bought a Snow Leopard and I have tried to install this on my macbook pro 2008 (10.5.8) and I can not do it. I have to erase the hard drive before in order to succeed. Please tell me step by step what to do. I appreciate very much your help.
    Thanks

    Here are the directions:
    http://support.apple.com/kb/HT3910?viewlocale=en_US
    Ciao.

  • Help!!! How can I see what devices are connected to my icloud

    How do I know what devices and computers are linked to my icloud? Used it once at my ex boyfriends house on his computer and I think my photo stream is going to his desktop??? How can I tell and if so disconnect from it?

    My brother asked me for my account one day but i don't know if he used it to connect icloud or to just download an app. I just want to see if his device is connected to my icloud and if so, i want to disconnect him. So is there any site or anything i can do to see what devices are connected?

  • Does the macbook have a screen cover that makes it so the person next you cannot see what you are doing?

    does the macbook have a screen cover that makes it so the person next you cannot see what you are doing?

    Hello 23435,
    Welcome to the Apple Support Communities!
    I understand that your iPhone was knocked out of your hand and now it displays blue and black colors on the display. It does sound like this iPhone may need to be evaluated for service. If you would like more information about this process, please refer to the attached web link below. 
    iPhone Other Repair Options - Apple Support
    Have a great day,
    Joe

  • HT1209 My Itunes Library and iPhone have fallen out of sync on music over the yearsare - how can I compare my itunes library with my Iphone  to see what songs are missing from my library so I can then bring my Library up to date

    My Itunes Library and iPhone have fallen out of sync on music over the yearsare - how can I compare my itunes library with my Iphone  to see what songs are missing from my library so I can then bring my Library up to date

    Hello Solid Buck,
    Thank you so much for providing the details about the duplicate song issue you are experiencing.  It sounds like you would like to remove the duplicate songs that will not play on your iPhone, but when you connect it to iTunes, iTunes only shows you one copy of the song on your iPhone. 
    In this situation, I recommend deleting the individual songs that do not play directly from your iPhone.  I found the steps to do this on page 61 of the iPhone User Guide (http://manuals.info.apple.com/en_US/iphone_user_guide.pdf):
    Delete a song from iPhone: In Songs, swipe the song, then tap Delete.
    Thank you for using Apple Support Communities.
    Best,
    Sheila M.

  • I want to transfer my music from one computer to another, however a large majority of my songs are already on the new computer, is there a way to transfer only the ones not there? or to see what songs are only on the one computer

    i want to transfer my music from one computer to another, however a large majority of my songs are already on the new computer, is there a way to transfer only the ones not there? or to see what songs are only on the one computer

    Welcome to the Apple Community.
    Homesharing gives you the option of seeing only the content in the shared library, that is not already in your own library.

  • How do I filter two columns of names to see What names are the same?

    I have two lists of names (one with 2,000+ names and one with 300+ names) I want make a column that shows the names that are not in both columns and the names that are. Is there an automated way of doing this?
    Basically, I have 2,000 friends on facebook and only 300 of them like my business page. I want to know which friends to market too and which friends to stop annoying Any help would be greatly appreciated!

    Caleb,
    You may use COUNTIF to see what values are in both columns.
    In this example I used the expression: =COUNTIF(B,A)
    Regards,
    Jerry

  • How can I see what devices are linked to my iCloud?

    how can I see what devices are linked to my iCloud?

    You can see which devices are currently set up and/or logged in by signing in at iCloud.com on your computer.  Then click the Settings icon or select your name from the top right, then select iCloud Settings. A list of devices using your account will be displayed.

  • How can i see what devices are connected to my icloud?

    I want to know if pictues from my mac are on any other devices. How can i see what other devices i have connected to my icloud?

    My brother asked me for my account one day but i don't know if he used it to connect icloud or to just download an app. I just want to see if his device is connected to my icloud and if so, i want to disconnect him. So is there any site or anything i can do to see what devices are connected?

  • HT2688 How can I see what computers are authorized to share?

    How can I see what computers are authorized to share? My e-mail address changed and I need to make sure one of my authorized computers is not my old address. In itunes.

    In order to see which devices are authorized on your account:
    Open iTunes
    Click Store
    Click Account
    Click View Account
    Enter your password
    Look in the second section iTunes in the Cloud
    To the far right you'll see Manage Devices
    Once it's clicked you will see all of the devices currently authorized in iTunes/on your account
    I was going to say, "Hope this helps," but based on the above, I'm pretty sure it did!
    Thanks guys...

  • HT4890 How do I see what photos are in Icloud?

    How do i see what photos are in icloud?
    I have duplicate photos appearing in my photo library and in another folder underneath the photo library on my Iphone5.  This is killing my free space and i cant delete them from the phone because I dont have that option within those folders.  How do i delete them?

    Good day AMELIASARAH,
    One resolution to your issue would be to update your iPhone using iTunes on your computer rather than over the air. This requires much less space on the iPhone as most of the work is done by the computer. See this article for how to do it -
    If you need more space for an iOS update - Apple Support
    Thanks for using Apple Support Communities.
    Safe computing,
    Brett L 

  • My iphone after syncing with my mac is saying "64 items could not be synced, see i tunes for details" however I cant see what items are not synced as no obvious message. Where do I look for this info?

    My iphone after syncing with my mac is saying "64 items could not be synced, see i tunes for details" however I cant see what items are not synced as no obvious message. Where do I look for this info?

    Connect your phone to iTunes, then right-click on the name of your phone on the left sidebar and select Reset Warnings.  Then sync again and you should get a warning listing the problem files.

  • How do i see what applications are running in the background

    My iMac is running very slow my operating system is OS X Yosemite Version 10.10.2 with a 2.5 GHz Intel Core i5 Processor. How do I see what applications are running in the background?

    Reinstalling OS X Without Erasing the Drive
    Boot to the Recovery HD: Restart the computer and after the chime press and hold down the COMMAND and R keys until the menu screen appears. Alternatively, restart the computer and after the chime press and hold down the OPTION key until the boot manager screen appears. Select the Recovery HD and click on the downward pointing arrow button.
    Reinstalling OS X Without Erasing the Drive
    Repair the Hard Drive and Permissions: Upon startup select Disk Utility from the main menu. Repair the Hard Drive and Permissions as follows.
    When the recovery menu appears select Disk Utility and press the Continue button. After Disk Utility loads select the Macintosh HD entry from the the left side list.  Click on the First Aid tab, then click on the Repair Disk button. If Disk Utility reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported click on the Repair Permissions button. Wait until the operation completes, then quit Disk Utility and return to the main menu.
    Reinstall OS X: Select Reinstall OS X and click on the Continue button.
    Note: You will need an active Internet connection. I suggest using Ethernet if possible because it is three times faster than wireless.
    Alternatively, see:
    Reinstall OS X Without Erasing the Drive
    Choose the version you have installed now:
    OS X Yosemite- Reinstall OS X
    OS X Mavericks- Reinstall OS X
    OS X Mountain Lion- Reinstall OS X
    OS X Lion- Reinstall Mac OS X
         Note: You will need an active Internet connection. I suggest using Ethernet
                     if possible because it is three times faster than wireless.

Maybe you are looking for