将非唯一索引更改为唯一索引 [英] Alter a nonunique index to a unique index

查看:134
本文介绍了将非唯一索引更改为唯一索引的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些非唯一约束,我想改变为唯一约束(业务规则自数据模型以来已更改)。有没有办法做掉它和作为一个独特的约束重新创建?我认为在 alter约束命令中会有一个选项,但我还没有找到任何东西。

I have a few non-unique constraints that I want to alter into unique constraints ( business rules have changed since the data model was made ). Is there any way to do it with out dropping and recreating as a unique constraint? I was thinking there would be an option in the alter constraint command, but I have not found anything.

谢谢!

推荐答案

您不能以希望只能删除和重新创建的方式修改约束。如果您希望这样做而无停机时间,请查看 DBMS_REDEFINITION 包。

You can't modify a constraint in the way you wish you can only drop and recreate it. If you want to do this with no downtime then look into the DBMS_REDEFINITION package.

这篇关于将非唯一索引更改为唯一索引的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆