|
備忘:
1.不同用戶之間的表數(shù)據(jù)復(fù)制
對于在一個數(shù)據(jù)庫上的兩個用戶A和B,假如需要把A下表old的數(shù)據(jù)復(fù)制到B下的new,請使用權(quán)限足夠的用戶登入sqlplus:
insert into B.new(select * from A.old);
如果需要加條件限制,比如復(fù)制當(dāng)天的A.old數(shù)據(jù)
insert into B.new(select * from A.old where date=GMT);
藍(lán)色斜線處為選擇條件
2.同用戶表之間的數(shù)據(jù)復(fù)制
用戶B下有兩個表:B.x和B.y,如果需要從表x轉(zhuǎn)移數(shù)據(jù)到表y,使用用戶B登陸sqlpus即可:
insert into y select * from x;
3.B.x中個別字段轉(zhuǎn)移到B.y的相同字段
insert into y(字段1,字段2) select 字段1,字段2 from x;
4.生成新表
CREATE TABLE newTable AS (SELECT * FROM oldTable)
|