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

Commit 1becaa0

Browse files
committed
updates for SQL 2016 not supporting sp_query_store_consistency_check
1 parent 865d513 commit 1becaa0

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

docs/relational-databases/performance/best-practice-with-the-query-store.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ FROM sys.database_query_store_options;
241241

242242
If the problem persists, it indicates corruption of the Query Store data is persisted on the disk.
243243

244-
Query Store could be recovered by executing **sp_query_store_consistency_check** stored procedure within the affected database.
244+
For SQL 2017 and later, Query Store can be recovered by executing the **sp_query_store_consistency_check** stored procedure within the affected database. For 2016, you will need to clear the data from the Query Store as shown below.
245245

246246
If that did not help, you can try to clear Query Store before requesting read-write mode.
247247

@@ -333,7 +333,7 @@ The global trace flags 7745 and 7752 can be used to improve availability of data
333333

334334
- Trace flag 7745 will prevent the default behavior where Query Store writes data to disk before [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] can be shut down. This means that Query Store data that has been collected but not been yet persisted to disk will be lost.
335335

336-
- Trace flag 7752 enables asynchronous load of Query Store. This allows a database to become online and queries to be executed before the Query Store has been fully recovered. The default behavior is to do synchoronous load of Query Store. The default behavior prevents queries from executing before the Query Store has been recovered but also prevents any queries from being missed in the data collection.
336+
- Trace flag 7752 enables asynchronous load of Query Store. This allows a database to become online and queries to be executed before the Query Store has been fully recovered. The default behavior is to do a synchronous load of Query Store. The default behavior prevents queries from executing before the Query Store has been recovered but also prevents any queries from being missed in the data collection.
337337

338338
> [!IMPORTANT]
339339
> If you are using Query Store for just in time workload insights in [!INCLUDE[ssSQL15](../../includes/sssql15-md.md)], plan to install the performance scalability fixes in [KB 4340759](https://support.microsoft.com/help/4340759) as soon as possible.

docs/relational-databases/system-catalog-views/sys-database-query-store-options-transact-sql.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ monikerRange: "=azuresqldb-current||>=sql-server-2016||= azure-sqldw-latest||=sq
3535
|**desired_state**|**smallint**|Indicates the desired operation mode of Query Store, explicitly set by user.<br /> 0 = OFF <br /> 1 = READ_ONLY<br /> 2 = READ_WRITE|
3636
|**desired_state_desc**|**nvarchar(60)**|Textual description of the desired operation mode of Query Store:<br />OFF<br />READ_ONLY<br />READ_WRITE|
3737
|**actual_state**|**smallint**|Indicates the operation mode of Query Store. In addition to list of desired states required by the user, actual state can be an error state.<br /> 0 = OFF <br /> 1 = READ_ONLY<br /> 2 = READ_WRITE<br /> 3 = ERROR|
38-
|**actual_state_desc**|**nvarchar(60)**|Textual description of the actual operation mode of Query Store.<br />OFF<br />READ_ONLY<br />READ_WRITE<br />ERROR<br /><br /> There are situations when actual state is different from the desired state:<br />- If the database is set to read-only mode or if Query Store size exceeds its configured quota, Query Store may operate in read-only mode even if read-write was specified by the user.<br />- In extreme scenarios Query Store can enter an ERROR state because of internal errors. If this happens, Query Store can be recovered by executing the `sp_query_store_consistency_check` stored procedure in the affected database.|
38+
|**actual_state_desc**|**nvarchar(60)**|Textual description of the actual operation mode of Query Store.<br />OFF<br />READ_ONLY<br />READ_WRITE<br />ERROR<br /><br /> There are situations when actual state is different from the desired state:<br />- If the database is set to read-only mode or if Query Store size exceeds its configured quota, Query Store may operate in read-only mode even if read-write was specified by the user.<br />- In extreme scenarios Query Store can enter an ERROR state because of internal errors. If this happens, for SQL 2017 and later, Query Store can be recovered by executing the `sp_query_store_consistency_check` stored procedure in the affected database. If running `sp_query_store_consistency_check` doesn't work and for SQL 2016, you will need to clear the data by running `ALTER DATABASE [YourDatabaseName] SET QUERY_STORE CLEAR ALL;`|
3939
|**readonly_reason**|**int**|When the **desired_state_desc** is READ_WRITE and the **actual_state_desc** is READ_ONLY, **readonly_reason** returns a bit map to indicate why the Query Store is in readonly mode.<br /><br /> **1** - database is in read-only mode<br /><br /> **2** - database is in single-user mode<br /><br /> **4** - database is in emergency mode<br /><br /> **8** - database is secondary replica (applies to Always On and [!INCLUDE[ssSDSfull](../../includes/sssdsfull-md.md)] geo-replication). This value can be effectively observed only on **readable** secondary replicas<br /><br /> **65536** - the Query Store has reached the size limit set by the MAX_STORAGE_SIZE_MB option.<br /><br /> **131072** - The number of different statements in Query Store has reached the internal memory limit. Consider removing queries that you do not need or upgrading to a higher service tier to enable transferring Query Store to read-write mode.<br />**Applies to:** [!INCLUDE[ssSDSfull](../../includes/sssdsfull-md.md)].<br /><br /> **262144** - Size of in-memory items waiting to be persisted on disk has reached the internal memory limit. Query Store will be in read-only mode temporarily until the in-memory items are persisted on disk. <br />**Applies to:** [!INCLUDE[ssSDSfull](../../includes/sssdsfull-md.md)].<br /><br /> **524288** - Database has reached disk size limit. Query Store is part of user database, so if there is no more available space for a database, that means that Query Store cannot grow further anymore.<br />**Applies to:** [!INCLUDE[ssSDSfull](../../includes/sssdsfull-md.md)]. <br /> <br /> To switch the Query Store operations mode back to read-write, see **Verify Query Store is Collecting Query Data Continuously** section of [Best Practice with the Query Store](../../relational-databases/performance/best-practice-with-the-query-store.md#Verify).|
4040
|**current_storage_size_mb**|**bigint**|Size of Query Store on disk in megabytes.|
4141
|**flush_interval_seconds**|**bigint**|The period for regular flushing of Query Store data to disk in seconds. Default value is **900** (15 min).<br /><br /> Change by using the `ALTER DATABASE <database> SET QUERY_STORE (DATA_FLUSH_INTERVAL_SECONDS = <interval>)` statement.|

0 commit comments

Comments
 (0)