AskTom筆記(2)
last updated 2005-04-04
key word : forall/delete/update
1.
1)forall一次只能執行一個單一的語句,如果有多個insert/delete,必須使用多個forall
2)limit子句使用示例
//other statement
fetch c BULK COLLECT INTO data LIMIT 100;-- 每次100行
begin
FORALL i IN 1 .. data.count SAVE EXCEPTIONS
insert into t2 values data(i);
//other statement
2.
如何刪除大表中的大批次的資料
1)
create table new_table unrecoverable as select * from old_table where ....;
drop table old_table;
rename new_table to old_table;
create index old_table_idx1 on old_table(c1,c2) unrecoverable parallel 5;
.....
沒有日誌產生,只是把資料移動到新表上,drop/rename old/new,而且儘可能快的建立索引
2)
分割槽表.並行刪除資料.每個分割槽會使用自身的回滾段,會以並行的方式執行.
3)
分割槽表以便使用DROP分割槽而不是使用DELETE刪除資料.
3.
如何更新大表中的大批次資料
CREATE TABLE new_table as select
index new_table
grant on new table
add constraints on new_table
etc on new_table
drop table old_table
rename new_table to old_table;
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/6906/viewspace-21754/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- AskTom筆記(1)筆記
- ASKTOM 網站網站
- Day 2 筆記筆記
- docker 筆記2Docker筆記
- sqlserver筆記2SQLServer筆記
- makefile筆記(2)筆記
- cassandra筆記2筆記
- 『筆記』2-SAT筆記
- linux筆記2Linux筆記
- 社群使用筆記2筆記
- HTML DOM筆記2HTML筆記
- c++筆記2C++筆記
- iTerm2筆記筆記
- 論文筆記(2)筆記
- python筆記2Python筆記
- 盜墓筆記2筆記
- 22javascript筆記(2)JavaScript筆記
- dart2筆記-類Dart筆記
- Vue學習筆記2Vue筆記
- MySQL學習筆記2MySql筆記
- RocketMQ學習筆記 2MQ筆記
- Objective-C筆記-2Object筆記
- 設計模式筆記(2)設計模式筆記
- Hadoop筆記HDFS(2)Hadoop筆記
- Oracle學習筆記2Oracle筆記
- react學習筆記2React筆記
- FPGA讀書筆記2FPGA筆記
- mysql學習筆記-2MySql筆記
- jQuery學習筆記(2)jQuery筆記
- YYCache原始碼筆記2原始碼筆記
- JavaScript入門筆記(2)JavaScript筆記
- struts2筆記(一)筆記
- EBS開發筆記-2筆記
- Scala學習筆記2筆記
- IOS 開發筆記2iOS筆記
- TestNG—學習筆記2筆記
- autolayout學習筆記_2筆記
- Delphi逆向工程筆記[2]筆記