ORACLEʹÓÃEXCEPTIONS±í²éѯ³ö±íÖÐÖØ¸´¼Ç¼
SQL> conn system/oracle
Connected.
SQL> create table scott.t1(id number primary key,name varchar2(10)); --´´½¨²âÊÔ±í
Table created.
SQL> select constraint_name,table_name,constraint_type, --²é¿´ÏàÓ¦ÍêÕûÐÔÔ¼ÊøµÄ״̬
2 status,deferrable,deferred,validated
3 from dba_constraints
4 where owner='SCOTT' and table_name='T1';
CONSTRAINT_NAME TABLE_NAME C STATUS
------------------------------ ------------------------------ - --------
DEFERRABLE DEFERRED VALIDATED
-------------- --------- -------------
SYS_C0023319 T1 P ENABLED
NOT DEFERRABLE IMMEDIATE VALIDATED
SQL> insert into scott.t1 values(1,'tt');
1 row created.
SQL> insert into scott.t1 values(1,'hh'); --²åÈëidÁÐÖØ¸´µÄ¼Ç¼ʧ°Ü
insert into scott.t1 values(1,'hh')
*
ERROR at line 1:
ORA-00001: unique constraint (SCOTT.SYS_C0023319) violated
SQL> alter table scott.t1 disable novalidate constraint SYS_C0023319; --ÐÞ¸ÄÔ¼Êø×´Ì¬
Table altered.
SQL> select constraint_name,table_name,constraint_type, --²é¿´ÏàÓ¦ÍêÕûÐÔÔ¼ÊøµÄ״̬
2 status,deferrable,deferred,validated
3 from dba_constraints
4 where owner='SCOTT' and table_name='T1';
CONSTRAINT_NAME TABLE_NAME C STATUS
--------
Ïà¹ØÎĵµ£º
ËäȻѧϰJavaºÜ¾ÃÁË£¬×Ô¼ºÒ²Á¬½Ó¹ýһЩÊý¾Ý¿â£¬±ÈÈçmysqlÖ®ÀàµÄ£¬Èç½ñÄØ£¬Ò²Ñ§Ï°ÁËÒ»¶Îʱ¼äµÄOracle£¬È»¶øÄØ£¬½ñÌìÊÇÎÒµÚÒ»´ÎÁ¬½ÓOracle£¬ºÙºÙ£¬Ó¦¸Ã»¹²»ËãÌ«³Ù°É¡£
½ñÌìÄØ£¬Óе㱿׾£¬´ó¼ÒĪЦ£¡
ÎÒÕâÊÇÒ»¸ö²éѯÀý×Ó
Ê×ÏÈ£¬Ô ......
ÔÚJAVAÖеÄSQL Óï¾äµÄ±àд·½Ã棬ûÓÐʹÓÃORACLE °ó¶¨±äÁ¿£¬ºÜ´ó³Ì¶ÈÉϽµµÍÁËÊý¾Ý¿âµÄÐÔÄÜ£¬±íÏÖÔÚÁ½¸ö·½Ã棺
1¡¢SQLÓï¾äÓ²·ÖÎö(Hard Parse)Ì«¶à£¬ÑÏÖØÏûºÄCPU×ÊÔ´£¬ÑÓ³¤ÁËSQLÓï¾ä×ܵÄÖ´ÐÐʱ¼ä
SQLÓï¾äµÄÖ´Ðйý³Ì·Ö¼¸¸ö²½Ö裺Óï·¨¼ì²é¡¢·ÖÎö¡¢Ö´ÐС¢·µ»Ø½á¹û¡£ÆäÖзÖÎöÓÖ·ÖΪӲ·ÖÎö(Hard Parse)ºÍÈí·ÖÎö(Soft Pars ......
×÷Õß:Ñî´óÓÑ,Óà´¨ ²âÊÔÔ±:Íõ½¡
¿ª·¢¹¤¾ß:Oracle Jdeveloper 10131
ÈíÓ²¼þ»·¾³:
²Ù×÷ϵͳlinux redhat 3.0 Êý¾Ý¿âΪOracle 10G 10.0.2
Ó¦Ó÷þÎñÆ÷ΪSOA Application Server 10131
¿ª·¢ÓïÑÔ:java
¹ØÓÚÌåϵ½á¹¹,˵¶àÁËÒ²ÈÃÈ˾õµÃÔÎ.ÎÒÖ±½ÓʾÀýÒ»¸ö×ö·¨,ÖÁÓÚÀí½â,¾ÍÂýÂý¿´Êé°É!
²½Öè:
1.
´´ ......
×î½üÒª×öËÑË÷£¬ËùÒÔѧÆðOracleÈ«ÎÄË÷ÒýÀ´ÁË¡£
²Î¿¼ÎÄÕ£ºhttp://www.eygle.com/archives/2005/06/ecieoaoracleeia.html
ÈçºÎʹÓÃOracleÈ«ÎļìË÷¹¦ÄÜ?
×÷Õß:eygle
³ö´¦:http://www.eygle.com/blog
ÈÕÆÚ:June 11, 2005
ä¯ÀÀ´ÎÊý:
890
±¾ÎÄÁ´½Ó:http://www.eygle.com/archives/2005/06/ecieoaoracleeia.html
±¾ÎļòÒª ......
sqlÓï¾äÈçÏÂ:
select * from userdb40.numservice where ServiceNumber =88880068
and applytime <= to_date('2009-12-26 10:41:44','yyyy-MM-dd HH24:mi:ss')
select to_date('2007-06-28 19:51:20.0','yyyy-MM-dd HH24:mi:ss') from dual; ......