DM8单点_闪回查询报错flashback version has been out of date

问题描述

误操作后,闪回查询到某一时间点提示:“[-9801]:flashback version has been out of date.”

SQL> SELECT * FROM PERSON_TYPE WHEN TIMESTAMP '2023-11-23 18:51:41';
SELECT * FROM PERSON_TYPE WHEN TIMESTAMP '2023-11-23 18:51:41';
[-9801]:flashback version has been out of date.
used time: 0.548(ms). Execute id is 0.

问题排查

过了UNDO_RETENTION时间

--查询UNDO_RETENTION参数
select name,type,value from v$parameter where name = 'UNDO_RETENTION';

LINEID     name           TYPE VALUE    
---------- -------------- ---- ---------
1          UNDO_RETENTION SYS  90.000000

有博主写的默认900秒,15分钟,但是官方文档写的是90秒。如果显示的是90说明没有更改参数过了UNDO_RETENTION则无法进行闪回查询。不重启也验证了可以闪回查询。

解决办法

--更改UNDO_RETENTION参数
alter system set 'UNDO_RETENTION'=3600 both;
select name,type,value from v$parameter where name = 'UNDO_RETENTION';

--重启生效(可选)
[dmdba@localhost ~]$ /dmdb8/dmdbms/bin/DmServicefuwa stop
Stopping DmServicefuwa:                                    [ OK ]
[dmdba@localhost ~]$ /dmdb8/dmdbms/bin/DmServicefuwa start
Starting DmServicefuwa: 

附:开启闪回功能

--开启闪回功能
select name,type,value from v$parameter where name='ENABLE_FLASHBACK';
或
select para_value from v$dm_ini where para_name='ENABLE_FLASHBACK';  # 0未开启 1开启

alter system set 'ENABLE_FLASHBACK'=1 both; 
或
sf_set_system_para_value('ENABLE_FLASHBACK',1,0,1);
或
或者修改参数文件dm.ini中ENABLE_FLASHBACK值为1

--重启生效
[dmdba@localhost ~]$ /dmdb8/dmdbms/bin/DmServicefuwa stop
Stopping DmServicefuwa:                                    [ OK ]
[dmdba@localhost ~]$ /dmdb8/dmdbms/bin/DmServicefuwa start
Starting DmServicefuwa: 
                                                           [ OK ]

--修改UNDO_RETENTION
SQL> select name,type,value from v$parameter where name = 'UNDO_RETENTION';

LINEID     NAME           TYPE VALUE    
---------- -------------- ---- ---------
1          UNDO_RETENTION SYS  90.000000  
SQL> alter system set 'UNDO_RETENTION'=3600 both;

SQL> select name,type,value from v$parameter where name = 'UNDO_RETENTION';

LINEID     NAME           TYPE VALUE      
---------- -------------- ---- -----------
1          UNDO_RETENTION SYS  3600.000000

注意

更改ENABLE_FLASHBACK和ENABLE_FLASHBACK参数后重启与否不影响闪回查询。

--更改参数后未重启查看参数文件dm.ini
发现ENABLE_FLASHBACK=0
    UNDO_RETENTION=90

--重启查看参数文件dm.ini
发现ENABLE_FLASHBACK=1
    UNDO_RETENTION=3600

你可能感兴趣的:(DM故障处理,DM8单点_闪回查询报错)