jackyrong

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

expdp/imdp,exp/imp的使用小结。其中expdp/imdp只能在服务端用,exp/imp两者都可以使用。

1 expdp
     首先建立directory
        create directory dump as 'e:\dump';
      给权限:
        grant read,write on directory dump to scott;

    导出表:expdp system/manager directory=dump dumpfile=a.dmp tables=scott.dept,scott.emp
     普通用户只能导出自己方案的表;

 

    导出方案:expdp system/manager directory=dum dumpfile=a.dmp schemas=system,scott

   
     导出表空间:expdp system/manager directory=dump dumpfile=a.dmp tablespace=user01  
    
     导出数据库:expdp system/manager directory=dump dumpfile=full.dmp full=Y
2  impdp
     导入表:
      把表导入自己的方案:
           impdp scott/tiger directory=dump dumpfile=tab.dmp tables=dep,emp
       导入到其他方案:
           impdp system/manager directory=dump dumpfile=tab.dmp tables=scott.dept,scott.emp

remap_schema=scott:system
     导入方案:
      impdp scott/tiger directory=dump dumpfile=schema.dmp schemas=scott
      导表空间:
       impdp  system/manager directory=dump dumpfile=tablespace.dmp tablespace=user01
       导入数据库:
     impdp system/manager directory=dump dumpfile=full.dmp full=y
    3  exp
       表:
          exp system/manager@demo tables=scott.dept,scott.emp file=tab1.dmp
        方案:
      exp system/manager@demo owner=scott files=test1.dmp
        数据库
             exp system/manager@demo full=y file=full.dmp
     4 导入
         imp scott/tiger@demo file=tab2.dmp tables=dept
        导入不同的表空间
         imp system/manager@demo file=tab2.dmp tables=dept fromuser=scott touser=system
         导入数据库
    imp system/manager@demo file=full.dmp full=y

 

外加多个工具,好用的
   dbv,用来检查表段,数据文件等是否存在坏块

    dbv file=d:\demo\system01.dbf feedback=1000 blocksize=4096
    每1000个块显示一个".',表示进度,blocksize表示指定数据块的尺寸,默认2048

  

posted on 2008-07-25 12:29  jackyrong的世界  阅读(358)  评论(0编辑  收藏  举报