将非唯一索引更改为唯一索引
问题描述:
我有一些非唯一约束,我想改变为唯一约束(业务规则自数据模型以来已更改)。有没有办法做掉它和作为一个独特的约束重新创建?我认为在 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.