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

oracleËÀËøÔ­Òò·ÖÎö

ËÀËøµÄÔ­Òò
1¡£Ä£ÄâËÀËø
1¡£1¡£Ö÷±í
-- Create table
create table WDZ1
(
WDZ1ID NUMBER not null,
MEMO VARCHAR2(20)
)
;
alter table WDZ1
add constraint XXXXXX primary key (WDZ1ID);
1¡£2¡£´Ó±í£¨Ã»ÓÐÍ⽡µÄË÷Òý£©
-- Create table
create table WDZ2
(
WDZ2ID NUMBER not null,
WDZ1ID NUMBER,
MEMO VARCHAR2(20)
)
;
-- Create/Recreate primary, unique and foreign key constraints
alter table WDZ2
add constraint XXXXX primary key (WDZ2ID)
;
alter table WDZ2
add constraint XXX foreign key (WDZ1ID)
references WDZ1 (WDZ1ID);
1¡£3¡£²åÈëÊý¾Ý±íµ½×¡±í
begin
insert into wdz1 values (1,'aa');
insert into wdz1 values(2,'aa2');
insert into wdz1 values (3,'aa3');
insert into wdz2 values(10,3,'wdz3--1');
commit;
end;
1¡£4¡£ÔÚÒ»¸öÊý¾Ý¿âseeesionÀïÃæ²åÈëÊýµ½´Ó±í£¬µ«ÊDz»Ìá½»ÊÂÎñ
begin
update wdz2 set memo='update wdz2 momo'
where wdz2id=10;
insert into wdz2 values(20,2,'wdz2--1');
end;
¶Ô´Ó±í½øÐвåÈë/Ð޸ļǼ£¬Ê©¼ÓµÄËøÒ²¾ÍÊÇÐм¶Ëø
1¡£5¡£ÔÚÁíÍâÒ»¸öÊý¾Ý¿âseeesionÀïÃæɾ³ý Ö÷±íÊý¾Ý
delete from wdz1 where wdz1id=1
Õâʱºò ³ÌÐò»áËÀËø£¬³ý·Ç ÉÏÃæµÄ ¶Ô´Ó±íµÄ Êý¾Ý²Ù×÷Ìá½»ÊÂÎñ»òÕ߻عöÊÂÎñ¡£
2¡£¾ßÌåÔ­Òò·ÖÎö
Ò»¸öÊý¾Ý±íµÄÍâ¼üÖ÷ÒªÓÐ3ÖÖ·½Ê½À´Î¬»¤Ëü×Ô¼ººÍÖ÷±íÊý¾ÝµÄÒ»ÖÂÐÔ¡£
(1)delete cascade
Àý×ÓÈçÏ£º
alter table WDZ2
add constraint XXX foreign key (WDZ1ID)
references WDZ1 (WDZ1ID) on delete cascade;
(2)Set null
Àý×ÓÈçÏ£º
alter table WDZ2
add constraint XXX foreign key (WDZ1ID)
references WDZ1 (WDZ1ID) on delete set null;
(3)No action
×¢Ò⣬ÕâÊÇoracleÍâ¼üʹÓÃʱºòµÄĬÈÏÑ¡Ïî¡£
Àý×ÓÈçÏ£º
alter table WDZ2
add constraint XXX foreign key (WDZ1ID)
references WDZ1 (WDZ1ID);
ÒÔÇ°³öÏÖËÀËøÖ÷ÒªÊÇÎÒÃÇÈÏΪ£¬ÔÚ 1¡£4¡£»á¶ÔÊý¾Ý±íwdz2½øÐÐÊ©¼ÓÐм¶Ëø£¬µ«ÊÇ´Ó±í(wdz2)µÄÍ⽡ÊÇNo action£¬É¾³ýÖ÷±í(wdz1)²»»áÈ¥·ÃÎÊ´Ó±í£¬¸ü²»»áÈ¥Ëø¶¨ wdz2±íµÄ¼Ç¼»òÕ߶ÔÕû¸öÊý¾Ý´Ó±í(wdz2)Ê©¼Ó±í¼¶Ëø¡£ÊÂʵÉÏ oralceµÄNo action Ñ¡ÏîµÄ×ÖÃæÒâ˼ÆÛÆ­ÁËÎÒÃÇ£¬oracleÔÚɾ³ýÖ÷±íµÄʱºò
»áȥѰÕÒËùÓÐÒÔÖ÷±íµÄÖ÷¼ü×÷ΪÍâ¼üµÄÊý¾Ý±í£¬È»ºó¿´È¥¿´´Ó±í
ÊÇ·ñÓиÃÍâ¼üµÄË÷Òý£¬Èç¹ûûÓÐÔò»á¶ÔÕû¸ö´Ó±íÊ©¼Ó±í¼¶Ëø£¬È»ºó
¶Ô´Ó±í½


Ïà¹ØÎĵµ£º

Oracle´¥·¢Æ÷(¸ÅÄîºÍÀàÐÍ)

1.       ÒýÑÔ
 
2.       ´¥·¢Æ÷µÄ¸ÅÄîºÍÀàÐÍ
´¥·¢Æ÷ÊÇÒ»ÖÖÌØÊâµÄ´æ´¢¹ý³Ì£¬ËüÔÚ²åÈ룬ɾ³ý»òÐÞ¸ÄÌض¨±íÖеÄÊý¾Ýʱ´¥·¢Ö´ÐУ¬Ëü±ÈÊý¾Ý¿â±¾Éí±ê×¼µÄ¹¦ÄÜÓиü¾«Ï¸ºÍ¸ü¸´ÔÓµÄÊý¾Ý¿ØÖÆÄÜÁ¦¡£Êý¾Ý¿â´¥·¢Æ÷ÓÐÒÔϵÄ×÷Óãº
* °²È«ÐÔ¡£¿ÉÒÔ»ùÓÚÊý¾Ý¿âµÄÖµ ......

ORACLE JOB¼ä¸ôʱ¼ä²Î¿¼

 
¹Ø¼ü×Ö: oracle job ¼ä¸ôʱ¼ä trunc
¼ÙÉèÄãµÄ´æ´¢¹ý³ÌÃûΪPROC_RAIN_JM
ÔÙдһ¸ö´æ´¢¹ý³ÌÃûΪPROC_JOB_RAIN_JM
ÄÚÈÝÊÇ£º
Create Or Replace Procedure PROC_JOB_RAIN_JM   Is   li_jobno         Number;  &nb ......

Install Oracle 10g for Solaris

 Ò»¡¢Ê×ÏÈÏÂÔØ
1¡£µ½OracleµÄOTNÕ¾µãÉÏÏÂÔØOracle10g for Solaris x86µÄ°²×°ÅÌ http://www.oracle.com/technology ... ocs/solx86soft.html 2¡£ÏÂÔØÍê±ÏÒԺ󣬵õ½solarisx86_DB_10_1_0_3_Disk1.cpio.gzÎļþ ½âѹ£¬Éú³ÉDisk1Ŀ¼ $ gunzip -c solarisx86_DB_10_1_0_3_Disk1.cpio.gz | cpio -idmv È»ºó¿´oracle 10g fo ......

OracleÊý¾Ý¿â·ÖÇø±í²Ù×÷·½·¨

http://www.diybl.com/course/7_databases/oracle/oraclejs/2007614/52942.html
ÕªÒª£ºÔÚ´óÁ¿ÒµÎñÊý¾Ý´¦ÀíµÄÏîÄ¿ÖУ¬¿ÉÒÔ¿¼ÂÇʹÓ÷ÖÇø±íÀ´Ìá¸ßÓ¦ÓÃϵͳµÄÐÔÄܲ¢·½±ãÊý¾Ý¹ÜÀí£¬±¾ÎÄÏêϸ½éÉÜÁË·ÖÇø±íµÄʹÓᣠ
¡¡¡¡ ÔÚ´óÐ͵ÄÆóÒµÓ¦ÓûòÆóÒµ¼¶µÄÊý¾Ý¿âÓ¦ÓÃÖУ¬Òª´¦ÀíµÄÊý¾ÝÁ¿Í¨³£¿ÉÒÔ´ïµ½¼¸Ê®µ½¼¸°ÙGB£¬ÓеÄÉõÖÁ¿ÉÒÔµ½T ......

oracle ×Ö·û¼¯ÎÊÌâ

1.oracle×Ö·û¼¯ÎÊÌ⣺
Êý¾Ý¿â×Ö·û¼¯ÎªZHS16BGK£¬ºº×ÖÔÚÊý¾Ý¿â´æ·ÅµÄʱºòÕ¼ÓÃÁ½¸ö×Ö½Ú
Êý¾Ý¿â×Ö·û¼¯ÎªUTF8£¬ºº×ÖÔÚÊý¾Ý¿âÀï´æ·ÅµÄʱºòÕ¼ÓÃÈý¸ö×Ö½Ú
ÓÉÓÚ×Ö·û¼¯²»Í¬£¬µ¼ÖÂÏÖÔÚÊý¾Ý¿âIMPµÄʱºòÓÐЩ±íµÄ×ֶγ¤¶È²»¹»£¬³öÏÖORA-12899: value too large for columnµÄ´íÎó¡£
ͨ¹ýÐÞ¸Ä×Ö·û¼¯¿ÉÒÔ½â¾öÕâÖÖÎÊÌâ¡£
2.utf-8ºÍunico ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ