对 Oracle 闪回表启用约束
我在 Toad 中运行了一个数据复制功能,该功能禁用了所有约束,然后失败了。
这给我留下了一堆残疾的限制。其中大多数我已经能够成功启用,但闪回的那些让我的存储过程适合。
问题:
1)是否有必要重新启用闪回表的约束?我的假设是,如果未启用它们并使用闪回,则在恢复表时它们将被禁用,所以是的,应该重新启用它们。
2)我得到的错误是ORA-01735:无效的更改表选项。
EXECUTE IMMEDIATE
'ALTER TABLE'||' '||l_table_name||' '||'ENABLE CONSTRAINT'||'
'||l_Constraint_name;
我的假设是表名中的 ==$0
导致了问题,我需要将其用双引号引起来。然而,我这样做的尝试
EXECUTE IMMEDIATE
'ALTER TABLE'||' ""'||l_table_name||'"" '||'ENABLE CONSTRAINT'||'
'||l_Constraint_name;
也失败了。正确的语法是什么?或者我是否错误地指出了错误的真正含义?
I ran a data copy function in Toad that disabled all constraints and then failed.
That left me with a bunch of disabled constraints. Most of them I've been able to enable successfully, but the flashback ones are giving my stored proc fits.
Questions:
1) Is it necessary to reenable the constraints on the flashback tables? My assumption is that if they're not enabled and flashback is used, they'd be disabled when the table is restored, so yes, they should be re-enabled.
2) The error I get is ORA-01735: Invalid alter table option.
EXECUTE IMMEDIATE
'ALTER TABLE'||' '||l_table_name||' '||'ENABLE CONSTRAINT'||'
'||l_Constraint_name;
My assumption is that the ==$0
in the table name is causing problems, and I need to enclose it in double quotes. However, my attempts at doing so:
EXECUTE IMMEDIATE
'ALTER TABLE'||' ""'||l_table_name||'"" '||'ENABLE CONSTRAINT'||'
'||l_Constraint_name;
also failed. What's the proper syntax? Or am I barking up the wrong tree on what the error actually is?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
怎么样:
How about: