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

[ 功能建议 ]支持备份OracleDDL对象的原定义 #1323

Closed
unknowissue opened this issue Jan 11, 2022 · 3 comments
Closed

[ 功能建议 ]支持备份OracleDDL对象的原定义 #1323

unknowissue opened this issue Jan 11, 2022 · 3 comments

Comments

@unknowissue
Copy link
Contributor

目前遇到的问题/使用障碍

Oracle的logmnr的undo_sql字段不支持DDL语句,不支持回滚
我这边在DDL执行之前用dbms_metadata.get_ddl生成了对象的定义,并保存到了sql_rollback.undo_sql中,本地用还没啥问题。
这样在回滚时可以有个参考,如果时存储过程这样对象,还可以比较方便的进行回滚

这个功能用的同学多么?有必要提个pr么?

@nick2wang
Copy link
Collaborator

DDL不建议做类回滚操作,因为做不到真正的回滚,比如删除了某个字段,回滚只能做到重新添加字段,但是该字段的数据还是丢失了,只做纯表结构的恢复那根据之前的ddl语句只需要改写一句就可以了,不像DML一句update影响的数据可能需要上千万行去回滚

@unknowissue
Copy link
Contributor Author

DDL不建议做类回滚操作,因为做不到真正的回滚,比如删除了某个字段,回滚只能做到重新添加字段,但是该字段的数据还是丢失了,只做纯表结构的恢复那根据之前的ddl语句只需要改写一句就可以了,不像DML一句update影响的数据可能需要上千万行去回滚

确实,我也是保存上一个版本的定义,比如alter table时,回滚时看下原始的定义,能知道之前时什么类型。
而回滚具体还是得DBA来搞。
存储过程这样的变更,保存定义后,可能比较好用一些。

@unknowissue
Copy link
Contributor Author

#1332

@hhyo hhyo closed this as completed Jan 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants