oracleÁ·Ï°£¨mldnÊÓƵ¿Î³Ì£©ËÄ
ÊÓͼ
´´½¨ÐÂ±í£ºcreate table emp2 as select * from emp;
create view empv20 as select empno,ename,job,hiredate,deptno from emp where deptno=20 with check option;
Óï·¨£ºcreate or replace view ÊÓͼÃû³Æ as ×Ó²éѯ£¨ÐÞ¸ÄÖ®ºóµÄ×Ó²éѯ£©
Ìæ»»ÊÓͼ(ÐÞ¸Ä)
create or replace view empv20 as select empno,ename,job,hiredate,deptno,sal from emp
where deptno=20 with check option;
Óï·¨£ºupdate ÊÓͼÃû set ¸üÐÂÄÚÈÝ Ìõ¼þ
¸üÐÂÊÓͼ
ÓÐÁ½¸ö²ÎÊý£ºwith check optionºÍwith read only
½«ÊÓͼÖеÄ7369Ö°Ô±µÄ²¿ÃźÅÐÞ¸ÄΪ30
update empv20 set deptno=30 where empno=7369;
´´½¨ÊÓͼʱÌí¼ÓÉÏwith check optionÔò²»»á¶Ô´´½¨Ìõ¼þ¸üУ¬µ«ÊÇ¿ÉÒÔ¶ÔÆäËû×ֶθüС£
ÈôÐÞ¸ÄÊÓͼÖÐ7369µÄÖ°Ô±ÐÕÃûΪ“Ê·ÃÜ˹”£¬¿É·ñÐ޸ģ¿
update empv20 set ename='Ê·ÃÜ˹' where empno=7369;
´´½¨ÊÓͼʱÌí¼ÓÉÏwith read onlyÔò²»»á¶Ô´´½¨Ìõ¼þ¸üУ¬
create view empv20 as select empno,ename,job,hiredate,deptno from emp where deptno=20 with read only;
ÒÔϲÙ×÷ʱÌáʾ²»ÔÊÐíÐéÄâÁУ¬ÊÇÖ»¶Á²Ù×÷
update empv20 set deptno=30 where empno=7369;
update empv20 set ename='Ê·ÃÜ˹' where empno=7369;
ÐòÁÐ
Óï·¨£ºcreate sequence ÐòÁÐÃû
·¶Àý£ºcreate sequence myseq
ʹÓÃÐòÁÐ
Á½ÖÖ²Ù×÷£ºnextval—È¡µÃÐòÁеÄÏÂÒ»¸öÄÚÈÝ
currval—È¡µÃÐòÁеĵ±Ç°ÄÚÈÝ
insert into ±íÃû(ÁÐÒ»£¬Áжþ) values(±íÃû.nextval,±íÃû.currval)£»
ɾ³ýÐòÁУºdrop sequence ÐòÁÐÃû
Ôö³¤·ù¶È£ºincrement by ³¤¶È£¨·ÅÔÚ´´½¨ÐòÁеĺó±ß£©
·¶Àý£º1£¬´´½¨ÐòÁÐcreate sequence myseq
2£¬´´½¨±ícreate table testseq(next number,curr number);
3£¬Öظ´²åÈëÊý¾Ýinsert into testseq(next,curr) values(myseq.nextval,myseq.currval);
4£¬²éѯÊý¾Ýselect * from testseq;
²éѯ³öÀ´µÄÊý¾ÝÒÔ²½³¤ÎªÒ»µÄËÙ¶ÈÔö¼Ó£¬ÈôÏëÒª²½³¤²»ÎªÒ»£¬ÔòÐèÒªÔÚ´´½¨ÐòÁÐʱ¼ÓÉÏincrement by n£¬nΪ²½³¤£¬
Ó﷨Ϊ£ºcreate sequence ÐòÁÐÃû increment by n
²»ÄÜÐÞ¸ÄÒÑ´´½¨ÐòÁеIJ½³¤£¬Ö»ÄÜɾ³ýÐòÁÐÖØд´½¨Ê±Ð޸IJ½³¤¡£
ĬÈÏÇé¿öÏÂÐòÁÐÊÇ´Ó1
Ïà¹ØÎĵµ£º
²é¿´ËùÓбí¿Õ¼äʹÓÃÇé¿ö
SELECT UPPER(F.TABLESPACE_NAME) "±í¿Õ¼äÃû",
D.TOT_GROOTTE_MB "±í¿Õ¼ä´óС(M)",
D.TOT_GROOTTE_MB - F.TOTAL_BYTES "ÒÑʹÓÿռä(M)",
TO_CHAR(ROUND((D.TOT_GROOTTE ......
´´½¨±í
create table person (pid int,name varchar2(20) unique,
age int check(age between 0 and 150),sex varchar(4) default 'ÄÐ',tp int,
address varchar(200),constraint person_pid_pk primary key(pid));
²åÈëÊý¾Ý
insert into person values(0011,'ÁõÈý½ã',25,'ÄÐ',13930123021,'ºÓ±±Ê¡ÇúÑôÏØ');
´´½¨×Ó±í ......
×ÛºÏÁ·Ï°
ѧÉúÔ˶¯»á±ÈÈüÐÅÏ¢Êý¾Ý¿â
1£¬Ô˶¯Ô±sporter£¨Ô˶¯Ô±±àºÅsporterid£¬Ô˶¯Ô±ÐÕÃûname£¬Ô˶¯Ô±ÐÔ±ðsex£¬ËùÊôϵºÅdepartment£©
2£¬ÏîÄ¿item£¨ÏîÄ¿±àºÅitemid£¬ÏîÄ¿Ãû³Æitemname£¬ÏîÄ¿±ÈÈüµØµãlocation£©
3£¬³É¼¨grade£¨Ô˶¯Ô±±àºÅsporterid£¬ÏîÄ¿±àºÅitemid£¬»ý·Ömark£©
½¨±í
1£¬¶¨Òå¸÷¸ö±íµÄÖ÷ÂëÍâÂëÔ¼Êø
2£¬ ......
http://www.oracle.com/technology/global/cn/obe/2day_dba/index.html
¿Î³ÌÁбí
1
¹ÜÀíÊý¾Ý¿âµÄÒªËØÊÇʲô£¨Ã»Óб¾Õ¶ÔÓ¦µÄ¸½¼Ó×ÊÁÏ£©
2
°²×° Oracle ºÍ¹¹½¨Êý¾Ý¿â
3
Oracle Enterprise Manager Êý¾Ý¿â¿ØÖÆÈëÃÅ
4
ÅäÖÃÍøÂç»·¾³
5
¹ÜÀí Oracle Àý³Ì
6
¹ÜÀíÊý¾Ý¿â´æ´¢½á¹¹
7
¹ÜÀíÓû§ºÍ°²È«ÐÔ
8
¹ÜÀíģʽ¶ ......
¹ØÓÚOracleµÄsession
1.ÈçºÎ²é¿´session¼¶µÄµÈ´ýʼþ£¿
µ±ÎÒÃǶÔÊý¾Ý¿âµÄÐÔÄܽøÐе÷Õûʱ£¬Ò»¸ö×îÖØÒªµÄ²Î¿¼Ö¸±ê¾ÍÊÇϵͳµÈ´ýʼþ¡£$system_event,v$session_event,v$session_waitÕâÈý¸öÊÓͼÀï¼Ç¼µÄ¾ÍÊÇϵͳ¼¶ºÍsession¼¶µÄµÈ´ýʼþ£¬Í¨¹ý²éѯÕâЩÊÓͼÄã¿ÉÒÔ·¢ÏÖÊý¾Ý¿âµÄһЩ²Ù×÷µ½µ×ÔÚµÈ ......