Received 'ORA-00955: Name is already used by an existing object' after migrating Oracle schema/username

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Fisheye および Crucible は除く

    

要約

Confluence environment is migrated to a different Oracle database schema/username. However, when Confluence starts multiple 'ORA-00955: Name is already used by an existing object' are observed, impacting functionality. 

診断

An ORA-00955 is triggered when an attempt was made to create a database object (such as a table, view, cluster, index, or synonym) that already exists. 
The initial troubleshooting in this situation should cover the following checkpoints: 

  • Make sure you connect to Confluence with a username that matches the schema to which the new database tables are being created into.
  • Check that the "ALL_OBJECTS" view exists for the Oracle user schema
  • Validate the database permissions for the user under Step 2 in Database Setup for Oracle. Not having the proper privileges can cause Confluence to erroneously see a table from another schema, if the other schema shares the same table name.

All these points seem correct when reviewed by your Oracle DBA. 

原因

In older versions of Confluence (till Confluence 6.3) the official documentation Database Setup for Oracle explicitly requested to add a local ALL_OBJECTS view to the user's schema, to prevent a conflict that can occur when a table exists in another schema with the same name as one of the Confluence tables. This was a workaround for bug:  CONFSERVER-3613 - Getting issue details... STATUS

Recent versions of the same documentation (starting in Confluence 6.4 and later) had no mention about this local ALL_OBJECTS view.  Hence, if you had an old confluence environment which was installed on a version previous to Confluence 6.3, and later upgraded to a most recent version, you might have still the local  ALL_OBJECTS view in your Oracle database. 

To check this, you can use the following SQL statements: 

SQL> select count(1) from ALL_OBJECTS where owner='<OLD_ORACLE_CONFLUENCE_USERNAME>';
COUNT(1)
----------- 
          1086                
SQL> select count(1) from ALL_OBJECTS where owner='<NEW_ORACLE_CONFLUENCE_USERNAME>';
COUNT(1)
----------- 
               0     

ソリューション

When you do a export/import of an Oracle schema and you want to change the username as part of the migration, this local ALL_OBJECTS view needs to be recreated with the new username.

If not, it will report there is no access granted to the right tables.

  1. Confluence を停止します。
  2. Drop the existing local ALL_OBJECTS view:

    drop view <OLD_ORACLE_CONFLUENCE_USERNAME>.all_objects ;              
  3. Create a new ALL_OBJECTS view that is owned by the new username: 

    create view <NEW_ORACLE_CONFLUENCE_USERNAME>.all_objects as
    select *
    from sys.all_objects
    where owner = upper('<NEW_ORACLE_CONFLUENCE_USERNAME>');
  4. Confluence を起動します。


There might be other alternatives in Oracle to grant access to the ALL_OBJECTS view for the NEW_ORACLE_CONFLUENCE_USERNAME. Please, check with your Oracle DB Administrator the best way to address this situation once identified. 

最終更新日 2023 年 6 月 28 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.