Get the App
SLTechnology News&Howtos  ›  Database  › 

How to solve the ORA-14047 error when changing the table name in the database

Shulou Source: shulou.com Published: 2022-05-31 15:24:49 10月03日 Update

This article mainly explains "how to solve the ORA-14047 error when changing the table name in the database", interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Next, let the editor take you to learn how to solve the ORA-14047 error when changing the table name in the database.

Use test users to create test tables rename_tableSQL > show user;USER is "TEST" SQL > create table rename_table (id int); Table created.SQL > select table_name from user_tables TABLE_NAME----RENAME_TABLE uses SYS users to modify the table name of test users

SQL > show user;USER is "SYS" SQL > alter table test.RENAME_TABLE rename to test.RENAME_TABLE2;alter table test.RENAME_TABLE rename to test.RENAME_TABLE2 * ERROR at line 1:ORA-14047: ALTER TABLE | INDEX RENAME may not be combined with other operations

Cause of the problem

Oracle allows A users to modify the B user table name, but the user name cannot be specified before the new table name. The following method was used to modify the table name successfully.

SQL > alter table test.RENAME_TABLE rename to RENAME_TABLE2;Table altereSQL > select OWNER,TABLE_NAME from dba_tables where owner='TEST';OWNER TABLE_NAME--TEST RENAME_TABLE2

+ + split line + +

There is also a command rename to to change the table name, but this command can only change the table name of the following table for its own user.

Use the Sys user to modify the table name of the test user table

SQL > show user;USER is "SYS" SQL > select OWNER,TABLE_NAME from dba_tables where owner='TEST';OWNER TABLE_NAME--TEST RENAME_TABLE2SQL > rename test.RENAME_TABLE2 to RENAME_TABLE Rename test.RENAME_TABLE2 to RENAME_TABLE * ERROR at line 1:ORA-01765: specifying owner's name of the table is not allowed

Switch to test user, the table name was modified successfully

SQL > show user; USER is "TEST" SQL > select OWNER,TABLE_NAME from dba_tables where owner='TEST';OWNER TABLE_NAME--TEST RENAME_TABLE2SQL > rename RENAME_TABLE2 to RENAME_TABLE Table renamed.SQL > select OWNER,TABLE_NAME from dba_tables where owner='TEST' OWNER TABLE_NAME--TEST RENAME_TABLE so far, I believe you have a deeper understanding of "how to solve the ORA-14047 error when changing the table name in the database". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Tags: User data database error success content command method user table learning practical deeper interest dividing line reason practicality practicality simple operation is in more Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux MySQL Redmi Docker NVidia