Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2003

    Unanswered: ORA-04021: timeout occurred while waiting to lock object <ObjectName>

    When trying to drop a package I got an error:
    VBO-4552 : PL/SQL package(body) cannot be dropped.
    ORA-04021: timeout occurred while waiting to lock object <ObjectName>

    Oracle about this says such things:

    Data Access Failures Due To Locks

    When you issue a SQL statement, Oracle attempts to lock the resources needed to successfully execute the statement. If the requested data is currently held by statements of other uncommitted transactions, however, and remains locked for a long time, a timeout occurs.

    Consider the following scenarios involving data access failure:

    * Transaction Timeouts
    * Locks from In-Doubt Transactions

    Transaction Timeouts
    A DML statement that requires locks on a remote database can be blocked if another transaction own locks on the requested data. If these locks continue to block the requesting SQL statement, then the following sequence of events occurs:

    A timeout occurs.
    Oracle rolls back the statement.
    Oracle returns this error message to the user:
    ORA-02049: time-out: distributed transaction waiting for lock

    Because the transaction did not modify data, no actions are necessary as a result of the timeout. Applications should proceed as if a deadlock has been encountered. The user who executed the statement can try to reexecute the statement later. If the lock persists, then the user should contact an administrator to report the problem.

    So I am an administrator and I don`t know how to unlock a locked package. Could some help me?

  2. #2
    Join Date
    Oct 2003
    Forgive me for saying something obvious, but...

    To "unlock a package", you will have to find (and kill) the session(s) that are using the package.

  3. #3
    Join Date
    Nov 2003
    Bangalore, INDIA

    Thumbs up


    It is usually a valid error report because some object is locked:

    1. Check V$ACCESS for users of the object.

    2. If using DBMS_SQL for DDL be sure the DDL does not affect objects
    currently running or that you are directly dependent on.
    Eg: grant to the procedure that is running.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts