Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复oracle的sql上线,单条回退sql超过4000长度被强制截断成多条的问题 #1488

Merged
merged 1 commit into from
May 5, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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