Skip to content

Commit e2c89f1

Browse files
authored
Merge pull request #25369 from rwestMSFT/rw-1223-recovery-interval
Refresh recovery interval article and include issue 8410
2 parents 5b8074f + 8ccf7ff commit e2c89f1

1 file changed

Lines changed: 71 additions & 93 deletions

File tree

Lines changed: 71 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
---
2-
title: "Configure the recovery interval Server Configuration Option"
2+
title: Configure the recovery interval server configuration option
33
description: Learn about the recovery interval option. See how its value affects how often SQL Server issues automatic checkpoints on a database.
44
author: rwestMSFT
55
ms.author: randolphwest
6-
ms.date: "03/02/2017"
6+
ms.reviewer: randolphwest
7+
ms.date: 12/23/2022
78
ms.service: sql
89
ms.subservice: configuration
910
ms.topic: conceptual
@@ -17,94 +18,71 @@ helpviewer_keywords:
1718
- "maximum number of minutes per database recovery"
1819
- "recovery [SQL Server], recovery interval option"
1920
---
20-
# Configure the recovery interval Server Configuration Option
21-
[!INCLUDE [SQL Server](../../includes/applies-to-version/sqlserver.md)]
22-
23-
This topic describes how to configure the **recovery interval** server configuration option in [!INCLUDE[ssnoversion](../../includes/ssnoversion-md.md)] by using [!INCLUDE[ssManStudioFull](../../includes/ssmanstudiofull-md.md)] or [!INCLUDE[tsql](../../includes/tsql-md.md)]. The **recovery interval** option defines an upper limit on the time recovering a database should take. The [!INCLUDE[ssDEnoversion](../../includes/ssdenoversion-md.md)] uses the value specified for this option to determine approximately how often to issue [automatic checkpoints](../../relational-databases/logs/database-checkpoints-sql-server.md) on a given database.
24-
25-
The default recovery-interval value is 0, which allows the [!INCLUDE[ssDE](../../includes/ssde-md.md)] to automatically configure the recovery interval. Typically, the default recovery interval results in automatic checkpoints occurring approximately once a minute for active databases and a recovery time of less than one minute. Higher values indicate the approximate maximum recovery time, in minutes. For example, setting the recovery interval to 3 indicates a maximum recovery time of approximately three minutes.
26-
27-
**In This Topic**
28-
29-
- **Before you begin:**
30-
31-
[Limitations and Restrictions](#Restrictions)
32-
33-
[Recommendations](#Recommendations)
34-
35-
[Security](#Security)
36-
37-
- **To Configure the recovery interval Server Configuration Option, using:**
38-
39-
[SQL Server Management Studio](#SSMSProcedure)
40-
41-
[Transact-SQL](#TsqlProcedure)
42-
43-
- **Follow Up:** [After you configure the recovery interval option](#FollowUp)
44-
45-
## <a name="BeforeYouBegin"></a> Before You Begin
46-
47-
### <a name="Restrictions"></a> Limitations and Restrictions
48-
49-
- The recovery interval affects only databases that use the default target recovery time (0). To override the server recovery interval on a database, configure a non-default target recovery time on the database. For more information, see [Change the Target Recovery Time of a Database &#40;SQL Server&#41;](../../relational-databases/logs/change-the-target-recovery-time-of-a-database-sql-server.md).
50-
51-
### <a name="Recommendations"></a> Recommendations
52-
53-
- This option is an advanced option and should be changed only by an experienced database administrator or certified [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] professional.
54-
55-
- Typically, we recommend that you keep the recovery interval at 0, unless you experience performance problems. If you decide to increase the recovery-interval setting, we recommend increasing it gradually by small increments and evaluating the effect of each incremental increase on recovery performance.
56-
57-
- If you use **sp_configure** to change the value of the **recovery interval** option to more than 60 (minutes), specify RECONFIGURE WITH OVERRIDE. WITH OVERRIDE disables configuration value checking (for values that are not valid or are nonrecommended values).
58-
59-
### <a name="Security"></a> Security
60-
61-
#### <a name="Permissions"></a> Permissions
62-
Execute permissions on **sp_configure** with no parameters or with only the first parameter are granted to all users by default. To execute **sp_configure** with both parameters to change a configuration option or to run the RECONFIGURE statement, a user must be granted the ALTER SETTINGS server-level permission. The ALTER SETTINGS permission is implicitly held by the **sysadmin** and **serveradmin** fixed server roles.
63-
64-
## <a name="SSMSProcedure"></a> Using SQL Server Management Studio
65-
**To set the recovery interval**
66-
67-
1. In Object Explorer, right-click server instance and select **Properties**.
68-
69-
2. Click the **Database settings** node.
70-
71-
3. Under **Recovery**, in the **Recovery interval (minutes)** box, type or select a value from 0 through 32767 to set the maximum amount of time, in minutes, that [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] should spend recovering each database at startup. The default is 0, indicating automatic configuration by [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)]. In practice, this means a recovery time of less than one minute and a checkpoint approximately every one minute for active databases.
72-
73-
## <a name="TsqlProcedure"></a> Using Transact-SQL
74-
75-
#### To set the recovery interval
76-
77-
1. Connect to the [!INCLUDE[ssDE](../../includes/ssde-md.md)].
78-
79-
2. From the Standard bar, click **New Query**.
80-
81-
3. Copy and paste the following example into the query window and click **Execute**. This example shows how to use [sp_configure](../../relational-databases/system-stored-procedures/sp-configure-transact-sql.md) to set the value of the `recovery interval` option to `3` minutes.
82-
83-
```sql
84-
USE AdventureWorks2012 ;
85-
GO
86-
EXEC sp_configure 'show advanced options', 1;
87-
GO
88-
RECONFIGURE ;
89-
GO
90-
EXEC sp_configure 'recovery interval', 3 ;
91-
GO
92-
RECONFIGURE;
93-
GO
94-
95-
```
96-
97-
For more information, see [Server Configuration Options &#40;SQL Server&#41;](../../database-engine/configure-windows/server-configuration-options-sql-server.md).
98-
99-
## <a name="FollowUp"></a> Follow Up: After you configure the recovery interval option
100-
The setting takes effect immediately without restarting the server.
101-
102-
## See Also
103-
[Change the Target Recovery Time of a Database &#40;SQL Server&#41;](../../relational-databases/logs/change-the-target-recovery-time-of-a-database-sql-server.md)
104-
[Database Checkpoints &#40;SQL Server&#41;](../../relational-databases/logs/database-checkpoints-sql-server.md)
105-
[Server Configuration Options &#40;SQL Server&#41;](../../database-engine/configure-windows/server-configuration-options-sql-server.md)
106-
[sp_configure &#40;Transact-SQL&#41;](../../relational-databases/system-stored-procedures/sp-configure-transact-sql.md)
107-
[show advanced options Server Configuration Option](../../database-engine/configure-windows/show-advanced-options-server-configuration-option.md)
108-
[RECONFIGURE &#40;Transact-SQL&#41;](../../t-sql/language-elements/reconfigure-transact-sql.md)
109-
110-
21+
# Configure the recovery interval (min) server configuration option
22+
23+
[!INCLUDE [SQL Server](../../includes/applies-to-version/sqlserver.md)]
24+
25+
This article describes how to configure the **recovery interval (min)** server configuration option in [!INCLUDE[ssnoversion](../../includes/ssnoversion-md.md)] by using [!INCLUDE[ssManStudioFull](../../includes/ssmanstudiofull-md.md)] or [!INCLUDE[tsql](../../includes/tsql-md.md)]. The **recovery interval (min)** option defines an upper limit on the time recovering a database should take. The [!INCLUDE[ssDEnoversion](../../includes/ssdenoversion-md.md)] uses the value specified for this option to determine approximately how often to issue [automatic checkpoints](../../relational-databases/logs/database-checkpoints-sql-server.md) on a given database.
26+
27+
The default recovery-interval value is 0, which allows the [!INCLUDE[ssDE](../../includes/ssde-md.md)] to automatically configure the recovery interval. Typically, the default recovery interval results in automatic checkpoints occurring approximately once a minute for active databases and a recovery time of less than one minute. Higher values indicate the approximate maximum recovery time, in minutes. For example, setting the recovery interval to 3 indicates a maximum recovery time of approximately three minutes.
28+
29+
The setting takes effect immediately without restarting the server.
30+
31+
## Limitations and restrictions
32+
33+
The recovery interval affects only databases that use the default target recovery time (0). To override the server recovery interval on a database, configure a non-default target recovery time on the database. For more information, see [Change the Target Recovery Time of a Database (SQL Server)](../../relational-databases/logs/change-the-target-recovery-time-of-a-database-sql-server.md).
34+
35+
## Recommendations
36+
37+
This option is an advanced option and should be changed only by an experienced database administrator or certified [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] professional.
38+
39+
Typically, we recommend that you keep the recovery interval at 0, unless you experience performance problems. If you decide to increase the recovery-interval setting, we recommend increasing it gradually by small increments and evaluating the effect of each incremental increase on recovery performance.
40+
41+
If you use `sp_configure` to change the value of the **recovery interval (min)** option to more than 60 (minutes), specify `RECONFIGURE WITH OVERRIDE`. `WITH OVERRIDE` disables configuration value checking (for values that aren't valid or are nonrecommended values).
42+
43+
## Permissions
44+
45+
Execute permissions on `sp_configure` with no parameters or with only the first parameter are granted to all users by default. To execute `sp_configure` with both parameters to change a configuration option or to run the `RECONFIGURE` statement, a user must be granted the ALTER SETTINGS server-level permission. The ALTER SETTINGS permission is implicitly held by the **sysadmin** and **serveradmin** fixed server roles.
46+
47+
## Use SQL Server Management Studio
48+
49+
1. In Object Explorer, right-click server instance and select **Properties**.
50+
51+
1. Select the **Database settings** node.
52+
53+
1. Under **Recovery**, in the **Recovery interval (minutes)** box, type or select a value from 0 through 32767 to set the maximum amount of time, in minutes, that [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] should spend recovering each database at startup. The default is 0, indicating automatic configuration by [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)]. In practice, this means a recovery time of less than one minute and a checkpoint approximately every one minute for active databases.
54+
55+
## Use Transact-SQL
56+
57+
1. Connect to the [!INCLUDE[ssDE](../../includes/ssde-md.md)].
58+
59+
1. From the Standard bar, select **New Query**.
60+
61+
1. Copy and paste the following example into the query window and select **Execute**. This example shows how to use [sp_configure](../../relational-databases/system-stored-procedures/sp-configure-transact-sql.md) to set the value of the `recovery interval (min)` option to `3` minutes.
62+
63+
```sql
64+
USE AdventureWorks2019;
65+
GO
66+
EXEC sp_configure 'show advanced options', 1;
67+
GO
68+
RECONFIGURE;
69+
GO
70+
EXEC sp_configure 'recovery interval (min)', 3;
71+
GO
72+
RECONFIGURE;
73+
GO
74+
```
75+
76+
For more information, see [Server Configuration Options (SQL Server)](../../database-engine/configure-windows/server-configuration-options-sql-server.md).
77+
78+
## See also
79+
80+
- [Change the Target Recovery Time of a Database (SQL Server)](../../relational-databases/logs/change-the-target-recovery-time-of-a-database-sql-server.md)
81+
- [Database Checkpoints (SQL Server)](../../relational-databases/logs/database-checkpoints-sql-server.md)
82+
- [Server Configuration Options (SQL Server)](../../database-engine/configure-windows/server-configuration-options-sql-server.md)
83+
84+
## Next steps
85+
86+
- [sp_configure (Transact-SQL)](../../relational-databases/system-stored-procedures/sp-configure-transact-sql.md)
87+
- [show advanced options Server Configuration Option](../../database-engine/configure-windows/show-advanced-options-server-configuration-option.md)
88+
- [RECONFIGURE (Transact-SQL)](../../t-sql/language-elements/reconfigure-transact-sql.md)

0 commit comments

Comments
 (0)