BAM部署視圖失敗 - OLE DB or ODBC error: Cannot open database "BAMStarSchema". login failed 42000.

錯誤描述


今天在部署BAM視圖時遇到如下錯誤,找了很久終於找到原因,原來是數據庫用戶角色設置的問題,BAMStarSchema數據庫的用戶沒有”db_datareader”角色導致無法讀取該數據庫當中的數據。

英文錯誤描述信息

Deploying Activity... Done.
Deploying View... ERROR: The BAM deployment failed.
Internal error: The operation terminated unsuccessfully.
OLE DB error: OLE DB or ODBC error: Cannot open database "BAMStarSchema" request
ed by the login. The login failed.; 42000.
Errors in the high-level relational engine. A connection could not be made to th
e data source with the DataSourceID of 'bam_ExcByApplication', Name of 'bam_ExcB
yApplication'.
Errors in the OLAP storage engine: An error occurred while the dimension, with t
he ID of 'ExcByApplication_ExcDatetime', Name of 'ExcByApplication_ExcDatetime'
was being processed.
Errors in the OLAP storage engine: An error occurred while the 'Month' attribute
of the 'ExcByApplication_ExcDatetime' dimension from the 'BAMAnalysis' database
was being processed.
Server: The operation has been cancelled.
OLE DB error: OLE DB or ODBC error: Cannot open database "BAMStarSchema" request
ed by the login. The login failed.; 42000.
Errors in the high-level relational engine. A connection could not be made to th
e data source with the DataSourceID of 'bam_ExcByApplication', Name of 'bam_ExcB
yApplication'.
Errors in the OLAP storage engine: An error occurred while the dimension, with t
he ID of 'ExcByApplication_Application', Name of 'ExcByApplication_Application'
was being processed.
Errors in the OLAP storage engine: An error occurred while the 'Application' att
ribute of the 'ExcByApplication_Application' dimension from the 'BAMAnalysis' da
tabase was being processed.
OLE DB error: OLE DB or ODBC error: Cannot open database "BAMStarSchema" request
ed by the login. The login failed.; 42000.
Errors in the high-level relational engine. A connection could not be made to th
e data source with the DataSourceID of 'bam_ExcByApplication', Name of 'bam_ExcB
yApplication'.
Errors in the OLAP storage engine: An error occurred while the dimension, with t
he ID of 'ExcByApplication_ExcFaultDescription', Name of 'ExcByApplication_ExcFa
ultDescription' was being processed.
Errors in the OLAP storage engine: An error occurred while the 'FaultDescription
' attribute of the 'ExcByApplication_ExcFaultDescription' dimension from the 'BA
MAnalysis' database was being processed.
OLE DB error: OLE DB or ODBC error: Cannot open database "BAMStarSchema" request
ed by the login. The login failed.; 42000.
Errors in the high-level relational engine. A connection could not be made to th
e data source with the DataSourceID of 'bam_ExcByApplication', Name of 'bam_ExcB
yApplication'.
Errors in the OLAP storage engine: An error occurred while the dimension, with t
he ID of 'ExcByApplication_ExcDatetime', Name of 'ExcByApplication_ExcDatetime'
was being processed.
Errors in the OLAP storage engine: An error occurred while the 'Year' attribute
of the 'ExcByApplication_ExcDatetime' dimension from the 'BAMAnalysis' database
was being processed.
OLE DB error: OLE DB or ODBC error: Cannot open database "BAMStarSchema" request
ed by the login. The login failed.; 42000.
Errors in the high-level relational engine. A connection could not be made to th
e data source with the DataSourceID of 'bam_ExcByApplication', Name of 'bam_ExcB
yApplication'.
Errors in the OLAP storage engine: An error occurred while the dimension, with t
he ID of 'ExcByApplication_ExcDatetime', Name of 'ExcByApplication_ExcDatetime'
was being processed.
Errors in the OLAP storage engine: An error occurred while the 'Day' attribute o
f the 'ExcByApplication_ExcDatetime' dimension from the 'BAMAnalysis' database w
as being processed.

解決方法


我們可以使用T-SQL語句來修復該數據庫中的用戶角色設置,爲該用戶添加對其數據庫的“db_datareader”角色。在我的機器上,數據庫是運行在DemoDomain/SQL_Service這個賬戶下的,使用如下腳本啓用該用戶的'db_datareader'角色,另外你也可以通過SQL Management Studio用鼠標點擊配置的方式做同樣的操作。

USE BAMStarSchema 
EXEC sp_addrolemember 'db_datareader', 'DEMODOMAIN/SQL_SERVICE'

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章