数据库(表)的逻辑备份与恢复

本文介绍了如何使用 Oracle 的 exp 和 imp 工具进行数据的导出与导入操作,包括导出和导入表、表结构及整个数据库的方法,并详细解释了不同参数的作用。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

特别说明:导入、导出数据要在oracle目录的bin目录下,去导;即在doc下

 

导出表
(1)导出自己的表
  exp userid = scott/tiger@myoral tables =(emp,map) file=d:el.dmp  导出emp和map表


(2)导出表结构
exp userid = scott/tiger@myoral tables =(emp,map) file=d:el.dmp rows=n与导出表只是多

了一个rows=n.

 

(3)导出数据库

 

exp   userid  = system/manager@myora1   full  =  y   inctype  =  complete  file = d: aa.bmp;

 

 

========================

导入表

(1)导入自己的表

       imp  userid = scott/tiger@myor tables = (emp) file=d:/xx.dmp;

 

(2) 导入表到其他用户

     要求该用户具有dba的权限,或是imp_full_database

     imp  userid = system/manager@myor  tables=(emp) file=d:/xx.dmp touser=scott

 

(3) 导入表的结构

    只导入表的结构而不导入数据

    imp userid = soctt/tiger@myor tables=(emp) file=d:/xxx.dmp  rows=n;

 

(4) 导入数据

   如果对象(比如表)已经存在可以只导入表的数据

  imp userid = scott/tiger@myor tables=(emp) file=d:/xxx.dmp ignore=y

 

=============================

 

导入方案

 导入方案是指使用import工具将文件中的对象和数据导入到一个或是多个方案中。如果要导入其它方案,要求该用户具有dba的权限,或是imp_full_database

 

(1) 导入自身的方案

  imp userid = scott/tiger file=d:/xxx.dmp

(2) 导入其它方案

  imp userid = system/manager file=d:/xxx.dmp fromuser  = system touser = scott;

 

 

=====================

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值