Sunday, September 20, 2009

Troubleshooting: ORA-600 [LibraryCacheNotEmptyOnClose] during shutdown

Symptom:


ORA-00600: internal error code, arguments: [LibraryCacheNotEmptyOnClose], [], [], [], []


Affected Oracle versions:

10.2.0.1, 10.2.0.2, 10.2.0.3, 10.2.0.4

Workaround:

Ignore the error as it just indicates that there are some items in the library cache when closing down the instance. The error itself occurs AFTER the database close and dismount stages so only affects the instance shutdown itself. Datafiles have been closed cleanly.

Alternative:

Implementing database trigger to flush shared pool


CREATE OR REPLACE TRIGGER flush_shared_pool
BEFORE SHUTDOWN ON DATABASE
BEGIN
EXECUTE IMMEDIATE 'ALTER SYSTEM FLUSH SHARED_POOL';
EXCEPTION
WHEN OTHERS
THEN
raise_application_error (num => -20000, msg => 'Error flushing pool');
END;


References:

Oracle Metalink: Bug 4483084 - OERI[LibraryCacheNotEmptyOnClose] on shutdown