Oracle数据移动-导入和导出

命令详情:
1、导出: exp -help
2、导入:imp -help

级别:表,用户下的表,空间下的表,全库。不能导出数据字典。

============================实例===============================

1、以Scott用户为例,登录scott。

2、复制两个表
SQL> create table emp_dump as select * from emp;

表已创建。

SQL> create table dept_dump as select * from dept;

表已创建。

3、创建导出的目录:C:\orcl1122\export

---------------------------------------导出-------------------------------------------------------
--------------------------------------------------------------------------------------------------
4、导出两个表(emp,dept)在cmd窗口执行:

  exp scott/scott file=C:\orcl1122\export\scott3exp.dmp  tables=(emp_dump,dept_dump);

eg:

SQL> host  exp scott/scott file=C:\orcl1122\export\scott3exp.dmp
     tables=(emp_dump,dept_dump);
......
成功终止导出, 没有出现警告。
   
5、删除两个表emp_dump,dept_dump:

   SQL> drop table emp_dump;

表已删除。

SQL> drop table dept_dump;

表已删除。

------------------------------------------导入----------------------------------------------------------
----------------------------------------------------------------------------------------------------

6、导入之前导出的数据


SQL> host imp scott/scott file=C:\orcl1122\export\scott3exp.dmp;

Import: Release 11.2.0.1.0 - Production on 星期三 9月 27 16:23:14 2017

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.


连接到: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

经由常规路径由 EXPORT:V11.02.00 创建的导出文件
已经完成 ZHS16GBK 字符集和 AL16UTF16 NCHAR 字符集中的导入
. 正在将 SCOTT 的对象导入到 SCOTT
. 正在将 SCOTT 的对象导入到 SCOTT
. . 正在导入表                      "EMP_DUMP"导入了          14 行
. . 正在导入表                     "DEPT_DUMP"导入了           4 行
成功终止导入, 没有出现警告。

7ok

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值