5 Replies Latest reply: Apr 1, 2013 5:26 AM by S10390 RSS

    Lock in Dual table.

    976379
      Hi,
      I am getting below issue in my production system.

      Its showing lock for below query.

      SELECT SYSDATE FROM DUAL

      Can some one help me to understand how this query can generate lock ?

      Thanks,
        • 1. Re: Lock in Dual table.
          Nimish Garg
          i dont think it will create a lock on dual table..

          A table might be locked by Select query only if it is being used in "Select for update" clause
          • 2. Re: Lock in Dual table.
            Manik
            What is your oracle version?
            Please post the complete error description.

            Also post the ouput of the following queries. Just checking if you have created something with name called DUAL.
            SELECT *
              FROM all_tables
             WHERE table_name = 'DUAL' AND owner != 'SYS';
            
            select * from v$locked_object;                ------------- Assuming you have proper privilege.
            Cheers,
            Manik.
            • 3. Re: Lock in Dual table.
              JustinCave
              KriC wrote:
              Its showing lock for below query.
              Define "it". Is "it" a query that you're running? A tool? Something else? If this is a query, post the query. If this is coming from a tool, tell us what tool and what, exactly, it is saying.

              What does "showing lock" mean? Are you saying that this query has acquired a lock that is blocking some other session? Or that some other session has acquired a lock that is blocking this query?
              SELECT SYSDATE FROM DUAL

              Can some one help me to understand how this query can generate lock ?
              I'm willing to wager that it has nothing to do with any locks. My wager is that you have a query (or a tool) that is telling you that session A holds a lock that session B is blocked waiting on and that session A is currently running (or the last query session A ran) was this SELECT statement. If that's the case, the SELECT statement has nothing to do with the lock that some previous SQL statement run by session A acquired.

              Justin
              • 4. Re: Lock in Dual table.
                Chanchal Wankhade
                Hi,

                Can you paste exact query and error that you are getting.