當用戶端未指定資料庫內容而連線到 SQL Server 執行個體時,將會使用為其登入所定義的預設資料庫。若該資料庫因故無法使用,將會出現上列訊息。
當用戶端未指定資料庫內容而連線到 SQL Server 執行個體時,將會使用為其登入所定義的預設資料庫。若該資料庫因故無法使用,將會出現上列訊息。
注意: 如果此登入為一或多個 Linux 群組中的成員,而這些群組也已定義為 SQL Server 中的登入,則可能會使用其中一個群組的預設資料庫。沒有可靠的方法可預測登入嘗試時,將會選擇的預設資料庫。因此,請務必檢查登入帳戶的群組成員資格,然後檢查為所有群組所設定的預設資料庫,以確定這些資料庫均可用。
您需要將預設資料庫設定為可存取,或避免使用該特定資料庫。選項包含:
如需預設資料庫的詳細資訊,請參閱線上叢書中的 "sp_defaultdb" 以及 Microsoft 知識庫文章 307864。
將連接字串變更為一律會指定特定的資料庫。
確認為各登入所定義的預設資料庫仍存在且可存取。檢閱 SQL Server 錯誤記錄檔有助於判定特定資料庫無法存取的原因。
初次連線時,請使用 OSQL 等工具指定特定的資料庫。連線之後請執行 sp_defaultdb,將登入的預設資料庫,變更為目前可存取的資料庫。
使用身為 sysadmin 或 securityadmin 固定伺服器角色成員的帳戶登入,然後執行 sp_defaultdb,將登入失敗的預設資料庫變更為可存取的資料庫。如需預設資料庫的詳細資訊,請參閱線上叢書中的 "sp_defaultdb" 以及 Microsoft 知識庫文章 307864。
名稱 | 描述 | 預設值 |
已啟用 | 啟用或停用該工作流程。 | 是 |
間隔 (秒) | 每次重複執行工作流程之間的時間間隔 (秒)。 | 300 |
優先順序 | 定義警示優先順序。 | 1 |
嚴重性 | 定義警示嚴重性。 | 2 |
同步處理時間 | 同步處理時間 |
|
逾時 (秒) | 指定流程被關閉及標示為失敗之前,允許執行的時間。 | 200 |
資料庫連線的逾時 (秒) | 若工作流程無法在指定的期限之內存取資料庫,將會失敗並登錄一則事件。 | 15 |
Target | Microsoft.SQLServer.Linux.DBEngine | ||
Category | EventCollection | ||
Enabled | True | ||
Alert Generate | True | ||
Alert Severity | Error | ||
Alert Priority | Normal | ||
Remotable | True | ||
Alert Message |
| ||
Comment | Mom2017ID='{4FFA6A6A-3E49-468E-8C4A-DF5029908802}';MOM2017GroupID={467ECC75-C5DA-42BD-955C-A73BBB51AF74} |
ID | Module Type | TypeId | RunAs |
---|---|---|---|
_F6DA1507_12AF_11D3_AB21_00A0C98620CE_ | DataSource | Microsoft.SQLServer.Linux.DataSource.EventCollectionFiltered | Default |
GenerateAlert | WriteAction | System.Health.GenerateAlert | Default |
<Rule ID="Microsoft.SQLServer.Linux.EventRule.DBEngine.Cannot_open_user_default_database._Login_failed_1_5_Rule" Target="SqlDiscL!Microsoft.SQLServer.Linux.DBEngine" Enabled="true" ConfirmDelivery="true" Remotable="true" Comment="Mom2017ID='{4FFA6A6A-3E49-468E-8C4A-DF5029908802}';MOM2017GroupID={467ECC75-C5DA-42BD-955C-A73BBB51AF74}">
<Category>EventCollection</Category>
<DataSources>
<DataSource ID="_F6DA1507_12AF_11D3_AB21_00A0C98620CE_" Comment="{F6DA1507-12AF-11D3-AB21-00A0C98620CE}" TypeID="Microsoft.SQLServer.Linux.DataSource.EventCollectionFiltered">
<MachineName>$Target/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/MachineName$</MachineName>
<NetbiosComputerName>$Target/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/NetbiosComputerName$</NetbiosComputerName>
<InstanceName>$Target/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/InstanceName$</InstanceName>
<ConnectionString>$Target/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/ConnectionString$</ConnectionString>
<InstanceVersion>$Target/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/Version$</InstanceVersion>
<InstanceEdition>$Target/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/Edition$</InstanceEdition>
<SqlTimeoutSeconds>15</SqlTimeoutSeconds>
<TimeoutSeconds>200</TimeoutSeconds>
<IntervalSeconds>300</IntervalSeconds>
<SyncTime/>
<EventDisplayNumber>4064</EventDisplayNumber>
</DataSource>
</DataSources>
<WriteActions>
<WriteAction ID="GenerateAlert" TypeID="Health!System.Health.GenerateAlert">
<Priority>1</Priority>
<Severity>2</Severity>
<AlertMessageId>$MPElement[Name="Microsoft.SQLServer.Linux.EventRule.DBEngine.Cannot_open_user_default_database._Login_failed_1_5_Rule.AlertMessage"]$</AlertMessageId>
<AlertParameters>
<AlertParameter1>Event ID: $Data/Property[@Name='EventID']$. $Data/Property[@Name='Message']$</AlertParameter1>
</AlertParameters>
<Suppression>
<SuppressionValue/>
</Suppression>
</WriteAction>
</WriteActions>
</Rule>