Oracle數(shù)據(jù)庫表結(jié)構(gòu)及數(shù)據(jù)的復(fù)制

字號:


    Oracle數(shù)據(jù)庫表結(jié)構(gòu)及數(shù)據(jù)的復(fù)制,具體代碼如下:
    --只復(fù)制表結(jié)構(gòu)
    create table studentTemp as select * from student where 1=2;--條件為假 未得到數(shù)據(jù)
    --復(fù)制已有表數(shù)據(jù)到新表
    insert into studentTemp select * from student;
    insert into studentTemp(...) select ... from student;
    --復(fù)制表結(jié)構(gòu)與數(shù)據(jù)
    create table copyStudent as select * from student;
    insert into copyStudent select * from student;