oracleµÄÕýÔò±í´ïʽ
Ä¿Ç°£¬ÕýÔò±í´ïʽÒѾÔںܶàÈí¼þÖеõ½¹ã·ºµÄÓ¦Ó㬰üÀ¨*nix£¨Linux, UnixµÈ£©£¬HPµÈ²Ù×÷ϵͳ£¬PHP£¬C#£¬JavaµÈ¿ª·¢»·¾³¡£
Oracle 10gÕýÔò±í´ïʽÌá¸ßÁËSQLÁé»îÐÔ¡£ÓÐЧµÄ½â¾öÁËÊý¾ÝÓÐЧÐÔ£¬ Öظ´´ÊµÄ±æÈÏ, Î޹صĿհ׼ì²â£¬»òÕß·Ö½â¶à¸öÕýÔò×é³É
µÄ×Ö·û´®µÈÎÊÌâ¡£
Oracle 10gÖ§³ÖÕýÔò±í´ïʽµÄËĸöк¯Êý·Ö±ðÊÇ£ºREGEXP_LIKE¡¢REGEXP_INSTR¡¢REGEXP_SUBSTR¡¢ºÍREGEXP_REPLACE¡£
ËüÃÇʹÓÃPOSIX ÕýÔò±í´ïʽ´úÌæÁËÀϵİٷֺţ¨%£©ºÍͨÅä·û£¨_£©×Ö·û¡£
ÌØÊâ×Ö·û£º
'^' Æ¥ÅäÊäÈë×Ö·û´®µÄ¿ªÊ¼Î»Öã¬ÔÚ·½À¨ºÅ±í´ïʽÖÐʹÓ㬴ËʱËü±íʾ²»½ÓÊܸÃ×Ö·û¼¯ºÏ¡£
'$' Æ¥ÅäÊäÈë×Ö·û´®µÄ½áβλÖá£Èç¹ûÉèÖÃÁË RegExp ¶ÔÏóµÄ Multiline ÊôÐÔ£¬Ôò $ ҲƥÅä 'n' »ò 'r'¡£
'.' Æ¥Åä³ý»»Ðзû nÖ®ÍâµÄÈκε¥×Ö·û¡£
'?' Æ¥ÅäÇ°ÃæµÄ×Ó±í´ïʽÁã´Î»òÒ»´Î¡£
'*' Æ¥ÅäÇ°ÃæµÄ×Ó±í´ïʽÁã´Î»ò¶à´Î¡£
'+' Æ¥ÅäÇ°ÃæµÄ×Ó±í´ïʽһ´Î»ò¶à´Î¡£
'( )' ±ê¼ÇÒ»¸ö×Ó±í´ïʽµÄ¿ªÊ¼ºÍ½áÊøλÖá£
'[]' ±ê¼ÇÒ»¸öÖÐÀ¨ºÅ±í´ïʽ¡£
'{m,n}' Ò»¸ö¾«È·µØ³öÏÖ´ÎÊý·¶Î§£¬m=<³öÏÖ´ÎÊý<=n£¬'{m}'±íʾ³öÏÖm´Î£¬'{m,}'±íʾÖÁÉÙ³öÏÖm´Î¡£
'|' Ö¸Ã÷Á½ÏîÖ®¼äµÄÒ»¸öÑ¡Ôñ¡£Àý×Ó'^([a-z]+|[0-9]+)$'±íʾËùÓÐСд×Öĸ»òÊý×Ö×éºÏ³ÉµÄ×Ö·û´®¡£
num Æ¥Åä num£¬ÆäÖÐ num ÊÇÒ»¸öÕýÕûÊý¡£¶ÔËù»ñÈ¡µÄÆ¥ÅäµÄÒýÓá£
ÕýÔò±í´ïʽµÄÒ»¸öºÜÓÐÓõÄÌصãÊÇ¿ÉÒÔ±£´æ×Ó±í´ïʽÒÔºóʹÓ㬠±»³ÆΪBackreferencing. ÔÊÐí¸´ÔÓµÄÌæ»»ÄÜÁ¦
Èçµ÷ÕûÒ»¸öģʽµ½ÐµÄλÖûòÕßָʾ±»´úÌæµÄ×Ö·û»òÕßµ¥´ÊµÄλÖÃ. ±»Æ¥ÅäµÄ×Ó±í´ïʽ´æ´¢ÔÚÁÙʱ»º³åÇøÖУ¬
»º³åÇø´Ó×óµ½ÓÒ±àºÅ, ͨ¹ýÊý×Ö·ûºÅ·ÃÎÊ¡£ ÏÂÃæµÄÀý×ÓÁгöÁË°ÑÃû×Ö aa bb cc ±ä³É
cc, bb, aa.
Select REGEXP_REPLACE('aa bb cc','(.*) (.*) (.*)', '3, 2, 1') from dual£»
REGEXP_REPLACE('ELLENHILDISMIT
cc, bb, aa
'' תÒå·û¡£
×Ö·û´Ø£º
[[:alpha:]] ÈκÎ×Öĸ¡£
[[:digit:]] ÈκÎÊý×Ö¡£
[[:alnum:]] ÈκÎ×ÖĸºÍÊý×Ö¡£
[[:space:]] Èκΰ××Ö·û¡£
[[:upper:]] Èκδóд×Öĸ¡£
[[:lower:]] ÈκÎСд×Öĸ¡£
[[:punct:]] Èκαêµã·ûºÅ¡£
[[:xdigit:]] ÈκÎ16½øÖƵÄÊý×Ö£¬Ï൱ÓÚ[0-9a-fA-F]¡£
¸÷ÖÖ²Ù×÷·ûµÄÔËËãÓÅÏȼ¶
תÒå·û
(), (?:), (?=), [] Ô²À¨ºÅºÍ·½À¨ºÅ
*, +, ?, {n}, {n,}, {n,m} ÏÞ¶¨·û
^, $, anymetacharacter λÖúÍ˳Ðò
| “»ò”²Ù×÷
--²âÊÔÊý¾Ý
create table test(mc varchar2(60));
insert into test values('11223344556677889
Ïà¹ØÎĵµ£º
linux ÉϵÄoracle sqlplus ²»ÄÜÀûÓà ÉÏ, Ï ¼üÀ´²é¿´ÃüÁËÑË÷µ½½â¾öÎÊÌâµÄ°ì·¨£¬ÕûÀíÈçÏÂ
°²×°Èí¼þrlwrap¿ÉÒÔ½â¾öÕâ¸öÎÊÌ⣬¸ÃÈí¼þÊÇÓÃcдµÄ³ÌÐò
¹Ù·½ÏÂÔصØÖ·£ºhttp://utopia.knoware.nl/~hlub/uck/rlwrap/
°²×°¹ý³Ì£º
ÎÒÃÇÒ²¿ÉÒԲ鿴½âѹºóµÄtar°ü£¬²é¿´README°ïÖúÎļþ
shell>tar -zxvf rlwrap-0.36.tar.gz
sh ......
http://www.javaeye.com/topic/366991#
×÷Ϊһ¸ö¿ª·¢ÈËÔ±£¬¿ªÊ¼ÈÏÕæϵͳѧϰ
Oracle SQLÒ²Ö»ÓÐÔÂÓ֮࣬ǰµÄ
SQLÖª
ʶ½ö½öÊÇÏîÄ¿ÀïÃæÓõ½Ê²Ã´¾ÍÈ¥¿´Ê²Ã´£¬¼òµ¥Ëµ¾ÍÊÇ
Read The Fxxking Guide¡£ÔÚϵͳѧϰ
Oracle
SQL֮ǰ£¬°³µÄÏë·¨¾ÍÊÇ“°´ÕÕÐèÇóÍê³É¹¦ÄÜ£¬Ê£ÏµĽ»¸ø
DBAÀ´´¦À픡£Õâ¸öÏë·¨´ÓÕûÌåÀ´¿´ÏÔ ......
--´´½¨±í¿Õ¼ä
create tablespace Ãû³Æ
(
datafile='·¾¶\Ãû³Æ.ora',
size='50M',
autoextend='on'
)
/
--´´½¨ÁÙʱ±í¿Õ¼ä
create temporary tablespace Ãû³Æ
(
tempfile='·¾¶\Ãû³Æ.ora',
size='50M',
autoextend='on'
)
/
--´´½¨Óû§
create user Óû§Ãû idtenified by ÃÜÂë
/
--ΪÓû§Ö¸¶¨ ......
1.µ¼ÈëÊý¾ÝÃüÁimp userid=fkprod/fkprod full=y file=xxx.dmp
2.µ¼³öÊý¾Ý¿â¶ÔÏóÃüÁ
ʹÓÃtools--->export user objectÖ»Äܵ¼³öÊý¾Ý±í½Å±¾²»ÄÜ´ø³öÊý¾Ý,
»òÕßʹÓÃexp user/pwd file=/dir/xxx.dmp log=xxx.log full=y commit=y ignore=y
×¢Ò⣺Èç¹ûÄãÒªÔ¶³ÌµÇ¼µ½Êý¾Ý¿â·þÎñÆ÷µ¼³ö£¬¿ÉÒÔÔÚ±¾µØSQLPLUS×öÈçÏÂÃüÁ ......
ÒÔdbaµÇ½
1.²é¿´Äĸö±í±»Ëø:
select b.owner,b.object_name,l.session_id,l.locked_mode
from v$locked_object l, dba_objects b
where b.object_id=l.object_id;
2.²é¿´±»Ëø±íµÄsid ºÍserial# :
select t2.username,t2.sid,t2.serial#,t2.logon_time
from v$locked_object t1 ......