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

Similar Messages

  • How can I find out which tables are having DDL locks?

    I can see related information by querying DBA_DDL_LOCKS view, but it doesn't give me the information which tables are having DDL locks.
    Is there a way I can find out which tables are having DDL locks?
    Thanks!

    Here's a long script written back in 2001. Still works:
    BREAK on sid on serial# on username
    COL sid        for 9999
    COL serial#    for 99999
    COL username   for a20
    COL type       for a20    trunc
    COL lmode      for a5     trunc
    COL lrequest   for a4     trunc
    COL detail     for a75    trunc
    SELECT   s.sid
           , s.serial#
           , s.username
           , DECODE(
                  l.TYPE
                -- Long locks
                , 'TM', 'dml/data enq (TM)'
                , 'TX', 'transac enq (TX) '
                , 'UL', 'pls usr lock (UL)'
                -- Short locks
                , 'BL', 'buf hash tbl (BL)'
                , 'CF', 'control file (CF)'
                , 'CI', 'cross inst f (CI)'
                , 'CU', 'cursor bind (CU) '
                , 'DF', 'data file (CF)   '
                , 'DL', 'direct load (DL) '
                , 'DM', 'mount/strtup (DM)'
                , 'DR', 'reco lock (DR)   '
                , 'DX', 'distrib tran (DX)'
                , 'FI', 'sga opn file (FI)'
                , 'FS', 'file set (FS)    '
                , 'IN', 'instance num (IN)'
                , 'IR', 'instce recvr (IR)'
                , 'IS', 'get state (IS)   '
                , 'IV', 'libcache inv (IV)'
                , 'JQ', 'job queue (JQ)   '
                , 'KK', 'log sw kick (KK) '
                , 'LS', 'log switch (LS)  '
                , 'MM', 'mount def (MM)   '
                , 'MR', 'media recvry (MR)'
                , 'PF', 'pwfile enq (PF)  '
                , 'PR', 'process strt (PR)'
                , 'RW', 'row wait (RW)    '
                , 'RT', 'redo thread (RT) '
                , 'SC', 'scn enq (SC)     '
                , 'SM', 'smon lock (SM)   '
                , 'SN', 'seqno instce (SN)'
                , 'SQ', 'seqno enq (SQ)   '
                , 'ST', 'space transc (ST)'
                , 'SV', 'seqno value (SV) '
                , 'TA', 'generic enq (TA) '
                , 'TD', 'dll enq (TD)     '
                , 'TE', 'extend seg (TE)  '
                , 'TS', 'temp segment (TS)'
                , 'TT', 'temp table (TT)  '
                , 'UN', 'user name (UN)   '
                , 'WL', 'write redo (WL)  '
                , 'TYPE = ' || l.TYPE) AS type
           , DECODE(l.lmode, 0, 'none', 1, 'null', 2, 'RS', 3, 'RX', 4, 'S', 5, 'SRX', 6, 'X', TO_CHAR(l.lmode)) A
    S lmode
           , DECODE(l.request, 0, 'none', 1, 'null', 2, 'RS', 3, 'RX', 4, 'S', 5, 'SRX', 6, 'X', TO_CHAR(l.request
    )) AS lrequest
           , DECODE(
                  l.TYPE
                , 'JQ', 'Job #' || j.job || ' (' || j.what || ') owned by: ' || j.username
                , 'MR', DECODE(s.user_type, 'BG', 'DICTIONARY OBJECT', LOWER(obj.owner) || '.' || LOWER(obj.name))
    || ' (' || LOWER(obj.TYPE) || ')'
                , 'RT', 'thread #' || LOWER(l.id1)
                , 'RW', 'file#' || LOWER(SUBSTR(l.id1, 1, 3)) || ', block#' || LOWER(SUBSTR(l.id1, 4, 5)) || ', ro
    w#' || LOWER(l.id2)
                , 'TD', 'object: ' || LOWER(obj.owner) || '.' || LOWER(obj.name) || ' (' || LOWER(obj.TYPE) || ')'
                , 'TM', 'object: ' || LOWER(obj.owner) || '.' || LOWER(obj.name) || ' (' || LOWER(obj.TYPE) || ')'
                , 'TS', DECODE(l.id2, 0, 'enqueue', 'new block allocation')
                , 'TX', DECODE(
                             lo.object_name
                           , NULL, 'rbs #' || TRUNC(l.id1 / 65536) || ', slot #' || LOWER(l.id1)
                           , 'rbs #' || TRUNC(l.id1 / 65536) || ', slot #' || LOWER(l.id1) || ', object: ' || LOWE
    R(lo.object_name))
                , 'UL', 'lock name: ' || la.name || ', expiration date: ' || TO_CHAR(la.expiration, 'DD-MON-RR HH2
    4:MI:SS')
                , 'WL', 'redo log file#' || LOWER(l.id1)
                , 'id1 = ' || l.id1 || ', id2 = ' || l.id2) AS detail
        FROM sys.v_$lock l
           , (SELECT a.sid
                   , a.serial#
                   , NVL(a.username, 'SYS (' || LOWER(b.name) || ')') AS username
                   , DECODE(a.username, NULL, 'BG', 'USER') AS user_type
                FROM sys.v_$session a
                   , sys.v_$bgprocess b
               WHERE a.paddr = b.paddr(+)) s
           , (SELECT o.obj#
                   , u.name AS owner
                   , o.name
                   , DECODE(
                          o.type#
                        , 0, 'NEXT OBJECT'
                        , 1, 'INDEX'
                        , 2, 'TABLE'
                        , 3, 'CLUSTER'
                        , 4, 'VIEW'
                        , 5, 'SYNONYM'
                        , 6, 'SEQUENCE'
                        , 7, 'PROCEDURE'
                        , 8, 'FUNCTION'
                        , 9, 'PACKAGE'
                        , 11, 'PACKAGE BODY'
                        , 12, 'TRIGGER'
                        , 13, 'TYPE'
                        , 14, 'TYPE BODY'
                        , 19, 'TABLE PARTITION'
                        , 20, 'INDEX PARTITION'
                        , 22, 'LIBRARY'
                        , 23, 'DIRECTORY'
                        , 24, 'QUEUE'
                        , 28, 'JAVA SOURCE'
                        , 29, 'JAVA CLASS'
                        , 30, 'JAVA RESOURCE'
                        , 32, 'INDEXTYPE'
                        , 33, 'OPERATOR'
                        , 34, 'TABLE SUBPARTITION'
                        , 35, 'INDEX SUBPARTITION'
                        , 39, 'LOB PARTITION'
                        , 40, 'LOB SUBPARTITION'
                        , 43, 'DIMENSION'
                        , 44, 'CONTEXT'
                        , 47, 'RESOURCE PLAN'
                        , 48, 'CONSUMER GROUP'
                        , 51, 'SUBSCRIPTION'
                        , 52, 'LOCATION'
                        , 'UNDEFINED') AS type
                FROM sys.obj$ o
                   , sys.user$ u
               WHERE o.owner# = u.user#) obj
           , (SELECT vlo.xidusn
                   , vlo.xidslot
                   , vlo.xidsqn
                   , vlo.process
                   , o.owner || '.' || o.object_name AS object_name
                FROM sys.v_$locked_object vlo
                   , sys.dba_objects o
               WHERE vlo.object_id = o.object_id) lo
           , (SELECT job
                   , schema_user AS username
                   , what
                FROM dba_jobs) j
           , sys.dbms_lock_allocated la
       WHERE l.sid = s.sid
         AND l.id1 = obj.obj#(+)
         AND l.id2 = j.job(+)
         AND TRUNC(l.id1 / 65536) = lo.xidusn(+)
         AND LOWER(l.id1) = lo.xidslot(+)
         AND l.id2 = lo.xidsqn(+)
         AND l.id1 = la.lockid(+)
         AND l.TYPE != 'MR'
    UNION ALL
                      /*** LATCH HOLDERS ***/
    SELECT   s.sid
           , s.serial#
           , s.username
           , 'latch'
           , 'X'
           , 'none'
           , h.name || ' addr=' || LOWER(RAWTOHEX(laddr)) AS object
        FROM sys.v_$process p
           , sys.v_$session s
           , sys.v_$latchholder h
       WHERE h.pid = p.pid
         AND p.addr = s.paddr
    UNION ALL
                      /*** LATCH WAITERS ***/
    SELECT   s.sid
           , s.serial#
           , s.username
           , 'latch'
           , 'none'
           , 'X'
           , name || ' latch=' || p.latchwait AS object
        FROM sys.v_$session s
           , sys.v_$process p
           , sys.v_$latch l
       WHERE latchwait IS NOT NULL
         AND p.addr = s.paddr
         AND p.latchwait = l.addr
    ORDER BY sid
           , serial#
           , username
           , 4
           , 5
           , 6
           , 7;

  • How to find out what is the lock key for the computer

    How to find out what is the lock key for the computer?

    You don't.
    If you forgot or lost the password, all you can practically do is reset it.
    The manner in which you do so depends on what version of OS X you are running. The older versions utilize the reset password utility on your recovery/re-installation disk/drive.
    On Lion, you use the following technique to reset the Administrators password:
    Boot to your Lion Recovery Partition, by holding down the Option key while starting, and then selecting the Recovery HD as the boot choice.
    Once booted, at the top of the screen is a menu ..., select Utilities / Terminal from the menu bar.
    In the Terminal window, type “resetpassword” (without the quotes) and press return. A “Reset Password” window will open. Select your boot volume (your SSD drive) if it is not already selected. Select your administrators username from the menu labeled “Select the user account” if it is not already selected. Follow the prompts to reset the password. Restart the computer from the apple menu.

  • How can I find out whitch table are used in whitch document?

    How can I find out whitch table are used in whitch document?
    In the table EUL5_DOCUMENTS are stored the Documents and in the table EUL5_OBJS are stored the tables. How can I query these tables together?
    Are there other possiblities?
    Thanks

    Hi Dierk
    Please take a look at this thread: Re: An EUL query to list out All the Columns  (Fileds) for each Workbook
    I think you may well find what you are looking for in the answer that I gave there.
    Best wishes
    Michael

  • How can I find out what objects are in a datafile???

    My database is 8.1.7...
    I have a tablespace with multiple datafiles. How can I find out what objects are in a specific datafile???
    Thanks in advance...

    DBA_SEGMENTS
    DBA_SEGMENTS describes the storage allocated for all segments in the database.
    Related View
    USER_SEGMENTS describes the storage allocated for the segments owned by the current user's objects. This view does not display the OWNER, HEADER_FILE, HEADER_BLOCK, or RELATIVE_FNO columns.
    Column Datatype NULL Description
    OWNER
    VARCHAR2(30)
    Username of the segment owner
    SEGMENT_NAME
    VARCHAR2(81)
    Name, if any, of the segment
    PARTITION_NAME
    VARCHAR2(30)
    Object Partition Name (Set to NULL for non-partitioned objects)
    SEGMENT_TYPE
    VARCHAR2(17)
    Type of segment: INDEX PARTITION, TABLE PARTITION, TABLE, CLUSTER, INDEX, ROLLBACK, DEFERRED ROLLBACK, TEMPORARY, CACHE, LOBSEGMENT and LOBINDEX
    TABLESPACE_NAME
    VARCHAR2(30)
    Name of the tablespace containing the segment
    HEADER_FILE
    NUMBER
    ID of the file containing the segment header
    HEADER_BLOCK
    NUMBER
    ID of the block containing the segment header
    BYTES
    NUMBER
    Size in bytes, of the segment
    BLOCKS
    NUMBER
    Size, in Oracle blocks, of the segment
    EXTENTS
    NUMBER
    Number of extents allocated to the segment
    INITIAL_EXTENT
    NUMBER
    Size in bytes requested for the initial extent of the segment at create time. (Oracle rounds the extent size to multiples of 5 blocks if the requested size is greater than 5 blocks.)
    NEXT_EXTENT
    NUMBER
    Size in bytes of the next extent to be allocated to the segment
    MIN_EXTENTS
    NUMBER
    Minimum number of extents allowed in the segment
    MAX_EXTENTS
    NUMBER
    Maximum number of extents allowed in the segment
    PCT_INCREASE
    NUMBER
    Percent by which to increase the size of the next extent to be allocated
    FREELISTS
    NUMBER
    Number of process freelists allocated to this segment
    FREELIST_GROUPS
    NUMBER
    Number of freelist groups allocated to this segment
    RELATIVE_FNO
    NUMBER
    Relative file number of the segment header
    BUFFER_POOL
    VARCHAR2(7)
    Default buffer pool for the object
    This view with this another viwe can help you to identify where the object is:
    DBA_DATA_FILES
    DBA_DATA_FILES describes database files.
    Column Datatype NULL Description
    FILE_NAME
    VARCHAR2(513)
    Name of the database file
    FILE_ID
    NUMBER
    NOT NULL
    File identifier number of the database file
    TABLESPACE_NAME
    VARCHAR2(30)
    NOT NULL
    Name of the tablespace to which the file belongs
    BYTES
    NUMBER
    Size of the file in bytes
    BLOCKS
    NUMBER
    NOT NULL
    Size of the file in Oracle blocks
    STATUS
    VARCHAR2(9)
    File status: AVAILABLE or INVALID (INVALID means that the file number is not in use, for example, a file in a tablespace that was dropped)
    RELATIVE_FNO
    NUMBER
    Relative file number
    AUTOEXTENSIBLE
    VARCHAR2(3)
    Autoextensible indicator
    MAXBYTES
    NUMBER
    Maximum file size in bytes
    MAXBLOCKS
    NUMBER
    Maximum file size in blocks
    INCREMENT_BY
    NUMBER
    Autoextension increment
    USER_BYTES
    NUMBER
    Corresponding number of bytes
    USER_BLOCKS
    NUMBER
    Number of blocks which can be used by the data
    Joel Pérez
    http://otn.oracle.com/experts

  • How do I find out what applications are running in the background

    I have a 2008 iMac with 2GB memory.  How do I find out what programs are running in the background?  I am going to buy a new iMac before the end of the year to replace this one.  When I looked at Activity Monitor it shows 1.8Gb used but doesn't tell all the programs running.

    open activity monitor [if it doesnt launch click winders>Activity Monitor]. then it'll show all proceses

  • 11.1.2- Need to find out what reports are being executed by a user

    Hi,
    We have financial reports executed from workspace.In essbase session , only the user id is displayed and the Request type- mdxreport is displayed. We also tried searching the log for Financial report didnt find anything relevant.
    Is there a way to find out what reports are being executed by the user.
    Thanks in advance.
    Regards,
    Saumya

    STAT will give you the information for a limited period of time and is limited to the server which you are logged onto yourself. Beyond 24 hours it is of even less use even if you change the selection screen values.
    If you want it for a period way back into the past, then you need to use ST03N.
    There are at least 2 dependencies and 1 confusion:
    1 dependency) The length of period is determined by the size (length) of the file. You can change this in ST03N (default 50MB) via the menu settings.
    2 dependency) The stat collector jobs need to be scheduled to write the information to ST03N (once per hour is a legal requirement in some non-banana republic countries).
    1 confusion) There is an obscure function which converts a report submit to a transaction name (there is not much difference anyway) and an even more obsure one which filters what ST03N will record and therefore whether you can read it. You can (un)filter these things away if you search the SAP Marketplace for the term "MONI".
    What is of particular value from this control is that you can even detect a submission of an abap which only existed temporarily.
    Also note that having this information is potentially very powerfull with respect to the users (some of them are human too), so you should expose and use it responsibly.
    You should also ensure that only responsible users / auditors have access to S_TOOLS_EX.

  • How do i find out what devices are authorised on my apple ID?

    I have just bought a new iMac and want to get all my itunes library etc on it.  However, apparently i have reached my limit of 5 authorisations, which is entirely possible as I have had a number of iphones, Macair and ipads, some of which I either no longer own or are no longer functioning.  How do I find out what devices are authorised and then deauthorise any that I don't use any more - given that they may not even work!

    Welcome to the Apple Community.
    You can't de-authorise just the computers you no longer have access to.
    Your only option is to de-authorise all your computers and then re-authorise those you wish to be authorised. You can do this by logging into your account settings in iTunes on your computer (Store > View My ID) and selecting the option to de-authorise all.
    Please note however, you are only permitted to do this once in each 12 month period, therefore you would be better de-authorising your computers before you lose access to them. you can do this from the 'Store' menu in iTunes.

  • How do i find out what drives are present in a particular system

    Hi,
    How do i find out what drives are available in a particular system either by giving the systems ipaddress or the systems name...

    You can't do that. That would be a real security risc.
    /KAj

  • How do I find out what features are not useful in my Classifier?

    How do I find out what features are not useful in my Classifier? I am trying to trim down the number of features to speed up the training of my data, I have about 3700 features. I have found the Filter Based Feature Selection Module and have not been successful
    in using it. I have looked through all the examples and have not been able to find any examples using the module. Will the Filter Based Feature Selection Module help me to trim features. If so how do I use it?

    One way to do this would be is to use a random forest classifier. Feature/variable importance can be obtained relatively easily with random forests. 
    Here is how you may do it in R.
    > install.packages('randomForest') #install randomForest package in R if it is not already there
    > library(randomForest) # reference the library
    > data(mtcars) # load motor cars data that ships with 
    #train a random forest 
    > mtcars.rf <- randomForest(mpg ~ ., data=mtcars, ntree=1000,keep.forest=FALSE, importance=TRUE)
    > importance(mtcars.rf)
    > importance(mtcars.rf)
    #You will see an output like below
           %IncMSE IncNodePurity
    cyl  16.168645     169.96741
    disp 18.672188     260.08722
    hp   17.584375     184.95007
    drat  6.948743      63.54528
    wt   17.818509     254.30347
    qsec  4.772889      33.25546
    vs    5.303058      24.39064
    am    5.210181      17.36626
    gear  4.619161      21.55450
    carb  8.577037      28.46715
    # or plot the importance as follows
    > varImpPlot(mtcars.rf)
    What this tells you is how important predictors/features/variables like horsepower(hp), weight(wt), no. of cylinders (cyl) is in predicting miles per gallon (mpg).
    If you are wondering how the data looks like. Try this
    head(mtcars) # gives first few lines of the data set.
     mpg cyl disp  hp drat   wt ... 
    Mazda RX4     21.0   6  160 110 3.90 2.62 ... 
    Mazda RX4 Wag 21.0   6  160 110 3.90 2.88 ... 
    Datsun 710    22.8   4  108  93 3.85 2.32 ... 
    . Try this
    Here is a few useful resources:
    Random Forest documentation (Check out the pages on variable importance and variable importance plot)
    http://cran.r-project.org/web/packages/randomForest/randomForest.pdf 
    Motor cars data: http://stat.ethz.ch/R-manual/R-devel/library/datasets/html/mtcars.html

  • Are not the right ones for the icloud account. How can I find out what these are?

    I have downloaded icloud onto my PC. When I try to access my account I am told that although my Apple ID and password are correct they are not the right ones for the icloud account.How can I find out what these are?

    Christine Helen wrote:
    I can't find any way of creating an icloud ID. I only have a PC. no Mac product except an iPod classic.
    Oh, then you can't unless you know someone with a Mac you could use for a moment or 2. (Like at the Apple Store)

  • How can I find out what apps are on my step daughters phone without the phone?

    How can I find out what apps are on my step daughters phone without the phone? She is on my phone plan but does not live with me and I am concerned about the apps she may be using.

        baniville108,
    Thank you for reaching out to us. We certainly know the importance of being able to know what options are available with your device. With apps on devices, thoses are specific to the phone itself, so there is no open forum to view what apps are downloaded. The only option would be to physically review from the phone, or if you have the same Apple ID you can log into it and view from there. Please let us know if you need anymore assistance.
    Thank you,
    TonyG_VZW
    Follow us on Twitter @VZWSupport

  • HT4211 how can you find out what kb are being used by what apps

    how can you find out what kb are being used by what apps there is always alot of kb being used even when I don't use my phone

    Go into settings , general, usage and it tells you what the apps use. If your refering to the memory storage of the apps.

  • Hard drive shows 159gb of other (yellow) how do I find out what these are to free up space?

    hard drive shows 159gb of other (yellow) how do I find out what these are to free up space?

    Hope this helps.
    1. Empty Trash.
        http://support.apple.com/kb/PH10677
    2. Delete "Recovered Messages", if any.
        Hold the option key down and click "Go" menu in the Finder menu bar.
        Select "Library" from the dropdown.
        Library > Mail > V2 > Mailboxes
        Delete "Recovered Messages", if any.
        Empty Trash. Restart.
    3. Repair Disk
        Steps 1 through 7
        http://support.apple.com/kb/PH5836
    4. Disk space / Time Machine ?/ Local Snapshots
       http://support.apple.com/kb/ht4878
    5. Re-index Macintosh HD
       System Preferences > Spotlight > Privacy
       http://support.apple.com/kb/ht2409

  • 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

Maybe you are looking for

  • Multi Mapping in IDOCs

    Hi all i have a senario in which i have to send 990 IDocs at a single point of time not more then tht. I have done the mapping and changed the occurences of the IDocs node by externally exporting it and then importing it back again. I also needed to

  • Getting problem with running RWBLD60 with User parameters

    Hi All, I am trying to run a report using rwbld60 from command prompt which has input parameters I tried like this but it didnt work out rwbld60 module=reportname.rdf userid=scott/tiger@orcl destype=file desformat=pdf desname=report_out.pdf parameter

  • Netscape vs. Java 2 Security model

    Hi, new user here, downloaded and installed Java Virtual Machine plug-in, 1.4.2-b28, Wednesday evening. Added Java capability to IE 6.0.28. Running XP. Encountered a problem with a URL that had worked with Microsoft VM on another machine on my home n

  • PE7 problems on Windows Vista with custom DPI

    I "upgraded" from PE4 to PE7 from a purchased download of the combo package containing both Premiere and Photoshop Elements 7.  My old versions were Photoshop Elements 6 and Premier Elements 4 which worked fine on my Windows Vista Home Premium runnin

  • Why my macbook won't download latest itunes?

    my mac book won't download latest itunes? why?