ITPub博客

首页 > 数据库 > Oracle > [20190427]表改名与ora-14047错误.txt

[20190427]表改名与ora-14047错误.txt

原创 Oracle 作者:lfree 时间:2019-04-30 09:13:00 1 删除 编辑

[20190427]表改名与ora-14047错误.txt


--//改表名失败,做一个记录:


1.环境:

SCOTT@book> @ ver1

PORT_STRING                    VERSION        BANNER

------------------------------ -------------- --------------------------------------------------------------------------------

x86_64/Linux 2.4.xx            11.2.0.4.0     Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production


create table t as select rownum id from dual ;

create unique index pk_t on t(id);


SCOTT@book> alter table scott.t rename to scott.ttx;

alter table scott.t rename to scott.ttx

                                   *

ERROR at line 1:

ORA-14047: ALTER TABLE|INDEX RENAME may not be combined with other operations


--//这个报错很奇怪,什么是其它操作...注意*号出现位置.

--//想一下,表改名oracle目前不会支持修改schema模式的.修改如下ok:


SCOTT@book> alter table scott.t rename to ttx;

Table altered.


--或者

SCOTT@book> alter table ttx rename to tty;

Table altered.


--//实际上遇到这类问题,使用toad + sql_track操作跟踪看看就知道了,不过好像toad执行如下:

SCOTT@book> rename  tty to ttz;

Table renamed.


SCOTT@book> rename   ttz to scott.tta;

rename   ttz to scott.tta

                     *

ERROR at line 1:

ORA-01765: specifying owner's name of the table is not allowed


$ oerr ora 01765

01765, 00000, "specifying owner's name of the table is not allowed"

// *Cause: An attempt was made to rename the object with dotted object name.

// *Action: Do not specify username.tablename  in query for table name.


--//这个提示就很清晰!!实际上手边有一份oracle sql参考手册函数很有必要的.





来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/267265/viewspace-2642960/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
熟悉oracle相关技术,擅长sql优化,rman备份与恢复,熟悉linux shell编程。

注册时间:2008-01-03

  • 博文量
    4019
  • 访问量
    7999170