Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: ORA-04031 error while trying to load a PL/SQL object
Long term : Have the application use bind variables.
If you are pinning : database startup is the best time to pin. Are you pinning everyday and including new objects? Using algorithm? What does the algorithm do? If you have such a big SGA : then maybe pin all active PL/SQL on startup and forget it.
Can you tell the purpose of your flush? Please note that flush may not get rid of fragmentation. Thanks
John Kanagaraj <john.kanagaraj_at_hds.com> wrote:
Amir,
An ORA-4031 error on an Apps database needs to be considered in the same way as a 'normal' database. It is probably caused some program or process that executes a large number of small, non-resusable SQL. One normally thinks of user written SQL, but I have seen a severe case of ORA-4031 caused by a cronjob that regrants SELECT access to a read-account. The SQL generated thousands of 'grant select on <> to read_only_account' on all objects and held the shared pool/lib cache latch for long periods, while polluting it with small statements that broke up contiguos free space. Do you encounter lots of lib cache/shared pool latching? If so, you must trace them to see where/why they occur and you might discover the source of the 4031s.... YMMV!
Fyi, ORA-4031 is considered a 'user error', not a system error for whatever reason. You need to have an entry in the init.ora using the event parameter for an ORA-4031 error to be logged in the alert log. If you can check the older init.ora for the 8i instance, you might see this... Btw, there was a nice article from COE in either Metalink or OTN about the shared pool recently (don't have the URL but it was mentioned in this list).
Let the list know if you come across something, since that is how we all learn!
John Kanagaraj <><
DB Soft Inc
Phone: 408-970-7002 (W)
Co-Author: Oracle Database 10g Insider Solutions http://www.amazon.com/exec/obidos/tg/detail/-/0672327910/
Folks,
I have an 11i (11.5.0)/9.2.0.6 (64-bit) database running on Solaris 8 with the following shared pool sizing:
Shared_pool: 1.2 GB
Db_cache_size: 6 GB
ODM is enabled and that is why the cache size is large.
We run hot backups on this database (using use-managed backup procedure) and flush the shared pool every night after the hot backup (this process is scripted into the backup process). I pin ~ 300 packages into SGA based upon an algorithm in the pinning script. We had an issue this past Friday where some concurrent programs failed and reported the following error in their log files:
ORA-06508: PL/SQL: could not find program unit being called ORA-06512: at line 1
![]() |
![]() |