oracleѧϰ±Ê¼Ç2
ʹÓÃunrecoverable´´½¨±í
create table new_emp as select * from emp unrecoverable;
create table new_emp as select * from emp nologging;
ÍƼöʹÓÃlogging»òÕßnologging.
½«±íÒƶ¯µ½ÐµÄÊý¾Ý¶Î»òеıí¿Õ¼ä
ͨ¹ýÒƶ¯À´ÊµÏÖ´æ´¢²ÎÊýµÄÐÞ¸Ä
alter table emp move storage(initial 1m next 512k mimextents 1maxextens 999 pctincrease 0 );
alter table emp2 set unuserd(comm);
´´½¨Ö÷¼ü
create table dept
(deptno number(2),
dname varchar2(20),
loc varchar2(20),
constraint pk_dept primary key (deptno)
);
ÐÞ¸ÄÔö¼ÓÖ÷¼ü
alter table park_revenue
add (park_rev_pk primary key (account_no));
create table dept
(deptno number(5) primary key,
dname varchar2(20),
loc varchar2(30))
disable primary key;
×¢£ºµ±Ö÷¼ü±»ËµÃ÷Ϊ disable primary key ʱ£¬²»Äܽ¨Á¢ÏàÓ¦µÄÍⲿ¼ü¡£Ò»¶¨ÏÈÓãº
alter table dept enable primary key ºó·½¿ÉʹÓÃ:
deptno constraint fk_deptno References dept(deptno)
ΨһË÷ÒýºÍÖ÷¼üÇø±ð
ΨһË÷Òý£ºÎ¨Ò»Ë÷ÒýʹÓÃCREATE UNIQUE INDEXÃüÁîÍê³É£¬ÄܱêʶÊý¾Ý¿â±íÖÐÒ»ÐеĹؼü×Ö¡£ÔÚÊý¾Ý×ÖµäÖн¨Á¢ÁËΨһË÷ÒýÃû×Ö¡£
Ö÷ ¼ü£ºÖ÷¼üʹÓÃprimary keyÀ´Ö¸¶¨£¬ÄܱêʶÊý¾Ý¿â±íÖÐÒ»ÐеĹؼü×Ö¡£ÔÚÊý¾Ý×ÖµäÖÐÒ²½¨Á¢ÁËΨһË÷ÒýÃû×Ö¡£
²î ±ð£º±»¶¨ÒåΪΨһË÷ÒýµÄÁпÉÒÔ¿Õ£¬¶ø±»¶¨ÒåΪÖ÷¼üµÄÁв»ÄÜ¿Õ¡£
Ïà¹ØÎĵµ£º
oracle ÔõôÀ´±éÀúÒ»¸öÊ÷£¬Ïà±È½ÏÆäËû·½·¨£¬oracleµÄconnectÓï·¨¸üÄܱܺãÀûµÄ½â¾öÎÊÌâ¡£
Óï·¨¸ñʽ£º
select ...
from ...
start with...
connect by prior expr=expr
order siblings by ..
start with µÄ¹¦ÄÜÀàËÆÓÚwhere£¬Ö¸Ã÷´ÓÄĸö·ÖÖ§¿ªÊ¼±ãÀû£»
connect by Ö¸Ã÷¸¸½ÚµãºÍ×Ó½ÚµãµØÁ¬½Ó·½Ê½£¬¹Ø¼ü×Öprior·ÅÔÚ¸¸½Ú ......
ÏÖÔÚµÄÏîÄ¿±È½Ï½ô£¬¼ÓÉÏ×Ô¼ºÒ²±È½ÏÀÁ£¬ÊµÔÚÊǓûʱ¼ä”д°¡£¬ºÇºÇ£¬×òÌì¿´µ½Ò»ÆªÍ¦ºÃµÄOracle´æ´¢¹ý³ÌµÄÀý×Ó£¬ÕýºÃ×î½üÒªÓã¬×ª¹ýÀ´´ó¼ÒÒ»Æð·ÖÏíһϣ¬Ð»Ð»£¨³¿¹âӳϼ£©£¬Ô×÷µØÖ·£ºhttp://blog.csdn.net/xuyabao/archive/2008/03/20/2200205.aspx¡£
--------------------×Ô¶¨Ò庯Êý¿ªÊ¼--------------------
......
Óï·¨£º
DECODE(expr, search, result [, search, result ]... [, default ] )
Ó¦Óãº
DECODEº¯Êý½«Ã¿Ò»¸öexprºÍsearchµÄÖµ×ö±È½Ï¡£Èç¹ûexprµÄÖµÓësearchµÄÖµÏàµÈ£¬OracleÊý¾Ý¿â¾Í»á·µ»ØÏàÓ¦µÄresult¡£Èç¹ûÕÒ²»µ½Æ¥ÅäµÄÖµ£¬Oracle·µ»Ødefault¡£Èç¹ûûÓÐdefault£¬Oracle·µ»ØnullÖµ¡£²ÎÊý¿ÉÒÔÊÇÈÎÒâÊýÖµÀàÐÍ£¨NUMBER£¬BINAR ......
²©Ñå¿Æ¼¼Oracle erpÃâ·Ñ½²×ù
×÷ΪOracle¹«Ë¾¹Ù·½ÊÚȨÅàѵ»ú¹¹£¬²©ÑåOracle erpרҵÈÏ֤ר¼Ò¿Î³ÌÔÚ±±¾©¡¢ÉϺ£Í¬²½¿ªÕ¹Oracle erpÅàѵ¿Î³Ì¡£
Oracleµç×ÓÉÌÎñÌ×¼þ R12 ²ÆÎñÓ¦ÓÃÈí¼þÄܹ»×Ô¶¯»¯²¢¼ò»¯¿Í»§µÄ²ÆÎñÒµÎñÁ÷³Ì£¬°ïÖúÆóÒµ»ñµÃÆóÒµ·¶Î§ÄÚµÄÈÕ³£ÉÌÎñÖÇÄÜ£¬´Ó¶ø×ö³ö¸üÃ÷Öǵľö²ß¡¢¸Ä½øÔËÓª²¢½ÚÔ¼³É±¾¡£Í³Ò»µÄÊý¾ÝÄ£ÐÍÎªË ......
½¨Á¢ÁÙʱ±í½á¹¹
create global temporary table myemp as select * from emp;
Ð޸ıí½á¹¹
alter table dept modify (Dname char(20));
alter table dept add (headcount number(3));
¸´ÖÆÒ»¸ö±í
create table emp3 as select * from emp;
²ÎÕÕij¸öÒÑ´æÔÚµÄ±í½¨Á¢Ò»¸ö±í½á¹¹£¬²»ÐèÒªÊý¾Ý
create table emp4 as selec ......