oracle备份与还原数据


一、表数据备份与还原

creat table  备份表   select * from  原表  where

insert  into  原表  select  *  from  备份表  

 

二、利用备份表还原原表部分字段数据

update 原表 t
set (age, idnumber) =
  (select age, idnumber from 备份表 b where b.stuid = t.stuid)
     where exists

        (select 1 from 备份表 b

           where b.stuid = t.stuid
              and b.stuname = '张三');

三、exp导出命令(cmd下运行

1、导出数据库

exp  用户名/密码@orcl   file=d:\daochu.dmp  full=y

2、 导出表空间

exp 用户名/密码@orcl  file=d:\daochu.dmp  tablespaces=(testspace)


3、
导出用户

exp 用户名/密码@orcl  file=d:\daochu.dmp  owner=(system,sys)

4、导出表

exp 用户名/密码@orcl file=d:\daochu.dmp tables=table1,table2   

 

备注:buffer=4096(指定数据缓存区的大小) log=d:\student.log(指定日志保存路径),例如:

 

四、imp导入命令(cmd下运行)

 imp  用户名/密码@orcl  file=d:/daochu.dmp    full=y  ignore=y 

备注:导入数据前需用sys用户创建普通用户,并新建表空间、赋权。

 

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM