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

Commit 74eebd7

Browse files
authored
Merge pull request #12624 from pmasl/patch-686
Updating Recovery Phases related information
2 parents f647a3a + a221f3a commit 74eebd7

9 files changed

Lines changed: 139 additions & 137 deletions

docs/relational-databases/backup-restore/apply-transaction-log-backups-sql-server.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Apply Transaction Log Backups (SQL Server) | Microsoft Docs"
33
ms.custom: ""
4-
ms.date: "08/14/2016"
4+
ms.date: "10/23/2019"
55
ms.prod: sql
66
ms.prod_service: backup-restore
77
ms.reviewer: ""
@@ -23,7 +23,6 @@ ms.author: mathoma
2323

2424
This topic describes applying transaction log backups as part of restoring a [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] database.
2525

26-
2726
## <a name="Requirements"></a> Requirements for restoring transaction log backups
2827
To apply a transaction log backup, the following requirements must be met:
2928

@@ -33,14 +32,16 @@ ms.author: mathoma
3332

3433
- **Database not yet recovered:** The database cannot be recovered until after the final transaction log has been applied. If you recover the database after restoring one of the intermediate transaction log backups, that before the end of the log chain, you cannot restore the database past that point without restarting the complete restore sequence, starting with the full database backup.
3534

36-
> **TIP!** A best practice is to restore all the log backups (RESTORE LOG *database_name* WITH NORECOVERY). Then, after restoring the last log backup, recover the database in a separate operation (RESTORE DATABASE *database_name* WITH RECOVERY).
35+
> [!TIP]
36+
> A best practice is to restore all the log backups (`RESTORE LOG *database_name* WITH NORECOVERY`). Then, after restoring the last log backup, recover the database in a separate operation (`RESTORE DATABASE *database_name* WITH RECOVERY`).
3737
3838
## <a name="RecoveryAndTlogs"></a> Recovery and transaction logs
39-
When you finish the restore operation and recover the database, recovery rolls back all incomplete transactions. This is known as the *undo phase*. Rolling back is required to restore the integrity of the database. After rollback, the database goes online, and no more transaction log backups can be applied to the database.
40-
41-
For example, a series of transaction log backups contain a long-running transaction. The start of the transaction is recorded in the first transaction log backup, but the end of the transaction is recorded in the second transaction log backup. There is no record of a commit or rollback operation in the first transaction log backup. If a recovery operation runs when the first transaction log backup is applied, the long-running transaction is treated as incomplete, and data modifications recorded in the first transaction log backup for the transaction are rolled back. [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] does not allow for the second transaction log backup to be applied after this point.
39+
When you finish the restore operation and recover the database, the recovery process is executed to ensure the integrity of the database. For more information about the recovery process, see [Restore and Recovery Overview (SQL Server)](../../relational-databases/backup-restore/restore-and-recovery-overview-sql-server.md#TlogAndRecovery).
40+
41+
After the recovery process completes, the database goes online, and no more transaction log backups can be applied to the database. For example, a series of transaction log backups contain a long-running transaction. The start of the transaction is recorded in the first transaction log backup, but the end of the transaction is recorded in the second transaction log backup. There is no record of a commit or rollback operation in the first transaction log backup. If a recovery operation runs when the first transaction log backup is applied, the long-running transaction is treated as incomplete, and data modifications recorded in the first transaction log backup for the transaction are rolled back. [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] does not allow for the second transaction log backup to be applied after this point.
4242

43-
> **NOTE:** In some circumstances, you can explicitly add a file during log restore.
43+
> [!NOTE]
44+
> In some circumstances, you can explicitly add a file during log restore.
4445
4546
## <a name="PITrestore"></a> Use log backups to restore to the failure point
4647
Assume the following sequence of events.
@@ -98,6 +99,6 @@ ms.author: mathoma
9899
- [Recover a Database Without Restoring Data &#40;Transact-SQL&#41;](../../relational-databases/backup-restore/recover-a-database-without-restoring-data-transact-sql.md)
99100

100101
## See also
101-
[The Transaction Log &#40;SQL Server&#41;](../../relational-databases/logs/the-transaction-log-sql-server.md)
102-
102+
[The Transaction Log &#40;SQL Server&#41;](../../relational-databases/logs/the-transaction-log-sql-server.md)
103+
[SQL Server Transaction Log Architecture and Management Guide](../../relational-databases/sql-server-transaction-log-architecture-and-management-guide.md)
103104

docs/relational-databases/backup-restore/piecemeal-restores-sql-server.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Piecemeal Restores (SQL Server) | Microsoft Docs"
33
ms.custom: ""
4-
ms.date: "03/14/2017"
4+
ms.date: "10/23/2019"
55
ms.prod: sql
66
ms.prod_service: backup-restore
77
ms.reviewer: ""
@@ -138,7 +138,7 @@ ms.author: mathoma
138138
In the Enterprise edition, any offline secondary filegroup can be restored and recovered while the database remains online. If a specific read-only file is undamaged and consistent with the database, the file does not have to be restored. For more information, see [Recover a Database Without Restoring Data &#40;Transact-SQL&#41;](../../relational-databases/backup-restore/recover-a-database-without-restoring-data-transact-sql.md).
139139

140140
### Applying Log Backups
141-
If a read-only filegroup has been read-only since before the file backup was created, applying log backups to the filegroup is unnecessary and is skipped by file restore. If the filegroup is read/write, an unbroken chain of log backups must be applied to the last full or differential restore to bring the filegroup forward to the current log file.
141+
If a read-only filegroup has been read-only since before the file backup was created, applying log backups to the filegroup is unnecessary and is skipped by file restore. If the filegroup is read/write, an unbroken chain of log backups must be applied to the last full or differential restore to bring the filegroup forward to the current log file. For more information about the recovery process, see [Restore and Recovery Overview (SQL Server)](../../relational-databases/backup-restore/restore-and-recovery-overview-sql-server.md#TlogAndRecovery).
142142

143143
### Examples
144144

@@ -172,6 +172,6 @@ ms.author: mathoma
172172
[RESTORE &#40;Transact-SQL&#41;](../../t-sql/statements/restore-statements-transact-sql.md)
173173
[Restore a SQL Server Database to a Point in Time &#40;Full Recovery Model&#41;](../../relational-databases/backup-restore/restore-a-sql-server-database-to-a-point-in-time-full-recovery-model.md)
174174
[Restore and Recovery Overview &#40;SQL Server&#41;](../../relational-databases/backup-restore/restore-and-recovery-overview-sql-server.md)
175-
[Plan and Perform Restore Sequences &#40;Full Recovery Model&#41;](../../relational-databases/backup-restore/plan-and-perform-restore-sequences-full-recovery-model.md)
176-
175+
[Plan and Perform Restore Sequences &#40;Full Recovery Model&#41;](../../relational-databases/backup-restore/plan-and-perform-restore-sequences-full-recovery-model.md)
176+
[Restore and Recovery Overview (SQL Server)](../../relational-databases/backup-restore/restore-and-recovery-overview-sql-server.md)
177177

docs/relational-databases/backup-restore/recover-a-database-without-restoring-data-transact-sql.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Recover a Database Without Restoring Data (Transact-SQL) | Microsoft Docs"
33
ms.custom: ""
4-
ms.date: "03/14/2017"
4+
ms.date: "10/23/2019"
55
ms.prod: sql
66
ms.prod_service: backup-restore
77
ms.reviewer: ""
@@ -34,16 +34,16 @@ ms.author: mathoma
3434

3535
The [RESTORE](../../t-sql/statements/restore-statements-transact-sql.md) syntax for a recovery-only database restore is as follows:
3636

37-
RESTORE DATABASE *database_name* WITH RECOVERY
37+
`RESTORE DATABASE *database_name* WITH RECOVERY`
3838

3939
> [!NOTE]
40-
> The FROM **=** \<*backup_device>* clause is not used for recovery-only restores because no backup is necessary.
40+
> The FROM **=** \<*backup_device>* clause is not used for recovery-only restores because no backup is necessary.
4141
4242
**Example**
4343

4444
The following example recovers the [!INCLUDE[ssSampleDBobject](../../includes/sssampledbobject-md.md)] sample database in a restore operation without restoring data.
4545

46-
```
46+
```sql
4747
-- Restore database using WITH RECOVERY.
4848
RESTORE DATABASE AdventureWorks2012
4949
WITH RECOVERY
@@ -54,21 +54,21 @@ RESTORE DATABASE AdventureWorks2012
5454

5555
A database is restored piecemeal. After restore of the primary filegroup is complete, one or more of the unrestored files are consistent with the new database state, perhaps because it has been read-only for some time. These files only have to be recovered; data copying is unnecessary.
5656

57-
A recovery-only restore operation brings the data in the offline filegroup online; no data-copy, redo, or undo phase occurs. For information about the phases of restore, see [Restore and Recovery Overview &#40;SQL Server&#41;](../../relational-databases/backup-restore/restore-and-recovery-overview-sql-server.md).
57+
A recovery-only restore operation brings the data in the offline filegroup online; no data-copy, redo, or undo phase occurs. For information about the phases of restore, see [Restore and Recovery Overview &#40;SQL Server&#41;](../../relational-databases/backup-restore/restore-and-recovery-overview-sql-server.md#TlogAndRecovery).
5858

5959
The [RESTORE](../../t-sql/statements/restore-statements-transact-sql.md) syntax for a recovery-only file restore is:
6060

61-
RESTORE DATABASE *database_name* { FILE **=**_logical_file_name_ | FILEGROUP **=**_logical_filegroup_name_ }[ **,**...*n* ] WITH RECOVERY
61+
`RESTORE DATABASE *database_name* { FILE **=**_logical_file_name_ | FILEGROUP **=**_logical_filegroup_name_ }[ **,**...*n* ] WITH RECOVERY`
6262

6363
**Example**
6464

6565
The following example illustrates a recovery-only file restore of the files in a secondary filegroup, `SalesGroup2`, in the `Sales` database. The primary filegroup has already been restored as the initial step of a piecemeal restore, and `SalesGroup2` is consistent with the restored primary filegroup. Recovering this filegroup and bringing it online requires only a single statement.
6666

67-
```
67+
```sql
6868
RESTORE DATABASE Sales FILEGROUP=SalesGroup2 WITH RECOVERY;
6969
```
7070

71-
## Examples of Completing a Piecemeal Restore Scenario with a Recovery-Only Restore
71+
## Examples of completing a piecemeal restore scenario with a recovery-only restore
7272
**Simple recovery model**
7373

7474
- [Example: Piecemeal Restore of Database &#40;Simple Recovery Model&#41;](../../relational-databases/backup-restore/example-piecemeal-restore-of-database-simple-recovery-model.md)
@@ -89,5 +89,5 @@ RESTORE DATABASE Sales FILEGROUP=SalesGroup2 WITH RECOVERY;
8989
[File Restores &#40;Simple Recovery Model&#41;](../../relational-databases/backup-restore/file-restores-simple-recovery-model.md)
9090
[File Restores &#40;Full Recovery Model&#41;](../../relational-databases/backup-restore/file-restores-full-recovery-model.md)
9191
[RESTORE &#40;Transact-SQL&#41;](../../t-sql/statements/restore-statements-transact-sql.md)
92-
92+
[Restore and Recovery Overview (SQL Server)](../../relational-databases/backup-restore/restore-and-recovery-overview-sql-server.md)
9393

docs/relational-databases/backup-restore/recover-to-a-log-sequence-number-sql-server.md

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Recover to a Log Sequence Number (SQL Server) | Microsoft Docs"
33
ms.custom: ""
4-
ms.date: "03/17/2017"
4+
ms.date: "10/23/2019"
55
ms.prod: sql
66
ms.prod_service: backup-restore
77
ms.reviewer: ""
@@ -29,17 +29,12 @@ ms.author: mikeray
2929
You can use a log sequence number (LSN) to define the recovery point for a restore operation. However, this is a specialized feature that is intended for tools vendors and is unlikely to be generally useful.
3030

3131
## <a name="LSNs"></a> Overview of Log Sequence Numbers
32-
LSNs are used internally during a RESTORE sequence to track the point in time to which data has been restored. When a backup is restored, the data is restored to the LSN corresponding to the point in time at which the backup was taken. Differential and log backups advance the restored database to a later time, which corresponds to a higher LSN.
33-
34-
Every record in the transaction log is uniquely identified by a log sequence number (LSN). LSNs are ordered such that if LSN2 is greater than LSN1, the change described by the log record referred to by LSN2 occurred after the change described by the log record LSN.
35-
36-
The LSN of a log record at which a significant event occurred can be useful for constructing correct restore sequences. Because LSNs are ordered, they can be compared for equality and inequality (that is, **\<**, **>**, **=**, **\<=**, **>=**). Such comparisons are useful when constructing restore sequences.
32+
LSNs are used internally during a RESTORE sequence to track the point in time to which data has been restored. When a backup is restored, the data is restored to the LSN corresponding to the point in time at which the backup was taken. Differential and log backups advance the restored database to a later time, which corresponds to a higher LSN. For more information about LSNs, see the [SQL Server Transaction Log Architecture and Management Guide](../../relational-databases/sql-server-transaction-log-architecture-and-management-guide.md#Logical_Arch).
3733

3834
> [!NOTE]
39-
> LSNs are values of data type **numeric**(25,0). Arithmetic operations (for example, addition or subtraction) are not meaningful and must not be used with LSNs.
40-
41-
42-
## Viewing LSNs Used by Backup and Restore
35+
> LSNs are values of data type **numeric(25,0)**. Arithmetic operations (for example, addition or subtraction) are not meaningful and must not be used with LSNs.
36+
37+
## Viewing LSNs used by Backup and Restore
4338
The LSN of a log record at which a given backup and restore event occurred is viewable using one or more of the following:
4439

4540
- [backupset](../../relational-databases/system-tables/backupset-transact-sql.md)
@@ -53,9 +48,9 @@ ms.author: mikeray
5348
- [RESTORE FILELISTONLY](../../t-sql/statements/restore-statements-filelistonly-transact-sql.md)
5449

5550
> [!NOTE]
56-
> LSNs also appear in some message texts.
51+
> LSNs also appear in some messages in the error log.
5752
58-
## Transact-SQL Syntax for Restoring to an LSN
53+
## Transact-SQL Syntax for restoring to an LSN
5954
By using a [RESTORE](../../t-sql/statements/restore-statements-transact-sql.md) statement, you can stop at or immediately before the LSN, as follows:
6055

6156
- Use the WITH STOPATMARK **='**lsn:_<lsn_number>_**'** clause, where lsn:*\<lsnNumber>* is a string that specifies that the log record that contains the specified LSN is the recovery point.
@@ -71,7 +66,7 @@ ms.author: mikeray
7166
## Examples
7267
The following example assumes that the `AdventureWorks` database has been changed to use the full recovery model.
7368

74-
```
69+
```sql
7570
RESTORE LOG AdventureWorks FROM DISK = 'c:\adventureworks_log.bak'
7671
WITH STOPATMARK = 'lsn:15000000040000037'
7772
GO
@@ -93,7 +88,8 @@ GO
9388

9489
## See Also
9590
[Apply Transaction Log Backups &#40;SQL Server&#41;](../../relational-databases/backup-restore/apply-transaction-log-backups-sql-server.md)
96-
[The Transaction Log &#40;SQL Server&#41;](../../relational-databases/logs/the-transaction-log-sql-server.md)
97-
[RESTORE &#40;Transact-SQL&#41;](../../t-sql/statements/restore-statements-transact-sql.md)
98-
91+
[The Transaction Log &#40;SQL Server&#41;](../../relational-databases/logs/the-transaction-log-sql-server.md)
92+
[RESTORE &#40;Transact-SQL&#41;](../../t-sql/statements/restore-statements-transact-sql.md)
93+
[Restore and Recovery Overview (SQL Server)](../../relational-databases/backup-restore/restore-and-recovery-overview-sql-server.md#TlogAndRecovery)
94+
[SQL Server Transaction Log Architecture and Management Guide](../../relational-databases/sql-server-transaction-log-architecture-and-management-guide.md)
9995

0 commit comments

Comments
 (0)