1.不同的用戶間複製表
現有同一oracle下的兩用戶user1和user2
現在想把user1的表tb的結構複製到user2下,應該如何實現?
首先,使用更高一級權限的用戶,如sys登錄,執行類似如下語句即可:
create table user2.tb as select * from user1.tb;
2.不同的表間複製數據
在同一個用戶下將 tb1 複製到tb2中
insert into tb2 select * from tb1
沒有表的情況下tb1複製到tb2中,where 1=1 (複製數據和結構)1=2(複製結構)
create table tb2 as select * from tb1 where 1 = 2