数据库复制表结构

来源:互联网 发布:年度网络中文新词 编辑:程序博客网 时间:2024/05/20 14:43


 现在有一个数据库,我想用他的表结构,找了好久,比较好用的方法就是下面两种:

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 2011Copyright (c) 1982, 2005, Oracle.  All rights reserved.连接到: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - ProductionWith 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 2011Copyright (c) 1982, 2005, Oracle.  All rights reserved.连接到: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - ProductionWith the Partitioning, OLAP and Data Mining options经由常规路径由 EXPORT:V10.02.01 创建的导出文件警告: 这些对象由 SCOTT 导出, 而不是当前用户已经完成 ZHS16GBK 字符集和 AL16UTF16 NCHAR 字符集中的导入. 正在将 SCOTT 的对象导入到 TEST. 正在将 SCOTT 的对象导入到 TEST即将启用约束条件...成功终止导入, 没有出现警告。


原创粉丝点击