You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/relational-databases/logs/open-log-file-viewer.md
+75-80Lines changed: 75 additions & 80 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,90 +3,85 @@ title: "Open Log File Viewer"
3
3
description: Learn to use Log File Viewer in SQL Server Management Studio to access information about errors and events that are captured in several logs.
You can use Log File Viewer in [!INCLUDE[ssManStudioFull](../../includes/ssmanstudiofull-md.md)] to access information about errors and events that are captured in the following logs:
16
-
17
-
- Audit Collection
18
-
19
-
- Data Collection
20
-
21
-
- Database Mail
22
-
23
-
- Job History
24
-
25
-
- SQL Server
26
-
27
-
- SQL Server Agent
28
-
29
-
- Windows events (These Windows events can also be accessed from Event Viewer.)
30
-
31
-
Beginning in [!INCLUDE[ssSQL11](../../includes/sssql11-md.md)], you can use Registered Servers to view [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] log files from local or remote instances of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)]. By using Registered Servers, you can view the log files when the instances are either online or offline. For more information about online access, see the procedure "To view online log files from Registered Servers" later in this topic. For more information about how to access offline [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] log files, see [View Offline Log Files](../../relational-databases/logs/view-offline-log-files.md).
32
-
33
-
You can open Log File Viewer in several ways, depending on the information that you want to view.
34
-
35
-
## <aname="BeforeYouBegin"></a> Permissions
36
-
To access log files for instances of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] that are online, this requires membership in the securityadmin fixed server role.
37
-
38
-
To access log files for instances of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] that are offline, you must have read access to both the **Root\Microsoft\SqlServer\ComputerManagement10** WMI namespace, and to the folder where the log files are stored. For more information, see the Security section of the topic [View Offline Log Files](../../relational-databases/logs/view-offline-log-files.md).
39
-
40
-
### Security
41
-
Requires membership in the securityadmin fixed server role.
42
-
43
-
### View Log Files
44
-
45
-
##### To view logs that are related to general SQL Server activity
46
-
47
-
1. In Object Explorer, expand **Management**.
48
-
49
-
2. Do either of the following:
50
-
51
-
- Right-click **SQL Server Logs**, point to **View**, and then click either **SQL Server Log** or **SQL Server and Windows Log**.
52
-
53
-
- Expand **SQL Server Logs**, right-click any log file, and then click **View SQL Server Log**. You can also double-click any log file.
54
-
55
-
The logs include **Database Mail**, **SQL Server**, **SQL Server Agent**, and **Windows NT**.
56
-
57
-
##### To view logs that are related to jobs
58
-
59
-
- In Object Explorer, expand **SQL Server Agent**, right-click **Jobs**, and then click **View History**.
60
-
61
-
The logs include **Database Mail**, **Job History**, and **SQL Server Agent**.
62
-
63
-
##### To view logs that are related to maintenance plans
64
-
65
-
- In Object Explorer, expand **Management**, right-click **Maintenance Plans**, and then click **View History**.
66
-
67
-
The logs include **Database Mail**, **Job History**, **Maintenance Plans**, **Remote Maintenance Plans**, and **SQL Server Agent**.
68
-
69
-
##### To view logs that are related to Data Collection
70
-
71
-
- In Object Explorer, expand **Management**, right-click **Data Collection**, and then click **View Logs**.
72
-
73
-
The logs include **Data Collection**, **Job History**, and **SQL Server Agent**.
74
-
75
-
##### To view logs that are related to Database Mail
76
-
77
-
- In Object Explorer, expand **Management**, right-click **Database Mail**, and then click **View Database Mail Log**.
78
-
79
-
The logs include **Database Mail, Job History**, **Maintenance Plans**, **Remote Maintenance Plans**, **SQL Server**, **SQL Server Agent**, and **Windows NT**.
80
-
81
-
##### To view logs that are related to audits collections
82
-
83
-
- In Object Explorer, expand **Security**, expand **Audits**, right-click an audit, and then click **View Audit Logs**.
84
-
85
-
The logs include **Audit Collection** and **Windows NT**.
You can use Log File Viewer in [!INCLUDE [ssManStudioFull](../../includes/ssmanstudiofull-md.md)] to access information about errors and events that are captured in the following logs:
18
+
19
+
- Audit collection
20
+
- Data collection
21
+
- Database Mail
22
+
- Job history
23
+
- SQL Server
24
+
- SQL Server Agent
25
+
- Windows events (These Windows events can also be accessed from Event Viewer.)
26
+
27
+
You can use Registered Servers to view [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)] log files from local or remote instances of [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)]. By using Registered Servers, you can view the log files when the instances are either online or offline.
28
+
29
+
For more information about how to access offline [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)] log files, see [View Offline Log Files](view-offline-log-files.md).
30
+
31
+
You can open Log File Viewer in several ways, depending on the information that you want to view.
32
+
33
+
## Permissions
34
+
35
+
To access log files for instances of [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)] that are online, this requires membership in the **securityadmin** fixed server role.
36
+
37
+
To access log files for instances of [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)] that are offline, you must have read access to both the `Root\Microsoft\SqlServer\ComputerManagement10` WMI namespace, and to the folder where the log files are stored. For more information, see the Security section of the topic [View Offline Log Files](view-offline-log-files.md).
38
+
39
+
## View log files
40
+
41
+
### View logs that are related to general SQL Server activity
42
+
43
+
1. In Object Explorer, expand **Management**.
44
+
45
+
1. There are two options to view logs:
46
+
47
+
- Right-click **SQL Server Logs**, point to **View**, and then select either **SQL Server Log** or **SQL Server and Windows Log**.
48
+
49
+
- Expand **SQL Server Logs**, right-click any log file, and then select **View SQL Server Log**. You can also double-click any log file.
50
+
51
+
The logs include **Database Mail**, **SQL Server**, **SQL Server Agent**, and **Windows**.
52
+
53
+
### View logs that are related to jobs
54
+
55
+
In Object Explorer, expand **SQL Server Agent**, right-click **Jobs**, and then select **View History**.
56
+
57
+
The logs include **Database Mail**, **Job History**, and **SQL Server Agent**.
58
+
59
+
### View logs that are related to maintenance plans
60
+
61
+
In Object Explorer, expand **Management**, right-click **Maintenance Plans**, and then select **View History**.
62
+
63
+
The logs include **Database Mail**, **Job History**, **Maintenance Plans**, **Remote Maintenance Plans**, and **SQL Server Agent**.
64
+
65
+
### View logs that are related to Data Collection
66
+
67
+
In Object Explorer, expand **Management**, right-click **Data Collection**, and then select **View Logs**.
68
+
69
+
The logs include **Data Collection**, **Job History**, and **SQL Server Agent**.
70
+
71
+
### View logs that are related to Database Mail
72
+
73
+
In Object Explorer, expand **Management**, right-click **Database Mail**, and then select **View Database Mail Log**.
74
+
75
+
The logs include **Database Mail, Job History**, **Maintenance Plans**, **Remote Maintenance Plans**, **SQL Server**, **SQL Server Agent**, and **Windows**.
76
+
77
+
### View logs that are related to Audits collections
78
+
79
+
In Object Explorer, expand **Security**, expand **Audits**, right-click an audit, and then select **View Audit Logs**.
80
+
81
+
The logs include **Audit Collection** and **Windows**.
82
+
83
+
## Related content
84
+
85
+
-[Log File Viewer](log-file-viewer.md)
86
+
-[SQL Server Audit (Database Engine)](../security/auditing/sql-server-audit-database-engine.md)
Copy file name to clipboardExpand all lines: docs/relational-databases/security/password-policy.md
+38-54Lines changed: 38 additions & 54 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,10 +3,10 @@ title: "Password Policy"
3
3
description: This article goes over the Windows password policy mechanisms applying to a login that uses SQL Server authentication and to a contained database user with a password.
[!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)] can apply the same complexity and expiration policies used in Windows to passwords used inside [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)]. This functionality depends on the `NetValidatePasswordPolicy` API.
40
40
41
41
> [!NOTE]
42
-
> Azure SQL Database enforces [password complexity](#password-complexity). The password expiration and policy enforcement sections don't apply to Azure SQL Database.
43
-
>
44
-
> For information on password policy for Azure SQL Managed Instance, see our [SQL Managed Instance FAQ](/azure/azure-sql/managed-instance/frequently-asked-questions-faq#password-policy-).
42
+
> Azure SQL Database enforces [password complexity](#password-complexity). The password expiration and policy enforcement sections don't apply to Azure SQL Database. For information on password policy for Azure SQL Managed Instance, see our [SQL Managed Instance FAQ](/azure/azure-sql/managed-instance/frequently-asked-questions-faq#password-policy-).
45
43
46
-
## Password Complexity
44
+
## Password complexity
47
45
48
46
Password complexity policies are designed to deter brute force attacks by increasing the number of possible passwords. When password complexity policy is enforced, new passwords must meet the following guidelines:
49
47
@@ -53,93 +51,79 @@ Password complexity policies are designed to deter brute force attacks by increa
53
51
54
52
- The password contains characters from three of the following four categories:
55
53
56
-
- Latin uppercase letters (A through Z)
57
-
58
-
- Latin lowercase letters (a through z)
59
-
60
-
- Base 10 digits (0 through 9)
61
-
62
-
- Nonalphanumeric characters such as: exclamation point (!), dollar sign ($), number sign (#), or percent (%).
54
+
- Latin uppercase letters (`A` through `Z`)
55
+
- Latin lowercase letters (`a` through `z`)
56
+
- Base 10 digits (`0` through `9`)
57
+
- Nonalphanumeric characters such as: exclamation point (`!`), dollar sign (`$`), number sign (`#`), or percent (`%`).
63
58
64
59
Passwords can be up to 128 characters long. Use passwords that are as long and complex as possible.
65
60
66
-
## Password Expiration
61
+
## Password expiration
67
62
68
63
Password expiration policies are used to manage the lifespan of a password. When [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)] enforces password expiration policy, users are reminded to change old passwords, and accounts that have expired passwords are disabled.
69
64
70
-
## Policy Enforcement
65
+
## Policy enforcement
71
66
72
67
The enforcement of password policy can be configured separately for each SQL Server login. Use [ALTER LOGIN](../../t-sql/statements/alter-login-transact-sql.md) to configure the password policy options of a SQL Server login. The following rules apply to the configuration of password policy enforcement:
73
68
74
-
- When CHECK_POLICY is changed to ON, the following behaviors occur:
75
-
76
-
- CHECK_EXPIRATION is also set to ON unless it's explicitly set to OFF.
69
+
- When `CHECK_POLICY` is changed to `ON`, the following behaviors occur:
77
70
71
+
-`CHECK_EXPIRATION` is also set to `ON` unless it's explicitly set to `OFF`.
78
72
- The password history is initialized with the value of the current password hash.
79
-
80
73
-**Account lockout duration**, **account lockout threshold**, and **reset account lockout counter after** are also enabled.
81
74
82
-
- When CHECK_POLICY is changed to OFF, the following behaviors occur:
83
-
84
-
- CHECK_EXPIRATION is also set to OFF.
75
+
- When `CHECK_POLICY` is changed to `OFF`, the following behaviors occur:
85
76
77
+
-`CHECK_EXPIRATION` is also set to `OFF`.
86
78
- The password history is cleared.
87
-
88
79
- The value of `lockout_time` is reset.
89
80
90
81
Some combinations of policy options aren't supported.
91
82
92
-
- If MUST_CHANGE is specified, CHECK_EXPIRATION and CHECK_POLICY must be set to ON. Otherwise, the statement fails.
83
+
- If `MUST_CHANGE` is specified, `CHECK_EXPIRATION` and `CHECK_POLICY` must be set to `ON`. Otherwise, the statement fails.
93
84
94
-
- If CHECK_POLICY is set to OFF, CHECK_EXPIRATION can't be set to ON. An ALTER LOGIN statement that has this combination of options will fail.
85
+
- If `CHECK_POLICY` is set to `OFF`, `CHECK_EXPIRATION` can't be set to `ON`. An `ALTER LOGIN` statement that has this combination of options fails.
95
86
96
-
- Setting CHECK_POLICY = ON prevents the creation of passwords that are:
87
+
- Setting `CHECK_POLICY = ON` prevents the creation of passwords that are:
97
88
98
89
- Null or empty
99
-
100
90
- Same as name of computer or login
101
-
102
91
- Any of the following: `password`, `admin`, `administrator`, `sa`, `sysadmin`
103
92
104
93
The security policy might be set in Windows, or might be received from the domain. To view the password policy on the computer, use the Local Security Policy MMC snap-in (**secpol.msc**).
105
94
106
95
> [!NOTE]
107
-
> For SQL Server logins that have CHECK_POLICY enabled, if you run [ALTER LOGIN](../../t-sql/statements/alter-login-transact-sql.md) and don't include OLD_PASSWORD in the command to change the password, then [Enforce Password History](/windows/security/threat-protection/security-policy-settings/enforce-password-history) is ignored. This is a by-design behavior to allow password resets, despite any previously used passwords. Other checks associated with CHECK_POLICY, including length and complexity are checked regardless of whether OLD_PASSWORD is used.
96
+
> For SQL Server logins that have `CHECK_POLICY` enabled, if you run [ALTER LOGIN](../../t-sql/statements/alter-login-transact-sql.md) and don't include `OLD_PASSWORD` in the command to change the password, then [Enforce Password History](/windows/security/threat-protection/security-policy-settings/enforce-password-history) is ignored. This is a by-design behavior to allow password resets, despite any previously used passwords. Other checks associated with `CHECK_POLICY`, including length and complexity are checked regardless of whether `OLD_PASSWORD` is used.
108
97
109
-
## Checking SQL user password policy information
98
+
## Check SQL user password policy information
110
99
111
100
You can review SQL user password policies and expiration dates in SQL Server using the following query. Although the following query also works in Azure SQL Database, only password complexity is enforced in Azure SQL Database.
112
101
113
102
```sql
114
103
SELECT name,
115
-
is_policy_checked,
116
-
is_expiration_checked,
117
-
LOGINPROPERTY(name, 'IsMustChange') AS IsMustChange,
118
-
LOGINPROPERTY(name, 'IsLocked') AS IsLocked,
119
-
LOGINPROPERTY(name, 'LockoutTime') AS LockoutTime,
120
-
LOGINPROPERTY(name, 'PasswordLastSetTime') AS PasswordLastSetTime,
121
-
LOGINPROPERTY(name, 'IsExpired') AS IsExpired,
122
-
LOGINPROPERTY(name, 'BadPasswordCount') AS BadPasswordCount,
123
-
LOGINPROPERTY(name, 'BadPasswordTime') AS BadPasswordTime,
124
-
LOGINPROPERTY(name, 'HistoryLength') AS HistoryLength,
125
-
modify_date
104
+
is_policy_checked,
105
+
is_expiration_checked,
106
+
LOGINPROPERTY(name, 'IsMustChange') AS IsMustChange,
107
+
LOGINPROPERTY(name, 'IsLocked') AS IsLocked,
108
+
LOGINPROPERTY(name, 'LockoutTime') AS LockoutTime,
109
+
LOGINPROPERTY(name, 'PasswordLastSetTime') AS PasswordLastSetTime,
110
+
LOGINPROPERTY(name, 'IsExpired') AS IsExpired,
111
+
LOGINPROPERTY(name, 'BadPasswordCount') AS BadPasswordCount,
112
+
LOGINPROPERTY(name, 'BadPasswordTime') AS BadPasswordTime,
113
+
LOGINPROPERTY(name, 'HistoryLength') AS HistoryLength,
0 commit comments