linux - Oracle Sort Order - What may cause it to change -


disclaimer: know bad not use 'order by' in sql when sorted data required.

i supporting pro*c program having wierd-problem. 1 of possible causes of wierd-problem may original developers (from long time ago) have not used order in sql though program logic depends on it! program has been working fine these years , started showing problems recently.

we trying pin wierd-problem order mistake (there other cause candidates recent port solaris linux took place).

what shadowy things on database end should @ may have changed old sort order? things data files etc? have experience pro*c on solaris magically sorting result-set?

thanks!

since know program cares order in results returned , know query submitted missing order by clause, there reason don't fix problem rather looking try figure out whether actual order of results may have changed? if fix known order by problem , "weird problem" have disappears, provide pretty evidence "weird problem" is, in fact, caused missing order by.

unfortunately, there lots of things might have caused order of results change many of may impossible track down. obvious cause change in execution plan. that, in turn, may have been caused either because statistics changed or because statistics didn't change enough or because of patch or because of initialization parameter change or because of client configuration change among other things. if licensed use awr (automatic workload repository), might able find evidence plan has changed looking see if there multiple plan_hash_value values sql_id in dba_hist_sqlstat on different days. if there are, you'd still have try figure out whether different plans caused results returned in different order. beyond query plan change, though, there dozens of other possible causes. physical order of data on disk may have changed because reorganized table or because moved data files around on disk or because san automatically rebalanced moving data around. data may have been cached (or may not have been cached) in general in past cached. oracle patch may have been applied.


Comments

Popular posts from this blog

c++ - llvm function pass ReplaceInstWithInst malloc -

Cross-Compiling Linux Kernel for Raspberry Pi - ${CCPREFIX}gcc -v does not work -

java.lang.NoClassDefFoundError When Creating New Android Project -