2009/07/09

Copy 指令

copy from
[remote username / reomte password @ connect string]
[to username / pwasword @ connect string]
{append || create || insert || replace }
table name
using subquery; 

 
for example : (Command)

  set copycommit 1  => 一次要確認多少批資料數量
  set arraysize 1000 => 每一批擷取的資料記錄數量
  copy from TABBOT / LEDGER@HQ 
  create WORKER
  using
  select * from WORKER 

 *append : 把資料列新增到目的表格中 ,如果表格不存在則自動建立
 *create : 建立表格接著新增資料列
 *insert : 如果表格存在就把資料列新增到目的表格中,否則傳回錯誤.(所有欄未必須都在using子查詢中指定)
  *replace : 丟棄存在的的表格並用包含複製資料的表格來取代

結論 : 
    若使用在不同Oralce DB的複製,既方便又快速 (也可配合Windows排程)

沒有留言: