Error with Oracle Database - Tablespace does not exist

Platform Notice: Data Center Only - This article only applies to Atlassian apps on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. 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.

*Except Fisheye and Crucible

Problem

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

Diagnosis

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.

Cause

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

Resolution

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>');

Warning: Backup your database before proceeding.

Before running any SQL in this article, create a full backup of your Jira database. This is a database-level operation with no undo other than restoring from backup. Only proceed if you're comfortable running SQL directly against the Jira database, and test on a staging or cloned environment first, wherever possible.

Updated on September 25, 2025

Still need help?

The Atlassian Community is here for you.