When a client connects to a SQL Server instance without specifying a database context, the default database defined for its login is used. If that database is unavailable for any reason, the above message appears.
When a client connects to a SQL Server instance without specifying a database context, the default database defined for its login is used. If that database is unavailable for any reason, the above message appears.
Note: If the login is a member of one or more Linux groups that are also defined as logins within SQL Server, the default database for one of those groups may be used. There is not a reliable way to predict which of the default databases will be chosen during a login attempt. Therefore it is important to check group membership for the login account and then check the default database set for all groups to see that they are all available.
You need to either make the default database accessible or avoid using that particular database. Your options include:
For more information about default databases, see "sp_defaultdb" in Books Online and the Microsoft Knowledge Base article 307864.
Change your connection string to always specify a particular database.
Verify that the default database defined for each login still exists and is accessible. Review the SQL Server error log to help determine why a particular database is not accessible.
Use a tool such as OSQL to specify a particular database during the initial connection. Once you are connected, execute sp_defaultdb to change the default database for your login to a database that is currently accessible.
Log in with an account that is a member of the sysadmin or securityadmin fixed server roles, and execute sp_defaultdb to change the default database for the failing login to an accessible database. For more information about default databases, see "sp_defaultdb" in Books Online and the Microsoft Knowledge Base article 307864.
Name | Description | Default Value |
Enabled | Enables or disables the workflow. | Yes |
Interval (seconds) | The recurring interval of time in seconds in which to run the workflow. | 300 |
Priority | Defines Alert Priority. | 1 |
Severity | Defines Alert Severity. | 2 |
Synchronization Time | Synchronization Time |
|
Timeout (seconds) | Specifies the time the workflow is allowed to run before being closed and marked as failed. | 200 |
Timeout for database connection (seconds) | The workflow will fail and register an event, if it cannot access the database during the specified period. | 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>
<InstanceName>$Target/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/InstanceName$</InstanceName>
<ConnectionString>$Target/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/ConnectionString$</ConnectionString>
<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>