[20190427]表改名與ora-14047錯誤.txt

lfree發表於2019-04-30

[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部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-2642960/,如需轉載,請註明出處,否則將追究法律責任。

相關文章