Oracle±à³Ì³£¼û´íÎóºÍ·ÖÎö
1. ×ÊÔ´Õýæ´íÎó
ÔÚpl/sql developer¿ªÒ»¸ösql window,Ö´ÐÐÈçÏÂsql²»Ìá½»
Create Table aa(a Int);
Insert Into aa Values(234);
ÔÙ¿ªÒ»¸ösqlwindowÖ´ÐÐ
Drop Table aa
¾Í»á±¨ora-00054´íÎó¡£
OracleËøµÄ֪ʶ£º
´ËʱOracleÒѾ¶Ô·µ»ØµÄ½á¹û¼¯ÉϼÓÁËÅÅËüµÄÐм¶Ëø£¬ËùÓÐÆäËû¶ÔÕâЩÊý¾Ý½øÐеÄÐ޸Ļòɾ³ý²Ù×÷¶¼±ØÐëµÈ´ýÕâ¸öËøµÄÊÍ·Å£¬²úÉúµÄÍâÔÚÏÖÏó¾ÍÊÇÆäËûµÄ²Ù×÷½«·¢Éú×èÈû£¬Õâ¸öÕâ¸ö²Ù×÷commit»òrollback.
ͬÑùÕâ¸ö²éѯµÄÊÂÎñ½«»á¶Ô¸Ã±í¼Ó±í¼¶Ëø£¬²»ÔÊÐí¶Ô¸Ã±íµÄÈκÎddl²Ù×÷£¬·ñÔò½«»á±¨³öora-00054´íÎó£º:resource busy and acquire with nowait specified.
ÒòΪDDLÓï¾äÐèÒª±íÉϵÄÅÅËûËø,¶øÕâÓëDMLÓï¾äÒÑÔÚ±íÉÏ·ÅÖÃÁ˹²ÏíËøÏà³åÍ»,ËùÒÔÊÔͼÔÚ±íÖвåÈëÒ»¸öÁеÄÕâÌõDDLÓï¾ä»áʧ°Ü.ÐèҪעÒâµÄÊÇ:ÔÚÀàËÆÇé¿öÏÂ,DMLÓï¾ä»áµÈ´ý²¢²»¶Ï½øÐг¢ÊÔ,Ö±ÖÁ»ñµÃÆäËùÐèµÄËø(»»¾ä»°Ëµ¾ÍÊÇ¹ÒÆð);¶øDDLÓï¾äÔò»áÓÉÓÚ´íÎóÁ¢¼´ÖÕÖ¹.
ejb BllRequireNewTransÔÚejb-jar.xml±»ÅäÖÃΪÐèÒªÒ»¸öÐÂÊÂÎñ£¬ËùÒÔµ÷ÓôËejb·½·¨µÄÊÂÎñºÍBllRequireNewTrans²»ÔÚÒ»¸öÊÂÎñÖÐ,²»×¢Òâ¾Í»áÒý·¢ÉÏÃæµÄ´íÎó¡£
<container-transaction>
<method>
<ejb-name>BllRequireNewTrans</ejb-name>
<method-intf>Remote</method-intf>
<method-name>*</method-name>
</method>
<trans-attribute>RequiresNew</trans-attribute>
</container-transaction>
</assembly-descriptor>
2. ×ֶα»È«²¿ÖÿյĴíÎó
Create Table bb(a Int, b Int, c Int)
Insert Into bb Values(1,2,3)
Insert Into bb Values(3,2,3)
Insert Into bb Values(4,5,6)
Create Table cc(a Int, b Int, c Int);
Insert Into cc Values(1,20,30
Ïà¹ØÎĵµ£º
select round(sum(case when o.close_date is null then 1 else 0 end)/count(*),3)*100||'%' SCALE from order o
˵Ã÷£ºÊ¹ÓÃsum¶ÔÒ»¶¨Ìõ¼þµÄÊý¾ÝÇóºÍºó£¬Óë×ÜÊý½øÐбȽϡ£
||'%' ΪÒԵİٷֺÅÐÎʽÊä³ö½á¹û(Àý£º2%) ......
Linuxϵͳɾ³ýoracle 10g£¨°üÀ¨Èí¼þºÍʵÀý£©
Èí¼þ»·¾³£ºLinuxϵͳ¡¡Oracle 10.0.1.0
Éæ¼°Óû§£ºroot oracle
ɾ³ýoracleÈí¼þºÍʵÀý²½Ö裺
1¡¢oracleÓû§µÇ½sqlplusÍ£Ö¹Êý¾Ý¿â£ºshutdown
2¡¢oracleÓû§Í£Ö¹¼àÌý·þÎñ£ºlsnrctl stop£¨Èç¹û¼àÌý·þÎñÆô¶¯µÄ»°£©
3¡¢rootÓû§
ɾ³ý/tmpÏÂora*Îļþ
ɾ³ý/optÏÂOR ......
Shrink spaceºÏ²¢±íµÄË鯬
Ò»°ã±íÀïÓÐË鯬ÎÒÃǶ¼²ÉÓÃalter table table_name move tablespace_name,»òÕßexp,drop table table_name,impµÄ2ÖÖ·½Ê½10G¸øÎÒÃÇÆäËûµÄ·½·¨.ÏÂÃæÎÒÀ´ÊÔÒ»°É
ÓÃShrink SpaceÊÕËõOracleÊý¾Ý¶Î
ÔÚoracleÖпÉÒÔʹÓÃalter table table_name shrink spaceÊÕËõ±í,ʹÓÃshrinkÓÐÁ½¸öǰÌáÌõ¼þ:
1¡ ......
dba_¿ªÍ·
dba_users Êý¾Ý¿âÓû§ÐÅÏ¢
dba_segments ±í¶ÎÐÅÏ¢
dba_extents Êý¾ÝÇøÐÅÏ¢
dba_objects Êý¾Ý¿â¶ÔÏóÐÅÏ¢
dba_tablespaces Êý¾Ý¿â±í¿Õ¼äÐÅÏ¢
&nbs ......