Showing posts with label Oracle Metalink. Show all posts
Showing posts with label Oracle Metalink. Show all posts

Saturday, April 26, 2008

ORA-00936:missing expression



ORA-00936:missing expression

Cause:A required part of a clause or expression has been omitted. For example, a SELECT statement may have been entered without a list of columns or expressions or with an incomplete expression. This message is also issued in cases where a reserved word is misused, as in SELECT TABLE.

Action:Check the statement syntax and specify the missing component.

ORA-00936:missing expression

This Oracle error is mainly related to the SQL SELECT statements. One obvious reason is select column list is missing or expressions in the selected columns are incomplete.

Example:

One Simple example is

SELECT FROM EMPLOYEE; raise ORA-00936 error as the column list is missing..

This ORA-00936 may also caused with respective to the usage of the exponential operator “**” in the SQL statements. It may result the following errors:

ORA 936 missing expression
PLS-936
ORA 6550 line , column <>num:

ORA-00936 Exponential Operator Scenario:

Symptoms

Using the exponential operator '**' in a SQL statement results in ORA-936 or PLS-936 depending on whether the SQL statement is executed from SQLPLUS prompt or within a PL/SQL block.

SQL> select 2**2 from dual;
select 2**2 from dual
*
ERROR at line 1:
ORA-00936: missing expression

SQL> declare
2 x number := 2;
3 y number := 4;
4 z number;
5 begin
6 select x**y into z from dual;
7 end;
8 /
y number := 4;
*
ERROR at line 3:
ORA-06550: line 6, column 10:
PL/SQL: ORA-00936: missing expression
ORA-06550: line 6, column 1:
PL/SQL: SQL Statement ignored

Cause

'**' is a valid exponential character in PL/SQL and cannot be used in a SQL statement. The exponential operator '**' can be used in PL/SQL statements:

SQL> declare
2 x number := 2;
3 y number := 4;
4 z number;
5 begin
6 z := x**y;
7 end;
8 /

PL/SQL procedure successfully completed.

Fix

Use power() function instead of '**' in SQL statement'.

SQL> select power(2,2) from dual;

POWER(2,2)
----------
4

SQL> declare
2 x number := 2;
3 y number := 4;
4 z number;
5 begin
6 select power(x,y) into z from dual;
7 end;
8 /

PL/SQL procedure successfully completed.

Oracle Bugs related to ORA-00936 error:

There are also a few oracle bugs related to ORA-00936. Listed below are two bugs related to ORA-00936. You can find complete list of bugs at Oracle Metalink.

1) Bug#:4567818 base Bug#:4192148 (unpublished) on 9207

2) Bug#:4212516 (unpublished) on 10.1.0.4.0.

With these bugs, ORA-00936 error is thrown when the SELECT ON view fails.

Basically, ORA-00936 is thrown when a SQL view is created from "create or replace view MY_VIEW as select t.*,other_tab_col from tab t, other_tab". This creates a view definition that is incorrect in the DBA_VIEWS, thus throwing ORA-00936 and possible core dumps.

In order to fix the bugs and resolve ORA-00936, MetaLink offers these solutions for the appropriate version:

Fix for 9.2.0.7 :

Patch 4192148 is available for Solaris (64bit) and AIX5L Based Systems (64-bit).

Fix for 10.1.0.4 :

Patch 4212516 is available for most of the platforms.

ORA-00936 Example from Oracle Forum:

Question:

When trying o use the code below, I keep getting ORA-00936. What is the problem?

Dim sSQL As String = _
"UPDATE TBLICPMETHODS SET Frequency = @Frequency, " & _
"Calibration = @Calibration, QCValue = @QCVAlue" & _
" WHERE Frequency = '" & Session("EditFrequency") & "' AND MethodNumber = " & ddlMethods.SelectedValue

Dim connConnection As New OleDbConnection(Application("ERSconnectionStr"))

connConnection.Open()

Dim cmdCommand As New OleDbCommand(sSQL, connConnection)

Dim prmFrequency As OleDbParameter = _
New OleDbParameter("@Frequency", OleDbType.VarChar, 75)
prmFrequency.Value = sFrequency
cmdCommand.Parameters.Add(prmFrequency)

Dim prmCalibration As OleDbParameter = _
New OleDbParameter("@Calibration", OleDbType.Double, 75)
prmCalibration.Value = CDbl(sCalibration)
cmdCommand.Parameters.Add(prmCalibration)

Dim prmQCValue As OleDbParameter = _
New OleDbParameter("@QCValue", OleDbType.Double, 75)
prmQCValue.Value = CDbl(sQCValue)

cmdCommand.Parameters.Add(prmQCValue)
' MessageBox.show(cmdCommand.CommandText + ":Frequency=" + e.Item.Cells(2).Text + ":Calibration=" + e.Item.Cells(3).Text + ":QCValue=" + e.Item.Cells(4).Text)
Try
cmdCommand.ExecuteNonQuery()
Catch ex As OleDbException
MessageBox.show(ex.Message)
End Try

Answer:

What you are forgetting is that in OLEDB you cannot use named parameters. This being, your use of @parameter is throwing ORA-00936. Trying taking out the @ and using a question mark instead to clear up ORA-00936. Here is an example, instead of:

"UPDATE TBLICPMETHODS SET Frequency = @Frequency, " & _
"Calibration = @Calibration, QCValue = @QCVAlue"

use:

"UPDATE TBLICPMETHODS SET Frequency = ?, " & _
"Calibration = ?, QCValue = ?"

- By Mendus

 
 

Wednesday, April 23, 2008

ORA-00600: internal error code arguments:

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

Cause: This is the generic internal error number for Oracle program exceptions. This indicates that a process has encountered an exceptional condition.

Action: Report as a bug - the first argument is the internal error number

Most of the Oracle database administrators face the ORA-00600 Internal Error one or other time and it is very intricate resolving this error. So what is this ORA-600 error anyway?

ORA-600 errors are raised from the kernel code of the Oracle RDBMS software when an internal inconsistency is detected or an unexpected condition is met. This situation is not necessarily a bug as it might be caused by problems with the Operating System, lack of resources, hardware failures, etc.

With the ORA-600 error comes a list of arguments in square brackets. The first of these arguments tells us from where in the code the error was caught and thus is the key information in identifying the problem. This argument is either a number or a character string. The remaining arguments are used to supply further information eg. values of internal variables etc.

Whenever an ORA-600 error is raised a trace file is generated in either USER_DUMP_DEST or BACKGROUND_DUMP_DEST depending on whether the error was caught in a user or a background process. The error is also written in the alert log and so is the name of the trace file. The trace file contains vital information about what led to the error condition.

The following are some in depth details about the ORA-00600 Oracle error

Error:  ORA 600
Text:   internal error code, arguments: [%s], [%s], [%s], [%s], [%s], [%s], [%s]
-------------------------------------------------------------------------------
Cause:  This is the generic internal error number for Oracle program
        exceptions.    This indicates that a process has encountered an
        exceptional condition.
Action: Report as a bug - the first argument is the internal error number
 
*** Important: The notes below are for experienced users - See Note 22080.1
 
 
Explanation:
        Any ORA-600 error indicates Oracle has detected an internal 
        inconsistency or a problem which it doesnt know how best to 
        address. These are *NOT* necessarily bugs and can occur for
        reasons such as Operating System IO problems, running out of some
        resource etc..
 
Diagnosis:
        Oracle support need more information to determine what caused the
        error. The most useful items are:
 
        a) The alert log for the instance (and any other instances in
           a Parallel Server environment) 
           These should be in BACKGROUND_DUMP_DEST.
 
        b) The trace file for the failing session and any other
           relevant trace files.
 
        c) Information on what action was being performed.
 
        d) Whether the problem is reproducible or was a one off
           occurance.
 
        e) Anything that has recently been changed in the system
           environment. Eg: Has the OS been upgraded, Have any 
           database files just been restored, etc...
 
Articles:
        What information to collect for ORA 600                    
        ORA-600/ORA-7445 Troubleshooter   Note 153788.1

Where can you find more information about the ORA-600 error?

You can find further information on ORA-600 errors using MetaLink Search or by accessing the Oracle Internal Errors Technical Library (select "Top Tech Docs" in the main menu, locate the "Data Server" section. Here you will find the library dealing with Internal Errors).

Now you know this ORA-00600 error is more complex than any other Oracle error, so how to deal with these ORA-600 Internal Errors?

Unless you are able to identify the cause and possible fix for an ORA-600 error using the references mentioned below, it should be considered as a potentially serious issue and reported to Oracle Support for identification.

As mentioned in Note 146580.1 every ORA-600 error will generate a trace file. The name and location of the trace file is also written to the alert.log. To help Oracle Support determine what caused the ORA-600 you should open a TAR and supply the following information:

  1. The database alert log located in BACKGROUND_DUMP_DEST (for Oracle Real Application Clusters supply the alert log for all instances in the environment).
  2. The trace file mentioned in the alert log.
    • In case of multiple occurrences of the same ORA-600 error (ie. identical first arguments) you should only supply the first 2 or 3 trace files but do not delete any of the remaining traces as they might be required at a later stage.
    • In case of multiple different ORA-600 errors you should only supply the trace file from the first error. Oracle Support will request any other file that may be needed.
  3. Recent changes to the system environment, eg. hardware modifications, operating system upgrades, restore of datafiles, power failures, etc.
  4. Use RDA (Remote Diagnostic Agent) to collect important information:
    Note 314422.1 "Remote Diagnostic Agent (RDA) 4.0 - Overview"

The following is partial list of the ORA-00600 known bugs and issues. You can find complete list and details about these bugs at Oracle Metalink.

Partial list of ORA-00600 known bugs and issues:

  1. An Oracle ORA-00600 [729] : indicates a memory leak in the UGA. Setting diagnostic events 10262 ignores this error, that is, no ORA-00600 is produced even if a memory leak is detected.
  2. ORA-00600 [16365] : indicates a Half Duplex Violation. Shared servers and dispatchers cannot both be writing to the same virtual curcuit at the same time because they communicate with a half-duplex protocol (TTC protocol).
  3. ORA-00600 [kghpih:ds] : and ORA-00600 [17175] may occur in oracle 9.2.0.6 when two processes work on the same library cache object. fixed in oracle 9.2.0.7.. Note:300604.1
  4. An Oracle ORA-00600 [3020] : Bug.2322620 - RECOVERY HALTED ON PHYSICAL STANDBY WITH ORA-600 AND ORA-10564 Details: ORA-600 [3020] can occur on recovery of LOB data.Fixed in 8.1.7.5 PAtch available. This error occurred on our database recovery on the primary server.
  5. ora-00600 [12333] : Most probably a network error that may have caused bad data to be received or the client application may have sent the wrong data in the network buffer.
  6. Oracle ORA-00600 [12700] : Indicates corruption in index, table or the mapping between them. Upon this discovery, oracle marks the whole block as corrupt and users will not have normal access to the data from the corrupted block. This can also break referntial integrity and should be referred to oracle.
  7. ORA-00600 [lxhcsn] : Shutdown may dump ORA-7445. Known Bug 2311529

Conclusion:

In many cases ORA-00600 error indicates an existing corruption in the oracle database OR it can be a indication of events leading to data or database corruption.

Oracle database administrators should take an ORA-00600 error very seriously, and check any known fixes available in the Oracle MetlaLink and raise tars if no known fixes and work with oracle support to resolve the ORA-600 issue.