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/linux/sample-unattended-install-redhat.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ description: Use a sample bash script to install SQL Server on Red Hat Enterpris
5
5
author: rwestMSFT
6
6
ms.author: randolphwest
7
7
ms.reviewer: armaha
8
-
ms.date: 05/20/2022
8
+
ms.date: 11/16/2023
9
9
ms.service: sql
10
10
ms.subservice: linux
11
11
ms.topic: conceptual
@@ -19,7 +19,7 @@ ms.custom:
19
19
This sample bash script installs [!INCLUDE [ssnoversion-md](../includes/ssnoversion-md.md)] on Red Hat Enterprise Linux (RHEL) without interactive input. It provides examples of installing the [!INCLUDE [ssde-md](../includes/ssde-md.md)], the SQL Server command-line tools, SQL Server Agent, and performs post-install steps. You can optionally install full-text search and create an administrative user.
20
20
21
21
> [!TIP]
22
-
> If you don't need an unattended installation script, the fastest way to install SQL Server is to follow the [quickstart for Red Hat](quickstart-install-connect-red-hat.md). For other setup information, see [Installation guidance for SQL Server on Linux](sql-server-linux-setup.md).
22
+
> If you don't need an unattended installation script, the fastest way to install SQL Server is to follow the [Quickstart: Install SQL Server and create a database on Red Hat](quickstart-install-connect-red-hat.md). For other setup information, see [Installation guidance for SQL Server on Linux](sql-server-linux-setup.md).
23
23
24
24
## Prerequisites
25
25
@@ -224,4 +224,4 @@ Then run the bash script as follows:
224
224
225
225
## Related content
226
226
227
-
-[SQL Server on Linux overview](sql-server-linux-overview.md)
227
+
-[What is SQL Server on Linux?](sql-server-linux-overview.md)
Copy file name to clipboardExpand all lines: docs/linux/sql-server-linux-availability-group-operate-ha.md
+20-18Lines changed: 20 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ description: This article describes how to perform a rolling upgrade with SQL Se
4
4
author: rwestMSFT
5
5
ms.author: randolphwest
6
6
ms.reviewer: vanto
7
-
ms.date: 03/01/2018
7
+
ms.date: 11/16/2023
8
8
ms.service: sql
9
9
ms.subservice: linux
10
10
ms.topic: conceptual
@@ -17,23 +17,23 @@ ms.custom:
17
17
18
18
## Upgrade availability group
19
19
20
-
Before you upgrade an availability group, review the patterns and practices at [Upgrading availability group replica instances](../database-engine/availability-groups/windows/upgrading-always-on-availability-group-replica-instances.md).
20
+
Before you upgrade an availability group, review the patterns and practices at [Upgrade availability group replicas](../database-engine/availability-groups/windows/upgrading-always-on-availability-group-replica-instances.md).
21
21
22
-
The following sections explain how to perform a rolling upgrade with SQL Server instances on Linux with availability groups.
22
+
The following sections explain how to perform a rolling upgrade with SQL Server instances on Linux with availability groups.
23
23
24
24
### Upgrade steps on Linux
25
25
26
26
When availability group replicas are on instances of SQL Server in Linux, the cluster type of the availability group is either `EXTERNAL` or `NONE`. An availability group that is managed by a cluster manager besides Windows Server Failover Cluster (WSFC) is `EXTERNAL`. Pacemaker with Corosync is an example of an external cluster manager. An availability group with no cluster manager has cluster type `NONE` The upgrade steps outlined here are specific for availability groups of cluster type `EXTERNAL` or `NONE`.
27
27
28
-
The order in which you upgrade instances depends on if their role is secondary and whether or not they host synchronous or asynchronous replicas. Upgrade instances of SQL Server that host asynchronous secondary replicas first. Then upgrade instances that host synchronous secondary replicas.
28
+
The order in which you upgrade instances depends on if their role is secondary and whether or not they host synchronous or asynchronous replicas. Upgrade instances of SQL Server that host asynchronous secondary replicas first. Then upgrade instances that host synchronous secondary replicas.
29
+
30
+
> [!NOTE]
31
+
> If an availability group only has asynchronous replicas, to avoid any data loss change one replica to synchronous and wait until it's synchronized. Then upgrade this replica.
29
32
30
-
>[!NOTE]
31
-
>If an availability group only has asynchronous replicas, to avoid any data loss change one replica to synchronous and wait until it is synchronized. Then upgrade this replica.
32
-
33
33
Before you begin, back up each database.
34
34
35
35
1. Stop the resource on the node hosting the secondary replica targeted for upgrade.
36
-
36
+
37
37
Before running the upgrade command, stop the resource so the cluster will not monitor it and fail it unnecessarily. The following example adds a location constraint on the node that will result on the resource to be stopped. Update `ag_cluster-master` with the resource name and `nodeName1` with the node hosting the replica targeted for upgrade.
38
38
39
39
```bash
@@ -48,26 +48,28 @@ Before you begin, back up each database.
48
48
sudo yum update mssql-server
49
49
sudo yum update mssql-server-ha
50
50
```
51
+
51
52
1. Remove the location constraint.
52
53
53
54
Before running the upgrade command, stop the resource so the cluster will not monitor it and fail it unnecessarily. The following example adds a location constraint on the node that will result on the resource to be stopped. Update `ag_cluster-master` with the resource name and `nodeName1` with the node hosting the replica targeted for upgrade.
As a best practice, ensure the resource is started (using `pcs status` command) and the secondary replica is connected and synchronized state after upgrade.
59
61
60
62
1. After all secondary replicas are upgraded, manually fail over to one of the synchronous secondary replicas.
61
63
62
-
For availability groups with `EXTERNAL` cluster type, use the cluster management tools to fail over; availability groups with `NONE` cluster type should use Transact-SQL to fail over.
64
+
For availability groups with `EXTERNAL` cluster type, use the cluster management tools to fail over; availability groups with `NONE` cluster type should use Transact-SQL to fail over.
63
65
The following example fails over an availability group with the cluster management tools. Replace `<targetReplicaName>` with the name of the synchronous secondary replica that will become primary:
1. For an availability groups with an external cluster manager - where cluster type is EXTERNAL, clean up the location constraint that was caused by the manual failover.
111
+
1. For an availability groups with an external cluster manager - where cluster type is EXTERNAL, clean up the location constraint that was caused by the manual failover.
1. Resume data movement for the newly upgraded secondary replica - the former primary replica. This step is required when a higher version instance of SQL Server is transferring log blocks to a lower version instance in an availability group. Run the following command on the new secondary replica (the previous primary replica).
@@ -118,7 +120,7 @@ Before you begin, back up each database.
118
120
ALTER DATABASE database_name SET HADR RESUME;
119
121
```
120
122
121
-
After upgrading all servers, you can fail back. Fail over back to the original primary - if necessary.
123
+
After upgrading all servers, you can fail back. Fail over back to the original primary - if necessary.
Copy file name to clipboardExpand all lines: docs/linux/sql-server-linux-db-mail-sql-agent.md
+61-56Lines changed: 61 additions & 56 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: DB Mail and Email Alerts with SQL Agent on Linux
3
3
description: Learn how to use DB Mail and how to set up Email Alerts with SQL Server Agent (mssql-server-agent) on Linux.
4
4
author: rwestMSFT
5
5
ms.author: randolphwest
6
-
ms.date: 02/20/2018
6
+
ms.date: 11/16/2023
7
7
ms.service: sql
8
8
ms.subservice: linux
9
9
ms.topic: conceptual
@@ -14,78 +14,83 @@ ms.custom:
14
14
15
15
[!INCLUDE [SQL Server - Linux](../includes/applies-to-version/sql-linux.md)]
16
16
17
-
The following steps show you how to set up DB Mail and use it with SQL Server Agent (**mssql-server-agent**) on Linux.
17
+
The following steps show you how to set up DB Mail and use it with SQL Server Agent (**mssql-server-agent**) on Linux.
18
18
19
19
## 1. Enable DB Mail
20
20
21
21
```sql
22
-
USE master
23
-
GO
24
-
sp_configure 'show advanced options',1
25
-
GO
26
-
RECONFIGURE WITH OVERRIDE
27
-
GO
28
-
sp_configure 'Database Mail XPs', 1
29
-
GO
30
-
RECONFIGURE
31
-
GO
22
+
USE master
23
+
GO
24
+
sp_configure 'show advanced options',1
25
+
GO
26
+
RECONFIGURE WITH OVERRIDE
27
+
GO
28
+
sp_configure 'Database Mail XPs', 1
29
+
GO
30
+
RECONFIGURE
31
+
GO
32
32
```
33
33
34
34
## 2. Create a new account
35
+
35
36
```sql
36
-
EXECUTE msdb.dbo.sysmail_add_account_sp
37
-
@account_name ='SQLAlerts',
38
-
@description ='Account for Automated DBA Notifications',
39
-
@email_address ='sqlagenttest@gmail.com',
40
-
@replyto_address ='sqlagenttest@gmail.com',
41
-
@display_name ='SQL Agent',
42
-
@mailserver_name ='smtp.gmail.com',
43
-
@port =587,
44
-
@enable_ssl =1,
45
-
@username ='sqlagenttest@gmail.com',
46
-
@password ='<password>'
37
+
EXECUTE msdb.dbo.sysmail_add_account_sp
38
+
@account_name ='SQLAlerts',
39
+
@description ='Account for Automated DBA Notifications',
40
+
@email_address ='sqlagenttest@gmail.com',
41
+
@replyto_address ='sqlagenttest@gmail.com',
42
+
@display_name ='SQL Agent',
43
+
@mailserver_name ='smtp.gmail.com',
44
+
@port =587,
45
+
@enable_ssl =1,
46
+
@username ='sqlagenttest@gmail.com',
47
+
@password ='<password>'
47
48
GO
48
49
```
49
50
50
51
## 3. Create a default profile
51
52
52
53
```sql
53
-
EXECUTE msdb.dbo.sysmail_add_profile_sp
54
-
@profile_name ='default',
55
-
@description ='Profile for sending Automated DBA Notifications'
54
+
EXECUTE msdb.dbo.sysmail_add_profile_sp
55
+
@profile_name ='default',
56
+
@description ='Profile for sending Automated DBA Notifications'
56
57
GO
57
58
```
58
59
59
60
## 4. Add the Database Mail account to a Database Mail profile
61
+
60
62
```sql
61
-
EXECUTE msdb.dbo.sysmail_add_principalprofile_sp
62
-
@profile_name ='default',
63
-
@principal_name ='public',
64
-
@is_default =1 ;
63
+
EXECUTE msdb.dbo.sysmail_add_principalprofile_sp
64
+
@profile_name ='default',
65
+
@principal_name ='public',
66
+
@is_default =1 ;
65
67
```
66
-
67
-
## 5. Add account to profile
68
+
69
+
## 5. Add account to profile
70
+
68
71
```sql
69
-
EXECUTE msdb.dbo.sysmail_add_profileaccount_sp
70
-
@profile_name ='default',
71
-
@account_name ='SQLAlerts',
72
-
@sequence_number =1;
72
+
EXECUTE msdb.dbo.sysmail_add_profileaccount_sp
73
+
@profile_name ='default',
74
+
@account_name ='SQLAlerts',
75
+
@sequence_number =1;
73
76
```
74
-
77
+
75
78
## 6. Send test email
76
-
> [!NOTE]
79
+
80
+
> [!NOTE]
77
81
> You might have to go to your email client and enable the "allow less secure clients to send mail." Not all clients recognize DB Mail as an email daemon.
78
82
79
83
```
80
-
EXECUTE msdb.dbo.sp_send_dbmail
81
-
@profile_name = 'default',
82
-
@recipients = 'recipient-email@gmail.com',
83
-
@Subject = 'Testing DBMail',
84
-
@Body = 'This message is a test for DBMail'
84
+
EXECUTE msdb.dbo.sp_send_dbmail
85
+
@profile_name = 'default',
86
+
@recipients = 'recipient-email@gmail.com',
87
+
@Subject = 'Testing DBMail',
88
+
@Body = 'This message is a test for DBMail'
85
89
GO
86
90
```
87
91
88
92
## 7. Set DB Mail Profile using mssql-conf or environment variable
93
+
89
94
You can use the mssql-conf utility or environment variables to register your DB Mail profile. In this case, let's call our profile default.
90
95
91
96
```bash
@@ -95,27 +100,27 @@ sudo /opt/mssql/bin/mssql-conf set sqlagent.databasemailprofile default
95
100
MSSQL_AGENT_EMAIL_PROFILE=default
96
101
```
97
102
98
-
## 8. Set up an operator for SQLAgent job notifications
103
+
## 8. Set up an operator for SQLAgent job notifications
99
104
100
105
```sql
101
-
EXEC msdb.dbo.sp_add_operator
102
-
@name=N'JobAdmins',
103
-
@enabled=1,
104
-
@email_address=N'recipient-email@gmail.com',
105
-
@category_name=N'[Uncategorized]'
106
-
GO
106
+
EXEC msdb.dbo.sp_add_operator
107
+
@name=N'JobAdmins',
108
+
@enabled=1,
109
+
@email_address=N'recipient-email@gmail.com',
110
+
@category_name=N'[Uncategorized]'
111
+
GO
107
112
```
108
113
109
-
## 9. Send email when 'Agent Test Job' succeeds
114
+
## 9. Send email when 'Agent Test Job' succeeds
110
115
111
116
```
112
-
EXEC msdb.dbo.sp_update_job
113
-
@job_name='Agent Test Job',
114
-
@notify_level_email=1,
115
-
@notify_email_operator_name=N'JobAdmins'
117
+
EXEC msdb.dbo.sp_update_job
118
+
@job_name='Agent Test Job',
119
+
@notify_level_email=1,
120
+
@notify_email_operator_name=N'JobAdmins'
116
121
GO
117
122
```
118
123
119
124
## Related content
120
125
121
-
-[Run a SQL Server Agent job on Linux](sql-server-linux-run-sql-server-agent-job.md)
126
+
-[Create and run SQL Server Agent jobs on Linux](sql-server-linux-run-sql-server-agent-job.md)
0 commit comments