OracleÖÐÔ¼ÊøʹÓÃ
ÒÔϼ¸ÖÖÔ¼Êø ¡¢²¢ Ò»Ò»Áо٣º
1.Ö÷¼üÔ¼Êø£º
Òª¶ÔÒ»¸öÁмÓÖ÷¼üÔ¼ÊøµÄ»°£¬ÕâÁоͱØÐëÒªÂú×ãµÄÌõ¼þ¾ÍÊÇ·Ö¿Õ
ÒòΪÖ÷¼üÔ¼Êø£º¾ÍÊǶÔÒ»¸öÁнøÐÐÁËÔ¼Êø£¬Ô¼ÊøΪ£¨·Ç¿Õ¡¢²»Öظ´£©
ÒÔÏÂÊÇ´úÂë Òª¶ÔÒ»¸öÁмÓÖ÷¼ü£¬ÁÐÃûΪid,±íÃûΪemp
¸ñʽΪ£º
alter table ±í¸ñÃû³Æ add constraint Ô¼ÊøÃû³Æ Ôö¼ÓµÄÔ¼ÊøÀàÐÍ £¨ÁÐÃû£©
Àý×Ó£º
alter table emp add constraint ppp primary key (id)
————————————————————————————————
2.checkÔ¼Êø£º
¾ÍÊǸøÒ»ÁеÄÊý¾Ý½øÐÐÁËÏÞÖÆ
±È·½Ëµ£¬ÄêÁäÁеÄÊý¾Ý¶¼Òª´óÓÚ20µÄ
±íÃû£¨emp£© ÁÐÃû£¨age£©
¸ñʽ£º
alter table ±íÃû³Æ add constraint Ô¼ÊøÃû³Æ Ôö¼ÓµÄÔ¼ÊøÀàÐÍ £¨ÁÐÃû£©
Àý×Ó£º
alter table emp add constraint xxx check(age>20)
______________________________________________________________________
3.uniqueÔ¼Êø£º
ÕâÑùµÄÔ¼Êø¾ÍÊǸøÁеÄÊý¾Ý×·¼ÓµÄ²»Öظ´µÄÔ¼ÊøÀàÐÍ
¸ñʽ£º
alter table ±íÃû add constraint Ô¼ÊøÃû³Æ Ô¼ÊøÀàÐÍ£¨ÁÐÃû£©
±È·½Ëµ¿ÉÒÔ¸øenameÁмӸöunique£¬ÈÃenameÁеÄÊý¾Ý²»Öظ´
Àý×Ó£º
alter table emp add constraint qwe unique(ename)
————————————————————————————————
4.ĬÈÏÔ¼Êø£º
Òâ˼ºÜ¼òµ¥¾ÍÊÇÈôËÁеÄÊý¾ÝĬÈÏΪһ¶¨µÄÊý¾Ý
¸ñʽ£º
alter table ±íÃû³Æ add constraint Ô¼ÊøÃû³Æ Ô¼ÊøÀàÐÍ Ä¬ÈÏÖµ£© for ÁÐÃû
±È·½Ëµ£ºemp±íÖеÄgongziÁÐĬÈÏΪ10000
alter table emp add constraint jfsd default 10000 for gongzi
————————————————————————————————
5.Íâ¼üÔ¼Êø£º
Õâ¸öÓеãÄÑÀí½âÁË£¬Íâ¼üÆäʵ¾ÍÊÇÒýÓÃ
ÒòΪÖ÷¼üʵÏÖÁËʵÌåµÄÍêÕûÐÔ£¬
Íâ¼üʵÏÖÁËÒýÓõÄÍêÕûÐÔ£¬
Ó¦ÓÃÍêÕûÐԹ涨£¬ËùÒýÓõÄÊý¾Ý±ØÐë´æÔÚ£¡
Æäʵ¾ÍÊǸöÒýÓã¬
±È·½ËµÒ
Ïà¹ØÎĵµ£º
oracleÈçºÎ¼Ç¼Óû§µÄµÇ½ÐÅÏ¢
¿ÉÒÔ×öÒ»¸ö´¥·¢Æ÷
ÓÃÒÔϵķ½Ê½¿ÉÒÔ¼à¿ØµÇÈëµÇ³öµÄÓÃ戶:
´´½¨Ò»ÕżÇ¼µÇ¼TABLE£¬ÈçÏ£º
CREATE TABLE SYSTEM.LOGIN_LOG
(
SESSION_ID &nb ......
ÐÞ¸ÄOracleµÄ½ø³ÌÊý[processes]¼°»á»°Êý[sessions]
1.ͨ¹ýSQLPlusÐÞ¸Ä
OracleµÄsessionsºÍprocessesµÄ¹ØϵÊÇ
sessions=1.1*processes + 5
ʹÓÃsys£¬ÒÔsysdbaȨÏ޵Ǽ£º
SQL> show parameter processes;
NAME &n ......
OracleÖÐÌí¼ÓJob
--ÿ15·ÖÖÓ trunc(sysdate+1/96,'MI')/*5:Mins*/ sysdate + 5/(60*24)
SQL> variable jobno number;
SQL> begin
2 dbms_job.submit(:jobno,'´æ´¢¹ý³ÌÃû;',sysdate,'/*1:Hr*/ sysdate + 1/24' );
3 commit;
4 end;
5 /
......
½ÌÄãÓÃLinuxÍê³ÉOracle×Ô¶¯ÎïÀí±¸·Ý
http://www.cngr.cn/article/63/390/2006/2006071919004.shtml
±¾ÎĵÄÄ¿±êÊÇͨ¹ýÖ´ÐÐÒ»Shell½Å±¾À´Íê³ÉOracleÊý¾Ý¿â×Ô¶¯±¸·ÝµÄÈ«¹ý³Ì£¬¶øÇÒÄܹ»ÔÚµ±Ç°Ä¿Â¼ÏÂÉú³ÉÆäѹËõÎļþ¡£¾ßÌåʵÏÖ²½ÖèÈçÏ£º¡¡¡¡
¡¡¡¡1£®ÒÔOracleÓû§Éí·ÝµÇ¼µ½LinuxϵͳÏ¡£¡¡¡¡
¡¡¡¡2£®½¨Á¢database.srciptÎÄ ......
1£© ½¨Á¢ÐòÁÐÃüÁî
CREATE SEQUENCE [user.]sequence_name
[increment by n]
[start with n]
[maxvalue n | nomaxvalue]
[minvalue n | nominvalue];
INCREMENT BY£º Ö¸¶¨ÐòÁкÅÖ®¼äµÄ¼ä¸ô ......