Oracle schema created with name "ACTIVATION_MS" then it is renamed to ACTIVATION_MS_DEV but schema name for identity column didn't change

huangapple go评论60阅读模式
英文:

Oracle schema created with name "ACTIVATION_MS" then it is renamed to ACTIVATION_MS_DEV but schema name for identity column didn't change

问题

I am working on Spring Boot application, as a db I use Oracle. Schema created with name "ACTIVATION_MS" then it is renamed to ACTIVATION_MS_DEV but schema name for identity column didn't change.

Example: ID NUMBER(38) default "ACTIVATION_MS"."ISEQ$$_108264".nextval generated as identity

And when I want to insert row into table, it says "sequence not found" since schema name didn't change.

How can I alter schema name, remove it before sequence name without recreating table?

英文:

I am working on Spring Boot application, as a db I use Oracle. Schema created with name "ACTIVATION_MS" then it is renamed to ACTIVATION_MS_DEV but schema name for identity column didn't change.

Example: ID NUMBER(38) default "ACTIVATION_MS"."ISEQ$$_108264".nextval generated as identity

And when I want to insert row into table, it says "sequence not found" since schema name didn't change.

How can I alter schema name, remove it before sequence name without recreating table?

答案1

得分: 1

你无法在不重新创建表的情况下更改模式名称或删除它前面的序列名称。正如您已经发现的那样,重命名模式只会影响顶级对象所有权。它不会调整对象内嵌在代码中的任何内容,因此包括拥有模式名称的标识列、触发器、视图、存储过程或任何其他具有嵌入式PL/SQL的对象都必须被替换。您需要使用新的标识列重新创建表,或者在表内部删除并重新创建标识列。

英文:

> How can I alter schema name, remove it before sequence name without recreating table?

You can't. As you've discovered, renaming a schema only affects top-level object ownership. It does not adjust anything embedded in code within an object, so identity columns, triggers, views, stored procedures or any other object with embedded PL/SQL that includes the owning schema name must be replaced. You would need to recreate the table with a new identity column, or drop and recreate the identity column within the table.

huangapple
  • 本文由 发表于 2023年5月25日 18:32:23
  • 转载请务必保留本文链接:https://go.coder-hub.com/76331324.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定