数据库复制表结构
2012-02-20 19:04
239 查看
现在有一个数据库,我想用他的表结构,找了好久,比较好用的方法就是下面两种:
1、
2、
1、
create table a as select * from b where 1=2 ;
2、
--导出 exp userid=用户名/密码 file=文件名.dmp tables=(表名1,表名2.....) rows=n; --导入 imp userid=用户名/密码 file=文件名.dmp full=y; --- C:\Documents and Settings\Administrator>exp userid=scott/tiger file=scott.dmp tables=(emp,dept) rows=n; Export: Release 10.2.0.1.0 - Production on 星期三 8月 3 18:31:48 2011 Copyright (c) 1982, 2005, Oracle. All rights reserved. 连接到: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production With the Partitioning, OLAP and Data Mining options 已导出 ZHS16GBK 字符集和 AL16UTF16 NCHAR 字符集 注: 将不导出表数据 (行) 即将导出指定的表通过常规路径... . . 正在导出表 EMP . . 正在导出表 DEPT 成功终止导出, 没有出现警告。 C:\Documents and Settings\Administrator>imp userid=test/test file=scott.dmp full=y; Import: Release 10.2.0.1.0 - Production on 星期三 8月 3 18:42:36 2011 Copyright (c) 1982, 2005, Oracle. All rights reserved. 连接到: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production With the Partitioning, OLAP and Data Mining options 经由常规路径由 EXPORT:V10.02.01 创建的导出文件 警告: 这些对象由 SCOTT 导出, 而不是当前用户 已经完成 ZHS16GBK 字符集和 AL16UTF16 NCHAR 字符集中的导入 . 正在将 SCOTT 的对象导入到 TEST . 正在将 SCOTT 的对象导入到 TEST 即将启用约束条件... 成功终止导入, 没有出现警告。
相关文章推荐
- Sql Server两个数据库中有一张表的结构一样,怎么快速将一张表中的数据复制到另一个表中
- SqlServer 不同数据库之间复制表结构
- 数据库复制:修改表结构、新增表、新增存储过程 会被复制到订阅服务器
- 解决高并发的数据库主从复制结构
- 在一个数据库里复制一个表结构到多个数据库
- 数据库经常涉及表结构及表数据的复制
- 【SQL Server高可用性】数据库复制:修改表结构、新增表、新增存储过程 会被复制到订阅服务器?
- SQL语句:在两个数据库间复制表结构和更新数据
- 数据库复习(1)--MySQL复制表结构和数据
- 数据库表数据和表结构复制
- - 用db2look导出表结构,用db2move完成数据库的复制
- 数据库中用开窗函数和复制表结构
- 数据库复制结构内容相同的数据
- 4种主流数据库中复制表结构语法分析
- 数据库复制:修改表结构、新增表、新增存储过程 会被复制到订阅服务器
- SQL语句:在两个数据库间复制表结构和数据数据库
- 【数据库】mysql中复制表结构的方法小结
- 如何复制数据库结构
- 在sql server不同的数据库之间复制表结构和数据
- 如何复制数据库结构