expdp错误,ORA-01555: 快照过旧

/*
2020-11-03 09:44:56
错误信息:
expdp备份时提示如下错误
ORA-31693: 表数据对象 "TEST"."TEST_DOC" 无法加载/卸载并且被跳过, 错误如下:
ORA-02354: 导出/导入数据时出错
ORA-01555: 快照过旧: 回退段号 12 (名称为 "_SYSSMU12_4103953449$") 过小
*/

-- 解决办法:
-- 1、查看undo表空间利用率
-- 检查是否利用率过高,可以适当添加表空间数据文件
select a.*
    , cast(a.used_gb*100.0 / a.max_gb as number(18,1)) as used_percent
from (
select tablespace_name
    , cast(sum(bytes)/1024/1024/1024 as number(18,1)) as used_gb 
    , cast(sum(maxbytes)/1024/1024/1024 as number(18,1)) as max_gb 
from dba_data_files 
where tablespace_name like '%UNDO%' 
group by tablespace_name
) a;

-- 2、查看系统参数,适当调大 retention
show parameter undo_retention;
alter system set undo_retention = 7200;

-- 3、如果表中含有lob字段,修改 undo_retention 后,需要单独修改表字段的 retention
select * from dba_lobs
WHERE OWNER = USER
AND TABLE_NAME LIKE '%DOC'
ORDER BY TABLE_NAME;

ALTER TABLE EHR_HEALTHRECORD_DOC MODIFY LOB(DOCCONTENT)(retention);

-- 4、批量调整表的保留时间
select 'ALTER TABLE '|| table_name ||' MODIFY LOB('|| column_name ||')(retention);'
from dba_lobs
WHERE OWNER = USER
AND TABLE_NAME LIKE '%DOC'
ORDER BY TABLE_NAME
;

你可能感兴趣的:(oracle,expdp,ora-01555)