1.主库的scn与备库的scn做比较,得出时间差
select (to_date(to_char(scn_to_timestamp((select current_scn from v$database)), ‘YYYY-MM-DD HH24:MI:SS‘), ‘YYYY-MM-DD HH24:MI:SS‘) - to_date(to_char(scn_to_timestamp((select current_scn from v$database@link_to_slave_pdb1)), ‘YYYY-MM-DD HH24:MI:SS‘), ‘YYYY-MM-DD HH24:MI:SS‘)) * 24 * 60 "delaytime(分钟)" from dual;