Skip to content

Commit

Permalink
修复oracle的sql上线,单条回退sql超过4000长度被强制截断成多条的问题 (#1488)
Browse files Browse the repository at this point in the history
  • Loading branch information
thcoffee authored May 5, 2022
1 parent 21a2ba2 commit dcba64a
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions sql/engines/oracle.py
Original file line number Diff line number Diff line change
Expand Up @@ -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;'''
Expand Down

0 comments on commit dcba64a

Please sign in to comment.