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

Oracle³£ÓÃSQLÓï¾ä(PL/SQL developer¹¤¾ßϵÄ)

 ½¨±í
create table users(
id number(4) primary key,
username varchar2(10),
password varchar2(10)
)
²éѯ±í²¢½âËø±í(¼´¿ÉÒÔµã»÷ÊäÈë¿òÏÂÃæµÄ"Ëø"ͼ±ê¹¤¾ß, ¼´"Edit data")
select * from users for update
ɾ³ý±íÖжàÓàµÄÁÐ
alter table mobilephone drop column mobiletype
תÔØ
-----------------------------------------------------------------------------------------------
oracle²Ù×÷Óï¾ä£º
1.´´½¨±í
create table ±íÃû(
 ÁÐÃû1 ÀàÐÍ£¬
 ÁÐÃû2 ÀàÐÍ
);
2.ÐÞ¸ÄÀàÊôÐÔ
alter table ±íÃû modify(ÁÐÃû ÀàÐÍ);
3.Ìí¼ÓÁÐ
alter table ±íÃû add(ÁÐÃû ÀàÐÍ);
4.Ìí¼ÓÖ÷¼üÔ¼ÊøºÍ·Ç¿ÕÔ¼Êø
alter table ±íÃû add constraint pk_±íÃû primary key(ÁÐÃû);
alter table ±íÃû modify(ÁÐÃû not null);
5.ɾ³ýÖ÷¼üÔ¼Êø
alter table ±íÃû drop primary key;
alter table ±íÃû drop constraint pk_±íÃû;
6.ʧЧԼÊø
alter table ±íÃû disable primary key;
alter table ±íÃû disable constraint pk_±íÃû;
7.ÓÐЧԼÊø
alter table ±íÃû enable primary key;
alter table ±íÃû enable constraint pk_±íÃû;
8.ɾ³ýÁÐ
alter table ±íÃû drop column ÁÐÃû;
9.ÉèÖÃijÁв»¿ÉÓã¬È»ºóɾ³ý
alter table ±íÃû set unused(ÁÐÃû);
alter table ±íÃû drop unused columns;
10.Ð޸ıíÃû
rename ±íÃû1 to ±íÃû2
alter ±íÃû1 rename to ±íÃû2;
11.½Ø¶Ï±í
truncate table ±íÃû;
12.½Ø¶Ï±í±£ÁôÐпռä
truncate table ±íÃû resue storage;
13.²é¿´±í½á¹¹
desc table ±íÃû;
14.ɾ³ý±í
drop table ±íÃû;
15.²åÈë¼Ç¼
Àý£ºinsert into ±íÃû values(ÄÚÈÝ1,ÄÚÈÝ2,ÄÚÈÝ3,ÄÚÈÝ4);
16.´ø²ÎÊý¶Ô»°·½Ê½²åÈëÐÐ
Àý:insert into ±íÃû values(&ÁÐÃû1,&ÁÐÃû2);
  insert into ±íÃû values(ÄÚÈÝ1,ÄÚÈÝ2);
17.²åÈëij¼¸ÁмǼ
insert into ±íÃû(ÁÐÃû1,ÁÐÃû2) values(ÄÚÈÝ1,ÄÚÈÝ2);
18.ΪÁвåÈë¿ÕÖµ£¨ÆäÁв»ÄÜΪnot null£©
insert into ±íÃû values(ÄÚÈÝ1,null,null);
19.´´½¨±í£¨°üÀ¨Ö÷¼ü¼°Íâ¼üÉèÖã©·½·¨Ò»
create table ±íÃû(
  ÁÐÃû1 ÀàÐÍ
  constraint pk_±íÃû primary key,
  ÁÐÃû2 ÀàÐÍ not null,
  ÁÐÃû3 ÀàÐÍ 
  constraint fk_±íÃû reference ±íÃû(ÁÐÃû),
  ÁÐÃû3 ÀàÐÍ
  constraint


Ïà¹ØÎĵµ£º

oracle ±í¿Õ¼ä²Ù×÷

oracle±í¿Õ¼ä²Ù×÷Ïê½â
  1
  2
  3×÷Õߣº   À´Ô´£º    ¸üÐÂÈÕÆÚ£º2006-01-04 
  5
  6 
  7½¨Á¢±í¿Õ¼ä
  8
  9CREATE TABLESPACE data01
 10DATAFILE '/ora ......

Oracle SQL*PlusµÄ»·¾³ÅäÖ㨸ü¸ÄÐÐ¿í£©

µ±ÎÒÃÇÓÃoracleµÄSQL*Plus¹¤¾ßÊäÈësqlÓï¾äµÄʱºò£¬SQL*PlusµÄĬÈÏÉèÖÃ×ÜÓÐЩ²»ºÏÀíµÄµØ·½£¬´ËʱÎÒÃÇͨ¹ýÒÔÏÂһЩ·½·¨¸Ä½ø£º
1¡¢¿ÉÒÔÔËÓÃSQL*Plus×ÔÉíһЩÓï¾ä¸Ä±ä»·¾³²ÎÊý¡£
     SQL>  set linesize 900 ;   /* ¸ü¸ÄÏÔʾµÄ¿í¶È, ÉèÖóÉ900ºó, Ò»ÐÐÊý¾Ý¾Í²»»á·ÖÁ½ÐÐÏÔʾÁË */
&nb ......

OracleµÄ³õʼ»¯²ÎÊýÎļþ

     oracleʵÀýÆô¶¯Ê±¶ÁÈ¡pfile²ÎÊýÎļþ£¬ÐÞ¸Äpfile³õʼ»¯²ÎÊýÎļþºó£¬±ØÐëÖØÐÂÆô¶¯ÊµÀý²ÅÄÜÉúЧ¡£ 
     pfile²ÎÊýÎļþÓëspfile²ÎÊýÎļþ¶¼ÊÇÓÃÀ´´æ·Å³õʼ»¯²ÎÊýµÄÎïÀíÎļþ£¬pfileÒÔÎı¾ÎļþµÄÐÎʽ´æ´¢£¬ÓŵãÊÇÒ×Óڲ鿴ÓëÐ޸ģ»spfileÒÔ¶þ½øÖƵÄÐÎʽ´æ´¢£¬ËäÈ»ÄÜʵÏÖÒÔʵÀ ......

OracleÓÃimpºÍexpʵÏÖÊý¾ÝµÄµ¼ÈëºÍµ¼³ö

 ImpºÍExp
ÃüÁîÏê½â:
Exp
µ¼³ö
ģʽ:
Fullģʽ---µ¼³ö
Õû¸öÊý¾Ý¿â
Userģʽ---µ¼³ö
Ö¸¶¨µÄÓû§
Tableģʽ—µ¼³ö
Ö¸¶¨µÄ±í
Tablespaceģʽ—µ¼³ö
±í
¿Õ¼ä
Exp
µ¼³ö
²ÎÊý:
OWNERÖ¸¶¨Òªµ¼³ö
µÄÓû§Áбí
FULL=y±íʾҪµ¼³ö
Õû¸öÊý¾Ý¿â
TablesÖ¸¶¨Òªµ¼³ö
µÄ±í
TablepacesÖ¸¶¨Òªµ¼³ö
µÄ±í ......

Oracle JOB Ó÷¨Ð¡½á

Ò»¡¢ÉèÖóõʼ»¯²ÎÊý job_queue_processes
¡¡¡¡sql> alter system set job_queue_processes=n;£¨n>0£©
¡¡¡¡job_queue_processes×î´óֵΪ1000
¡¡¡¡
¡¡¡¡²é¿´job queue ºǫ́½ø³Ì
¡¡¡¡sql>select name,description from v$bgprocess;
¡¡¡¡
¡¡¡¡¶þ£¬dbms_job package Ó÷¨½éÉÜ
¡¡¡¡°üº¬ÒÔÏÂ×Ó¹ý³Ì£º
¡¡¡¡
¡¡ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ