½¨Á¢OracleÈ«ÎÄË÷Òý
×î½üÒª×öËÑË÷£¬ËùÒÔѧÆð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
±¾ÎļòҪ˵Ã÷È«ÎļìË÷¹¦ÄܵÄʹÓ㬲»×öÌ«¶àµÄ¾ßÌå˵Ã÷¡£
½ö¹©²Î¿¼Ê¹Ó÷½·¨¡£
1.ÊÚȨ
¶Ô¾ßÌåʹÓÃÈ«ÎļìË÷µÄÓû§ÊÚȨ.
$ sqlplus "/ as sysdba"
SQL*Plus: Release 9.2.0.4.0 - Production on Sun May 15 20:00:10 2005
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Connected to:
Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.4.0 - Production
SQL> grant ctxapp to club; //¿ª·ÅÊý¾Ý¿â½¨Á¢È«ÎļìË÷ȨÏÞ
Grant succeeded.
SQL> connect ctxsys/password
Connected.
SQL> grant execute on ctx_ddl to club;
Grant succeeded.
2.ʹÓÃÓ¦ÓÃÓû§Á¬½Ó
´´½¨ÓòË÷Òý
SQL> connect club/password
Connected.
SQL> begin ctx_ddl.create_preference('club_lexer','chinese_vgram_lexer'); end;
2 /
PL/SQL procedure successfully completed. //¶¨ÖÆÖÐÎÄ·ÖÎöÆ÷¡£ÁíÒ»¸ö·ÖÎöÆ÷½Ð×öchinese_lexer¡£
Elapsed: 00:00:00.03
SQL> create index id_cont_msg
2 on jivemessage ( SUBJECT ) indextype is ctxsys.context parameters('lexer club_lexer');
Index created.
Elapsed: 00:01:22.42
SQL> select count(*) from jivemessage where contains(subject,'ÐÒ¸£')>0;
COUNT(*)
----------
1847
Elapsed: 00:00:00.17
SQL> select count(*) from jivemessage where subject like '%ÐÒ¸£%';
COUNT(*)
----------
1841
Elapsed: 00:00:02.89
3.¼ìË÷±È½Ï
ÒÔÏÂÊÇÒ»¸öÈ«ÎļìË÷µÄʾÀý£¬ÎÒÃǼìË÷'abc'£¬ÄÇôȫÎļìË÷¿ÉÒÔ°Ñ°üº¬'abc'µÄÈκα仯×éºÏ¶¼²éѯ³öÀ´£¬°üÀ¨´óСд¡¢È«°ë½Ç£¬¶øÈç¹ûÓõ¥´¿µÄSQLʵÏÖͬÑùµÄ½á¹û£¬ÔòÐèÒª¶à´ÎlikeÖ®ºóunion all£¬ÆäÐÔÄܲî¾àÊDz»¿ÉÏëÏóµÄ¡£
È«ÎļìË÷ÔÚÀàËÆÎı¾Ä£ºý²éѯÉϾßÓм«´óµÄÓÅÊÆ¡£µ±È»Ò²¿ÉÄÜ´æÔÚÎÊÌ⣬¼´´Ê·¨·ÖÎöÆ÷ÊÇ·ñ׼ȷ£¬»á·ñ©µô²¿·ÖÄÚÈݵȡ£
×ܵÄË
Ïà¹ØÎĵµ£º
1.ÒÔsysÓû§µÇ¼oracle
2.²éÕÒÄãÒª¸ü¸ÄµÄ±í£¬ÎÒÃÇ“TEST”ÖеēAAA”±íΪÁУ¬×¢Ò⣬ÔÚoracleÖУ¬±íºÍ¿Õ¼ä¶¼ÊÇÒÔ´óд×ÖĸÏÔʾµÄ£¬ËùÒÔÕâÀﶼҪÓôó×Ö×Öĸ
Ö´ÐÐ
select object_id from all_objects where owner='TEST' and object_name='AAA';
»áµÃµ½Ò»¸öobject_id,Õâ¾ÍÊÇÎÒÃÇÐèÒª¸ü¸Ä±íµÄid£¬ÎÒÃÇÒ ......
¡¶¸£²¼Ë¹¡·ÍøÕ¾½üÈÕ·¢±íÎÄÕ³ƣ¬Èç¹û¼×¹ÇÎÄ74ÒÚÃÀÔªÊÕ¹ºSunµÄ¼Æ»®ÓÉÓÚÅ·Ã˵Ä×èÄÓ¶øÒÔʧ°Ü¸æÖÕ£¬Õâ²¢²»»á¸ø¼×¹ÇÎÄ´øÀ´Ì«´óËðʧ£¬µ«È´»áÁîSunÔâÊÜÖØ´´¡£
¼×¹ÇÎÄÊÕ¹ºSunµÄ½»Ò×ÈÔδ»ñµÃÅ·ÃËίԱ»áµÄÅú×¼¡£
Å·ÃË·´Â¢¶Ï¼à¹Ü²¿Ãŵ£ÐÄ£¬¼×¹ÇÎÄÊÕ¹ºSun½«¶ÔSunµÄ¿ªÔ´Êý¾Ý¿âÒµÎñMySQLÔì³É²»ÀûÓ°Ïì¡£¼×¹ÇÎÄÃæ¶ÔÅ·Ã˵ÄÒÉÂDz¢²»Ô¸×ö³öÈà ......
ÔÚJAVAÖеÄSQL Óï¾äµÄ±àд·½Ã棬ûÓÐʹÓÃORACLE °ó¶¨±äÁ¿£¬ºÜ´ó³Ì¶ÈÉϽµµÍÁËÊý¾Ý¿âµÄÐÔÄÜ£¬±íÏÖÔÚÁ½¸ö·½Ã棺
1¡¢SQLÓï¾äÓ²·ÖÎö(Hard Parse)Ì«¶à£¬ÑÏÖØÏûºÄCPU×ÊÔ´£¬ÑÓ³¤ÁËSQLÓï¾ä×ܵÄÖ´ÐÐʱ¼ä
SQLÓï¾äµÄÖ´Ðйý³Ì·Ö¼¸¸ö²½Ö裺Óï·¨¼ì²é¡¢·ÖÎö¡¢Ö´ÐС¢·µ»Ø½á¹û¡£ÆäÖзÖÎöÓÖ·ÖΪӲ·ÖÎö(Hard Parse)ºÍÈí·ÖÎö(Soft Pars ......
http://www.haoxiai.net/shujuku/Oracle/111145.html
Ò»¡¢Êý¾Ý¿âÃû
ʲôÊÇÊý¾Ý¿âÃû
Êý¾Ý¿âÃû¾ÍÊÇÒ»¸öÊý¾Ý¿âµÄ±êʶ£¬¾ÍÏñÈ˵ÄÉí·ÝÖ¤ºÅÒ»Ñù¡£ËûÓòÎÊýDB_NAME±íʾ£¬Èç¹ûһ̨»úÆ÷ÉÏ×°Á˶àÈ«Êý¾Ý¿â£¬ÄÇôÿһ¸öÊý¾Ý¿â¶¼ÓÐÒ»¸öÊý¾Ý¿âÃû¡£ÔÚÊý¾Ý¿â°²×°»ò´´½¨Íê³ÉÖ®ºó£¬²ÎÊýDB_NAME±»Ð´Èë²ÎÊýÎļþÖ®ÖС£¸ñʽÈçÏ£º
DB_NAME=m ......
sysdate+(5/24/60/60) ÔÚϵͳʱ¼ä»ù´¡ÉÏÑÓ³Ù5Ãë
sysdate+5/24/60 ÔÚϵͳʱ¼ä»ù´¡ÉÏÑÓ³Ù5·ÖÖÓ
sysdate+5/24 ÔÚϵͳʱ¼ä»ù´¡ÉÏÑÓ³Ù5Сʱ
sysdate+5 ÔÚϵͳʱ¼ä»ù´¡ÉÏÑÓ³Ù5Ìì
add_months(sysdate,-5) ÔÚϵͳʱ¼ä»ù´¡ÉÏÑÓ³Ù5ÔÂ
add_months(sysdate,-5*12) ÔÚϵͳʱ¼ä»ù´¡ÉÏÑÓ³Ù5Äê
ÉÏÔÂÄ©µÄÈÕÆÚ£ºselect last_day(add_mon ......