From dcba64a2811589bb4f9ccc573b83a5cbfe86daf5 Mon Sep 17 00:00:00 2001 From: thcoffee <48222283@qq.com> Date: Thu, 5 May 2022 11:50:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Doracle=E7=9A=84sql=E4=B8=8A?= =?UTF-8?q?=E7=BA=BF=EF=BC=8C=E5=8D=95=E6=9D=A1=E5=9B=9E=E9=80=80sql?= =?UTF-8?q?=E8=B6=85=E8=BF=874000=E9=95=BF=E5=BA=A6=E8=A2=AB=E5=BC=BA?= =?UTF-8?q?=E5=88=B6=E6=88=AA=E6=96=AD=E6=88=90=E5=A4=9A=E6=9D=A1=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=20(#1488)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sql/engines/oracle.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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;'''