您的位置:首页 > 数据库 > Oracle

oracle 学习小结9

2013-07-01 16:17 344 查看
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

  
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: