oracle deterministic¹Ø¼ü×Ö
http://inthirties.com:90/viewthread.jsp?tid=1395
Õâ¸ödeterministicÊDz»ÊǺÜÑÛÊìѽ£¬
ÎÒÃÇÔÚonline redefinitionÀï¼ûµ½¹ýÕâ¸ö¹Ø¼ü×Ö£¬Õâ¸ö¹Ø¼üÔÚÔÚ×Ô¶¨ÒåµÄº¯ÊýË÷ÒýÀïÒ²³öÏÖÁË¡£
ÏÈ¿´¿´Îĵµ
DETERMINISTIC Clause
Specify DETERMINISTIC to indicate that the function returns the same
result value whenever it is called with the same values for its
arguments.
You must specify this keyword if you intend to call the function in
the expression of a function-based index or from the query of a
materialized view that is marked REFRESH FAST or ENABLE QUERY REWRITE.
When Oracle Database encounters a deterministic function in one of these
contexts, it attempts to use previously calculated results when
possible rather than reexecuting the function. If you subsequently
change the semantics of the function, you must manually rebuild all
dependent function-based indexes and materialized views.
Do not specify this clause to define a function that uses package
variables or that accesses the database in any way that might affect the
return result of the function. The results of doing so will not be
captured if Oracle Database chooses not to reexecute the function.
The following semantic rules govern the use of the DETERMINISTIC
clause:
*You can declare a top-level subprogram DETERMINISTIC.
*You can declare a package-level subprogram DETERMINISTIC in the
package specification but not in the package body.
*You cannot declare DETERMINISTIC a private subprogram (declared
inside another subprogram or inside a package body).
*A DETERMINISTIC subprogram can call another subprogram whether the
called program is declared DETERMINISTIC or not.
ҪʵÏÖ×Ô¼ºµÄº¯Êý£¬¼ÓÈ뺯ÊýË÷Òý£¬±ØÐë¼ÓÈëÕâ¸ödeterministic¹Ø¼ü×Ö£¬±£Ö¤ÄãÕâÐеķµ»ØÊÇÒ»¸öÈ·¶¨Êý¡£
·ñÔò³öÏÖ
30553, 00000, “The function is not deterministic”
// *Cause: The function on which the index is defined is not
deterministic
// *Action: If the function is deterministic, mark it
DETERMINIS
Ïà¹ØÎĵµ£º
ÔµÆðÒ»¸ö±í¿Õ¼äÌ«´ó,ɾ³ýÊý¾ÝºóÓÉÓÚÎļþβ±»ÓÃ,ÎÞ·¨resize,´òËã°ÑËùÓбí¿Õ¼äÉϵĶÔÏómoveµ½Ò»¸öÁÙʱ´æ´¢µÄ±í¿Õ¼ä×öÕûÀí¡£
moveÒ»¸ö±íµ½ÁíÍâÒ»¸ö±í¿Õ¼äʱ,Ë÷Òý²»»á¸ú×ÅÒ»Æðmove£¬¶øÇÒ»áʧЧ¡££¨LOBÀàÐÍÀýÍ⣩±ímove£¬ÎÒÃÇ·ÖΪ£º
*ÆÕͨ±ímove
*·ÖÇø±ímove
*LONG,LOB´ó×Ö¶ÎÀàÐÍmoveÀ´½øÐвâÊÔºÍ˵Ã÷¡£
Ë÷ÒýµÄmove£¬ÎÒÃÇÍ ......
1.»ù±¾½á¹¹
CREATE OR REPLACE PROCEDURE ´æ´¢¹ý³ÌÃû×Ö
(
²ÎÊý1 IN NUMBER,
²ÎÊý2 IN NUMBER
) IS
±äÁ¿1 INTEGER :=0;
±äÁ¿2 DATE;
BEGIN
END ´æ´¢¹ý³ÌÃû×Ö
2.SELECT INTO STATEMENT
½«select²éѯµÄ½á¹û´æÈëµ½±äÁ¿ÖУ¬¿ÉÒÔͬʱ½«¶à¸öÁд洢¶à¸ö±äÁ¿ÖУ¬±ØÐëÓÐ ......
WinXP ÏÂÖØÐÂÉèÖà Oracle ¹ÜÀíÔ±ÃÜÂë
Windows ÏÂÐÞ¸Ä Oracle ¹ÜÀíÔ±ÃÜÂë²Ù×÷²½Öè¡£´Ë²½ÖèÔÚ WinXP5.1¡¢Oracle92 ϲÙ×÷³É¹¦¡£¸ü¸ÄÒÔºóÐèÒªÖØÆô¼ÆËã»úºÍʵÀý·½¿ÉÉúЧ¡£
±³¾°£ºWinXP °æ±¾ 5.1£¨ÄÚ²¿°æ±¾ºÅ 2600.xpsp_sp2_dgr.07022 ......
Ë÷Òý
Ë÷ÒýµÄÄ¿µÄÊÇÌá¸ß´æ´¢Êý¾ÝÒ³ÃæµÄËÙ¶È
·þÎñÆ÷ɨÃèË÷ÒýÒÔ»ñµÃÊý¾Ý´æ´¢µ¥ÔªµÄµØÖ·
Ë÷ÒýµÄÓŵãΪ£ºÌá¸ß²éѯµÄÖ´ÐÐËٶȡ¢ÊµÊ©Êý¾ÝµÄΨһÐÔ¡¢¼ÓËÙÁ˱íÖ®¼äµÄÁ¬½Ó
Ë÷ÒýµÄȱµãΪ£º´´½¨Ë÷ÒýÐèÒª»¨·Ñ½Ï¶àµÄʱ¼ä¡¢Ã¿¸ö´´½¨µÄË÷ÒýÁ¬Í¬ÔÏȵÄÊý¾ÝÔ´¶¼ÐèÒª¿Õ¼äÀ´´æ´¢Êý¾Ý¡¢Ã¿´ÎÐÞ¸ÄÊý¾ÝʱË÷Òý¶¼Òª¸üÐÂ
......
×Ó²éѯ
µ¥ÐÐ×Ó²éѯ(single-row subqueries)
ʹÓõÄÔËËã·ûºÅ(=,>,<,>=,<=,<>)
¶àÐÐ×Ó²éѯ(multiple-row subqueries)
ʹÓõÄÔËËã·ûºÅ(in,not in,exists,not exits,all,any)
Ïà¹Ø×Ó²éѯ(correlated subqueries)
&nb ......