Oracle Error Message
PLS-00252: reference to the wrong copy of package STANDARD
Reason for the Error
A reference is made to the fixed package version of STANDARD when the database is open, or to the on-disk version when the database is closed. Explicit use of a SYS.X$ package name can lead to this. One might also see this from a compilation that begins while the db is closed but has the bad luck to have another session open the db before compilation is complete. Another possible cause is having ‘set serveroutput on’ through svrmgrl when doing an ‘alter database close’.
Solution
Make use of on-disk versions of packages when the database is open and fixed (preloaded) versions when the database is closed. Do not attempt to use the wrong set. It should be quite hard to reference the wrong set, except by using SYS.X$ package names explicitly. Also, be sure to ‘set serveroutput off’ before doing an ‘alter database close’.