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/database-engine/availability-groups/windows/manually-prepare-a-secondary-database-for-an-availability-group-sql-server.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -188,7 +188,7 @@ This topic describes how to prepare a database for an Always On availability gro
188
188
GO
189
189
```
190
190
191
-
5. After you restore the full backup, you must create a log backup on the primary database. For example, the following [!INCLUDE[tsql](../../../includes/tsql-md.md)] statement backs up the log to the a backup file named *E:\MyDB1_log.bak*:
191
+
5. After you restore the full backup, you must create a log backup on the primary database. For example, the following [!INCLUDE[tsql](../../../includes/tsql-md.md)] statement backs up the log to the a backup file named *E:\MyDB1_log.trn*:
192
192
193
193
```
194
194
BACKUP LOG MyDB1
@@ -198,7 +198,7 @@ This topic describes how to prepare a database for an Always On availability gro
198
198
199
199
6. Before you can join the database to the secondary replica, you must apply the required log backup (and any subsequent log backups).
200
200
201
-
For example, the following [!INCLUDE[tsql](../../../includes/tsql-md.md)] statement restores the first log from *C:\MyDB1.bak*:
201
+
For example, the following [!INCLUDE[tsql](../../../includes/tsql-md.md)] statement restores the first log from *C:\MyDB1.trn*:
202
202
203
203
```
204
204
RESTORE LOG MyDB1
@@ -209,15 +209,15 @@ This topic describes how to prepare a database for an Always On availability gro
209
209
210
210
7. If any additional log backups occur before the database joins the secondary replica, you must also restore all of those log backups, in sequence, to the server instance that hosts the secondary replica using RESTORE WITH NORECOVERY.
211
211
212
-
For example, the following [!INCLUDE[tsql](../../../includes/tsql-md.md)] statement restores two additional logs from *E:\MyDB1_log.bak*:
212
+
For example, the following [!INCLUDE[tsql](../../../includes/tsql-md.md)] statement restores two additional logs from *E:\MyDB1_log.trn*:
Copy file name to clipboardExpand all lines: docs/relational-databases/security/authentication-access/determining-effective-database-engine-permissions.md
This article describes how to determine who has permissions to various objects in the SQL Server Database Engine. SQL Server implements two permission systems for the Database Engine. An older system of fixed roles has preconfigured permissions. Beginning with SQL Server 2005 a more flexible and precise system is available. (The information in this article applies to SQL Server, beginning with 2005. Some types of permissions are not available in some versions of SQL Server.)
23
23
24
-
> [!IMPORTANT]
24
+
> [!IMPORTANT]
25
25
> * The effective permissions are the aggregate of both permission systems.
26
26
> * A denial of permissions overrides a grant of permissions.
27
27
> * If a user is a member of the sysadmin fixed server role, permissions are not checked further, so denials will not be enforced.
@@ -45,20 +45,20 @@ This article describes how to determine who has permissions to various objects i
45
45
## Older Fixed Role Permission System
46
46
47
47
Fixed Server Roles and Fixed Database Roles have preconfigured permissions that cannot be changed. To determine who is a member of a fixed server role, execute the following query:
48
-
> [!NOTE]
48
+
> [!NOTE]
49
49
> Does not apply to SQL Database or SQL Data Warehouse where server level permission is not available. The `is_fixed_role` column of `sys.server_principals` was added in SQL Server 2012. It is not needed for older versions of SQL Server.
50
-
> ```sql
51
-
>SELECTSP1.nameAS ServerRoleName,
52
-
> isnull (SP2.name, 'No members') AS LoginName
53
-
>FROMsys.server_role_membersAS SRM
54
-
>RIGHT OUTER JOINsys.server_principalsAS SP1
55
-
>ONSRM.role_principal_id=SP1.principal_id
56
-
>LEFT OUTER JOINsys.server_principalsAS SP2
57
-
>ONSRM.member_principal_id=SP2.principal_id
58
-
>WHERESP1.is_fixed_role=1-- Remove for SQL Server 2008
59
-
>ORDER BYSP1.name;
60
-
```
61
-
> [!NOTE]
50
+
> ```sql
51
+
>SELECTSP1.nameAS ServerRoleName,
52
+
> isnull (SP2.name, 'No members') AS LoginName
53
+
>FROMsys.server_role_membersAS SRM
54
+
>RIGHT OUTER JOINsys.server_principalsAS SP1
55
+
>ONSRM.role_principal_id=SP1.principal_id
56
+
>LEFT OUTER JOINsys.server_principalsAS SP2
57
+
>ONSRM.member_principal_id=SP2.principal_id
58
+
>WHERESP1.is_fixed_role=1-- Remove for SQL Server 2008
59
+
>ORDER BYSP1.name;
60
+
>```
61
+
> [!NOTE]
62
62
> * All logins are members of the public role and cannot be removed.
63
63
> * This query checks tables in the master database but it can be executed in any database for the on premises product.
64
64
@@ -100,18 +100,18 @@ Remember that a Windows user might be a member of more than one Windows group (e
100
100
### Server Permissions
101
101
102
102
The following query returns a list of the permissions that have been granted or denied at the server level. This query should be executed in the master database.
103
-
> [!NOTE]
103
+
> [!NOTE]
104
104
> Server-level permissions cannot be granted or queried on SQL Database or SQL Data Warehouse.
105
-
> ```sql
106
-
>SELECTpr.type_desc, pr.name,
107
-
> isnull (pe.state_desc, 'No permission statements') AS state_desc,
108
-
> isnull (pe.permission_name, 'No permission statements') AS permission_name
109
-
>FROMsys.server_principalsAS pr
110
-
>LEFT OUTER JOINsys.server_permissionsAS pe
111
-
>ONpr.principal_id=pe.grantee_principal_id
112
-
>WHERE is_fixed_role =0-- Remove for SQL Server 2008
113
-
>ORDER BYpr.name, type_desc;
114
-
```
105
+
> ```sql
106
+
>SELECTpr.type_desc, pr.name,
107
+
> isnull (pe.state_desc, 'No permission statements') AS state_desc,
108
+
> isnull (pe.permission_name, 'No permission statements') AS permission_name
109
+
>FROMsys.server_principalsAS pr
110
+
>LEFT OUTER JOINsys.server_permissionsAS pe
111
+
>ONpr.principal_id=pe.grantee_principal_id
112
+
>WHERE is_fixed_role =0-- Remove for SQL Server 2008
0 commit comments