Íæ×ªOracle£¨5£©
||------- Êý¾Ý¿â¹ÜÀí -------||
//ÏÔʾ³õʼ»¯²ÎÊý
show parameter;
//Êý¾Ý¿â±íµÄÂß¼±¸·ÝÓë»Ö¸´
//µ¼³ö
1.µ¼³ö±í
exp userid=scott/tiger@ORCL tables=(emp) file=d:\e1.dmp
2.µ¼³öÆäËû·½°¸µÄ±í£¬Ê×ÏÈҪȷÈÏ×Ô¼ºÊÇsysdbaÉí·Ý
exp userid=system@919959ORCL tables=(scott.emp) file=d:\e1.dmp
3.µ¼³ö±í½á¹¹
exp userid=scott/tiger@ORCL tables=(emp) file=d:\e3.dmp rows=n
4.ʹÓÃÖ±½Óµ¼³ö·½Ê½(ЧÂÊ±ÈÆÕͨµ¼³ö·½Ê½¿ì)
exp userid=scott/tiger@ORCL tables=(emp,dept) file=d:\e4.dmp direct=y
5.µ¼³ö·½°¸
exp userid=scott/tiger@ORCL owner=scott file=d:\e5.dmp
6.µ¼³öÊý¾Ý¿â£¬¸ÃÓû§±ØÐëÊÇdba
exp userid=system/919959@ORCL full=y inctype=complete file=d:\e6.dmp
//µ¼Èë
1.µ¼Èë×Ô¼º±í
imp userid=scott/tiger@ORCL tables=(emp) file=d:\e1.dmp
2.µ¼Èë±íµ½ÆäËûÓû§
ÒªÇó¸ÃÓû§¾ßÓÐdbaȨÏÞ£¬»òÊÇimp_full_database
imp userid=system/919959@ORCL tables(emp) file=d:\e2.dmp touser=scott
3.µ¼Èë±íµÄ½á¹¹
imp userid=scott/tiger@ORCL tables=(emp) file=d:\e3.dmp rows=n
4.µ¼ÈëÊý¾Ý
imp userid=scott/tiger@ORCL tables=(emp) file=d:\e4.dmp ignore=y
||------- ±í¿Õ¼ä¹ÜÀí -------||
½¨±í¿Õ¼äÐèÒªdbaÓû§È¨ÏÞ
//½¨Á¢±í¿Õ¼ä
create tablespace sp001 datafile 'd:\data01.dbf' size 20m uniform size 128k
//ʹÓÃÊý¾Ý±í¿Õ¼ä
create table mypart(
deptno number(4),
dname varchar2(14),
loc varchar2(13)
) tablespace sp001;
//ʹ±í¿Õ¼äÍÑ»ú
alter tablespace sp001 offline;
//ʹ±í¿Õ¼äÁª»ú
alter tablespace sp001 online;
//Ö»¶Á±í¿Õ¼ä
alter tablespace sp001 read only;
//Ð޸ıí¿Õ¼äΪ¿É¶Á¿Éд
alter tablespace sp001 read write;
//ÏÔʾ±í¿Õ¼ä°üÀ¨À©µÄËùÓбí
select * from all_tables where tablespace_name='sp001';
//ÖªµÀ±íÃ÷£¬²é¿´¸Ã±íÊôÓÚÄĸö±í¿Õ¼ä
select tablespace_name ,table_name from user_tables where table_name='EMP';
//À©Õ¹±í¿Õ¼ä
1.Ôö¼ÓÊý¾ÝÎļþ
alter tablespace sp01 add datafile 'd:\sp01.dbf' size 20m;
2.Ôö¼ÓÊý¾ÝÎļþ´óС(ÕâÀïÐèҪעÒâµÄÊÇÊý¾ÝÎļþµÄ´óС²»Òª³¬¹ý500m)
alter database datafile 'd:\sp01.dbf' resize 20m;
3.ÉèÖÃÎļþµÄ×Ô¶¯Ôö³¤
alter tablespace datafile 'd:\sp
Ïà¹ØÎĵµ£º
ʲôÊǺϲ¢¶àÐÐ×Ö·û´®£¨Á¬½Ó×Ö·û´®£©ÄØ£¬ÀýÈ磺
SQL> desc test;
Name Type Nullable Default Comments
------- ------------ -------- ------- --------
COUNTRY VARCHAR2(20) Y &nb ......
in ÊǰÑÍâ±íºÍÄÚ±í×÷hash Á¬½Ó£¬¶øexistsÊǶÔÍâ±í×÷loopÑ»·£¬Ã¿´ÎloopÑ»·ÔÙ¶ÔÄÚ±í½øÐвéѯ¡£
Ò»Ö±ÒÔÀ´ÈÏΪexists±ÈinЧÂʸߵÄ˵·¨ÊDz»×¼È·µÄ¡£
Èç¹û²éѯµÄÁ½¸ö±í´óСÏ൱£¬ÄÇôÓÃinºÍexists²î±ð²»´ó¡£
in ÊǰÑÍâ±íºÍÄÚ±í×÷hash Á¬½Ó£¬¶øexistsÊǶÔÍâ±í×÷loopÑ»·£¬Ã¿´ÎloopÑ»·ÔÙ¶ÔÄÚ±í½øÐвéѯ¡£
Ò»Ö ......
1. trigger ÊÇ×Ô¶¯Ìá½»µÄ£¬²»ÓÃCOMMIT£¬ROLLBACK
2. trigger×î´óΪ32K£¬Èç¹ûÓи´ÔÓµÄÓ¦ÓÿÉÒÔͨ¹ýÔÚTRIGGERÀïµ÷ÓÃPROCEDURE»òFUNCTIONÀ´ÊµÏÖ¡£
3. Óï·¨
CREATE OR REPLACE TRIGGER <trigger_name>
<BEFORE | AFTER> <ACTION>
ON <table_name>
DECLARE
<variable definitions> ......
oracle¿Í»§¶ËplsqlÉèÖÃ(windows7) ÔÚwindows7°²×°plsqlÒÔ·ÃÎÊ·þÎñÆ÷ÉϵÄoracleÊý¾Ý¿â
1. ÔÚ¹ÙÍøÏÂÔØoracle database 10g client£¬°²×°Ê±Ñ¡Ôñinstant client£¬°´Ä¬ÈÏÉèÖð²×°
2. °²×°»òʹÓÃÂÌÉ«°æµÄplsql
3. ÔÚplsqlĿ¼ÏÂÕÒµ½(»òн¨)Îļþtnsnames.ora£¬¿ÉÖØ¸´Ìí¼ÓÈçÏ¶Σº
MYNAME =
(DESCRIPTION =
(ADDRESS_L ......
create or replace trigger InsertEdcTerminal
after INSERT on edc_terminal
FOR EACH ROW
DECLARE
merchantId char(15);
terminalId char(8);
uservalue char(6) ;
updatedate char(8);
updatetime char(6);
v_cardtype Merchant_Card.Card_Type%TYPE;
v_cardstate merchant_card.card_stat%TYPE;
v_banktyp ......