Skip to content

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

  • by
  • June 22, 2022June 24, 2022

ORA-01765

Saw an error ORA-01765 when tried to rename a table by SYS.

SQL> conn / as sysdba
Connected.
SQL> rename hr.employees to hr.employees_bak;
rename hr.employees to hr.employees_bak
       *
ERROR at line 1:
ORA-01765: specifying owner's name of the table is not allowed

ORA-01765 means that you cannot specify the schema owner before the table name, which is not allowable even when you login as the owner.

SQL> conn hr/hr@orcl
Connected.
SQL> rename hr.employees to hr.employees_bak;
rename hr.employees to hr.employees_bak
       *
ERROR at line 1:
ORA-01765: specifying owner's name of the table is not allowed

Solution

To solve ORA-01765, you should connect to the database as the schema owner and then RENAME the table without adding any schema name.

SQL> rename employees to employees_bak;

Table renamed.

There're only 4 types of schema object that can use RENAME TO syntax.

  • Table
  • View
  • Sequence
  • Private synonym

Leave a Reply

Your email address will not be published.