在oracle中更改或删除重新创建表是否会影响其上定义的策略
如果我有一个表并在其上定义了策略,那么如果我删除并重新创建表或更改它,我是否需要重新定义策略,前提是表的更改或重新创建不会更改函数需要查看的元素?
If i have a table and a defined policy on it then do I need to redefine the policy if I drop and recreate the table or alter it, provided that the alteration or the recreation of the table does not alter elements that the function needs to see?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的。让我们创建一个策略。
这样就可以了。但是如果我们删除并重新创建表(使用我之前准备的备份)...
不。提供更改不会使生成的谓词无效,更改表不会删除策略:
请注意,更改修改了由谓词测试的列,并且策略仍然有效。
让我们尝试一下:
好的,这是一个错误,因为视图的新投影不包括谓词中的列。但它表明策略仍然存在。所以让我们修复该错误:
Yes. Let's create a policy.
so that works. But if we drop and re-create the table (using a backup I prepared earlier) ...
No. Providing the change doesn't invalidate the generated predicate altering a table doesn't drop the policy:
Note that the change modified the column which is tested by the predicate and the policy still remains in force.
Let's try it:
Okay, so that's an error because the view's new projection doesn't include the column in the predicate. But it suggests teh ploicy is still in place. So let's fix that error: