轉(zhuǎn)移Oracle海量數(shù)據(jù)到另外的用戶流程
假如你想把Oracle中的大量數(shù)據(jù)(80MB以上)轉(zhuǎn)移Oracle海量數(shù)據(jù)到另外的相關(guān)用戶或者是另外的相關(guān)表空間里。我建議你可以使用以下的快速轉(zhuǎn)移數(shù)據(jù)的實際操作方法。望大家瀏覽完之后會有所收獲。
一、建新表的方式
- create table target_tablename tablespace
- target_tablespace_name nologging
- pctfree 10 pctused 60
- storage(initial 5M next 5M minextents 1
- maxextents unlimited pctincrease 0)
- as select * from username.source_tablename where
條件;
注意事項: 新建的表沒有原來表的索引和默認(rèn)值, 只有非空(not null)的約束素條件可以繼承過來,其它的約束條件或索引需要重新建立.
二、直接插入的方法
- INSERT /*+ APPEND */ INTO target_tablename
- SELECT * FROM username.source_tablename where 條件;
- COMMIT;
注意事項:
用INSERT /*+ APPEND */ 的方法會對target_tablename產(chǎn)生級別為6的獨占鎖,如果運行此命令時還有對target_tablename的DML操作會排隊在它后面,對OLTP系統(tǒng)在用的表操作是不合適的。
說明:這兩種方法轉(zhuǎn)移Oracle海量數(shù)據(jù)數(shù)據(jù)時沒有用SGA里數(shù)據(jù)緩沖區(qū)和事物處理的回滾段, 也不寫聯(lián)機事物日志,就象數(shù)據(jù)庫裝載工具Solload一樣直接把數(shù)據(jù)寫到物理文件,速度是很快的。在Oracle8i以后的版本都可以使用。
【編輯推薦】
- Oracle數(shù)據(jù)插入的性能優(yōu)化的描述
- 獲得Oracle權(quán)限的TABLE FUNCTION實操
- Oracle job interval 參數(shù)設(shè)置示例
- Oracle NLS_LANG設(shè)置的具體操作方法
- Oracle NLS_LANG設(shè)置的具體操作方法