In a previous essay, simply mention the isolation level in SQL Server. The isolation level of SQL Server is implemented through the locking mechanism. Now go deeper and talk about locks in SQL
only use 1 GB of memory)
Layer-3 memory allocation for SQL Server OS
The memory allocation of SQL Server OS is divided into three levels, as shown in dependency 4.
Figure 4. SQL Server
system authentication mode no longer requires storing passwords. Storing passwords is one of the major vulnerabilities of applications that use standard SQL Server logins. To install the Windows System authentication mode in SQL Server Enterprise Manager, follow these steps:
1) Expand the
. Usually the simple wait state is: pageiolatch_x.(3), according to the execution plan, scan or seek the memory of the data page, the execution needs to process the records to find out. This step requires a variety of locks to be applied to enable transaction isolation. Usually causes blocking, which begins with Lck_.(4), instructions may also have to do some connection or calculation work (SUM, max, sort, etc.)This step mainly uses the CPU.(5), depen
Once installed, you can download the SQL Server Management Studio (SSMS) tool from the following address, which is an integrated environment for accessing, configuring, controlling, managing, and developing all of the components of SQL Server. SSMS combines a number of graphical tools with a rich scripting editor to en
code that runs only one thread at a time. The latch itself is a special version of a critical section, because it allows for multiple concurrent read operations. In the context of SQL Server This means that multiple threads can concurrently read a shared data structure, such as an in-memory page, but the write-shared structure must be a single thread. A latch is used to coordinate the physical execution of
[Database] blocking and deadlock 5 analysis summary of the above analysis, if the database application developer or administrator wants to affect the SQL Server lock application and release behavior, to alleviate the blocking or deadlock problem, consider the following factors: 1. select the transaction isolation level. The higher the transaction
Foundation Build.
· Automatic Updates: SQL Server is integrated with Microsoft Update for security updates. MySQL does not have automatic update patching.
High effectiveness
SQL Server provides the highest level of effectiveness. Always on (always online) technology provides a comprehensive enterprise-class choice
is not null condition put auditLogout to Cain.D, two different fields or statements result in a full table scan. For example where M=1 orN=1. If you create an index that is M and N, it also causes scan, and the workaround is to index m and N separately. Test the table of 120,000 data, the index error is set up in the case of IO overhead10.xxx, after the index is set, all become 0.003, the contrast is very huge. Although it can cause performance problems with the insert operation, most of the bo
in the scope of the user session,
Can be in the scope of a routine that creates an object (stored procedure, trigger, function).
1. User-defined tables, indexes
2. system tables, indexes
3. Global temporary tables, indexes
4. Local temporary table, index
5. Table variables
6. Tables returned in table-valued functions
Internal objects: is created as needed by the SQL Server database engine to proc
A few days ago "read" "Sqlserver2005 Advanced Program Design" and "The introduction of SQL Server 2008 Programming Classic (3rd edition)," The two translations of the Chinese version of the book. found that the directory structure is roughly the same, the content of the explanation is almost the same. There is suspicion of plagiarism. See the "Transaction and lock" in the one, found that even the small exam
install the Windows authentication mode in SQL Server Enterprise Manager, use the following procedure:
1) Expand the server group.2 Right click on the server, and then click Properties.3 in the authentication of the Security tab, click Windows only.
4. Isolate your server a
and return data .) The second parameter limits the recursive level of the stored procedure. The default value is zero or all levels. The third parameter indicates that the Stored Procedure contains files. The default value is zero or only for the folder. Value 1 indicates the file that contains the result set. Defining a value not zero for the third parameter will add a line to the output call file, which is a small file that is displayed in a folder
this code in resources.
Generally, when we use SQL statements, SQL Server automatically chooses an appropriate lock mode and range based on the type of SQL statement, such as SELECT, Update, and the resources used.
But sometimes we need finer control over locking behavior, so we can change the behavior of locks by lo
, to minimize the logic of the transaction process, early to commit or roll back the transaction;2 Set the deadlock timeout parameter to a reasonable range, such as: 3 minutes-10 minutes, over time, automatically give up the operation, to avoid process suspension;3 optimization program, check and avoid deadlock phenomenon;4. All scripts and SPS should be carefully tested before it is the version.5 All SPS must have error handling (via @error)6 generally do not modify the default level of
these steps:1) Expand the server group.2) Right-click the server and click Properties.3) on the Security tab, click Windows only.4. Isolate your server and regularly back upPhysical and logical isolation forms the foundation of SQL Serv
improve the performance.
DECLARE @Query VARCHAR(100)SET @Query = 'SELECT * FROM Sales.Customers WHERE contactname = @contactname'EXECUTE sp_executesql @Query,N'@contactname VARCHAR(50)',@contactname = 'Allen, Michael'
TRY-CATCH for Exception Handling
After SQL Server 2005, exception handling is supported. If exception statements are checked and processed, exceptions will not cause more code to consume more
Xp_create_subdir
The xp_create_subdir stored procedure introduced in SQL Server 2005 is very lightweight because you can use it to create folders on the SQL server hard disk or from a network share within the T-SQL.
Exec xp_create_subdir 'C: \ MSSQL \ data'
Xp_delete_fil
), storage locations, and how to decide which one to choose for use;
10. What are the isolation levels and default levels of SQLServer, what are the major lock types of databases, and how row version control is implemented;
11. How to track deadlocks; how to track and find blocking; how to process problematic statements; what events should we track when using Pro
introduces two ways to troubleshoot blocking. A few days ago, the company Server-side have components, suspected because of the composition of exception-handling do not thoughtful, resulting in rare special exception occurs, let SQL Server transaction did not execute to cmmmit or rollback, causing some tables or records are "locked" (LO CK) ". Then there was a l
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.