Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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
  2
  3×÷Õߣº   À´Ô´£º    ¸üÐÂÈÕÆÚ£º2006-01-04 
  5
  6 
  7½¨Á¢±í¿Õ¼ä
  8
  9CREATE TABLESPACE data01
 10DATAFILE '/ora ......

ORACLE 11G DBA course given in English.

This course is aim to train the great DBA with good English speaking.
In recent years, more demands of Oracle DBA, but most of Senior DBAs are required to speak good English.
English has become the great barrier for more peoples in their career development, you must have the deep feeling about it ......

Oracle»Ö復ÒâÍâ刪³ýµÄ數據

 1. flashback table table_test to timestamp to_timestamp('20091103000000','yyyymmddhh24miss');
 2.Èç¹û報錯ORA-08189: cannot flashback the table because row movement is not enabled
 3.alter table table_test enable row movement;
 4.OK ......

Oracle Shrink Table


´Ó10g¿ªÊ¼£¬oracle¿ªÊ¼ÌṩShrinkµÄÃüÁ¼ÙÈçÎÒÃǵıí¿Õ¼äÖÐÖ§³Ö×Ô¶¯¶Î¿Õ¼ä¹ÜÀí (ASSM),¾Í¿ÉÒÔʹÓÃÕâ¸öÌØÐÔËõС¶Î£¬¼´½µµÍHWM¡£ÕâÀïÐèҪǿµ÷Ò»µã£¬10gµÄÕâ¸öÐÂÌØÐÔ£¬½ö¶ÔASSM±í¿Õ¼äÓÐЧ£¬·ñÔò»á±¨ ORA-10635: Invalid segment or tablespace type¡£ 
Èç¹û¾­³£ÔÚ±íÉÏÖ´ÐÐDML²Ù× ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ