备份schema并排除大表到ASM磁盘上

1.查出占用空间比较大的表

select owner,segment_name,segment_type,bytes/1024/1024 mb from dab_segment where owner='RM' order by mb desc

2.查出ASM的路径

select * from dba_data_files;

3.到ASM路径下手工创建目录

su - grid  asmcmd   ASM>cd +DATA     ASM>mkdir expdp1

4.到本地目录下创建logfile.(用root用户)

cd /home/oracle     mkdir expdp1.log

5.创建directory,并赋权给导出用户

>create directory expdp1 as '+DATA/expdp1';

>grant read,write on directory expdp1 to rm;

6.设置log文件存放位置,并赋权限

>create or replace directory logdir as '/oracle/home';

>grant read,write on directory logdir to rm;

7.执行导出备份

expdp rm/rmlb2017 directory=expdp1 dumpfile=expdp1.log logfile=LOGDIR:expdp1.log schemas=rm exclude=table:"IN('RECG_SUSP_RESULT_PHOTO')",table :"IN('VMC_ALARM_PIC')";

 

posted @ 2017-09-06 13:19  高伟-林州  阅读(204)  评论(0编辑  收藏  举报