Is this a bug? 2006-02-24 - By Bobak, Mark
Consider this:
Connected to: Oracle9i Enterprise Edition Release 9.2.0.6.0 - 64bit Production With the Partitioning, Real Application Clusters, OLAP and Oracle Data Mining options JServer Release 9.2.0.6.0 - Production
SQL> create table test_fbi(a varchar2(4000));
Table created.
SQL> create index test_fbi_length on test_fbi(upper(a)) online compute statistics; create index test_fbi_length on test_fbi(upper(a)) online compute statistics * ERROR at line 1: ORA-00604 (See ORA-00604.ora-code.com): error occurred at recursive SQL level 1 ORA-01450 (See ORA-01450.ora-code.com): maximum key length (3215) exceeded
When I ran into this, I had an index created in my preprod environment, and Oracle was refusing to let me create it in my identical prod environment....I was stumped, how could it error on this here, but exist in preprod, which is identical in terms of version, O/S, block size, etc?
Now, I'm aware that any function that returns varchar2 implicitly returns varchar2(4000). Tom Kyte has a write up on this available here http://asktom.oracle.com/~tkyte/article1/index.html that explains it, and demonstrates how to work around it by wrapping the output in a SUBSTR() and then hiding that inside of a view. That's all fine and well and good. What I didn't understand is HOW I was ever allowed to create the index in preprod.....and then I discovered this:
SQL> create index test_fbi_length on test_fbi(upper(a)) online compute statistics; create index test_fbi_length on test_fbi(upper(a)) online compute statistics * ERROR at line 1: ORA-00604 (See ORA-00604.ora-code.com): error occurred at recursive SQL level 1 ORA-01450 (See ORA-01450.ora-code.com): maximum key length (3215) exceeded
SQL> c/online/ 1* create index test_fbi_length on test_fbi(upper(a)) compute statistics SQL> /
Index created.
Why does it work when you drop the ONLINE keyword?? In fact, it doesn't even need to be an FBI to demonstrate this behavior. Observe:
SQL> create index test_ind_key_length on test_fbi(a) online compute statistics; create index test_ind_key_length on test_fbi(a) online compute statistics * ERROR at line 1: ORA-00604 (See ORA-00604.ora-code.com): error occurred at recursive SQL level 1 ORA-01450 (See ORA-01450.ora-code.com): maximum key length (3215) exceeded
SQL> c/online/ 1* create index test_ind_key_length on test_fbi(a) compute statistics SQL> /
Index created.
Anyone else think this is a bit weird, not to mention inconsistent, behavior?
Any thoughts/ideas?
-Mark
-- Mark J. Bobak Senior Oracle Architect ProQuest Information & Learning
"Exception: Some dividends may be reported as qualified dividends but are not qualified dividends. These include:
* Dividends you received on any share of stock that you held for less than 61 days during the 121-day period that began 60 days before the ex-dividend date. The ex-dividend date is the first date following the declaration of a dividend on which the purchaser of a stock is not entitled to receive the next dividend payment. When counting the number of days you held the stock, include the day you disposed of the stock but not the day you acquired it. See the examples below. Also, when counting the number of days you held the stock, you cannot count certain days during which your risk of loss was diminished. See Pub. 550 for more details." --IRS, Form 1040-A Instruction Booklet, Line 9b: Qualified Dividends
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> <HTML> <HEAD> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"> <META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7638.1"> <TITLE>Is this a bug?</TITLE> </HEAD> <BODY> <!-- Converted from text/rtf format -->
<P><FONT SIZE=2 FACE="Arial">Consider this:</FONT> </P>
<P><FONT SIZE=2 FACE="Arial">Connected to:</FONT>
<BR><FONT SIZE=2 FACE="Arial">Oracle9i Enterprise Edition Release 9.2.0.6.0 - 64bit Production</FONT>
<BR><FONT SIZE=2 FACE="Arial">With the Partitioning, Real Application Clusters, OLAP and Oracle Data Mining options</FONT>
<BR><FONT SIZE=2 FACE="Arial">JServer Release 9.2.0.6.0 - Production</FONT> </P>
<P><FONT SIZE=2 FACE="Arial">SQL> create table test_fbi(a varchar2(4000));< /FONT> </P>
<P><FONT SIZE=2 FACE="Arial">Table created.</FONT> </P>
<P><FONT SIZE=2 FACE="Arial">SQL> create index test_fbi_length on test_fbi (upper(a)) online compute statistics;</FONT>
<BR><FONT SIZE=2 FACE="Arial">create index test_fbi_length on test_fbi(upper(a) ) online compute statistics</FONT>
<BR><FONT SIZE=2 FACE="Arial"> *</FONT >
<BR><FONT SIZE=2 FACE="Arial">ERROR at line 1:</FONT>
<BR><FONT SIZE=2 FACE="Arial">ORA-00604 (See ORA-00604.ora-code.com): error occurred at recursive SQL level 1</FONT>
<BR><FONT SIZE=2 FACE="Arial">ORA-01450 (See ORA-01450.ora-code.com): maximum key length (3215) exceeded< /FONT> </P> <BR> <BR>
<P><FONT SIZE=2 FACE="Arial">When I ran into this, I had an index created in my preprod environment, and Oracle was refusing to let me create it in my identical prod environment….I was stumped, how could it error on this here, but exist in preprod, which is identical in terms of version, O/S, block size, etc?</FONT></P>
<P><FONT SIZE=2 FACE="Arial">Now, I'm aware that any function that returns varchar2 implicitly returns varchar2(4000). Tom Kyte has a write up on this available here </FONT><A HREF="http://asktom.oracle.com/~tkyte/article1 /index.html"><U><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">http://asktom.oracle .com/~tkyte/article1/index.html</FONT></U></A><FONT SIZE=2 FACE="Arial"> that explains it, and demonstrates how to work around it by wrapping the output in a SUBSTR() and then hiding that inside of a view. That's all fine and well and good. What I didn't understand is HOW I was ever allowed to create the index in preprod…..and then I discovered this:</FONT></P>
<P><FONT SIZE=2 FACE="Arial">SQL> create index test_fbi_length on test_fbi (upper(a)) online compute statistics;</FONT>
<BR><FONT SIZE=2 FACE="Arial">create index test_fbi_length on test_fbi(upper(a) ) online compute statistics</FONT>
<BR><FONT SIZE=2 FACE="Arial"> *</FONT >
<BR><FONT SIZE=2 FACE="Arial">ERROR at line 1:</FONT>
<BR><FONT SIZE=2 FACE="Arial">ORA-00604 (See ORA-00604.ora-code.com): error occurred at recursive SQL level 1</FONT>
<BR><FONT SIZE=2 FACE="Arial">ORA-01450 (See ORA-01450.ora-code.com): maximum key length (3215) exceeded< /FONT> </P> <BR>
<P><FONT SIZE=2 FACE="Arial">SQL> c/online/</FONT>
<BR><FONT SIZE=2 FACE="Arial"> 1* create index test_fbi_length on test _fbi(upper(a)) compute statistics</FONT>
<BR><FONT SIZE=2 FACE="Arial">SQL> /</FONT> </P>
<P><FONT SIZE=2 FACE="Arial">Index created.</FONT> </P>
<P><FONT SIZE=2 FACE="Arial">Why does it work when you drop the ONLINE keyword? ? In fact, it doesn't even need to be an FBI to demonstrate this behavior. </FONT></P>
<P><FONT SIZE=2 FACE="Arial">Observe:</FONT> </P>
<P><FONT SIZE=2 FACE="Arial">SQL> create index test_ind_key_length on test _fbi(a) online compute statistics;</FONT>
<BR><FONT SIZE=2 FACE="Arial">create index test_ind_key_length on test_fbi(a) online compute statistics</FONT>
<BR><FONT SIZE=2 FACE="Arial"> *</FONT>
<BR><FONT SIZE=2 FACE="Arial">ERROR at line 1:</FONT>
<BR><FONT SIZE=2 FACE="Arial">ORA-00604 (See ORA-00604.ora-code.com): error occurred at recursive SQL level 1</FONT>
<BR><FONT SIZE=2 FACE="Arial">ORA-01450 (See ORA-01450.ora-code.com): maximum key length (3215) exceeded< /FONT> </P> <BR>
<P><FONT SIZE=2 FACE="Arial">SQL> c/online/</FONT>
<BR><FONT SIZE=2 FACE="Arial"> 1* create index test_ind_key_length on test_fbi(a) compute statistics</FONT>
<BR><FONT SIZE=2 FACE="Arial">SQL> /</FONT> </P>
<P><FONT SIZE=2 FACE="Arial">Index created.</FONT> </P> <BR>
<P><FONT SIZE=2 FACE="Arial">Anyone else think this is a bit weird, not to mention inconsistent, behavior?</FONT> </P>
<P><FONT SIZE=2 FACE="Arial">Any thoughts/ideas?</FONT> </P>
<P><FONT SIZE=2 FACE="Arial">-Mark</FONT> </P>
<P><B><FONT SIZE=2 FACE="Century Gothic">--</FONT></B>
<BR><B><FONT SIZE=2 FACE="Century Gothic">Mark J. Bobak</FONT></B>
<BR><B><FONT SIZE=2 FACE="Century Gothic">Senior Oracle Architect</FONT></B>
<BR><B><FONT COLOR="#000000" SIZE=2 FACE="Century Gothic">P</FONT><FONT SIZE=2 FACE="Century Gothic">ro</FONT><FONT COLOR="#FF0000" SIZE=2 FACE="Century Gothic">Q</FONT><FONT SIZE=2 FACE="Century Gothic">uest Information & Learning</FONT></B> </P>
<P><FONT SIZE=2 FACE="Courier New">"Exception: Some dividends may be reported as qualified dividends but are not qualified dividends. These include:</FONT> </P>
<P><FONT SIZE=2 FACE="Courier New">• Dividends you received on any share of stock that you held for less than 61 days during the 121-day period that began 60 days before the ex-dividend date. The ex-dividend date is the first date following the declaration of a dividend on which the purchaser of a stock is not entitled to receive the next dividend payment. When counting the number of days you held the stock, include the day you disposed of the stock but not the day you acquired it. See the examples below. Also, when counting the number of days you held the stock, you cannot count certain days during which your risk of loss was diminished. See Pub. 550 for more details.& #8221;</FONT></P>
<P><FONT SIZE=2 FACE="Courier New"> --IRS, Form 1040-A Instruction Booklet, Line 9b: Qualified Dividends</FONT> </P>
</BODY> </HTML>
|
|