-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathOPTIMIZE_DB.sql
50 lines (37 loc) · 1.29 KB
/
OPTIMIZE_DB.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*******************
option PAGE_VERIFY
CHECKSUM est plus performant :
référence :
https://dba-presents.com/index.php/databases/sql-server/22-checksum-vs-torn-page-detection-performance
*/
ALTER DATABASE CURRENT SET PAGE_VERIFY CHECKSUM;
/*****************************
AUTO_UPDATE_STATISTICS_ASYNC
****************************
Plus performant lorsque l'option auto_update_statistics_async est à ON
Référence :
https://sqlespresso.com/2017/10/25/synchronous-vs-asynchronously-statistics-updates/
*/
ALTER DATABASE CURRENT SET AUTO_UPDATE_STATISTICS_ASYNC ON WITH NO_WAIT;
/*******************
DELAYED_DURABILITY
******************
Référence :
https://www.sqlskills.com/blogs/paul/delayed-durability-sql-server-2014/
https://docs.microsoft.com/fr-fr/sql/relational-databases/logs/control-transaction-durability?view=sql-server-ver15
*/
ALTER DATABASE CURRENT SET DELAYED_DURABILITY = FORCED;
/*******************
AUTO_CLOSE
******************
référence :
https://blog.sqlauthority.com/2016/09/22/sql-server-set-auto_close-database-option-off-better-performance/
*/
ALTER DATABASE CURRENT SET AUTO_CLOSE OFF;
/*******************
AUTO_SHRINK
******************
référence :
https://techyaz.com/sql-server/performance-tuning/always-turn-off-database-auto-shrink/
*/
ALTER DATABASE CURRENT SET AUTO_SHRINK OFF;