SQL Server常用到的几个设置选项

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了SQL Server常用到的几个设置选项相关的知识,希望对你有一定的参考价值。

1. SET DEADLOCK_PRIORITY
  2. SET LOCK_TIMEOUT
  3.@@LOCK_TIMEOUT
  4.SET IDENTITY_INSERT
  5.SET IMPLICIT_TRANSACTIONS
  6.SET NOCOUNT
  7.@@ROWCOUNT
  8.SET ROWCOUNT
  9.SET TRANSACTION ISOLATION LEVEL
  10.SET XACT_ABORT
  1. SET DEADLOCK_PRIORITY
  说明:控制在发生死锁情况时会话的反应方式。如果两个进程都锁定数据,并且直到其它进程释放自己的锁时,每个进程才能释放自己的锁,即发生死锁情况。
  语法:SET DEADLOCK_PRIORITY LOW | NORMAL | @deadlock_var
  参数:LOW 指定当前会话为首选死锁牺牲品。Microsoft® SQL Server™ 自动回滚死锁牺牲品的事务,并给客户端应用程序返回 1205 号死锁错误信息。
  NORMAL 指定会话返回到默认的死锁处理方法。
  @deadlock_var 是指定死锁处理方法的字符变量。如果指定 LOW,则 @deadlock_var 为 3;如果指定 NORMAL,则 @deadlock_var 为 6。
  注释:SET DEADLOCK_PRIORITY 的设置是在执行或运行时设置,而不是在分析时设置。
  权限:SET DEADLOCK_PRIORITY 权限默认授予所有用户。
  2. SET LOCK_TIMEOUT
  说明:指定语句等待锁释放的毫秒数。
  语法:SET LOCK_TIMEOUT timeout_period
  参数:timeout_period 是在 Microsoft® SQL Server™ 返回锁定错误前经过的毫秒数。值为 -1(默认值)时表示没有超时期限(即无限期等待)。
  当锁等待超过超时值时,将返回错误。值为 0 时表示根本不等待,并且一遇到锁就返回信息。
  注释:在连接开始时,该设置的值为 -1。设置更改后,新设置在其余的连接时间里一直有效。
  SET LOCK_TIMEOUT 的设置是在执行或运行时设置,而不是在分析时设置。
  READPAST 锁定提示为该 SET 选项提供了另一种方式。
  权限:SET LOCK_TIMEOUT 权限默认授予所有用户。
参考技术A

没完全理解你的意思,你可以通过:

SELECT * FROM sys.configurations AS c

取得SQL 的配置项目

configuration_id name value minimum maximum value_in_use description is_dynamic is_advanced
101 recovery interval (min) 0 0 32767 0 Maximum recovery interval in minutes 1 1
102 allow updates 0 0 1 0 Allow updates to system tables 1 0
103 user connections 0 0 32767 0 Number of user connections allowed 0 1
106 locks 0 5000 2147483647 0 Number of locks for all users 0 1
107 open objects 0 0 2147483647 0 Number of open database objects 0 1
109 fill factor (%) 0 0 100 0 Default fill factor percentage 0 1
114 disallow results from triggers 0 0 1 0 Disallow returning results from triggers 1 1
115 nested triggers 1 0 1 1 Allow triggers to be invoked within triggers 1 0
116 server trigger recursion 1 0 1 1 Allow recursion for server level triggers 1 0
117 remote access 1 0 1 1 Allow remote access 0 0
124 default language 0 0 9999 0 default language 1 0
400 cross db ownership chaining 0 0 1 0 Allow cross db ownership chaining 1 0
503 max worker threads 0 128 32767 0 Maximum worker threads 0 1
505 network packet size (B) 4096 512 32767 4096 Network packet size 1 1
518 show advanced options 0 0 1 0 show advanced options 1 0
542 remote proc trans 0 0 1 0 Create DTC transaction for remote procedures 1 0
544 c2 audit mode 0 0 1 0 c2 audit mode 0 1
1126 default full-text language 1033 0 2147483647 1033 default full-text language 1 1
1127 two digit year cutoff 2049 1753 9999 2049 two digit year cutoff 1 1
1505 index create memory (KB) 0 704 2147483647 0 Memory for index create sorts (kBytes) 1 1
1517 priority boost 0 0 1 0 Priority boost 0 1
1519 remote login timeout (s) 20 0 2147483647 20 remote login timeout 1 0
1520 remote query timeout (s) 600 0 2147483647 600 remote query timeout 1 0
1531 cursor threshold -1 -1 2147483647 -1 cursor threshold 1 1
1532 set working set size 0 0 1 0 set working set size 0 1
1534 user options 0 0 32767 0 user options 1 0
1535 affinity mask 0 -2147483648 2147483647 0 affinity mask 1 1
1536 max text repl size (B) 65536 -1 2147483647 65536 Maximum size of a text field in replication. 1 0
1537 media retention 0 0 365 0 Tape retention period in days 1 1
1538 cost threshold for parallelism 5 0 32767 5 cost threshold for parallelism 1 1
1539 max degree of parallelism 0 0 1024 0 maximum degree of parallelism 1 1
1540 min memory per query (KB) 1024 512 2147483647 1024 minimum memory per query (kBytes) 1 1
1541 query wait (s) -1 -1 2147483647 -1 maximum time to wait for query memory (s) 1 1
1543 min server memory (MB) 0 0 2147483647 16 Minimum size of server memory (MB) 1 1
1544 max server memory (MB) 2147483647 16 2147483647 2147483647 Maximum size of server memory (MB) 1 1
1545 query governor cost limit 0 0 2147483647 0 Maximum estimated cost allowed by query governor 1 1
1546 lightweight pooling 0 0 1 0 User mode scheduler uses lightweight pooling 0 1
1547 scan for startup procs 0 0 1 0 scan for startup stored procedures 0 1
1548 awe enabled 0 0 1 0 AWE enabled in the server 0 1
1549 affinity64 mask 0 -2147483648 2147483647 0 affinity64 mask 1 1
1550 affinity I/O mask 0 -2147483648 2147483647 0 affinity I/O mask 0 1
1551 affinity64 I/O mask 0 -2147483648 2147483647 0 affinity64 I/O mask 0 1
1555 transform noise words 0 0 1 0 Transform noise words for full-text query 1 1
1556 precompute rank 0 0 1 0 Use precomputed rank for full-text query 1 1
1557 PH timeout (s) 60 1 3600 60 DB connection timeout for full-text protocol handler (s) 1 1
1562 clr enabled 0 0 1 0 CLR user code execution enabled in the server 1 0
1563 max full-text crawl range 4 0 256 4 Maximum  crawl ranges allowed in full-text indexing 1 1
1564 ft notify bandwidth (min) 0 0 32767 0 Number of reserved full-text notifications buffers 1 1
1565 ft notify bandwidth (max) 100 0 32767 100 Max number of full-text notifications buffers 1 1
1566 ft crawl bandwidth (min) 0 0 32767 0 Number of reserved full-text crawl buffers 1 1
1567 ft crawl bandwidth (max) 100 0 32767 100 Max number of full-text crawl buffers 1 1
1568 default trace enabled 1 0 1 1 Enable or disable the default trace 1 1
1569 blocked process threshold (s) 0 0 86400 0 Blocked process reporting threshold 1 1
1570 in-doubt xact resolution 0 0 2 0 Recovery policy for DTC transactions with unknown outcome 1 1
1576 remote admin connections 0 0 1 0 Dedicated Admin Connections are allowed from remote clients 1 0
1577 common criteria compliance enabled 0 0 1 0 Common Criteria compliance mode enabled 0 1
1578 EKM provider enabled 0 0 1 0 Enable or disable EKM provider 0 1
1579 backup compression default 0 0 1 0 Enable compression of backups by default 1 0
1580 filestream access level 0 0 2 0 Sets the FILESTREAM access level 1 0
1581 optimize for ad hoc workloads 0 0 1 0 When this option is set, plan cache size is further reduced for single-use adhoc OLTP workload. 1 1
1582 access check cache bucket count 0 0 65536 0 Default hash bucket count for the access check result security cache 1 1
1583 access check cache quota 0 0 2147483647 0 Default quota for the access check result security cache 1 1
16384 Agent XPs 0 0 1 0 Enable or disable Agent XPs 1 1
16385 SQL Mail XPs 0 0 1 0 Enable or disable SQL Mail XPs 1 1
16386 Database Mail XPs 0 0 1 0 Enable or disable Database Mail XPs 1 1
16387 SMO and DMO XPs 1 0 1 1 Enable or disable SMO and DMO XPs 1 1
16388 Ole Automation Procedures 0 0 1 0 Enable or disable Ole Automation Procedures 1 1
16390 xp_cmdshell 0 0 1 0 Enable or disable command shell 1 1
16391 Ad Hoc Distributed Queries 0 0 1 0 Enable or disable Ad Hoc Distributed Queries 1 1
16392 Replication XPs 0 0 1 0 Enable or disable Replication XPs 1 1

请教ac68u梅林固件里的几个选项是啥意思

参考技术A 朋友您好,很高兴为您解答问题 请把问题补充完整 大家才能给你提供完善的建议 相信您在知道这个平台 一定会有满意的收获 真诚希望能够帮助您,如果满意请采纳,祝您好运常伴。

以上是关于SQL Server常用到的几个设置选项的主要内容,如果未能解决你的问题,请参考以下文章

MySQL 常用到的几个字符处理函数

测试工作中经常用到的几个Linux命令(第一弹)

MySQL中经常用到实用的几种SQL语句

sql plus中常用的几个命令

magic method细解python一直让我疑惑的几个常用魔法方法(上)

关于position定位中的几个注意点