Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Commit c623f3c

Browse files
committed
Update old Linux articles
1 parent 7c2abb1 commit c623f3c

2 files changed

Lines changed: 277 additions & 279 deletions

File tree

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
author: rwestMSFT
33
ms.author: randolphwest
4-
ms.date: 09/15/2022
4+
ms.date: 07/16/2024
55
ms.service: sql
66
ms.subservice: linux
77
ms.topic: include
@@ -10,27 +10,38 @@ ms.custom:
1010
---
1111
## Add a database to the availability group
1212

13-
Ensure that the database you add to the availability group is in the full recovery model and has a valid log backup. If this is a test database or a newly created database, take a database backup. On the primary [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)], run the following Transact-SQL script to create and back up a database called `db1`:
13+
Ensure that the database you add to the availability group is in the full recovery model and has a valid log backup. If your database is a test database or a newly created database, take a database backup. On the primary [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)], run the following [!INCLUDE [tsql-md](../../includes/tsql-md.md)] (T-SQL) script to create and back up a database called `db1`:
1414

1515
```sql
1616
CREATE DATABASE [db1];
17-
ALTER DATABASE [db1] SET RECOVERY FULL;
17+
GO
18+
19+
ALTER DATABASE [db1]
20+
SET RECOVERY FULL;
21+
GO
22+
1823
BACKUP DATABASE [db1]
19-
TO DISK = N'/var/opt/mssql/data/db1.bak';
24+
TO DISK = N'/var/opt/mssql/data/db1.bak';
2025
```
2126

22-
On the primary [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)] replica, run the following Transact-SQL script to add a database called `db1` to an availability group called `ag1`:
27+
On the primary [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)] replica, run the following T-SQL script to add a database called `db1` to an availability group called `ag1`:
2328

2429
```sql
25-
ALTER AVAILABILITY GROUP [ag1] ADD DATABASE [db1];
30+
ALTER AVAILABILITY GROUP [ag1]
31+
ADD DATABASE [db1];
2632
```
2733

2834
### Verify that the database is created on the secondary servers
2935

3036
On each secondary [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)] replica, run the following query to see if the `db1` database was created and is synchronized:
3137

3238
```sql
33-
SELECT * FROM sys.databases WHERE name = 'db1';
39+
SELECT * FROM sys.databases
40+
WHERE name = 'db1';
41+
GO
42+
43+
SELECT DB_NAME(database_id) AS 'database',
44+
synchronization_state_desc
45+
FROM sys.dm_hadr_database_replica_states;
3446
GO
35-
SELECT DB_NAME(database_id) AS 'database', synchronization_state_desc FROM sys.dm_hadr_database_replica_states;
3647
```

0 commit comments

Comments
 (0)