Category Archives: Oracle

ioerr & ORA-00257

iotk-explain-oracle-error.php is a facility that helps to provide substantive documentation for common Oracle errors that you might encounter while using IOTK. It was added to the framework because of the often abstract or unrelated messages given by Oracle’s error reporting facility oerr.

For example, if you receive an ORA-00257 error you can execute the following Oracle command:

oerr ora 257

oerr will produce the following documentation:

00257, 00000, "archiver error. Connect internal only, until freed."
// *Cause:  The archiver process received an error while trying to archive
//       a redo log.  If the problem is not resolved soon, the database
//       will stop executing transactions. The most likely cause of this
//       message is the destination device is out of space to store the
//       redo log file.
// *Action:  Check archiver trace file for a detailed description
//        of the problem. Also verify that the
//       device specified in the initialization parameter
//       ARCHIVE_LOG_DEST is set up properly for archiving.

Instead of executing oerr to get a description of the issue, you can execute IOTK’s ioerr using the same command line parameters passed to oerr:

ioerr ora 257

Will produce the following documentation:

ORA-257
-------

Oracle's (oerr ora 257) official description:
archiver error. Connect internal only, until freed.

PROBLEM DESCRIPTION
-------------------

Attempts to service requests by querying or making transactions against Oracle
produce the following error:

exception 'ut_Oracle_Error' with message '
==================================================
Array
(
     => 257
    [message] => ORA-00257: archiver error. Connect internal only, until freed.
    [offset] => 0
    [sqltext] =>
)
==================================================

As a result of this issue, Oracle is essentially useless for retrieving or
manipulating data.

RESOLUTION
----------

o Log into Oracle as sysdba by executing the following as the oracle user:

    sqlplus / as sysdba

o Execute this command at the SQL*Plus prompt:

    SQL> show parameter db_recovery

  (Note, "SQL>" is the SQL*Plus prompt.)

o You should see something like the following:

    NAME                                 TYPE        VALUE
    ------------------------------------ ----------- ------------------------------
    db_recovery_file_dest                string      /path/to/flash_recovery_area
    db_recovery_file_dest_size           big integer 2G

o Exit SQL*Plus and execute:

    df -k

o You need to determine if the path set for "db_recovery_file_dest" (in this
  case "/path/to/flash_recovery_area") is 100% full.  If so, Oracle can no
  longer write archive logs.  If the disk is full you need to free up space.

o If the disk is not full you most likely need to increase the amount of space
  Oracle is allowed to use for archive logs, defined by "db_recovery_file_dest
  _size".  In this case, the value is set to "2G" or 2 gigabytes.  Oracle might
  need more than 2 gigs for archive logs.  You need to increase this.

o Log into Oracle as sysdba by executing the following as the oracle user:

    sqlplus / as sysdba

o Execute the following:

    SQL> alter system set db_recovery_file_dest_size = 5g;

  (In this case, I'm increasing "db_recovery_file_dest_size" from 2 gigs to
   5 gigs thus giving Oracle 3 more gigs to use for archive logs.)

o When this completes successfully you should see:

    System altered.

o Next, execute the following:

    SQL> alter system switch logfile;

o When this completes successfully you should see:

    System altered.

The system should be recovered.

In total, documentation is provided for 21 errors ranging from issues with straightforward solutions (like this one) to more complex issues with solutions requiring code changes or upgrades of Oracle.


ioerr & ORA-03137

iotk-explain-oracle-error.php is a facility that helps to provide substantive documentation for common Oracle errors that you might encounter while using IOTK. It was added to the framework because of the often abstract or unrelated messages given by Oracle’s error reporting facility oerr.

For example, if you receive an ORA-03137 error you can execute the following Oracle command:

oerr ora 3137

oerr will produce the following documentation:

03137, 00000, "TTC protocol internal error : [%s] [%s] [%s] [%s] [%s] [%s] [%s] [%s]"
// *Cause:  TTC protocol internal error.
// *Action: Contact Oracle Support Services.

The right solution for this problem may not require you to call Oracle Support Services. My experience with them is that getting resolution to an issue is a rarity and I would call a number of consulting firms I’ve worked with in the past before calling them. The solution might be quite simple though: disable statement caching.

Instead of executing oerr to get a description of the issue, you can execute IOTK’s ioerr using the same command line parameters passed to oerr:

ioerr ora 3137

Will produce the following documentation:

ORA-3137
--------

Oracle's (oerr ora 3137) official description:
TTC protocol internal error : [%s] [%s] [%s] [%s] [%s] [%s] [%s] [%s]

PROBLEM DESCRIPTION
-------------------

Occasionally you get this error when you attempt to execute queries.  The error
appears both in the PHP error log and in the Oracle alert log and looks like
this:

ORA-03137: TTC protocol internal error : [12333] [10] [84] [101] [] [] [] []

RESOLUTION
----------

Find out what the value is for the PHP configuration setting:

    oci8.statement_cache_size

You find this either by looking in the php.ini file, if you know where it is,
or by executing the following command on the command line:

    php -i | grep statement_cache_size

If the value for the statement_cache_size is not 0, change it to zero and
re-execute your tests/queries.

NOTES
-----

We encountered this error using the following software packages:

    Oracle 11.1.0.6.0
    Oracle Instant Client 11.1.0.1
    PHP 5.2.4
    OCI 1.3.5
    APC 3.0.14
    openSuSE 10.3

In total, documentation is provided for 19 errors ranging from issues with straightforward solutions (like this one) to more complex issues with solutions requiring code changes or upgrades of Oracle.

I will document all of the errors that I’ve tracked and documented while building and using IOTK. I suspect a few of my solutions will be helpful to people. Here are the specific errors that I have documented:

ORA-01000
An issue caused by a memory leak in specific versions of older PHP OCI 8 drivers. Proud to say I helped provide reproducible test cases for this one for Oracle.

ORA-01001
ORA-01031
ORA-01036
ORA-12154
ORA-12528
ORA-12541
ORA-01745
ORA-01861
ORA-02429
ORA-28002

ORA-03114
If accompanied by an ORA-07445 and core dump you might need to upgrade Oracle to 11g. This was a nasty one.

ORA-03137
ORA-00054
ORA-06550
ORA-06553
ORA-00904

OCI-22303
An issue that used to arise when calling oci_new_collection() to bind user defined types to stored procedures. This is essentially another memory leak in the PHP OCI 8 driver, one for which I also provided reproducible test cases to Oracle.


ioerr & ORA-04068

iotk-explain-oracle-error.php is a facility that helps to provide substantive documentation for common Oracle errors that you might encounter while using IOTK.  It was added to the framework because of the often abstract or unrelated messages given by Oracle’s error reporting facility oerr.

For example, if you receive an ORA-04068 error you can execute the following Oracle command:

oerr ora 4068

oerr will produce the following documentation:

04068, 00000, "existing state of packages%s%s%s has been discarded"
// *Cause:  One of errors 4060 - 4067 when attempt to execute a stored
//          procedure.
// *Action: Try again after proper re-initialization of any application's
//          state.

For someone new to IOTK, Oracle, or this error it might take some time to figure out exactly what to do. But after using IOTK for awhile, the solution is quite simple: restart Apache.

Instead of executing oerr to get a description of the issue, you can execute IOTK’s ioerr using the same command line parameters passed to oerr:

ioerr ora 4068

Will produce the following documentation:

ORA-4068
--------

Oracle's (oerr ora 4068) official description:
existing state of packages%s%s%s has been discarded

PROBLEM DESCRIPTION
-------------------

This issue occurs when interacting with stored procedures through a Web
browser.  You will receive this error after hitting submit on a form.  Prior
to receiving this error you either rebuilt your application or a part of it
that included reloading PL/SQL.

This error is occurring because Oracle has determined that the cached version
of your stored procedure code no longer matches changes to the database.  In
essence the application is out of sync with the database.

Here is what Oracle will report:

    exception 'ut_Oracle_Error' with message '
    ==================================================
    Array
    (
         => 4068
        [message] => ORA-04068: existing state of packages has been discarded
    ORA-04061: existing state of package "IOTK.CO_PKG" has been invalidated
    ORA-04065: not executed, altered or dropped package "IOTK.CO_PKG"
    ORA-06508: PL/SQL: could not find program unit being called: "IOTK.CO_PKG"
    ORA-06512: at line 3
        [offset] => 0
        [sqltext] => [Full text of query that was being executed]
        [p_id] => inout
        [p_local_time] => 1241799814
        [p_name] => IOTK
    )
    ==================================================

RESOLUTION
----------

Restart your Web server and than go back to your browser and hit the reload
button.

Restarting your Web server will cause Oracle to re-cache the stored procedure
code.  Reloading the page in your browser will cause your browser to re-post
the form.

NOTES
-----

It is common to get this error after rebuilding your application or performing
a push to production.  To ensure this issue does not occur, always restart your
Web server after either of these occurrences.

In total, documentation is provided for 18 errors ranging from issues with straightforward solutions (like this one) to more complex issues with solutions requiring code changes or upgrades of Oracle.

I will document all of the errors that I’ve tracked and documented while building and using IOTK. I suspect a few of my solutions will be helpful to people. Here are the specific errors that I have documented:

ORA-01000
An issue caused by a memory leak in specific versions of older PHP OCI 8 drivers. Proud to say I helped provide reproducible test cases for this one for Oracle.

ORA-01001
ORA-01031
ORA-01036
ORA-12154
ORA-12528
ORA-12541
ORA-01745
ORA-01861
ORA-02429
ORA-28002

ORA-03114
If accompanied by an ORA-07445 and core dump you might need to upgrade Oracle to 11g. This was a nasty one.

ORA-00054
ORA-06550
ORA-06553
ORA-00904

OCI-22303
An issue that used to arise when calling oci_new_collection() to bind user defined types to stored procedures. This is essentially another memory leak in the PHP OCI 8 driver, one for which I also provided reproducible test cases to Oracle.


Follow

Get every new post delivered to your Inbox.