ORA-14155,ORA-14047

用pl/sql工具rename一个表名时报ora-14155和ora-14047错误,过程如下:

1.创建测试表

17:14:43 SQL> create table test_id (id int,addr  varchar2(50));

Table created.

2.rename表名,报错 ORA-14155: missing PARTITION or SUBPARTITION keyword,原因分析:语法错误,正确语法应是rename to

17:17:47 SQL> alter table hr.test_id rename hr.test_addr;
alter table test_id rename test_addr
                           *
ERROR at line 1:
ORA-14155: missing PARTITION or SUBPARTITION keyword

3.rename to表名,报错,ORA-14047: ALTER TABLE|INDEX RENAME may not be combined with other operations,原因分析:当你执行alter table hr.test_id 的时候,你已经告诉oracle你要修改哪个用户下的哪个表了,所以在rename to 的时候就不需要在指定用户名称了.如果在写用户名的话,oracle也许会认为你是要把hr下的test_id 表改名存储到其他用户下面去,oracle不允许这么做!

17:18:17 SQL> alter table hr.test_id rename to hr.test_addr;
alter table hr.test_id rename to hr.test_addr
                                   *
ERROR at line 1:
ORA-14047: ALTER TABLE|INDEX RENAME may not be combined with other operations

4.rename表名成功

17:19:05 SQL> alter table hr.test_id rename to test_addr;

Table altered.

 

转载于:https://www.cnblogs.com/tomatoes-/p/11084090.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值