Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ORA-06508 - PL/SQL: could not find program unit being called

Samuel RabiniOct 30 2012 — edited Nov 29 2012
Hi,
I'm working on an Oracle Database 11g Release 11.1.0.6.0 - 64bit Production With the Real Application Clusters option.

Since 2 weeks I'm facing problems with a job.
The job executes
dispatch.pk_process.check_geofence;
every 2 seconds, forces to run on instance 1.
Some time, now it's once a day, in a different moment, the job start failing returning the ORA-06508.

The job body is:
  PROCEDURE check_geofence
  IS
    CURSOR tt IS
      SELECT id_data, id_device, id_vehicle, date_event, date_write
        FROM t_process
       WHERE id_type_process = ln_process_geofence
       ORDER BY date_event;

    id_user_ NUMBER;     
    errc_    NUMBER;
    errm_    VARCHAR2(500);
    i        NUMBER;
  BEGIN
    id_user_ := dispatch.pk_security.login_hard('process_geofence','process_geofence');
    i := 0;
    FOR t IN tt LOOP
      BEGIN
        pk_space_target.check_inout_space_target (
               in_id_data    => t.id_data,
               in_id_device  => t.id_device,
               in_id_vehicle => t.id_vehicle,
               id_date_event => t.date_event,
               id_date_write => t.date_write
          );
      EXCEPTION 
        WHEN OTHERS THEN
          errm_ := 'process geofence: '||SUBSTR(SQLERRM, 1, 500)||' - '||DBMS_UTILITY.FORMAT_ERROR_BACKTRACE;
          errc_ := SQLCODE;
          INSERT INTO t_data_error (id_data, date_error, error_number, error_message)
               VALUES (t.id_data, SYSDATE, errc_, errm_);
      END;
      
      DELETE FROM t_process WHERE id_data = t.id_data AND id_type_process = ln_process_geofence;
      
      i := i + 1;
      IF i mod 100 = 0 THEN COMMIT; END IF;
    END LOOP;
    id_user_ := dispatch.pk_security.logout;
  END;
the error is returned while executing the procedure
pk_space_target.check_inout_space_target
I know the ORA-06508 could happen on open connections after a recompile.
But I did not recompile anything.

The only solution that works is to compile package pk_space_target introducing some error (decompile it) and re-compile without the error.
Than to the same with pk_process.

After the last recompile, everything start to work fine again.

Do you have any suggestion on how/what investigate?
I cannot find any cause!!

Thanks in advance,
Samuel
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 27 2012
Added on Oct 30 2012
8 comments
5,029 views