Thursday, May 08, 2014

ORA-12988

Tables in the SYS schema are usually created by Oracle but you can create them yourself. If they are created by Oracle you should not be trying to change them. If they are created by you, you should seriously consider moving them into another schema. Either way, if you try to drop a column from a table owned by SYS, you get an ORA-12988. You can see what I mean in the example below, which I ran in an Oracle 11.2 database:

SQL> conn / as sysdba
Connected.
SQL> show user
USER is "SYS"
SQL> create table tab1
  2  (col1 number,
  3   col2 number)
  4  /
 
Table created.
 
SQL> alter table tab1 drop column col1
  2  /
alter table tab1 drop column col1
*
ERROR at line 1:
ORA-12988: cannot drop column from table owned by SYS
 
SQL>


No comments: