ORACLEä¸å¦æ表æ°æ®éå¾å¤§ï¼M级ææ´å¤§ï¼ï¼updateæ个å段æ¯å¾æ
¢çï¼å¦æçHIS项ç®ä¸æ´æ°åå²ä¸å¡æµç¨è¡¨ï¼160ä¸æ¡è®°å½ï¼ç¨CURSORæ¥æ´æ°ï¼1000æ¡COMMITä¸æ¬¡ï¼è±äº4天ä¹æ²¡æ´æ°å®ï¼ï¼åæ¥å°è¯è¿çæ¹è¿åæ³æï¼
1.æ表ä¸çLOGGINGåæ¶
2.æ表ä¸çINDEXåæ¶
ä½æ¯ä¾ç¶å¾æ
¢ï¼æ å¥ä¸æ¾å°è¿ä¸ªï¼
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:6407993912330å¨è¿ä¸ªä¸»é¢é®çéï¼ORAå®æ¹æäºä¸ç§å¤ççåæ³ï¼
1.å©ç¨CREATE table as select xxxxxçåæ³æ¥çæä¸æ°è¡¨T1
2.å¨T1ä¸å建ä¸ç®æ 表ä¸æ ·çç´¢å¼
3.æç®æ 表å é¤æRENAME(注æå¤ä»½ä»¥å¤åæ)
4.æT1æ¹åæç®æ 表
è¯äºä¸ä¸ï¼æç¶é常å°å¿«ï¼æçä»»å¡å·®ä¸å¤å¨2Minå°±å®æäºã
å¦csywdk.table_roomæ¯ä¸å¼ 大表,è¦å é¤å
¶ä¸bakfwidå¨noNewYWFW20081205ä¸çè®°å½,ä¸è¦æ´æ°bakfwidå¨imp_table_roomä¸è®°å½çROOM_LOC为imp_table_room.room_loc:
(1)å建æ°è¡¨
create table tmp_new_table_room081205 as
select t1.ROOM_ID,t1.NEWROOMID,t1.BUILDID,t1.TFH,t1.DKH,t1.BUILD_NO,t1.LAYER_NO,t1.ROOM_NO,t1.ROOM_NAME,
decode(t2.bakfwid,null,t1.ROOM_LOC,t2.room_loc)
t1.ROOM_AREA,
t1.SURTYPE,t1.LAYER_NAME,t1.DEVDEP,t1.CELL,t1.DELFLAG,t1.QXXZ,t1.SJSJLSH,t1.FD,t1.ID,t1.BAKFWID
from csywdk.table_room t1 left join imp_table_room t2 on t1.bakfwid=t2.bakfwid
where not exists(select 1 from noNewYWFW20081205 t3 where t3.bakfwid=t1.bakfwid)
(2)å建å¤ä»½è¡¨
create table Table_room081205 as
select * from csywdk.table_room
(3)æ¿æ¢å表
drop table sde.table_room
create table sde.table_room as
select * from tmp_new_table_room081205
å¨è¿ä¸ªé®çéè¿æå°ä¸å¥ORA PL/SQLæçç¸å
³çè¯ï¼
âè½ç¨ä¸å¥è¯å¥å¤ççä»»å¡å³ä¸è¦ç¨å¤å¥ç¼ç¨æ¥å®ç°âã
åæ¥èæ¯æä¸å¥æ§è¡æ¶ï¼åæ»æ®µä¸å¤å¤§ï¼çæ¥åªè½åå¤å¥½ç¡¬ç为ä¸çäº