How to check Locking sessions in oracle 10g

Hi,
I have tried to get locking sessions. i got the blocking session by using v$lock view.
Pls help how to get locking sessions.
Regards,
Venkat

Hi Venkat
Or just run this independent of database version
select a.sid blocker, 'is blocking the session ', b.sid blockee from v$lock a, v$lock b
where a.block =1 and b.request > 0  and a.id1=b.id1 and a.id2=b.id2;You can extend this query to find the username and machine (plus all other details) from v$session using the a.sid and b.sid from above
To find the blocking session_
SELECT S.SID, S.SQL_ID, S.USERNAME, S.MACHINE from
V$SESSION S WHERE S.SID  = (SELECT blocker from
(select a.sid blocker, 'is blocking the session ', b.sid blockee from v$lock a, v$lock b
where a.block =1 and b.request > 0  and a.id1=b.id1 and a.id2=b.id2
*_To find the blocked session_*SELECT S.SID, S.SQL_ID, S.USERNAME, S.MACHINE from
V$SESSION S WHERE S.SID = (SELECT blockee from
(select a.sid blocker, 'is blocking the session ', b.sid blockee from v$lock a, v$lock b
where a.block =1 and b.request > 0 and a.id1=b.id1 and a.id2=b.id2
Edited : Added blocker and blockee code                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Similar Messages

  • How to check locked session?

    Hi all,
    How do I check locked session,or which tables has been locked.and how to kill the lock session. i would need to do it in sqlplus. we'r not allowed to use toad.

    SELECT sess.osuser AS OsUser, NVL (sess.program, sess.module) AS
    Program, sess.terminal AS Terminal,
    obj.Object_Name AS TABLE_NAME,
    DBMS_ROWID.rowid_create (1, ROW_WAIT_OBJ#, ROW_WAIT_FILE#,
    ROW_WAIT_BLOCK#, ROW_WAIT_ROW#) AS ROW_ID
    FROM dba_objects obj, v$session sess
    WHERE sess.SID IN (SELECT a.SID
    FROM v$lock a, v$session b
    WHERE (id1, id2) IN (SELECT b.id1, b.id2
    FROM v$lock b
    WHERE b.id1 = a.id1 AND
    b.id2 = a.id2 AND b.request > 0)
    AND a.SID = b.SID
    AND a.lmode = 0)
    AND obj.object_id = sess.ROW_WAIT_OBJ#)

  • How to check Created directories in Oracle 10g

    Actuall i created a directory
    CREATE OR REPLACE DIRECTORY DIR_TEXTFILES AS 'D:\TEXTFILES';
    but i can such directories in d:\ of my laptop
    as a beginner to oracle i dont know these thing....Pls Experts help me...

    No brother...Actually am learning how to insert a textfile into a Column of type CLOB
    for that i created a table
    and a procedure like this
    SQL> desc sunil_textfiles;
    Name Null? Type
    ID NOT NULL NUMBER(38)
    DATA_TEXTFILES CLOB
    CREATE OR REPLACE DIRECTORY DIR_TEXTFILES AS 'D:\TEXTFILES';
    CREATE OR REPLACE PROCEDURE
    PR_TEXTFILES(PR_ID IN NUMBER,PR_FILENAME IN VARCHAR2)
    AS
    L_CLOB CLOB;
    L_BFILE BFILE;
    BEGIN
    INSERT INTO SUNIL_TEXTFILES VALUES (PR_ID,EMPTY_CLOB())
    RETURNING DATA_TEXTFILES INTO L_CLOB;
    L_BFILE := BFILENAME('DIR_TEXTFILES',PR_FILENAME);
    DBMS_LOB.FILEOPEN( L_BFILE );
    DBMS_LOB.LOADFROMFILE(L_CLOB,L_BFILE,DBMS_LOB.GETLENGTH(L_BFILE));
    DBMS_LOB.FILECLOSE( L_BFILE );
    END;
    EXEC PR_TEXTFILES(1,'D:\TEXTFILES\TEXTLOADING.TXT');
    but i dont know where to put this textloading.txt file...which i need to insert on that clob column
    help me..

  • How to genrate and check wait statistics in oracle 10g

    Dear all,
    how to genrate and check WAIT STATISTICS in oracle 10g on RHEL4.
    Regards,
    Ali

    Oracle Kernel keeps track of these statistics. Query v$waitstat for overall system level wait statistics or v$session_wait for individual session wait statistics.

  • How to check image size in oracle 9i & 10g database

    hi,
    i have inserted an Image into a table in oracle database & I want to View the Query How to check image size in oracle 9i & 10g database
    thanks
    Edited by: user8920919 on May 30, 2010 1:43 AM

    user8920919 wrote:
    hi,
    How to check image size in oracle 9i & 10g database
    thanksWhat do you mean with "image size"?

  • How to block Sql Plus sessions in Oracle 10g

    Hi,
    I want to block all sql plus sessions in oracle 10g, as we have a application and we need each and every one to use this application not the sql plus session.
    Kindly update us as soon as possible. and also thanks in advanced.

    Understand the concept Karl, but a layered defense seldom works in the IP world. If I manage to get through the firewall, then how can you prevent me access, at IP level, at any other ISO stack layer? If you manage to get through, then your firewall policies could just be too weak :) at least you must have some kind of an IDS infrastructure in place..
    what I mean is, you can have infinite number of threats.. and this will be part of your Risk Analysis. Determining all possible threats to the assets, what are being protected and their associated value, and predicting the rate of occurrence.... with all of these you could probably come up with contingency plans and incident response.. And most of all, you should not ignore the fact that people are creative, ingenious, and curious, and they'll prove this to you by testing your security implementations. So you'll have to periodically evaluate your security.. that's why there are audits.. Also, you must balance Security, Performance, Usability, and your Budget.
    Yes, you can argue that if the entire firewall goes down (thus no IP defense), then something like DBV (or even denying IPs in sqlnet) can provide some defense. But is that not then a case of too little too late? It's better too little too late, than no protection at all... Imagine if there's no DBV, or if you have not implemented the concept of "Least Privilege"? or if the backups and exports are not encrypted? That would be more devastating.. that's the importance of database security options and features in providing "defense in depth"
    I question just what purpose and how effective IP packet security is at higher layers. It can never substitute doing this instead at firewall level. Well, it's not all about network security. All facets must be considered and the inter-relationships should be understand. Like the core information security and access management, physical and personnel security, training them, etc... And all of these are equally important in providing a secure ecosystem
    As for security that relies on the client to pass secure data (like executable name or o/s user name)... all this can easily be spoofed. Even if the app and Oracle driver are somehow digitally signed and these signatures can be verified on the server side, we only need to look at Vista to see how secure this really would be. Microsoft attempted to encrypt every single h/w and s/w layer from the physical DVD track to the pixel on the monitor.. and this was defeated. And this was done as o/s kernel level. It is less complex to hack at driver level and even trivial to do it at application level.Security is about risk management. Blocking SQL*Plus does not negate the risk of SQL from the wild being run on a production server. For example, the client is a VB client using ODBC. It is easy to create a proxy that accepts the ODBC connection from the VB client and proxy the OCI packets to the real Oracle server. Now you have a man-in-the-middle than can inspect every single SQL call made to Oracle, and inject any PL/SQL or SQL code it wants.
    Security is far beyond writing a login trigger to deny SQL*Plus sessions and calling that a defense. >
    Yes I agree with you. That's why there are independent organizations and regulating bodies that provides security best practices, to give us a headstart on comming up of strong security policies.
    And one of my favorites is the one provided by IASE (sponsored by Defense Information Systems Agency) where there's lot of content regarding hardening and policies
    http://iase.disa.mil/stigs/stig/index.html
    http://iase.disa.mil/stigs/checklist/index.html
    http://iase.disa.mil/stigs/SRR/index.html
    - Karl Arao
    http://karlarao.wordpress.com

  • Can I disable logging for session in Oracle 10g?

    I use a procedure to delete a lot of row for an application repeatedly. Because the DELETE statement is time consuming and the data don't need to be archived, I decide to use the nologging option.
    How to do it?
    What is the best choice? Can I disable logging from session in Oracle 10g?
    Thank you
    Edited by: jetq on Jul 23, 2009 9:46 AM

    Hi,
    "Delete" without generating redo-log is not possible.
    If you are on 10g, one way of making this thing efficiant is partition the table, with range-list partitioning. Partitioning existing table will be an excercise in itself, but that will be one time activity.
    In partitioned (or sub-partitioned) tables, you can truncate a partition (or subpartition). That won't generate any redo log (or very very less redo log) and that runs in seconds.
    In your case if you range partition INCOMING table by datetime (1 partition per day) and list sub-partition it by STATUS, that would help.
    Another approach is, if you are deleteing, say 80% records every day and leaving 20% (or very less) records. What you can do is, partition the table only by range on datetime. Then, every time you want to delete data, copy the rows you want to keep in some other table (or temporary table), truncate partition for that day and insert rows back (which you want to keep).
    I have done a similar thing and it works very quickly and generates very less redo log. Redo log generated in case of truncating partition or creating new partitions is just for Oracle internal commands (like data dictionary update etc).
    Have fun.

  • How to run a report from oracle 10g form in .csv format

    dear all,
    how to run a report from oracle 10g form in .csv format? i've already run in pdf & excel format.
    i'm using
    SET_REPORT_OBJECT_PROPERTY (ro_report_id, report_desformat, 'PDF'); --for pdf
    SET_REPORT_OBJECT_PROPERTY (ro_report_id, report_desformat, 'SPREADSHEET'); ---for excel
    Please Help..

    i have already tried.
    but the report show in htm or html format. that file will not save into csv. please help.

  • How to install Procedural Option in Oracle 10g Database express edition

    When i try execute exec send_mail shows error ORA-00900: invalid SQL statement.
    Error code shows "This error can occur if the Procedural Option is not installed "
    How to install Procedural Option in Oracle 10g express edition
    I'm using Oracle 10g Database express edition. Let me know how to run a procedure.

    I'm not sure of the meaning of ORA-00900 for Oracle XE but I think that PL/SQL is already installed by default according to the XE features list.
    See the Oracle® Database Express Edition 2 Day Developer Guide about procedure call.

  • How to find encrypted columns in oracle 10g database

    Hi,
    How to find encrypted columns in oracle 10g database? We can see using view dba_encrypted_columns or all_encrypted_columns .
    my question is apart from this is there anyother views or tables?
    Thanks..

    user602872 wrote:
    Hi,
    How to find encrypted columns in oracle 10g database? We can see using view dba_encrypted_columns or all_encrypted_columns .
    my question is apart from this is there anyother views or tables?Hmm not which I could find,
    SQL> select * from dict where lower(table_name) like '%encrypted%';
    TABLE_NAME
    COMMENTS
    DBA_ENCRYPTED_COLUMNS
    Encryption information on columns in the database
    ALL_ENCRYPTED_COLUMNS
    Encryption information on all accessible columns
    USER_ENCRYPTED_COLUMNS
    Encryption information on columns of tables owned by the user
    SQL>HTH
    Aman....

  • How can I change SGA_TARGET IN Oracle 10G.

    Dear Experts,
    Please tell me
    How can I change SGA_MAX_SIZE IN Oracle 10G.
    How can I change SGA_TARGET IN Oracle 10G.
    How Can i recreate SPFILE IN Oracle 10G.

    Dear Experts,
    Please tell me
    How can I change SGA_MAX_SIZE IN Oracle 10G.
    How can I change SGA_TARGET IN Oracle 10G.
    How Can i recreate SPFILE IN Oracle 10G.SGA_MAX_SIZE and SGA_TARGET are all to be changed by alter system statement.
    The difference is, you can't make change to SGA_MAX_SIZE effective while instance is running. Need restart database to make change effective.
    Your can change SGA_TARGET while instance is running, as long as it's smaller than SGA_MAX_SIZE
    to recreate a spfile,
    you can shutdown your database,
    find a copy of valid pfile,
    startup pfile=/directory/yourpfile
    and
    create spfile from pfile;

  • Lots of Inactive perl sessions in Oracle 10g r2 on Debian Linux 64 bit

    Hi,
    There are lots of Inactive perl session in Oracle 10g release 2 10.2.0.3.0 on Debian Linux 64 bit, is it normal
    ps aux|grep oracle is showing following in processes of perl
    /home/u01/app/oracle/product/10.2.0/database1/perl/bin/perl /home/u01/app/oracle/product/10.2.0/database1 /sysman/admin/scripts/db/dbarchfull.pl

    Hi,
    There are lots of Inactive perl session in Oracle 10g release 2 10.2.0.3.0 on Debian Linux 64 bit, is it normal
    ps aux|grep oracle is showing following in processes of perl
    /home/u01/app/oracle/product/10.2.0/database1/perl/bin/perl /home/u01/app/oracle/product/10.2.0/database1 /sysman/admin/scripts/db/dbarchfull.pl

  • Lock types in oracle 10g with sql examples

    can some body easily in simple words tell some thing about the table locks types in oracle 10g with some sql examples?

    Oracle locking is a complex topic that may not easily be explained with simple words.
    Please try to read above mentioned link starting from simple examples to used lock types. I don't think it's a good idea to "over simplify" the topic starting from the different lock types.
    Another way to explain some lock types can be found in following OTN discussion with Tom Kyte (who is also one of the primary author of Concepts Guide 11.2): TM / TX Locks ( Tom Kyte and Oracle Docu) ; note the different points of view about what is the row lock ...
    Edited by: P. Forstmann on 29 juin 2011 14:00

  • How to create new database on Oracle 10g

    Hi All,
    Can any one tell me how to create new database on oracle 10g.
    Thanks in Advance for your help.

    again some confusion here.....
    u said u need a new database in your first post and now you saying u need a new schema..
    one database has many schemas(users)..... ex: scott,sys,system are few of them...
    now it depends you need seperate database for test,dev environment - this is in the case u have many schemas under each database and many tables(objects) under each schema.
    OR
    You just need a separate schema (in same db) for test,dev environment...where in you will have multiple tables in each schema...U need to know the dba credentials of the db to create a new schema.
    ideally u need to have different database...You can create one with out sys/system(oracle users) password as these passwords are db dependent.
    what you need is access to the any machine where server is installed(can be the same mc where you have your dev db or a diff machine) and that will be the machine where your db will be installed (can do it through database configuration assistance),ofcourse you will need windows authentication for this.
    so you login to the same machine or access it from your machine using remote login.
    I hope that is clear.Hope i am not listing things that you already know..Just did it coz of confusion between db and schema
    Message was edited by:
    coolguy

  • How can I change SGA_MAX_SIZE IN oRACLE 10G.

    Dear Experts,
    Please tell me
    How can I change SGA_MAX_SIZE IN Oracle 10G.
    How can I change SGA_TARGET IN Oracle 10G.
    How Can i recreate SPFILE.

    another copy of dup How can I change SGA_TARGET IN Oracle 10G.

Maybe you are looking for

  • Hi i want to exit the program if no file found by FM call file_get name

    HI I am calling a function module which is picking up a file from utility server presently its giving error message that if no file found it propts for error msg no file found or file could not be opened i suppose  its coming by the FM only now i wan

  • Re: Satellite P750 with 2 external monitors

    Hi, I am just wondering if it is possible to have two "external" LCD monitors connected to my Toshiba Satellite P750? One on the VGA and the other one on the HDMI perhaps? Cheers Niels

  • HELP!!!! My Mom lost my ipod touch in our house! How do I locate it?

    HELP!!!! My Mom lost my ipod touch in our house! How do I locate it?

  • UDF Mapping Nodes

    Hello all, I'm trying to map two source structure names into one destination structure name. example : Source -BBSEG_DEBIT --NEWBS --WRBTR -BBSEG_CREDIT --NEWBS --WRBTR -BBSEG_CREDIT --NEWBS --WRBTR Destination -BBSEG --NEWBS --WRBTR -BBSEG --NEWBS -

  • ABAP Report Details

    Dear ABAP gurus, I tried to search before posting but couldn't find my answer. My Client showed me a FI report ( income statement ) created in ECC system , and I work as BI resource. How can I reverse engineer that report and extract the technical de