Oracle数据复制
2016-12-20 15:29
302 查看
总结一下数据库中复制表的各种方式
2.已经存在New_TabelName表,且Older_TableName与New_TabelName表结构相同,将Older_TableName中的所有满足条件的记录复制New_TabelName中:
3.不管Older_TableName和New_TabelName表结构是否相同,将Older_TableName中指定的字段Atrr1,Attr2,Attr3复制到New_TabelName的Attr_a,Attr_b,Attr_c:
4.如果New_TableName不存在,将旧表Older_TableName中的字段以及相应的数值全部复制到New_TableName中:
Method1
create table … as…
Method2
select … into ta**重点内容**ble2 from table1
select into from跟insert into select from两种表复制语句区别详细见http://www.myexception.cn/database/479886.html
但Method2方法在SQL/PL中运行报错:ORA-00905: 缺少关键字,具体原因进一步查找中
5.New_TableName不存在,将旧表Older_TableName中指定字段以及满足条件的表内容复制到New_TableName中:
复制表
1.仅复制表的字段,不复制表内容create table New_TabelName as (select * from Older_TableName where 1<0 )
2.已经存在New_TabelName表,且Older_TableName与New_TabelName表结构相同,将Older_TableName中的所有满足条件的记录复制New_TabelName中:
insert into New_TabelName select * from Older_TableName where Condition1 and Condition2...
3.不管Older_TableName和New_TabelName表结构是否相同,将Older_TableName中指定的字段Atrr1,Attr2,Attr3复制到New_TabelName的Attr_a,Attr_b,Attr_c:
insert into New_TabelName(Attr_a,Attr_b,Attr_c) select Atrr1,Attr2,Attr3 from Older_TableName where Condition1 and Condition2...
4.如果New_TableName不存在,将旧表Older_TableName中的字段以及相应的数值全部复制到New_TableName中:
Method1
create table … as…
create table New_TabelName as (select * from Older_TableName )
Method2
select … into ta**重点内容**ble2 from table1
select Attr1,Attr2,Attr3 into New_TabelName from Older_TableName where Condition1 and Condition2...
select into from跟insert into select from两种表复制语句区别详细见http://www.myexception.cn/database/479886.html
但Method2方法在SQL/PL中运行报错:ORA-00905: 缺少关键字,具体原因进一步查找中
5.New_TableName不存在,将旧表Older_TableName中指定字段以及满足条件的表内容复制到New_TableName中:
create table New_TabelName as (select Attr1,Attr2,Attr3 from Older_TableName t where t.Attr1 is not null and t.Attr2>111)
相关文章推荐
- 利用oracle高级复制功能实现数据同步的问题
- 『Oracle数据复制容灾案例系列』中银国际证券Oracle容灾案例
- 用ORACLE的高级复制实现内外网数据同步
- oracle 数据同步复制故障解决
- 精细分析Oracle分布式系统数据复制技术
- 用ORACLE的高级复制实现内外网数据同步
- [请教]SQL2005复制功能同步Oracle数据后,索引丢失?
- 如何在Oracle中复制表结构和表数据
- 利用oracle高级复制功能实现数据同步
- ORACLE的高级复制实现内外网数据同步
- 『Oracle数据复制容灾案例系列』兴业证券Oracle容灾案例
- 使用Oracle可传输表空间的特性复制数据(3)跨平台的传输实践
- 使用Oracle可传输表空间的特性复制数据(2)操作步骤
- 如何在Oracle中复制表结构和表数据
- 使用Oracle可传输表空间的特性复制数据(7)实战RMAN备份传输表空间
- OracleDataguard数据同步复制的容灾技术方案
- 使用Oracle可传输表空间的特性复制数据(1)基础概念
- 使用Oracle可传输表空间的特性复制数据(5)实战CONVERT
- Oracle不同数据库同步Merge方法,可以部分替代高级复制。对小数据量同步问题不大。转载http://blog.chinaunix.net/u1/55091/showart_430716.html
- Oracle 跨库 查询 复制表数据