温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

Oracle数据导入导出基本操作示例

发布时间:2020-07-17 23:03:09 来源:网络 阅读:261 作者:春天的金缕 栏目:关系型数据库

Oracle数据导入导出基本操作示例


  1. 数据导出

    a.将数据库orcl完全导出,用户名user 密码password 导出到D:\dc.dmp中    

     exp user/password@orcl   file=d:\dc.dmp    full=y

     full=y   表示全库导出


    b.将数据库中user1和user2用户导出

     exp user/password@orcl  file=d:\dc.dmp    owner=(user1,user2)

     full方式可以备份所有用户的数据库对象,包括表空间、用户信息等,owner=XX只能备份指定用户的对象.


    c.将用户user中表user_operator,user_id导出

     exp user/password@orcl   file=d:\dc.dmp  tables=(user_operator,user_id)

     tables=xx 表示备份相关表


  d.按条件导出数据

   exp user/password@orcl   file=d:\dc.dmp tables=(user_id) query=’where dept_id=1’

  e.只导出表,不导出数据

   exp user/password@orcl   file=d:\dc.dmp  tables=(user_id) rows=N 


2.数据导入

  a.将D:\dc.dmp中导入到数据库中

   imp user/password@orcl   file=d:\dc.dmp ignore=y

   ignore=y 表示忽略错误  因为有的表已经存在,然后它就报错,对该表就不进行导入。


  b.将d:\daochu.dmp中的表user_id导入

   imp user/password@orcl   file=d:\dc.dmp  tables=(user_id)

 

  

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI