重庆思庄Oracle、KingBase、PostgreSQL、Redhat认证学习论坛

标题: 重命名表时出现ORA-14047问题 [打印本页]

作者: 刘泽宇    时间: 2025-9-10 19:46
标题: 重命名表时出现ORA-14047问题
需要对一个表改名,改的时候报错:

SQL> alter table test.TEST_HISTORY rename to test.TEST_HISTORYbak;
                                                        *
ERROR at line 1:
ORA-14047: ALTER TABLE|INDEX RENAME may not be combined with other operations

查询文档,这种需要目标表不指定SCHEMA的方式才可以,即支持如下两种语法:

SQL> alter table bys.t3 rename to t3bak;  ===>>>直接在DBA账户下不加修改后表的SCHEMA名

Table altered.

SQL> conn bys/bys
Connected.
SQL> alter table t3bak rename to t3;   ===>>>直接在相应用户下不加SCHEMA名字

Table altered.

===
查询mos,得到如下文章:ORA-14047: ALTER TABLE | INDEX RENAME May Not Be Combined With Other Operations (文档 ID 400398.1)
在该文章中,说明了报错的原因:

The combination of actions appear to be:
1.the actual table rename
2.specifiying the schema name of the target






欢迎光临 重庆思庄Oracle、KingBase、PostgreSQL、Redhat认证学习论坛 (http://bbs.cqsztech.com/) Powered by Discuz! X3.2