Compiling PL/SQL objects
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 7 of 7

Thread: Compiling PL/SQL objects

  1. #1
    Join Date
    Mar 2006
    Location
    Charlotte, NC
    Posts
    865

    Compiling PL/SQL objects

    Hi,

    I am curious to know what does Oracle do internally when we issue for ex. alter procedure xyz compile;

    Will it just check for the syntax, depending objects availability, and required privileges?

    What happens if one of the depending objects (table) is locked by other session? It compile with errors or waits till the lock released or it won't care about the locked objects?

    I haven't find any useful information in google as well as in Metalink so posting here for experts comments.

    Thanks,
    Vijay Tummala

    Try hard to get what you like OR you will be forced to like what you get.

  2. #2
    Join Date
    Nov 2002
    Location
    Mooresville, NC
    Posts
    349
    During compilation why it'll wait for locking? It's not accessing table data, so locking should not be issue.
    http://www.perf-engg.com
    A performance engineering forum

  3. #3
    Join Date
    Oct 2008
    Location
    Chandigarh, India
    Posts
    322
    I think it's like compiling a program unit for lexical, syntax and semantics analysis.
    lucky

  4. #4
    Join Date
    Mar 2007
    Location
    Ft. Lauderdale, FL
    Posts
    3,554
    Quote Originally Posted by mahajanakhil198 View Post
    I think it's like compiling a program unit for lexical, syntax and semantics analysis.
    it goes beyond that... checks referenced objects are there, remote connectivity over eventual dblink is available, number and type of input parameters is correct, etc.

    Only possible locking situation would be a library cache lock when the object being compiled is in use.
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.

  5. #5
    Join Date
    Mar 2006
    Location
    Charlotte, NC
    Posts
    865
    Thanks Malay, I do have the same understanding but the other DBA in my team had the problem with compiling a procedure and he said he found some other session locking one of the referencing tables and when he killed that session he is able to compile. He is not clear what type of lock it is. As PAVB said it might be library cache lock.

    I will wait for the same situation and check what type of lock is stopping compilation.

    Thanks all for your inputs.

    Thanks,
    Vijay Tummala

    Try hard to get what you like OR you will be forced to like what you get.

  6. #6
    Join Date
    Mar 2007
    Location
    Ft. Lauderdale, FL
    Posts
    3,554
    Quote Originally Posted by vnktummala View Post
    ... other DBA in my team had the problem with compiling a procedure and he said he found some other session locking one of the referencing tables and when he killed that session he is able to compile. He is not clear what type of lock it is. As PAVB said it might be library cache lock.
    this only makes sense if offending session was executing the very same procedure your fellow DBA was attempting to compile. It wasn't a table lock, it was library cache lock.
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.

  7. #7
    Join Date
    Mar 2006
    Location
    Charlotte, NC
    Posts
    865
    Thanks PAVB.

    Thanks,
    Vijay Tummala

    Try hard to get what you like OR you will be forced to like what you get.

Posting Permissions

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


Click Here to Expand Forum to Full Width