ÈçºÎÔÚOracleÖи´ÖƱí½á¹¹ºÍ±íÊý¾Ý
1. ¸´ÖƱí½á¹¹¼°ÆäÊý¾Ý£º
create table table_name_new as select * from table_name_old
2. Ö»¸´ÖƱí½á¹¹£º
create table table_name_new as select * from table_name_old where
1=2;
»òÕߣº
create table table_name_new like table_name_old
3. Ö»¸´ÖƱíÊý¾Ý£º
Èç¹ûÁ½¸ö±í½á¹¹Ò»Ñù£º
insert into table_name_new select * from table_name_old
Èç¹ûÁ½¸ö±í½á¹¹²»Ò»Ñù£º
insert into
table_name_new(column1,column2...) select column1,column2...
from table_name_old
Ïà¹ØÎĵµ£º
´ËÎÄ´ÓÒÔϼ¸¸ö·½ÃæÀ´ÕûÀí¹ØÓÚ·ÖÇø±íµÄ¸ÅÄî¼°²Ù×÷:
1.±í¿Õ¼ä¼°·ÖÇø±íµÄ¸ÅÄî
2.±í·ÖÇøµÄ¾ßÌå×÷ÓÃ
3.±í·ÖÇøµÄÓÅȱµã
4.±í·ÖÇøµÄ¼¸ÖÖÀàÐ ......
¶ÔoracleÒѾѧϰÈý¸ö¶à4£¬¿ÉÒÔ²âÊÔÓÃһЩ¸´ÔÓµÄ×éºÏ£» 5£¬ËüÉú³ÉµÄ²âÊÔÓÃÀýÊÇÓм£¿ÉÑÈÕ£¬¼´ÓйæÂɵ쬲»ÏñÊÖ¹¤²âÊÔÄÇÑù»áÒÅ©һЩÓÃÀýµÄ×éºÏ¡£ 3 Ñ¡ÔñOATSµÄ»ù±¾ÔÔòÒ»°ã¶¼ÊÇÏÈÈ·¶¨²âÊÔµÄÒòËØ¡¢Ë®Æ½ºÍ½»»¥×÷Ó㬺óÑ¡ÔñÊÊÓõÄÕý½»±í¡£ÔÚÈ·¶¨ÒòËØµÄˮƽÊýʱ£¬Ö÷ÒªÒòËØÓ¦¸Ã¶à°²Åż¸¸öˮƽ£¬´ÎÒªÒòËØ¿ÉÉÙ°²Åż¸¸öˮƽ¡£ £¨1ÖØ ......
||------- ά»¤Êý¾ÝÍêÕûÐÔ -------||
¡¾Ô¼Êø¡¿
//Ô¼Êø
not null //·Ç¿Õ
unique //Ψһ ²»ÄÜÖØ¸´£¬µ«¿ÉÒÔΪ¿Õ
primary key //Ö÷¼ü
foreign key //Íâ¼ü
check //Âú×ãÌõ¼þ
//É̵êÊÛ»õϵͳ±íÉè¼Æ°¸Àý£¨1£©
//goods ÉÌÆ·±í
goodsid ......
DBAÃǾ³£»áÓöµ½Ò»¸öÕâÑùÁîÈËÍ·ÌÛµÄÎÊÌ⣺²»ÖªµÀËÔÚOracleÉÏ´´½¨ÁËÒ»¸öÓû§£¬´´½¨Ê±£¬Ã»ÓиøÕâ¸öÓû§Ö¸¶¨Ä¬Èϱí¿Õ¼ä£¬ËùÒÔÕâ¸öÓû§¾Í»á²ÉÓÃĬÈϵıí¿Õ¼ä——system±í¿Õ¼ä¡£µ¼ÖÂϵͳ±í¿Õ¼äѸËÙ±»Óû§Êý¾ÝÕ¼Âú£¬Ö±ÖÁå´»ú¡£
ÔÚ10GÖУ¬DBAÓа취±ÜÃâÕâÖÖÎÊÌâÁË——ÔÚÏßÖ¸¶¨ÏµÍ³Ä¬Èϱí¿Õ¼ä£º
ALTER DAT ......
µÚÒ»²¿·Ö£ºoracle pl/sqlʵÀýÁ·Ï°(1)
Ò»¡¢Ê¹ÓÃscott/tigerÓû§ÏµÄemp±íºÍdept±íÍê³ÉÏÂÁÐÁ·Ï°£¬±íµÄ½á¹¹ËµÃ÷ÈçÏÂ
empÔ±¹¤±í(empnoÔ±¹¤ºÅ/enameÔ±¹¤ÐÕÃû/job¹¤×÷/mgrÉϼ¶±àºÅ/hiredateÊܹÍÈÕÆÚ/salн½ð/commÓ¶½ð/deptno²¿ÃűàºÅ)
dept²¿Ãűí(deptno²¿ÃűàºÅ/dname²¿ÃÅÃû³Æ/locµØµã)
¹¤×Ê £½ н½ð £« Ó¶½ð
Ò²¿ÉÒÔͨ¹ý ......