After migrating the Bitbucket Server database from one Oracle server to another, the application leads to an error during start up: missing table [bb_alert]
プラットフォームについて: Data Center のみ。 - This article only applies to Atlassian apps on the Data Center プラットフォーム。
この KB は Data Center バージョンの製品用に作成されています。Data Center 固有ではない機能の Data Center KB は、製品のサーバー バージョンでも動作する可能性はありますが、テストは行われていません。 Server* 製品のサポートは 2024 年 2 月 15 日に終了しました。Server 製品を実行している場合は、 アトラシアン Server サポート終了 のお知らせにアクセスして、移行オプションを確認してください。
*Fisheye および Crucible は除く
問題
After migrating a Bitbucket database from one Oracle server to another the application doesn't start up with following error in atlassian-bitbucket.log:
ERROR [spring-startup] c.a.j.s.w.s.JohnsonDispatcherServlet SpringMVC dispatcher [springMvc] could not be started
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'crowdAliasDao': Unsatisfied dependency expressed through method 'setSessionFactory' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [stash-context.xml]: Cannot resolve reference to bean 'sessionFactoryPrototype' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactoryPrototype' defined in class path resource [stash-context.xml]: Invocation of init method failed; nested exception is org.hibernate.tool.schema.spi.SchemaManagementException: Schema-validation: missing table [bb_alert]原因
According to the article Connecting Bitbucket Server to Oracle, whenever a DB is created in Oracle, a local all_objects view to the user's schema must be created in the ownership of the DB user.
If the new schema is set up with a different user as the owner rather than the one in the original, then the all_objects view (which is also copied along with the tables) would not allow the application to read the tables due to insufficient privileges.
ソリューション
Reassign ownership of the all-objects view to the new user in the migrated schema and restart the application.
この内容はお役に立ちましたか?