Re: ODBC connection - extra statements being run

  • From: "Norman Dunbar" <norman.dunbar@xxxxxxxxxxxxxxxxxxxxxxxxx>
  • To: <oracle-l@xxxxxxxxxxxxx>, <oracledba@xxxxxxxxxxx>, <John.Fedock@xxxxxxxxxxxx>
  • Date: Thu, 09 Feb 2006 08:12:17 +0000

Morning John,

Norman Dunbar.
Contract Oracle DBA.
Rivers House, Leeds.

Internal : 7 28 2051
External : 0113 231 2051


>>> "Fedock, John (KAM.RHQ)" <John.Fedock@xxxxxxxxxxxx> 02/08/06
08:46pm >>>
>> When a user connects to my HP-UX 10g database from Excel via ODBC
and runs a SQL select statement joining  2 tables, a 10046 trace clearly
shows >>that statement running quickly, then another mysterious
statement running, which is basically a select from the 2 tables with no
join.   This causes it to >> run for more than 10 minutes.  The original
statement runs < 2 second in SQLPLUS.    Can anyone explain?


I had a similar problem, without the mysterious query though, using
ODBC from Access to Oracle.

The access query did the equivalent of :

SELECT stuff
FROM table_a, table_b, table_c
WHERE table_a.something contains "some text"
AND <other joins here>;

ODBC fiddled about and discovered that the column being searched was a
LONG in the database. I presume it figured out that you cannot do a LIKE
on a LONG in Oracle so it simply dropped the where clauses off and
pulled back a cartesian join of all three tables in the query. I presume
the intention was to do some sort of filtering out at the Access end
rather than on the big, powerful, Oracle server end.

Unfortunately, the three tables were three of the biggest in the
database and a three way cartesian join resulted in something like 27
thousand million billion rows being 'returned' to Access. The cost of
the statement was something like 2567 G in the explain plan. The Access
user decided that the response time was too long and closed Access down.
This left the query still running at the Oracle end.

After a week and a half running (honest) Oracle started to sort the
results and the box simply stopped - the TEMP space was being absolutely
hammered.

My advice is simple :

"ODBC - just say NO!"

HTH

Cheers,
Norm.


Information in this message may be confidential and may be legally privileged. 
If you have received this message by mistake, please notify the sender 
immediately, delete it and do not copy it to anyone else.

We have checked this email and its attachments for viruses. But you should 
still check any attachment before opening it.

We may have to make this message and any reply to it public if asked to under 
the Freedom of Information Act, Data Protection Act or for litigation.  Email 
messages and attachments sent to or from any Environment Agency address may 
also be accessed by someone other than the sender or recipient, for business 
purposes.

If we have sent you information and you wish to use it please read our terms 
and conditions which you can get by calling us on 08708 506 506.  Find out more 
about the Environment Agency at www.environment-agency.gov.uk
--
//www.freelists.org/webpage/oracle-l


Other related posts: