diff --git a/sql/engines/oracle.py b/sql/engines/oracle.py index 537ffbdd94..6b20f5fec7 100644 --- a/sql/engines/oracle.py +++ b/sql/engines/oracle.py @@ -981,10 +981,14 @@ def backup(self, workflow, cursor, begin_time, end_time): endtime=>to_date('{end_time}','yyyy/mm/dd hh24:mi:ss'), options=>dbms_logmnr.dict_from_online_catalog + dbms_logmnr.continuous_mine); end;''' - undo_sql = f'''select sql_redo,sql_undo from v$logmnr_contents - where SEG_OWNER not in ('SYS','SYSTEM') - and session# = (select sid from v$mystat where rownum = 1) - and serial# = (select serial# from v$session s where s.sid = (select sid from v$mystat where rownum = 1 )) order by scn desc''' + undo_sql = f'''select + xmlagg(xmlparse(content sql_redo) order by scn,rs_id,ssn,rownum).getclobval() , + xmlagg(xmlparse(content sql_undo) order by scn,rs_id,ssn,rownum).getclobval() + from v$logmnr_contents + where SEG_OWNER not in ('SYS') + and session# = (select sid from v$mystat where rownum = 1) + and serial# = (select serial# from v$session s where s.sid = (select sid from v$mystat where rownum = 1 )) + group by scn,rs_id,ssn order by scn desc''' logmnr_end_sql = f'''begin dbms_logmnr.end_logmnr; end;'''