oracle数据库备份 expdb导出错误提示ORA-01555: snapshot too old:

数据库导出提示:
在这里插入图片描述
处理方法:
ORA-01555快照过旧的问题,通常可以先去检查undo表空间的大小和undo_retention参数的设置,并进行增大调整的方法进行处理;
1.增大undo表空间大小
2.增加undo_retention的时间

1.增加undo表空间大小
先查看表空间使用情况
SELECT a.tablespace_name “UNDOTBS1”,
a.bytes / 1024 / 1024 “表空间大小(M)”,
(a.bytes - b.bytes) / 1024 / 1024 “已使用空间(M)”,
b.bytes / 1024 / 1024 “空闲空间(M)”,
round(((a.bytes - b.bytes) / a.bytes) * 100, 2) “使用比”
FROM (SELECT tablespace_name, sum(bytes) bytes
FROM dba_data_files
GROUP BY tablespace_name) a,
(SELECT tablespace_name, sum(bytes) bytes, max(bytes) largest
FROM dba_free_space
GROUP BY tablespace_name) b
WHERE a.tablespace_name = b.tablespace_name
ORDER BY ((a.bytes - b.bytes) / a.bytes) DESC;

在这里插入图片描述
查看使用了51%,可以增加undo表空间。

增加方法:
alter tablespace undotbs1 add datafile ‘/data/oradata01/undotbs02.dbf’ size 500M autoextend on next 512M maxsize 24G;

2.增加undo_retention的时间
先查询现有服务器的undo_retention时间
show parameter undo_retention;
在这里插入图片描述
900秒是15分钟,增加到2小时
alter system set undo_retention=7200 scope=both;
在这里插入图片描述
关于undo_retention官方文档有如下两点说明:
1:For an undo tablespace with the AUTOEXTEND option enabled, the database attempts to honor the minimum retention period specifiedby UNDO_RETENTION. When space is low, instead of overwriting unexpired undo information, the tablespace auto-extends. If the MAXSIZE clause is specified for an auto-extending undo tablespace, when the maximum size is reached, thedatabase may begin to overwrite unexpired undo information.
大体意思是 数据库可以在undo_retention设置的时间里保留undo数据,当空间不足时,如果undo表空间是可以自动扩展的,那是可以自动扩展空间来保留更多的undo数据,而不是覆盖未到期(未到undo_retention设置的时间)的undo数据

2:If the undo tablespace is configured with the AUTOEXTEND option, the database dynamically tunes the undo retention periodto be somewhat longer than the longest-running active query on the system. However,this retention period may be insufficient to accommodate Oracle Flashback operations. Oracle Flashback operations resulting in snapshot too old errors are the indicator that you must intervene to ensure that sufficient undo data isretained to support these operations. To better accommodate Oracle Flashback features, you can either set the undo_retention parameter to a value equal to the longest expected Oracle Flashback operation, or you can change the undo tablespace to fixed size.
大体意思是 如果undo表空间的自动扩展的,那数据库可以动态的调整undo retention的保留时间来支持长查询。Retention保留时间可能不足以支持闪回操作时,会返回快照过旧的错误,必须要保留足够的undo数据来支持闪回查询。最好的建议是设置UNDO_RETENTION参数到一个支持最长查询的时间。

  • 0
    点赞
  • 16
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值