I often encounter some questions about database optimization. I think this is the most basic skill requirement, especially the use of SQLServer2005. for SQL Server optimization, full-time or part-time DBAs are easier to work and more efficient, but many new users may not know much about them, I will write some basic introductions here.
I. First, I will introduce the two tools used to optimize data in
SQL Server skills: how to monitor and optimize OLAP Databases
It is very important to optimize the performance of online analysis and processing. Fortunately, some tools can help monitor and improve the operation of OLAP databases.
The Microsoft SQL Server Analysis Service (SSAS) provides a powerful engine used to cr
Sometimes you like your books. -- Feng Tang
1. The dead-lock event occurs in sqlserver, mainly because two threads occupy the exclusive lock of a resource respectively, and then the two threads obtain the exclusive lock of the resources owned by the other side. This causes dead-lock.
2. when encounters dead-lock, it selects one thread from two threads as the winner, the winner transaction is executed, the other thread will become the loser, and the loser transaction will be rollback, for loser,
unlocked unlocked not locked NOLOCK unlocked unlocked unlocked HOLDLOCK shared share share update UPDLOCK error update update TABLOCKX error Unlocked not Lock update other unlocked unlocked Unlocked update * Specifies that the NOLOCK hint will make the table specified with this hint read-only in cursor.16, use Profiler to track the query, get the time required to query, find out the problem of SQL; optimiz
a complete ORACLE11GR2 program is also an effective method, but this 64-bit version of the installation package has 2 multi-g, quite large, if only to establish a linked server, there is no need to install such a monster. In fact, we only need to download the ODAC compressed package on the Oracle official website.As to how to install ODAC, not the focus of this article, you can search for my other article
SQL Server 2008 R2, he was using SQL Server from Visual Studio 2010. I remember that there is no graphical interface, I asked him how to do the graphical operation, he said that the use of SQL Management Studio, the amount, this name and
During the project development process, the operation of the database is often encountered in the process of table structure, stored procedures and other modifications, when the general operation is done directly in SQL Server Enterprise Manager in the operation, or Query Analyzer to execute the relevant statements, and we in the actual application for security, Generally can be as few as possible to contac
The original: How the program ape solves SQL Server accounted for cpu100%Article Directory
Problems encountered
Monitoring the database using SQL Server Profiler
SQL1: Find the latest 30 alarm events
SQL2: Gets the current total number of alarm
module requires the PowerShell v3 environment. Manually download the Get-SqlServer-Escalate-CheckAccess.psml to any of the following two locations to complete the module installation:
%USERPROFILE%\\Documents\\Windows\\PowerShell\\Modules\\Get-SqlServer-Escalate-CheckAccess.psm1%WINDIR%\\System32\\Windows\\PowerShellv1.0\\Modules\\Get-SqlServer-Escalate-CheckAccess.psm1
Or use this command to import the module:
Import-Module c:\\temp\\Get-SqlServer-
even crashed when it fails to respond to low Windows Memory. Therefore, after "lock page in memory" is enabled, we need to limit the memory usage of the SQL Server Buffer Pool. As mentioned in Figure 2 above, we will not detail it here.
Another problem is that when buffer poolallocates memory through allocateuserphysicalpages, the memory occupied by sqlservr.exe that we see in the task manager only contai
Pool. As mentioned In Figure 2 above, we will not detail it here.
Another problem is that when Buffer poolallocates memory through allocateuserphysicalpages, the memory occupied by sqlservr.exe that we see in the task manager only contains the non-Data Cache part and MemToLeave part in the Buffer Pool, instead of Data cache.exe, it seems that sqlservr.exe can only occupy several hundred megabytes of memory and dozens of GB of memory. In this case, check the
cursor. Lock prompt read-only optimistic value optimistic row version control lock No prompt not locked update NOLOCK not locked HOLDLOCK sharing update UPDLOCK error Update TABLOCKX Error unlocked unlocked update other unlocked update * The specified NOLOCK prompt will make the table specified with this prompt read-only in the cursor.
16. Use Profiler to track the query, obtain the time required for the query, and locate the
sys.dm_exec_query_stats .If you want to have an overview of the time that is spent on SQL Server optimization, you can check:sys.dm_exec_query_optimizer_info . The time spent and the last overhead can be very useful.You can use the following DMVs to query the internal parallel query and its query text, execution plan:
Sys.dm_exec_cached_plan : Shows the cached query plans.
sys.dm_exec_requests
unlocked unlocked Unlocked update NOLOCK unlocked unlocked unlocked unlocked HOLDLOCK shared share share update UPDLOCK error update update update TABLOCKX error unlocked Fixed update other unlocked unlocked Unlocked update * Specifies that the NOLOCK prompt will cause the table specified for that hint to be read-only in Gianpene.
16, with Profiler to track the query, get the time required to find out the problem of
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.