TO_BINARY_DOUBLE after upgrade 9i/10g
Hi all,
we encountered strange xplans after migration. I found out the issue was ODBC provided bind variable as type 101
*kkscoacd
Bind#0
oacdty=101 mxl=08(64) mxlc=00 mal=00 scl=00 pre=00
oacflg=01 fl2=1000000 frm=00 csi=31 siz=8 off=0
No bind buffers allocated*
which I realized is new type BINARY_DOUBLE which was not there in 9i. So the optimizer transformed this select:
SELECT "ACCOUNT_ID" FROM "MDM"."ACCOUNT_ADDRESS" WHERE ("ACCOUNT_ID" = :V1 )
into
SELECT "ACCOUNT_ID" FROM "MDM"."ACCOUNT_ADDRESS" WHERE (TO_BINARY_DOUBLE("ACCOUNT_ID") = :V1 )
which determined the FULL SCAN on the table . 9i did not know about this type and did not convert the value which resulted in good index range scan.
NOW: As I'm waiting for the dev to fix it somehow I tried a workaround which is clearly a creation of FuncBasedIndex on ACCOUNT_ID named NU_AD_ACCOUNT_BNDB while NU_AD_ACCOUNT_BNDB was the original index on ACCOUNT_ID.
Running it once again I came across another strange behavior which I could not explain. The optimizer did NOT pick none of these indexes but the PK instead and did an index_full_scan on it. PK is composite index on ACCOUNT_ID plus another column which is NOT filtered in the SQL.
Please help me explain why despite the cost of NU_AD_ACCOUNT_BNDB the optmizer decided to go on the PK in FFS. Here's the 10053 trace file:
QUERY BLOCK TEXT
SELECT "ACCOUNT_ID" FROM "MDM"."ACCOUNT_ADDRESS" WHERE ("ACCOUNT_ID" = :V1 )
QUERY BLOCK SIGNATURE
qb name was generated
signature (optimizer): qb_name=SEL$1 nbfros=1 flg=0
fro(0): flg=0 objn=1048639 hint_alias="ACCOUNT_ADDRESS"@"SEL$1"
SYSTEM STATISTICS INFORMATION
Using WORKLOAD Stats
CPUSPEED: 765 millions instructions/sec
SREADTIM: 0 milliseconds
MREADTIM: 5 millisecons
MBRC: 54.000000 blocks
MAXTHR: 100915200 bytes/sec
SLAVETHR: 1635328 bytes/sec
BASE STATISTICAL INFORMATION
Table Stats::
Table: ACCOUNT_ADDRESS Alias: ACCOUNT_ADDRESS
#Rows: 3564300 #Blks: 36411 AvgRowLen: 152.00
Index Stats::
Index: NU_AD_ACCOUNT Col#: 1
LVLS: 2 #LB: 4226 #DK: 3539358 LB/K: 1.00 DB/K: 1.00 CLUF: 3492510.00
Index: NU_AD_ACCOUNT_BNDB Col#: 30
LVLS: 2 #LB: 5125 #DK: 3725283 LB/K: 1.00 DB/K: 1.00 CLUF: 3665379.00
Index: PK_AA1 Col#: 1 2
LVLS: 2 #LB: 4976 #DK: 3479567 LB/K: 1.00 DB/K: 1.00 CLUF: 3426964.00
SINGLE TABLE ACCESS PATH
BEGIN Single Table Cardinality Estimation
Column (#30): SYS_NC00030$(BINARY_DOUBLE) NO STATISTICS (using defaults)
AvgLen: 6.00 NDV: 111384 Nulls: 0 Density: 8.9779e-06
Column (#1): ACCOUNT_ID(NUMBER)
AvgLen: 6.00 NDV: 3564300 Nulls: 0 Density: 2.8056e-07 Min: 17 Max: 4524701
Histogram: HtBal #Bkts: 254 UncompBkts: 254 EndPtVals: 255
Table: ACCOUNT_ADDRESS Alias: ACCOUNT_ADDRESS
Card: Original: 3564300 Rounded: 35643 Computed: 35643.00 Non Adjusted: 35643.00
END Single Table Cardinality Estimation
Access Path: TableScan
Cost: 95348.31 Resp: 95348.31 Degree: 0
Cost_io: 55958.00 Cost_cpu: 1958683004
Resp_io: 55958.00 Resp_cpu: 1958683004
Access Path: index (index (FFS))
Index: NU_AD_ACCOUNT
resc_io: 6497.00 resc_cpu: 1527703771
ix_sel: 0.0000e+00 ix_sel_with_filters: 1
Access Path: index (FFS)
Cost: 37220.05 Resp: 37220.05 Degree: 16
Cost_io: 6497.00 Cost_cpu: 1527703771
Resp_io: 6497.00 Resp_cpu: 1527703771
Access Path: index (index (FFS))
Index: PK_AA1
resc_io: 7648.00 resc_cpu: 1509898711
ix_sel: 0.0000e+00 ix_sel_with_filters: 1
Access Path: index (FFS)
Cost: 38012.98 Resp: 38012.98 Degree: 1
Cost_io: 7648.00 Cost_cpu: 1509898711
Resp_io: 7648.00 Resp_cpu: 1509898711
kkofmx: index filter:TO_BINARY_DOUBLE("ACCOUNT_ADDRESS"."ACCOUNT_ID")=:B1
kkofmx: index filter:TO_BINARY_DOUBLE("ACCOUNT_ADDRESS"."ACCOUNT_ID")=:B1
Access Path: index (FullScan)
Index: NU_AD_ACCOUNT
resc_io: 4228.00 resc_cpu: 749064497
ix_sel: 1 ix_sel_with_filters: 1
Cost: 4079.62 Resp: 4079.62 Degree: 1
Access Path: index (AllEqGuess)
Index: NU_AD_ACCOUNT_BNDB
resc_io: 14665.00 resc_cpu: 148095035
ix_sel: 0.004 ix_sel_with_filters: 0.004
Cost: 1764.33 Resp: 1764.33 Degree: 1
Access Path: index (FullScan)
Index: PK_AA1
resc_io: 4978.00 resc_cpu: 744413457
ix_sel: 1 ix_sel_with_filters: 1
Cost: 4145.27 Resp: 4145.27 Degree: 1
****** trying bitmap/domain indexes ******
****** finished trying bitmap/domain indexes ******
Best:: AccessPath: IndexRange Index: PK_AA1
Cost: 4145.27 Degree: 1 Resp: 4145.27 Card: 35643.00 Bytes: 0
Thank You for your analysis.
Of course many things had changed with 10g but this is a simple one and even If I tried to tweak the optimizer to make it behave as 9i I couldnt make it work.
this select along with others on the same table and for the same filtered column used to run smoothly on 9i. As I tried to sort out why on 10g it wasn't any longer happening, I bumped into the fact the bind variable's type is declare as binary_double while the column is NUMBER...
*kkscoacd
Bind#0
oacdty=101 mxl=08(64) mxlc=00 mal=00 scl=00 pre=00
Thus all those select were running on full scan after migration because the index values wasnt matched because of the conversion forced during parse( as I spotted in trace file). That didn't occur on 9i because on that version there was no BINARY_DOUBLE so I assume the optimizer accepted the bind variable's type as simply a number. Am I wrong?
So my assumption is that ODBC value was already mistyped on 9i but luckily it kept working because it wasnt handled
Simone
Similar Messages
-
Problem with Java Application after upgrade to 10g
after upgrading to 10g if I enable coloumn of varchar255 to load into memory of my middleware orm following error is thrown,
javax.servlet.jsp.JspException at jsp.viewsinglerecord.throwError(_viewsinglerecord.java:31) [SRC:/jsp/standardinclude.jsp:84] at jsp.viewsinglerecord._jspService(_viewsinglerecord.java:1185) [SRC:/jsp/displaymultiplerecords.jsp:461] at com.orionserver[Oracle Application Server Containers for J2EE 10g (10.1.2.3.0)].http.OrionHttpJspPage.service(OrionHttpJspPage.java:56) at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:356) at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:498) at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:402) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.3.0)].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:835) at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.3.0)].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:341) at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.3.0)].server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:230) at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.3.0)].server.http.GetParametersRequestDispatcher.forward(GetParametersRequestDispatcher.java:257) at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069) at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.3.0)].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:835) at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.3.0)].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:341) at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.3.0)].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:816) at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.3.0)].server.http.AJPRequestHandler.run(AJPRequestHandler.java:231) at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.3.0)].server.http.AJPRequestHandler.run(AJPRequestHandler.java:136) at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.3.0)].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192) at java.lang.Thread.run(Thread.java:534)
Any lights on this issue ?after upgrading to 10g if I enable coloumn of varchar255 to load into memory of my middleware orm following error is thrown,
javax.servlet.jsp.JspException at jsp.viewsinglerecord.throwError(_viewsinglerecord.java:31) [SRC:/jsp/standardinclude.jsp:84] at jsp.viewsinglerecord._jspService(_viewsinglerecord.java:1185) [SRC:/jsp/displaymultiplerecords.jsp:461] at com.orionserver[Oracle Application Server Containers for J2EE 10g (10.1.2.3.0)].http.OrionHttpJspPage.service(OrionHttpJspPage.java:56) at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:356) at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:498) at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:402) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.3.0)].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:835) at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.3.0)].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:341) at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.3.0)].server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:230) at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.3.0)].server.http.GetParametersRequestDispatcher.forward(GetParametersRequestDispatcher.java:257) at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069) at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.3.0)].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:835) at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.3.0)].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:341) at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.3.0)].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:816) at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.3.0)].server.http.AJPRequestHandler.run(AJPRequestHandler.java:231) at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.3.0)].server.http.AJPRequestHandler.run(AJPRequestHandler.java:136) at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.3.0)].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192) at java.lang.Thread.run(Thread.java:534)
Any lights on this issue ? -
Select after upgrade 9i - 10g runs slowly thousand times - urgent
I have select which runs around one second on Oracle 9. After upgrade to 10g this select runs more than two hours. I compute statistics on all tables, all columns and all indexes. This select consist from two parts - every part run on oracle 10g around 0.5 second but together more than 2 hours. When I rewrite it using WITH clausule, it runs 2 second. But I don't want to rewrite selects .. I want to find why it runs slow on 10g.
Below are original and rewrited select with their execution plans.
Any idea or recomendation?
Select:
SELECT * FROM (
SELECT DISTINCT from_fix_ident ident, from_ident_icao icao
, latitude1 latitude, longitude1 longitude, from_fix_fea_pk src
, -1 mslink
FROM l_sky_airway, l_dgn_airway
WHERE l_sky_airway.mslink=l_dgn_airway.mslink
UNION ALL
SELECT DISTINCT to_fix_ident ident, to_ident_icao icao
, latitude2 latitude, longitude2 longitude, to_fix_fea_pk src
, -2 mslink
FROM l_sky_airway, l_dgn_airway
WHERE l_sky_airway.mslink=l_dgn_airway.mslink
UNION ALL
SELECT ident, icao, latitude, longitude, 5 src, mslink FROM l_sky_navaid
UNION ALL
SELECT ident, icao, latitude, longitude, 6 src, mslink FROM l_sky_waypoint)
WHERE ident||';'||icao||';'||src IN (
SELECT ident||';'||icao||';'||src FROM (
SELECT from_fix_ident ident
, from_ident_icao icao
, latitude1 latitude
, longitude1 longitude
, from_fix_fea_pk src
FROM l_sky_airway, l_dgn_airway
WHERE l_sky_airway.mslink = l_dgn_airway.mslink
UNION ALL
SELECT to_fix_ident ident
, to_ident_icao icao
, latitude2 latitude
, longitude2 longitude
, to_fix_fea_pk src
FROM l_sky_airway, l_dgn_airway
WHERE l_sky_airway.mslink = l_dgn_airway.mslink
MINUS
SELECT ident
, icao
, latitude
, longitude
, 5 src
FROM l_sky_navaid
MINUS
SELECT ident
, icao
, latitude
, longitude
, 6 src
FROM l_sky_waypoint
ORDER BY ident, icao, src, mslink, latitude, longitude;Execution plan:
Plan
SELECT STATEMENT ALL_ROWSCost: 2 003 Bytes: 1 572 402 240 Cardinality: 24 568 785
29 SORT ORDER BY Cost: 2 003 Bytes: 1 572 402 240 Cardinality: 24 568 785
28 FILTER
12 VIEW EUS. Cost: 825 Bytes: 3 522 880 Cardinality: 55 045
11 UNION-ALL
4 HASH UNIQUE Cost: 398 Bytes: 981 948 Cardinality: 22 317
3 HASH JOIN Cost: 142 Bytes: 981 948 Cardinality: 22 317
1 TABLE ACCESS FULL TABLE EUS.L_SKY_AIRWAY Cost: 85 Bytes: 290 121 Cardinality: 22 317
2 TABLE ACCESS FULL TABLE EUS.L_DGN_AIRWAY Cost: 56 Bytes: 691 827 Cardinality: 22 317
8 HASH UNIQUE Cost: 398 Bytes: 981 948 Cardinality: 22 317
7 HASH JOIN Cost: 143 Bytes: 981 948 Cardinality: 22 317
5 TABLE ACCESS FULL TABLE EUS.L_SKY_AIRWAY Cost: 85 Bytes: 290 121 Cardinality: 22 317
6 TABLE ACCESS FULL TABLE EUS.L_DGN_AIRWAY Cost: 56 Bytes: 691 827 Cardinality: 22 317
9 TABLE ACCESS FULL TABLE EUS.L_SKY_NAVAID Cost: 6 Bytes: 57 225 Cardinality: 1 635
10 TABLE ACCESS FULL TABLE EUS.L_SKY_WAYPOINT Cost: 22 Bytes: 324 712 Cardinality: 8 776
27 VIEW EUS. Cost: 325 Bytes: 12 042 Cardinality: 446
26 MINUS
23 MINUS
20 SORT UNIQUE Cost: 325 Bytes: 23 128 Cardinality: 446
19 UNION-ALL
15 HASH JOIN Cost: 145 Bytes: 9 812 Cardinality: 223
13 TABLE ACCESS FULL TABLE EUS.L_SKY_AIRWAY Cost: 89 Bytes: 2 899 Cardinality: 223
14 TABLE ACCESS FULL TABLE EUS.L_DGN_AIRWAY Cost: 56 Bytes: 691 827 Cardinality: 22 317
18 HASH JOIN Cost: 146 Bytes: 9 812 Cardinality: 223
16 TABLE ACCESS FULL TABLE EUS.L_SKY_AIRWAY Cost: 89 Bytes: 2 899 Cardinality: 223
17 TABLE ACCESS FULL TABLE EUS.L_DGN_AIRWAY Cost: 56 Bytes: 691 827 Cardinality: 22 317
22 SORT UNIQUE Bytes: 512 Cardinality: 16
21 TABLE ACCESS FULL TABLE EUS.L_SKY_NAVAID Cost: 6 Bytes: 512 Cardinality: 16
25 SORT UNIQUE Bytes: 2 992 Cardinality: 88
24 TABLE ACCESS FULL TABLE EUS.L_SKY_WAYPOINT Cost: 24 Bytes: 2 992 Cardinality: 88 Rewrited select which run fast:
WITH inselect AS
(SELECT ident || ';' || icao || ';' || src
FROM (SELECT from_fix_ident ident, from_ident_icao icao,
latitude1 latitude, longitude1 longitude,
from_fix_fea_pk src
FROM l_sky_airway, l_dgn_airway
WHERE l_sky_airway.mslink = l_dgn_airway.mslink
UNION ALL
SELECT to_fix_ident ident, to_ident_icao icao,
latitude2 latitude, longitude2 longitude,
to_fix_fea_pk src
FROM l_sky_airway, l_dgn_airway
WHERE l_sky_airway.mslink = l_dgn_airway.mslink
MINUS
SELECT ident, icao, latitude, longitude, 5 src
FROM l_sky_navaid
MINUS
SELECT ident, icao, latitude, longitude, 6 src
FROM l_sky_waypoint)),
mainselect AS
(SELECT DISTINCT from_fix_ident ident, from_ident_icao icao,
latitude1 latitude, longitude1 longitude,
from_fix_fea_pk src, -1 mslink
FROM l_sky_airway, l_dgn_airway
WHERE l_sky_airway.mslink = l_dgn_airway.mslink
UNION ALL
SELECT DISTINCT to_fix_ident ident, to_ident_icao icao,
latitude2 latitude, longitude2 longitude,
to_fix_fea_pk src, -2 mslink
FROM l_sky_airway, l_dgn_airway
WHERE l_sky_airway.mslink = l_dgn_airway.mslink
UNION ALL
SELECT ident, icao, latitude, longitude, 5 src, mslink
FROM l_sky_navaid
UNION ALL
SELECT ident, icao, latitude, longitude, 6 src, mslink
FROM l_sky_waypoint)
SELECT *
FROM mainselect
WHERE ident || ';' || icao || ';' || src IN (SELECT *
FROM inselect)
ORDER BY ident, icao, src, mslink, latitude, longitude;
Plan
SELECT STATEMENT ALL_ROWSCost: 550 336 Bytes: 2 383 172 145 Cardinality: 24 568 785
31 SORT ORDER BY Cost: 550 336 Bytes: 2 383 172 145 Cardinality: 24 568 785
30 HASH JOIN Cost: 2 647 Bytes: 2 383 172 145 Cardinality: 24 568 785
17 VIEW VIEW SYS.VW_NSO_1 Cost: 1 173 Bytes: 1 472 922 Cardinality: 44 634
16 HASH UNIQUE Cost: 1 173 Bytes: 1 205 118 Cardinality: 44 634
15 VIEW EUS. Cost: 828 Bytes: 1 205 118 Cardinality: 44 634
14 MINUS
11 MINUS
8 SORT UNIQUE Cost: 828 Bytes: 2 314 600 Cardinality: 44 634
7 UNION-ALL
3 HASH JOIN Cost: 142 Bytes: 981 948 Cardinality: 22 317
1 TABLE ACCESS FULL TABLE EUS.L_SKY_AIRWAY Cost: 85 Bytes: 290 121 Cardinality: 22 317
2 TABLE ACCESS FULL TABLE EUS.L_DGN_AIRWAY Cost: 56 Bytes: 691 827 Cardinality: 22 317
6 HASH JOIN Cost: 143 Bytes: 981 948 Cardinality: 22 317
4 TABLE ACCESS FULL TABLE EUS.L_SKY_AIRWAY Cost: 85 Bytes: 290 121 Cardinality: 22 317
5 TABLE ACCESS FULL TABLE EUS.L_DGN_AIRWAY Cost: 56 Bytes: 691 827 Cardinality: 22 317
10 SORT UNIQUE Bytes: 52 320 Cardinality: 1 635
9 TABLE ACCESS FULL TABLE EUS.L_SKY_NAVAID Cost: 6 Bytes: 52 320 Cardinality: 1 635
13 SORT UNIQUE Bytes: 298 384 Cardinality: 8 776
12 TABLE ACCESS FULL TABLE EUS.L_SKY_WAYPOINT Cost: 22 Bytes: 298 384 Cardinality: 8 776
29 VIEW EUS. Cost: 825 Bytes: 3 522 880 Cardinality: 55 045
28 UNION-ALL
21 HASH UNIQUE Cost: 398 Bytes: 981 948 Cardinality: 22 317
20 HASH JOIN Cost: 142 Bytes: 981 948 Cardinality: 22 317
18 TABLE ACCESS FULL TABLE EUS.L_SKY_AIRWAY Cost: 85 Bytes: 290 121 Cardinality: 22 317
19 TABLE ACCESS FULL TABLE EUS.L_DGN_AIRWAY Cost: 56 Bytes: 691 827 Cardinality: 22 317
25 HASH UNIQUE Cost: 398 Bytes: 981 948 Cardinality: 22 317
24 HASH JOIN Cost: 143 Bytes: 981 948 Cardinality: 22 317
22 TABLE ACCESS FULL TABLE EUS.L_SKY_AIRWAY Cost: 85 Bytes: 290 121 Cardinality: 22 317
23 TABLE ACCESS FULL TABLE EUS.L_DGN_AIRWAY Cost: 56 Bytes: 691 827 Cardinality: 22 317
26 TABLE ACCESS FULL TABLE EUS.L_SKY_NAVAID Cost: 6 Bytes: 57 225 Cardinality: 1 635
27 TABLE ACCESS FULL TABLE EUS.L_SKY_WAYPOINT Cost: 22 Bytes: 324 712 Cardinality: 8 776 Reformated
Message was edited by:
Vlada
Message was edited by:
VladaVlada,
could you please post an properly formatted explain plan output using DBMS_XPLAN.DISPLAY including the "Predicate Information" section below the plan to provide more details regarding your statement. Please use the \[code\] and \[code\] tags to enhance readability of the output provided:
In SQL*Plus:
SET LINESIZE 130
EXPLAIN PLAN FOR <your statement>;
SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY);In order to get a better understanding where your statement spends the time you might want to turn on SQL trace as described here:
[When your query takes too long|http://forums.oracle.com/forums/thread.jspa?threadID=501834]
and post the "tkprof" output here, too.
Could you also provide the information which version of 10g you're currently using? (4-digit version number). Note that 10g introduced a couple of significant changes including CPU costing enabled by default and a different default setting of DBMS_STATS regarding column histograms.
So you might want to re-gather the statistics using the method_opt parameter of the DBMS_STATS.GATHER__STATS procedures explicitly defined as "FOR ALL COLUMNS SIZE 1" to mimic the 9i behaviour.
You also might want to try the "OPTIMIZER_FEATURES_ENABLE" session setting set to "9.2.0" in order to find out if any of the new optimizer features could be causing the issue if re-gathering the statistics as suggested above doesn't make a difference.
Do you know if the tables/indexes in your 9i database also had reasonable statistics?
Regards,
Randolf
Oracle related stuff blog:
http://oracle-randolf.blogspot.com/
SQLTools++ for Oracle:
http://www.sqltools-plusplus.org:7676/
http://sourceforge.net/projects/sqlt-pp/
Edited by: Randolf Geist on Sep 8, 2008 9:32 AM
Added some specific suggestions -
After Upgrade OBI 10g to 11g:Odbc driver returned an error - SQLExecDirectW
Hi all,
for an OBI upgrade from 10g to 11g I used a RPD and Webcatalog based on a remote machine other than my local machine. Firstable I am making the tests on a Linux Virtual machine, which uses the Sample Lite version from Oracle.
I made the following steps:
1. I upgraded the RPD and Webcatalog. It worked without any errors.
2. I set the static variable BI_EE_HOME via Administration Tool to the path in the Linux machine.
--> Here I am not sure if the set path is correct. It begins with: \bi\ ...\instances\...\coreapplication_obis1 (... : I can't mention here the whole path name).
--> When the OBI Server is installed in Windows, the mentioned static variable points to something like 'C:\<install folder>\...\coreapplication_obis1'
--> Question: is the begin of my set path correct?. I set that pointing to the Linux OBI Server, because the OBI Server is installed on Linux.
Problem:
After login as the user in RPD: Administrator/<Password for my upgraded RPD> I can see the links in the Catalog and the Dashboards links. But I can not see any values, any Reports when going through the links.
For example when trying to see a Dashboard with date 12.02.2011it happens:
Odbc driver returned an error (SQLExecDirectW).
Status: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] general error.
[nQSError: 43113] Message returned from OBIS.
[nQSError: 43119] Query Failed:
[nQSError: 17001] Oracle Error code: 12154, message: ORA-12154: TNS:could not resolve the connect identifier specified
at OCI call OCIServerAttach.
[nQSError: 17014] Could not connect to Oracle database. (HY000)
SQL Issued: SELECT "Dimension_-_My Dimension"."MyDimension" saw_0 FROM "Accounting (ACC)" WHERE "Dimension_-_My Dimension"."MyDimension" LIKE 'J%' ORDER BY saw_0
I think its not retrieving the data from the remote database, because I don't have the data of the remote database in my local. I think the OBI Server still is pointing to the local virtual machine Oracle database.
Can anybody tell me what happens here and how can I solve this problem?.
I would appreciate any help....Hi gerardnico,
I've tried many things and did as in your articles, but I don't have success with that.
These are the things I did:
1. I searched for the file tnsnames.ora in my Linux virtual machine. I could find it in many paths:
/.../Oracle_BI1/network/admin/samples/tnsnames.ora
/.../oracle/xe/app/oracle/product/10.2.0/server/hs/admin/tnsnames.ora.sample
/.../oracle/xe/app/oracle/product/10.2.0/server/network/admin/tnsnames.ora
/.../oracle/xe/app/oracle/product/10.2.0/server/network/admin/samples/tnsnames.ora
/.../oracle/xe/app/oracle/product/10.2.0/server/network/admin/temp/tnsnames.ora
/.../usr/lib/oracle/xe/app/oracle/product/10.2.0/server/network/admin
in the last path I found the listener.ora as well.
2. I took the tnsnames.ora from the last path, because the ORACLE_HOME points to /.../usr/lib/oracle/xe/app/oracle/product/10.2.0/server
3. I edited the tnsnames.ora this way:
# tnsnames.ora Network Configuration File:
XE =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = host_of_the_remote_machine)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = database_name_of_the_remote_machine)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
(CONNECT_DATA =
(SID = database_SID_of_the_remote_machine)
(PRESENTATION = RO)
4. I made a backup of the tnsnames.ora in path /.../Oracle_BI1/network/admin/samples/tnsnames.ora
and copied the tnsnames.ora from /.../usr/lib/oracle/xe/app/oracle/product/10.2.0/server/network/admin to the Oracle_BI1 path
5. I set the TNS_ADMIN to /.../usr/lib/oracle/xe/app/oracle/product/10.2.0/server/network/admin
6. I restarted the BI Server
No success in what I did. The error is still there.
7. I've tried also: sqlplus database_user_remote_machine/database_password_remote_machine@database_SID_remote_machine
I didn't get the connection:
SQL*Plus: Release 10.2.0.1.0 - Production on Thu Jun 16 04:36:10 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
ERROR:
ORA-12154: TNS:could not resolve the connect identifier specified
Enter user-name: database_user_remote_machine
Enter password:
ERROR:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux Error: 2: No such file or directory
What am I doing wrong here?. I am still thinking that I need the import of the database.
Additional SID=Service-Name=Database-name in the remote machine. -
SAP cannot start Oracle after Upgrading to 10g
I have upgraded Oracle to 10g (10.2). After upgrading I run startsap but sapstart can start Oracle database but R3trans cannot verify that the database is started.
the following log are in startdb.log. Please give me an idea what to do to solve this problem.
S27adm 22> more startdb.log
Mon Jun 2 13:00:22 GMT: 2008
LOGFILE FOR STARTING ORACLE
Mon Jun 2 13:00:22 GMT: 2008
checking required environment variables
ORACLE_HOME is >/oracle/S27/102_64<
ORACLE_SID is >S27<
Mon Jun 2 13:00:22 GMT: 2008
check initora
Mon Jun 2 13:00:22 GMT: 2008
check initora
Mon Jun 2 13:00:22 GMT: 2008
checking V2 connect
TNS Ping Utility for HPUX: Version 10.2.0.2.0 - Production on 02-JUN-2008 13:00:22
Copyright (c) 1997, 2005, Oracle. All rights reserved.
Used parameter files:
/oracle/S27/102_64/network/admin/sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (COMMUNITY = SAP.WORLD)(PROTOCOL = TCP)(HOST = er3asu81)(PORT = 1553)) (CONNECT_DATA = (SERVER = DEDICATED) (
SERVICE_NAME = S27.world)))
OK (0 msec)
tnsping: V2 connect to S27
Mon Jun 2 13:00:22 GMT: 2008
Connect to the database to check the database state:
R3trans: connect check finished with return code: 12
Database not available
Mon Jun 2 13:00:22 GMT: 2008
Shutdown database
First trying to shutdown the database - May be,
the database is in the nomount or mount state
Mon Jun 2 13:00:22 GMT: 2008
starting database
SQL*Plus: Release 10.2.0.2.0 - Production on Mon Jun 2 13:00:23 2008
Copyright (c) 1982, 2005, Oracle. All Rights Reserved.
Connected to an idle instance.
ORACLE instance started.
Total System Global Area 2533359616 bytes
Fixed Size 2199816 bytes
Variable Size 2025713400 bytes
Database Buffers 503316480 bytes
Redo Buffers 2129920 bytes
Database mounted.
SP2-0158: unknown SET option "charwidth"
no rows selected
Not a terminal
Not a terminal
Database altered.
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - 64bit Production
With the Partitioning and Data Mining options
Mon Jun 2 13:00:46 GMT: 2008
Connect to the database to verify, that the database is now open
R3trans check finished with return code: 12
ERROR: Startup of database failed
Notify Database Administrator.
Mon Jun 2 13:00:46 GMT: 2008
/usr/sap/S27/SYS/exe/run/startdb: Terminating with error code 2Verify .dbenv* files in your <sid>adm home directory and update them as recommended in 10g upgrade documentation in the SAP Marketplace.
If still not resolved, do R3trans -d from <sid>adm home directory and post the recent trans.log file to review further.
Good Luck
Nag Anthati -
Strange Client Behavior after upgrading to 10g
Hello Friends !!!!
Here is my scenario:
Oracle Database 10g 10.2.0.3
Windows 2008 Server SP2
After upgrading from oracle 9.2.0.1.0 and Windows 2003 Server I'm facing a strange behavior.
Many times over the days some machines do not release some table resources even having their status "INACTIVE" and the wait event "SQL *Net message from client" and wait class "IDLE".
Therefore, i got a lot of locked sessions, and users complaining..... until I kill them
The client machine was as well switched to Oracle 10g client....
Have you guys got any tips about this scenario?
Tks for any advice.About the lock queue:
1. blocking session has an exclusive table lock on VENDEDORES table; this is very rare in application because most of the time not needed: application code should try to avoid to take such kind of lock.
2. blocked sessions request a row share table lock: it looks like that VENDEDORES table is a child table linked to some parent table with a foreign key constraint and that an index on the child table foreign key is missing (this kind of lock is requested if you DELETE from parent table or update parent table primary key).
About the lock session: this is the blocking session that is waiting since 19 seconds on client: it is likely an application issue: you should try to investigate what the client (aservice.exe) is doing while holding an exclusive table lock. -
SQL Query takes 7 hours after upgrade to 10g
the following query executes in under a minute in 9i, however once upgraded to 10g it takes 7 hours. The query is designed to select the data row with the max date value for the selected criteria (there are multiple rows that match the below criteria with different dates)
I have tested in a lower environment the setting of "_optimizer_cost_based_transformation"=off and this corrects the problem. I do not feel comfortable setting this parameter session or system wide to provide a solution
We are running Oracle 10gR2 on Solaris
select "INSTN_ID_N",
"MEAS_D",
"FEED_TYPE_C",
"FREQ_C",
"STAT_LVL_C",
"TS_D",
"IX_INSTN_ID_C",
"ENTI_TYPE_C",
"CNTXT_ID_C",
"CNTXT_C",
"IX_CNTXT_ID_C",
"VND_C",
"PRCS_C",
"USR_ID_C",
"STAT_C",
"OVRD_RSN_C",
"LD_DT_D",
"UPD_USR_C",
"UPD_TS_D",
"INS_USR_C",
"INS_TS_D",
"DEL_FLG_C"
from IDA.V_INSTANCE_STATUS M
where
TS_D =
select max (TS_D) from IDA.V_INSTANCE_STATUS
where
INSTN_ID_N = M.INSTN_ID_N AND
MEAS_D = M.MEAS_D AND
FEED_TYPE_C = M.FEED_TYPE_C AND
FREQ_C = M.FREQ_C AND
STAT_LVL_C = M.STAT_LVL_C AND
IX_INSTN_ID_C = M.IX_INSTN_ID_C
)user638113 wrote:
the following query executes in under a minute in 9i, however once upgraded to 10g it takes 7 hours. The query is designed to select the data row with the max date value for the selected criteria (there are multiple rows that match the below criteria with different dates)
I have tested in a lower environment the setting of "_optimizer_cost_based_transformation"=off and this corrects the problem. I do not feel comfortable setting this parameter session or system wide to provide a solutionIf you're sure that the "lower" environment reproduces the same issue, and not due to some other differences (different statistics, parameters etc.), then you could share the two different execution plans generated via DBMS_XPLAN.DISPLAY having the cost based transformations turned on and off. Make sure you use the \ tags before and after the plan output to format it in fixed font. You can use the "Quote" button in the message editor to see how to use the tag.
Furthermore a optimizer trace (10053) might reveal why the cost based transformations lead to such an result.
Regards,
Randolf
Oracle related stuff blog:
http://oracle-randolf.blogspot.com/
SQLTools++ for Oracle (Open source Oracle GUI for Windows):
http://www.sqltools-plusplus.org:7676/
http://sourceforge.net/projects/sqlt-pp/ -
Weird query problem after upgrade to 10g
After upgrading from 9i to 10g I've noticed that one query slowed down drastically (from 100[ms] to 30[s])
SELECT ... FROM first_table LEFT OUTER JOIN second_table ON ...
WHERE first_table.number_column = '453' ...
What's weird is the redundant apostrophes around number in WHERE clause. The same query without those apostrophes executes in 100[ms].
I know it doesn't make any sense to put numbers inside apostrophes but it results from the application structure. Since I can't change the application I need the way to improve this query from the database level.
I tested this query with other databases (9i and 10g) and there is no differences whether the number is in apostrophes or not.
What does it depend on?
Any ideas how to speed-up this query?
Thanks in advance
KuntaHi Gerard,
When the query window comes from a table Oracle always recommends:
1) Use the /*+ ordered */ hint
2) Put the table the quiery window comes from (geometry-2 in the query) first in the from clause
However, your query is also written very strange. Do you know about SDO_WITHIN_DISTANCE? Or are you trying to do SDO_ANYINTERACT (since the distance is 0)?
So I would write the query you have as:
SELECT s.ROWNUM
from NOMINATIONS O, COUNTIES s
where sdo_relate(S.GEOM,o.geom, 'querytype=WINDOW mask=anyinteract')='TRUE';
or in Oracle10g:
SELECT s.ROWNUM
from NOMINATIONS O, COUNTIES s
where sdo_anyinteract(S.GEOM,o.geom)='TRUE'; -
Ora -1031 after upgrade to 10G
Hi,
After upgrading oracle to 10G, we have a problem with archiving redo logs and database backup. Backup and archiving fails when we try to start it with user system giving error 1031:insufficient privileges Determination of Oracle version failed.
We are running oracle on SAP and we use SAP tools brarchive and brbackup for this.
Does anyone have an idea about this?Was the upgrade successful?
Can you log into the database as sys/sysdba from sqlplus?
Do the SAP tools support Oracle 10G? -
Images after upgrade from 10g to 11g
We recently upgraded from 10g to 11g and all the images are broke in the dashboard.
Can anyone provide the steps needs to be done in order to fix the broken images?
Thanks.Put image files at
Drive:\Oracle\Middleware\Oracle_BI1\bifoundation\web\app\res\s_blafp\images
Drive:\Oracle\Middleware\user_projects\domains\bifoundation_domain\servers\bi_server1\tmp\_WL_user\analytics_11.1.1\7dezjl\war\res\s_blafp\images
If required
Drive:\Oracle\Middleware\user_projects\domains\bifoundation_domain\servers\AdminServer\tmp\.appmergegen_1291264099332\analytics.ear\ukjjdc\res\s_blafp\images
Call them using fmap
Syntax: fmap:images/imagename.imageformat
for e.g: fmap:images/geograph.jpg
Pls mark correct/helpful if helps -
ODI Procedures not working after upgrading from 10G to 11G
Hello Gurus,
We have run into a scenario where the procedures in ODI are not working after we upgraded it from 10G to 11G (11.1.1.6). However we can make it to run if we create the procedure from scratch.
Also we are having issues related to packages where in the packages were running before we applied the patch 11.1.1.6.3. And after applying the patches they are not running.
Any help will be appreciated.
ThanksIf you want someone to help you, please be elaborate in the exact errors you are getting.
A general statement would do nothing but guess work.
What is the error that you get while executing the procedure.
What are the exact issues that you get while executing packages ? -
The system don't goes up after Upgrade to 10g
Hello friends. After a Oracle upgrade of 9i to 10g (Windows 2003 / Basis Release 46D). The system SAP R/3 4.6C don't goes up. A follow message is the error in file "dev_w0":
Now I'm connected to ORACLE
C Database instance prd is running on SAPUPG with ORACLE version 10.2.0.2.0 since 20070612
B Connection 0 opened
B Wp Hdl ConName ConCnt ConState TX PRM RCT Date Time
B 000 000 R/3 000000 ACTIVE NO YES NO 20070613 100955
B ***LOG BZA=> table SVERS doesn't exist on database [dblink 2056 ]
To understand the problem I run the follow command into "sqlplus":
SQL> select * from svers;
select * from svers
ERROR at line 1:
ORA-00942: table or view does not exist
SQL> select * from sapr3.svers;
VERSION
46C
Please take special attention to this point: When the execution it's was made indicating a DBSCHEMA plus table (sapr3.svers) the command it's succesfull, otherwise fail's. If I logon with user: "SYSTEM" it's the same result.
Thank's to everyone for help me and understand my very bad english.
Best regards.
Xavier PolHi,
It looks like you have some "wrong" concepts.
First you say that:
<b>Now in WS1, there is no schema</b>
later on you are telling
<b>have then check the command
select * from SAPBOS.SVERS and it worked.</b>
So, do you have a schema or don't you?
Let me try to understand what you have done, for your description
1) you have a system called BOS. On this system you have a schema called SAPBOS.
2) you did a system copy from BOS to W1S. Guessing -> You did a restore from a BOS
Now your SAPW1S has "dissapeared"
am I understandin it properly?
If so, you should think a little.
You have restored a backup from BOS ( DB name BOS, SCHEMA BOS, tablespace names PSAPBOS ) into W1S
Restoring a backup will not change the schema name ( AFAIK, there is no simple way of doing so )
Restoring a backup will not change the tablespaces names ( in Oracle 10g you can do this, but has to be done manually )
Restoring the backup will not change the DB name. The System copy procedure ask you to create a script that will perform this last change.
So, at the end of the process you have a DB called W1S, with a schema called SAPBOS and tablespaces called PSAPBOS.
As mentioned before there is no simple way of changing the schema name.
If you <b>need/want/desire</b> to do so then you cannot use BACKUP/RESTORE for system copies. You must use the R3Load method ( take all data out of the DB and then take all the data in on the new system ) -
Problem in self service after upgrade to 10G
Hi all,
My customer has upgraded recently to 10G database and running on 11.5.10.2 application.
I have procedure in the custom package in the database accessed through the mod_plsql. After some time it's working, the server start replying with web page cannot be found, but the procedure in the package exists and its valid!
Tried to Enable Logging for the PL/SQL Gateway according to "Metalink Note:116715.1". I got the following error messages:
"SIGNATURE (parameter names) MISMATCH VARIABLES IN FORM NOT IN PROCEDURE:"
Any solution?
Thanks,
KumarFirst of all, it is wrong queue for APPS related query , you would have post this question to "e-Business Suite" -> "Applications Technology" -> "Application Maintenance" , you would have got lots of reply till now.
Have you applied interoperability patch after 10g upgrade ?
Cheer,
Virag -
Dequeue not happenning From Java after upgrading to 10G from 8i
Hi,
After the application is upgraded to Oracle 10.1.0 the java/jms clients are not dequeuing the messages. Strange thing is they are running fine and doing nothing.
Also ernqueue happenned successfully from one of the java proc and they are not bieng dequeued and proceeded for the next queues.
Anybody, any help.Check if...
1. You are using Browse or Remove mode??
2. After dequeue, Are the messages getting removed from the queue. If not....
3. Have you by any chance set the retaintion time, that too, a long one.
4. Can it be that the messages are getting dequeued successfully but you are not storing them [or printing them just to check] after you receive them.
Check.....coz I do not think there should be a problem if it is not giving any error message.
Sanju. -
What must be changed before and after upgrade to 10g?
Hi,
We need to uprade databases(8i/9i) to 10gR2.
How do the uprades affect the current applications?
What need to changed in applications?
Notes: The applications may be developed by VB,Java,.net,oracle Form...
Thanks,In general the answer on what needs to be changed depends on the version being upgraded to and the tools and manner in which the application are coded.
Most everything will upgrade cleanly to 10g but what you need to do is create a test system, upgrade it to 10g, and point the applications at it and test, test, and test.
One thing to watch for is current cleint-server type applications that may be using an old Oracle client that needs updating. Also you might want to check on the version of ODBC drivers being used.
If you have support you might try some target metalink searches on specific products like Forms using key terms like Upgrade, 10g, etc...
HTH -- Mark D Powell --
Maybe you are looking for
-
Why can't iMovie 09 open a project created in an earlier version of iMovie?
I recently bought a new (intel) iMac with iMovie 09 to replace our old (PowerPC) iMac G5. I had created several movie projects in iMovie on the old iMac, but these are apparently unreadable on the new one. I presume this may have something to do with
-
What are the acceptable Sap methods/steps to change standard SAP/Abap code?
To you Sap experts: Can you point me to Sap document that lists the acceptable methods to follow when modifing SAP standard (abap code). We are on release 4..7. I assume there is a best practice guide if you have to modify standard Sap code of w
-
Re: Deleting Album Artwork
I have some albums that I can not get album artwork for. All the Beatles albums, for example. So, I thought I would drag album images off of Amazon into iTunes. Of course, I did not realize that I was only adding the image to one song at a time. The
-
Issue with multisite for CTS-P55C60-K9
Hi, I faced one issue when I was tried to add Multisite licence for CTS-P55C60-K9. Now CTS-P55C60-K9 has End of Sale. How can I order Multisite licence for codec in my case? According to a datasheet I need LIC-P55C60-MS.
-
Can't open Mail directly by clicking on icon
Can't open Mail directly by clicking on icon. I have to unfold menu. Once it opens I have to click on Inbox to se the mail. It is not quick as everything Apple used to be. Was better before. This version is really uncomfortable.