Error with Oracle Database - Tablespace does not exist

お困りですか?

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

コミュニティに質問

プラットフォームについて: 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 は除く

問題

When starting or restarting Bitbucket Server a database error is thrown in the application log. The following appears in the atlassian-bitbucket.log:

2016-12-02 11:33:29,369 ERROR [active-objects-init-compatibility-tenant-0]  net.java.ao.sql Exception executing SQL update <CREATE INDEX "index_ao_bd73c3_pro578890136" ON "AO_BD73C3_PROJECT_AUDIT"("PROJECT_ID")>
java.sql.SQLSyntaxErrorException: ORA-00959: tablespace '<Tablespace_Name>' does not exist

診断

The Tablespace_Name referred to in the error message is the same as the user Bitbucket Server uses to connect to the database. When a default tablespace is not defined for a user, Oracle uses the connection username as the name of the default tablespace.

原因

The default tablespace originally defined for the user used by Bitbucket Server to connect to the database was disassociated from the user. 

ソリューション

Determine which database object is associated with the Bitbucket Server database user:

select count(1) from all_objects where owner='<bitbucket_user>' and object_type='VIEW' and object_name='ALL_OBJECTS';


If the result set returns a value more than 1, redefine the default tablespace for the Bitbucket Server user used to connect to the database (as defined in BITBUCKET_HOME/bitbucket.properties):

 ALTER USER <bitbucket_user> DEFAULT TABLESPACE <correct tablespace name here>;

 

If the result set is empty, the view needs to be created:

CREATE VIEW bitbucket.all_objects AS

  SELECT *

  FROM sys.all_objects

  WHERE owner = upper('<bitbucket_user>');

 


データベースの変更を行う場合は必ず事前にバックアップを取得してください。可能な場合は、まずステージング サーバーで SQL コマンドの変更、挿入、更新、または削除を行うようにします。

最終更新日: 2017 年 1 月 19 日

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

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