Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

oracle 10g»ù´¡²Ù×÷±í

¡¡¡¡1´´½¨Ð±í
¡¡¡¡1.1´Ó²éѯµ½µÄ±í´´½¨±í
¡¡¡¡create table temp as select stuName,stuNo,stuSex from stuInfo where stuAge>25;
¡¡¡¡1.2´´½¨Ð±í
¡¡¡¡/*ѧÉúÐÅÏ¢±í*/
¡¡¡¡create table stuInfo(
¡¡¡¡stuName varchar2(10) ,
¡¡¡¡stuNo varchar2(10),
¡¡¡¡stuSex varchar2(4),
¡¡¡¡stuAge number(2),
¡¡¡¡stuSeat number(10),
¡¡¡¡stuAddress varchar2(400));
¡¡¡¡/*ѧÉú³É¼¨±í*/
¡¡¡¡create table stuMark(
¡¡¡¡examNo varchar2(10),
¡¡¡¡stuNo varchar2(10),
¡¡¡¡writtenExam number(4),
¡¡¡¡labExam number(4));
¡¡¡¡2 Ð޸ıí
¡¡¡¡2.1 Ôö¼Ó×Ö¶Î
¡¡¡¡alter table stuInfo add(Zip number(6));
¡¡¡¡2.2 ɾ³ý×Ö¶Î
¡¡¡¡alter table stuInfo drop column Zip
¡¡¡¡2.3 ÐÞ¸Ä×Ö¶ÎÀàÐÍ
¡¡¡¡alter table stuInfo modify(Zip varchar2(6));
¡¡¡¡2.4ÐÞ¸Ä×ֶδóС
¡¡¡¡alter table stuInfo modify(Zip number(4));
¡¡¡¡2.5 ɾ³ý±í
¡¡¡¡drop table stuInfo
¡¡¡¡3Ô¼Êø
¡¡¡¡3.1Ìí¼ÓÔ¼Êø
¡¡¡¡alter table stuInfo add constraint PK_stuNo primary key(stuNo);
¡¡¡¡alter table stuInfo add constraint CK_stuSex check(stuSex in('ÄÐ','Å®'));
¡¡¡¡alter table stuInfo add constraint CK_stuAge check(stuAge between 15 and 40);
¡¡¡¡alter table stuInfo add constraint CK_stuSeat check(stuSeat between 1 and 30);
¡¡¡¡alter table stuMark add constraint PK_ExamNo_stuMark  primary key(examNo);
¡¡¡¡alter table stuMark add constraint FK_stuNo_stuMark  foreign key(stuNo) references stuInfo(stuNo);
¡¡¡¡select stuName,decode(stuSex,'ÄÐ','ÄÐͬ־'),
¡¡¡¡(stuSex,'Å®','Ůͬ־')
¡¡¡¡from stuInfo;
¡¡¡¡alter table stuInfo modify(stuSex not null);
¡¡¡¡3.2ɾ³ýÔ¼Êø
¡¡¡¡3.2.1ɾ³ýÆÕÍ¨Ô¼Êø
¡¡¡¡alter table stuInfo drop constraint CK_stuSex;
¡¡¡¡3.2.2ɾ³ý±»Íâ¼ü²ÎÕÕµÄÖ÷¼üÔ¼Êø
¡¡¡¡alter table stuInfo drop primary key PK_StuNo
¡¡¡¡4Ë÷Òý
¡¡¡¡4.1´´½¨Ë÷Òý
¡¡¡¡create index stuName_index on stuInfo(stuName);
¡¡¡¡4.2ɾ³ýË÷Òý
¡¡¡¡drop index stuName_index;
¡¡¡¡5´´½¨ÐòÁÐ
¡¡¡¡5.1 ´´½¨ÐòÁÐ
¡¡¡¡create sequence stuSeat_identity
¡¡¡¡minvalue 1
¡¡¡¡maxvalue 99999999
¡¡¡¡start with 1
¡¡¡¡increment by 1
¡¡¡¡cache 2
¡¡¡¡5.2´¥·¢Æ÷ʵÏÖ×Ö¶ÎÁÐ×ÔÔö³¤


Ïà¹ØÎĵµ£º

oracleµÄ¹éµµÄ£Ê½

Ò»¡£²é¿´oracleÊý¾Ý¿âÊÇ·ñΪ¹éµµÄ£Ê½£º
1.select name,log_mode from v$database;
NAME               LOG_MODE
------------------ ------------------------
QUERY           NOARCHIVELO ......

oracleÎÊÌâÖ®Ò»£º±¾»úÁ¬½ÓÊý¾Ý¿â·þÎñÆ÷

½ñÌìÔÚnet managerÅäÖñ¾µØ·þÎñʱ³öÏÖÕâÑùµÄÎÊÌâ
ORA-12514: TNS:listener could not resolve SERVICE_NAME given in connect descriptor
ÔÚgoogleÉÏËÑË÷µÃµ½Èô¸É´ð°¸£¬×ÜÊDz»¶Ô£¬ºóÀ´ÔÚͬʵİïÖúϽâ¾öÁËÎÊÌ⣬ÏÖÔÚ×ܽáһϸú´ó¼Ò·ÖÏí¡£
1¡¢Ñ¡Öб¾µØ——·þÎñÃüÃû£¬Ôڱ༭Öд´½¨
2¡¢ÊäÈënet·þÎñÃû£¬×¢ÒâÕâÊÇ ......

Oracle ±íÁ¬½Ó·½Ê½·ÖÎö

Ò» ÒýÑÔ
Êý¾Ý²Ö¿â¼¼ÊõÊÇĿǰÒÑÖªµÄ±È½Ï³ÉÊìºÍ±»¹ã·º²ÉÓõĽâ¾ö·½°¸£¬ÓÃÓÚÕûºÍµçÐÅÔËÓªÆóÒµÄÚ²¿ËùÓзÖÉ¢µÄԭʼҵÎñÊý¾Ý£¬²¢Í¨¹ý±ã½ÝÓÐЧµÄÊý¾Ý·ÃÎÊÊֶΣ¬¿ÉÒÔÖ§³ÖÆóÒµÄÚ²¿²»Í¬²¿ÃÅ£¬²»Í¬ÐèÇ󣬲»Í¬²ã´ÎµÄÓû§ËæÊ±»ñµÃ×Ô¼ºËùÐèµÄÐÅÏ¢¡£Êý¾Ý²Ö¿âϵͳÐèÒªÄܹ»¼°Ê±µØ×·×ٺͷÖÎö´óÁ¿µÄÀúÊ·Êý¾Ý£¬²¢Äܹ»¼°Ê±×ö³ö·ÖÎöºÍÔ¤²â£¬Òò´ËÊ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ