Label:For space reasons, AlwaysOn availability groups are split into two parts: theoretical and actual. The actual combat component was then disassembled for preparation and the AlwaysOn availability Group was built. Three articles of the respective links: SQL Server->> high Availability and disaster recovery (HADR) technology-AlwaysOn (theory)
(note that the output is reformatted to make it easier to read ):
From this output, you can see that I have a parameterized cache plan that is executed twice and each EXEC statement is executed once.
Use parameterized query to save resources and optimize performance
Before a statement can be executed, each T-SQL statement needs to be evaluated and an execution plan needs to be created. Creating an executio
-------------------------------------------------------------------------------------------------------2 49152 (@ salesorderid INT) Select sum (linetotal) as linetotalFrom adventureworks. Sales. salesorderheader HJoin adventureworks. Sales. salesorderdetail D on D. salesorderid = H. salesorderidWhere H. salesorderid = @ salesorderid
From this output, you can see that I have a parameterized cache plan that is executed twice and each exec statement is executed once.
Use parameterized
T-SQL query advanced-understanding the lock introduction in SQL Server, each query will find the shortest path to achieve their goals. If the database only accepts one connection, only one query is executed at a time. Therefore, q
server environment in which it is actually applied. As the resource requirements evolve, SQL Server automatically adjusts itself.If you have questions about this, you can run the same query repeatedly on a server that is heavily loaded, and in most cases, the time it takes
statement is running slowly and the system has a performance problem)Session-Wait type: The horizontal axis is the wait type, and the ordinate is the waiting quantity.(This example: there is a lot of waiting in the system, indicating that the system has a performance problem)
Understanding System Execution Metrics (CPU, memory, disk counters)
Diagnose the system for bottlenecks and resource bottlenecks with 3 main counters.
Und
Recently encountered in the work, SQL Server 2012 can not put the core of the CPU all the problem, believe that many people have encountered this problem, so today this section first to say how this problem arises.First introduce the environment of the serverWindows R2 Enterprise Edition (X64) + Microsoft SQL
1. Use SET STATISTICS TIME ON
-- First clear the cache
Dbcc dropcleanbuffers;
Dbcc freeproccache;
-- Run
Set statistics time on;
SELECT orderid, custid, empid, shipperid, orderdate, filler
FROM dbo. Orders
WHERE orderdate> = '123'
AND orderdate
Set statistics time off;
GO
You will get a similar message:
SQL Server Analysis and Compilation Time:
CPU time = 15 m
Label:When we read and write database files, these process activities trigger some run-time events when a file is read, written, or an error occurs. From a user's point of view, some of the time will be concerned about these events, especially our debugging, audit, service maintenance. For example, when database errors occur, column data is updated, CPU usage is high
The recent use of SQL Server in project-on-line usage has found that frequent updates and frequent queries cause deadlocks in high concurrency situations. Usually we know that if two transactions are inserting or modifying data on a table at the same time, it will occur when the X lock on the table is requested and h
multiple execution plans. Some parameters of the memory grant estimate are stored in the compilation plan, and it itself has a mechanism for calculating the amount of memory that needs to be granted to the query when it is actually executed. Memory User (consumers) A successfully executed query consists of three primary memory users: compilation, caching, and memory grant. Compiling: Creating and in hundr
through these operations usually have an initial delay. After the initial delay, such queries can usually return records quickly.
Query with response time requirements should not be specific. For example, the response time for executing order-by using an index is shorter than that for sorting. The next section describes this in detail. Create an index for the order-by/group-by/distinct column to shorten the response time
Order-by, group-by, and di
The resource usage of the server has been high. Please analyze it for a moment. Thank you-general Linux technology-Linux technology and application information. For more information, see the following. Cpu % men %
44 75.8
40 75.6
25 75.4
17 75.1
15 73.1
4 73.4
This is the percentage of
SQL Server High-availability scenarios Scenario One:asynchronous Mirror + AliasProgram IntroductionThe database server configures an asynchronous mirroring relationship, and the program client connection string configures the alias connection.1. Create an alias in the SQL
problem is about restoring the database.2.44% of the problem is about connecting to a remote server.1.91% of the problem is about database backup.1.91% of problems are related to dates, such as sorting by dates.1.49% of the questions are about database user roles and permissions.In addition to the high-frequency problems mentioned above, they also include: database, data table design, cross tabulation, dat
Document directory
2. 1. Export data from the table to a file (using trusted connections)
2. export data from the table to a file (using Hybrid Authentication)
2. 3. Import the data in the file to the table
0. References:
SQL Server BCP usage Summary
BCP Utility
How to import data from 6 million users to MySQL, MSSQL, and Oracle databases in a community
Sele
Today, someone told me that the memory on the Linux server is not fast enough, 128G of memory, will be used up immediately. I was startled, the application on this server is now very small, ah, how the utilization will be very high. First use Zabbix to see the next, memory remaining space is still very big, there is 117G of spare ah. Then log on to the
procedures. Although Service Broker can be used entirely within SQL Server, Ado.net knows how to communicate with Service Broker to trigger this mechanism and retrieve notifications from service Broker.
Note When data in SQL Server changes, the query notification allows you
Background: Please leave the case and listen to the feedback from the platform team. When importing some data to the production database, the client access times out, the initial positioning is that the IO usage on the server disk is too high, and the IO will soar to 100% during data import. As a result, many slow query
of deleteDelete does not completely free up space, will it cause space leakage? You don't have to worry about it, but these pages will be reused when the tables are inserted into the new data, although they are not released. So these pages are not "leaked" and will be left to SQL Server for reuse.If you really want to use the DELETE statement, if the table has a clustered index, rebuild the index can be fr
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.