MSSQL Server运维常用SQL命令

1、数据库连接数

select name, state, state_desc from sys.databases;

查询结果:

2、数据库状态

select name, state, state_desc from sys.databases;

查询结果:

3、数据文件状态

select a.name, b.physical_name, b.state, b.state_desc from sys.databases as a, sys.master_files as b where a.database_id = b.database_id;

 

4、平均每秒事务数TPS

5、 缓存命中率

SELECT (a.cntr_value * 1.0 / b.cntr_value) * 100.0 as BufferCacheHitRatio FROM sys.dm_os_performance_counters a JOIN (SELECT cntr_value, OBJECT_NAME FROM sys.dm_os_performance_counters WHERE counter_name = 'Buffer cache hit ratio base' AND OBJECT_NAME = 'SQLServer:Buffer Manager') b ON a.OBJECT_NAME = b.OBJECT_NAME WHERE a.counter_name = 'Buffer cache hit ratio' AND a.OBJECT_NAME = 'SQLServer:Buffer Manager'

6、平均每秒SQL编译数

select cntr_value from sys.dm_os_performance_counters where counter_name = 'SQL Compilations/sec';

7、平均每秒SQL重编译数

select cntr_value from sys.dm_os_performance_counters where counter_name = 'Lock Requests/sec'and instance_name = '_Total';

8、每秒全表扫描数

 select cntr_value from sys.dm_os_performance_counters where counter_name = 'Full Scans/sec';

9、平均每秒batch数

select cntr_value from sys.dm_os_performance_counters where counter_name = 'Batch Requests/sec';

10、每秒用户错误数

select cntr_value from sys.dm_os_performance_counters where counter_name = 'Errors/sec' and instance_name = '_Total';

11、每秒锁等待次数

select cntr_value from sys.dm_os_performance_counters where counter_name = 'Lock Waits/sec'and instance_name = '_Total';

12、’每秒锁请求次数

select cntr_value from sys.dm_os_performance_counters where counter_name = 'Lock Requests/sec'and instance_name = '_Total';

13、每秒锁超时次数

select cntr_value from sys.dm_os_performance_counters where counter_name = 'Lock Timeouts/sec'and instance_name = '_Total';

14、每秒锁死次数

select cntr_value from sys.dm_os_performance_counters where counter_name = 'Lock Requests/sec'and instance_name = '_Total';

15、查看死锁

SELECT request_session_id spid,OBJECT_NAME(resource_associated_entity_id)tableName FROM sys.dm_tran_locks WHERE resource_type='OBJECT ';

16、杀死死锁

Kill pid

17、显示死锁相关信息

exec sp_who2 pid

18、死锁跟踪

select * from sys.dm_xe_sessions where name = 'system_health'

SELECT

xed.value('@timestamp','datetime')as Creation_Date,  

xed.query('.')AS Extend_Event  

FROM

(  

SELECT CAST([target_data] AS XML)AS Target_Data  

FROM sys.dm_xe_session_targets AS xt  

INNER JOIN sys.dm_xe_sessions AS xs  

ON xs.address= xt.event_session_address  

WHERE xs.name=N'system_health'  

AND xt.target_name=N'ring_buffer'

) AS XML_Data  

CROSS APPLY Target_Data.nodes('RingBufferTarget/event[@name="xml_deadlock_report"]')AS XEventData(xed)  

ORDER BY Creation_Date DESC

19、每秒检查点写入Page数

select cntr_value from sys.dm_os_performance_counters where counter_name = 'Checkpoint pages/sec';

20、Lazy Writes/sec

select * from sys.dm_os_performance_counters where counter_name = 'Lazy writes/sec';

21、Always on 状态

select a.name, b.database_state, b.database_state_desc from sys.databases as a, sys.dm_hadr_database_replica_states as b where a.database_id = b.database_id and b.is_local=1;

22、慢查询

步骤一、---先清除sql server的缓存

 dbcc freeProcCache

SELECT creation_time N'语句编译时间'

,last_execution_time N'上次执行时间'

,total_physical_reads N'物理读取总次数'

,total_logical_reads/execution_count N'每次逻辑读次数'

,total_logical_reads N'逻辑读取总次数'

,total_logical_writes N'逻辑写入总次数'

,execution_count N'执行次数'

,total_worker_time/1000 N'所用的CPU总时间ms'

,total_elapsed_time/1000 N'总花费时间ms'

,(total_elapsed_time / execution_count)/1000 N'平均时间ms'

,SUBSTRING(st.text, (qs.statement_start_offset/2) + 1,

((CASE statement_end_offset

WHEN -1 THEN DATALENGTH(st.text)

ELSE qs.statement_end_offset END

- qs.statement_start_offset)/2) + 1) N'执行语句'

FROM sys.dm_exec_query_stats AS qs

CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) st

where SUBSTRING(st.text, (qs.statement_start_offset/2) + 1,

((CASE statement_end_offset

WHEN -1 THEN DATALENGTH(st.text)

ELSE qs.statement_end_offset END

- qs.statement_start_offset)/2) + 1) not like '%fetch%'

ORDER BY total_elapsed_time / execution_count DESC;

步骤二、正在执行的慢查询语句

SELECT  TOP 1 ST.transaction_id AS TransactionID ,

        st.session_id ,

        DB_NAME(DT.database_id) AS DatabaseName ,

        ses.host_name ,

        ses.login_name ,

        ses.status,

        AT.transaction_begin_time AS TransactionStartTime ,

        s.text ,

        c.connect_time ,

        DATEDIFF(second, AT.transaction_begin_time, GETDATE()) "exec_time(s)" ,

        DATEDIFF(minute, AT.transaction_begin_time, GETDATE()) AS Tran_run_time ,

        CASE AT.transaction_type

          WHEN 1 THEN 'Read/Write Transaction'

          WHEN 2 THEN 'Read-Only Transaction'

          WHEN 3 THEN 'System Transaction'

          WHEN 4 THEN 'Distributed Transaction'

        END AS TransactionType ,

        CASE AT.transaction_state

          WHEN 0 THEN 'Transaction Not Initialized'

          WHEN 1 THEN 'Transaction Initialized & Not Started'

          WHEN 2 THEN 'Active Transaction'

          WHEN 3 THEN 'Transaction Ended'

          WHEN 4 THEN 'Distributed Transaction Initiated Commit Process'

          WHEN 5 THEN 'Transaction in Prepared State & Waiting Resolution'

          WHEN 6 THEN 'Transaction Committed'

          WHEN 7 THEN 'Transaction Rolling Back'

          WHEN 8 THEN 'Transaction Rolled Back'

        END AS TransactionState

FROM    sys.dm_tran_session_transactions AS ST

        INNER JOIN sys.dm_tran_active_transactions AS AT ON ST.transaction_id = AT.transaction_id

        INNER JOIN sys.dm_tran_database_transactions AS DT ON ST.transaction_id = DT.transaction_id

        LEFT JOIN sys.dm_exec_connections AS C ON st.session_id = c.session_id

        LEFT JOIN sys.dm_exec_sessions AS ses ON c.session_id = ses.session_id

        CROSS APPLY sys.dm_exec_sql_text(c.most_recent_sql_Handle) s

WHERE   DATEDIFF(second, AT.transaction_begin_time, GETDATE()) > 2

步骤三、排查历史慢查询语句

SELECT TOP 20

  [Total IO] = (qs.total_logical_reads + qs.total_logical_writes)

  , [Average IO] = (qs.total_logical_reads + qs.total_logical_writes) /

                                            qs.execution_count

  , qs.execution_count

  , SUBSTRING (qt.text,(qs.statement_start_offset/2) + 1,    

  ((CASE WHEN qs.statement_end_offset = -1

    THEN LEN(CONVERT(NVARCHAR(MAX), qt.text)) * 2

    ELSE qs.statement_end_offset

    END - qs.statement_start_offset)/2) + 1) AS [Individual Query]

  , qt.text AS [Parent Query]

  , DB_NAME(qt.dbid) AS DatabaseName

  , qp.query_plan

FROM sys.dm_exec_query_stats qs

CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) as qt

CROSS APPLY sys.dm_exec_query_plan(qs.plan_handle) qp

ORDER BY [Average IO]  DESC

或者:

use master

-- SELECT * FROM dbo.sysprocesses WHERE spid IN (SELECT blocked FROM dbo.sysprocesses where blocked <> 0);

SELECT

    es.session_id,

    database_name=DB_NAME(er.database_id),

    er.cpu_time,

    er.reads,

    er.writes,

    er.logical_reads,

    login_name,

    er.status,

    blocking_session_id,

    wait_type,

    wait_resource,

    wait_time,

    individual_query=SUBSTRING(qt.text,(er.statement_start_offset/2)+1,((CASE  WHEN  er.statement_end_offset=-1 THEN  LEN(CONVERT(NVARCHAR(MAX),qt.text))* 2 ELSE   er.statement_end_offset  END-er.statement_start_offset)/2)+1),

    parent_query=qt.text,

    program_name,

    host_name,

    nt_domain,

    start_time,

    DATEDIFF(MS,er.start_time,GETDATE())as duration,

    (SELECT  query_plan  FROM  sys.dm_exec_query_plan (er.plan_handle))AS  query_plan

FROM

    sys.dm_exec_requests er

    INNER  JOIN  sys.dm_exec_sessions  es  ON er.session_id=es.session_id

    CROSS  APPLY  sys.dm_exec_sql_text (er.sql_handle)AS  qt

WHERE

    es.session_id> 50         

    AND  es.session_Id  NOT  IN(@@SPID)

ORDER BY

1, 2

说明:

logical_reads:逻辑读,衡量语句的执行开销。如果大于10w,说明此语句开销很大。可以检查下索引是否合理

status:进程的状态。running 表示正在运行,sleeping 表示处于睡眠中,未运行任何语句,suspend 表示等待,runnable 等待cpu 调度

blocking_session_id: 如果不为0,例如 60 。表示52号进程正在被60阻塞。50 进程必须等待60执行完成,才能执行下面的语句

host_name :发出请求的服务器名

program_name:发出请求的应用程序名

duration: 请求的执行时间

23、最耗CPU的回话SQL查询语法

SELECT TOP 10

[session_id],

[request_id],

 [start_time] AS '开始时间',

[status] AS '状态',

[command] AS '命令',

dest.[text] AS 'sql语句',

DB_NAME([database_id]) AS '数据库名',

[blocking_session_id] AS '正在阻塞其他会话的会话ID',

[wait_type] AS '等待资源类型',

[wait_time] AS '等待时间',

[wait_resource] AS '等待的资源',

[reads] AS '物理读次数',

[writes] AS '写次数',

[logical_reads] AS '逻辑读次数',

[row_count] AS '返回结果行数'

FROM sys.[dm_exec_requests] AS der

CROSS APPLY

sys.[dm_exec_sql_text](der.[sql_handle]) AS dest

WHERE [session_id]>50 AND DB_NAME(der.[database_id])='DB_name'  -- DB_name 根据自己写

ORDER BY [cpu_time] DESC

---------------------

SELECT TOP 10

   total_worker_time/execution_count AS avg_cpu_cost, plan_handle,

  

   execution_count,

  

   (SELECT SUBSTRING(text, statement_start_offset/2 + 1,

  

      (CASE WHEN statement_end_offset = -1

  

         THEN LEN(CONVERT(nvarchar(max), text)) * 2

  

         ELSE statement_end_offset

      END - statement_start_offset)/2)

   FROM sys.dm_exec_sql_text(sql_handle)) AS query_text

FROM sys.dm_exec_query_stats

  

ORDER BY [avg_cpu_cost] DESC

24、查看具体的CPU耗时SQL

SELECT TOP 10

dest.[text] AS 'sql语句'

 FROM sys.[dm_exec_requests] AS der

CROSS APPLY

sys.[dm_exec_sql_text](der.[sql_handle]) AS dest

WHERE [session_id]>50  

ORDER BY [cpu_time] DESC

25、查看CPU数和user scheduler数和最大工作线程数,检查worker是否用完也可以排查CPU占用情况

 --查看CPU数和user scheduler数目

SELECT cpu_count,scheduler_count FROM sys.dm_os_sys_info

--查看最大工作线程数

SELECT max_workers_count FROM sys.dm_os_sys_info

26、查看CPU占用高的语句

SELECT TOP 10

    total_worker_time/execution_count AS avg_cpu_cost, plan_handle,

    execution_count,

    (SELECT SUBSTRING(text, statement_start_offset/2 + 1,

       (CASE WHEN statement_end_offset = -1

          THEN LEN(CONVERT(nvarchar(max), text)) * 2

         ELSE statement_end_offset

       END - statement_start_offset)/2)

     FROM sys.dm_exec_sql_text(sql_handle)) AS query_text

 FROM sys.dm_exec_query_stats

 ORDER BY [avg_cpu_cost] DESC;

27、查询正在执行的语句

SELECT     [Spid] = session_Id, ecid, [Database] = DB_NAME(sp.dbid),

 [User] = nt_username, [Status] = er.status,

 [Wait] = wait_type,

 [Individual Query] = SUBSTRING(qt.text, er.statement_start_offset / 2, (CASE WHEN er.statement_end_offset = - 1 THEN LEN(CONVERT(NVARCHAR(MAX), qt.text))

                      * 2 ELSE er.statement_end_offset END - er.statement_start_offset) / 2),

                       [Parent Query] = qt.text,

                       Program = program_name, Hostname,

                       nt_domain, start_time

FROM    

     sys.dm_exec_requests er INNER JOIN  sys.sysprocesses sp ON er.session_id = sp.spid

     CROSS APPLY sys.dm_exec_sql_text(er.sql_handle) AS qt

WHERE     session_Id > 50 /* Ignore system spids.*/ AND session_Id NOT IN (@@SPID)

或者用下面的SQL语句排查:

SELECT  [Spid] = session_id ,

            ecid ,

            [Database] = DB_NAME(sp.dbid) ,

            [User] = nt_username ,

            [Status] = er.status ,

            [Wait] = wait_type ,

            [Individual Query] = SUBSTRING(qt.text,

                                           er.statement_start_offset / 2,

                                           ( CASE WHEN er.statement_end_offset = -1

                                                  THEN LEN(CONVERT(NVARCHAR(MAX), qt.text))

                                                       * 2

                                                  ELSE er.statement_end_offset

                                             END - er.statement_start_offset )

                                           / 2) ,

            [Parent Query] = qt.text ,

            Program = program_name ,

            hostname ,

            nt_domain ,

            start_time

    FROM    sys.dm_exec_requests er

            INNER JOIN sys.sysprocesses sp ON er.session_id = sp.spid

            CROSS APPLY sys.dm_exec_sql_text(er.sql_handle) AS qt

    WHERE   session_id > 50 -- Ignore system spids.

            AND session_id NOT IN ( @@SPID ) -- Ignore this current statement.

ORDER BY    1 ,

            2

28、查询数据库连接情况

select client_net_address '客户端IP',local_net_address '服务器的IP',* from sys.dm_exec_connections

SELECT * FROM sys.[sysprocesses] WHERE [spid]>50 --AND DB_NAME([dbid])='gposdb'

29、查看连接对象

select client_net_address '客户端IP',local_net_address '服务器的IP',* from sys.dm_exec_connections

SELECT * FROM sys.[sysprocesses] WHERE [spid]>50 --AND DB_NAME([dbid])='gposdb'

30、查看索引是否丢失

SELECT

     DatabaseName = DB_NAME(database_id)

     ,[Number Indexes Missing] = count(*)

 FROM sys.dm_db_missing_index_details

 GROUP BY DB_NAME(database_id)

 ORDER BY 2 DESC;

 SELECT  TOP 10

         [Total Cost]  = ROUND(avg_total_user_cost * avg_user_impact * (user_seeks + user_scans),0)

         , avg_user_impact

         , TableName = statement

         , [EqualityUsage] = equality_columns

         , [InequalityUsage] = inequality_columns

         , [Include Cloumns] = included_columns

 FROM        sys.dm_db_missing_index_groups g

 INNER JOIN    sys.dm_db_missing_index_group_stats s

        ON s.group_handle = g.index_group_handle

 INNER JOIN    sys.dm_db_missing_index_details d

        ON d.index_handle = g.index_handle

 ORDER BY [Total Cost] DESC;

31、查找持续时间最长的查询

SELECT

   DB_NAME(dbid) 'Database Name',

   physical_name 'File Location',

   NumberReads 'Number of Reads',

   BytesRead 'Bytes Read',

   NumberWrites 'Number of Writes',

   BytesWritten 'Bytes Written',   

   IoStallReadMS 'IO Stall Read',

   IoStallWriteMS 'IO Stall Write',

   IoStallMS as 'Total IO Stall (ms)'

FROM

   fn_virtualfilestats(NULL,NULL) fs INNER JOIN

    sys.master_files mf ON fs.dbid = mf.database_id

    AND fs.fileid = mf.file_id

ORDER BY

   DB_NAME(dbid);

32、排查连接对象

SELECT [session_id],

[request_id],

[start_time] AS '开始时间',

[status] AS '状态',

[command] AS '命令',

dest.[text] AS 'sql语句',

DB_NAME([database_id]) AS '数据库名',

[blocking_session_id] AS '正在阻塞其他的ID',

[wait_type] AS '等待资源类型',

[wait_time] AS '等待时间',

[wait_resource] AS '等待的资源',

[reads] AS '物理读次数',

[writes] AS '写次数',

[logical_reads] AS '逻辑读次数',

[row_count] AS '返回结果行数'

FROM sys.[dm_exec_requests] AS der

CROSS APPLY

sys.[dm_exec_sql_text](der.[sql_handle]) AS dest

WHERE [session_id]>50

ORDER BY [cpu_time] DESC;

33、查看占用较大的SQL语句

SELECT TOP 10

dest.[text] AS 'sql语句'

FROM sys.[dm_exec_requests] AS der

CROSS APPLY

sys.[dm_exec_sql_text](der.[sql_handle]) AS dest

WHERE [session_id]>50

ORDER BY [cpu_time] DESC;

如果SQLServer存在等待的SQL查询,执行下面的查询语句就会显示出会话中有多少个worker在等待

SELECT TOP 50

 [session_id],

 [request_id],

 [cpu_time],

 [start_time] AS '开始时间',

 [status] AS '状态',

 [command] AS '命令',

 dest.[text] AS 'sql语句',

 DB_NAME([database_id]) AS '数据库名',

 [blocking_session_id] AS '正在阻塞其他会话的会话ID',

 der.[wait_type] AS '等待资源类型',

 [wait_time] AS '等待时间',

 [wait_resource] AS '等待的资源',

 [dows].[waiting_tasks_count] AS '当前正在进行等待的任务数',

 [reads] AS '物理读次数',

 [writes] AS '写次数',

 [logical_reads] AS '逻辑读次数',

 [row_count] AS '返回结果行数'

 FROM sys.[dm_exec_requests] AS der

 INNER JOIN [sys].[dm_os_wait_stats] AS dows

 ON der.[wait_type]=[dows].[wait_type]

 CROSS APPLY

 sys.[dm_exec_sql_text](der.[sql_handle]) AS dest

 WHERE [session_id]>50

 ORDER BY [cpu_time] DESC

34、CPU占用高的SQL

SELECT total_worker_time/execution_count AS avg_cpu_cost, plan_handle,

   execution_count,

   (SELECT SUBSTRING(text, statement_start_offset/2 + 1,

      (CASE WHEN statement_end_offset = -1

         THEN LEN(CONVERT(nvarchar(max), text)) * 2

         ELSE statement_end_offset

      END - statement_start_offset)/2)

   FROM sys.dm_exec_sql_text(sql_handle)) AS query_text

FROM sys.dm_exec_query_stats

ORDER BY [avg_cpu_cost] DESC;

 

35、CPU调度程序在磁盘上等待的查询

SELECT  COUNT(*) Schedulers,

        AVG(work_queue_count) AS [Avg Work Queue Count],

        AVG(pending_disk_io_count) AS [Avg Pending DiskIO Count],

        SUM(work_queue_count) AS [SUM Work Queue Count],

        SUM(pending_disk_io_count) AS [SUM Pending DiskIO Count]

FROM sys.dm_os_schedulers WITH (NOLOCK)

WHERE scheduler_id < 255;

36、CPU调用过去一小时的详细信息

DECLARE @ms_ticks_now BIGINT

SELECT @ms_ticks_now = ms_ticks

FROM sys.dm_os_sys_info;

SELECT TOP 60 record_id

    ,dateadd(ms, - 1 * (@ms_ticks_now - [timestamp]), GetDate()) AS EventTime

    ,[SQLProcess (%)]

    ,SystemIdle

    ,100 - SystemIdle - [SQLProcess (%)] AS [OtherProcess (%)]

FROM (

    SELECT record.value('(./Record/@id)[1]', 'int') AS record_id

        ,record.value('(./Record/SchedulerMonitorEvent/SystemHealth/SystemIdle)[1]', 'int') AS SystemIdle

        ,record.value('(./Record/SchedulerMonitorEvent/SystemHealth/ProcessUtilization)[1]', 'int') AS [SQLProcess (%)]

        ,TIMESTAMP

    FROM (

        SELECT TIMESTAMP

            ,convert(XML, record) AS record

        FROM sys.dm_os_ring_buffers

        WHERE ring_buffer_type = N'RING_BUFFER_SCHEDULER_MONITOR'

            AND record LIKE '%<SystemHealth>%'

        ) AS x

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/bicheng/46920.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

TCP连接如何确保可靠性

TCP通过序列号、确认应答、超时重传、数据校验、流量控制、拥塞控制等机制&#xff0c;确保了数据传输的可靠性和效率。 序列号&#xff1a;每个TCP段都有一个序列号&#xff0c;代表了数据流中的字节位置。 通过序列号&#xff0c;接收方可以检测数据包是否丢失或重复&#…

03MFC画笔/画刷/画椭圆/圆/(延时)文字

文章目录 画实心矩形自定义画布设计及使用连续画线及自定义定义变量扇形画椭圆/圆输出颜色文本定时器与定时事件画实心矩形 自定义画布设计及使用 连续画线及自定义定义变量 扇形 画椭圆/圆 输出颜色文本

【图像】图像识别经典算法

图像识别经典算法 一、图像识别基础二、经典图像识别算法1. Haar-like Features AdaBoost (Viola-Jones)2. SIFT (Scale-Invariant Feature Transform)3. SURF (Speeded-Up Robust Features)4. HOG (Histogram of Oriented Gradients)5. CNN (Convolutional Neural Networks) …

尚品汇-(十六)

目录 商品详情功能开发 &#xff08;1&#xff09;搭建service-item &#xff08;2&#xff09;获取sku基本信息与图片信息 &#xff08;3&#xff09;获取分类信息&#xff08;查看三级分类&#xff09; 商品详情功能开发 &#xff08;1&#xff09;搭建service-item 点…

「UCD」浅谈蓝湖Figma交互设计对齐

在现代数字产品的设计和开发过程中,选择合适的工具对于提高团队效率和保证产品质量至关重要。本文将从开发和设计两个不同的角度,探讨蓝湖和Figma两款流行工具的优势与不足,并提出结论和建议。 开发研发视角:蓝湖 优点: 清晰的设计规范:蓝湖为开发工程师提供了清晰的设计…

Gradio:快速构建机器学习Web应用的神奇工具

文章目录 引言官网链接原理基础使用安装 Gradio创建一个简单的 Gradio 应用 高级使用自定义界面集成到现有Web应用中 优缺点优点缺点 总结 引言 Gradio 是一个基于 Python 的库&#xff0c;它极大地简化了将机器学习模型转化为交互式Web应用的过程。无需深入了解Web开发或后端…

状态管理的艺术:探索Flutter的Provider库

状态管理的艺术&#xff1a;探索Flutter的Provider库 前言 上一篇文章中&#xff0c;我们详细介绍了 Flutter 应用中的状态管理&#xff0c;以及 StatefulWidget 和 setState 的使用。 本篇我们继续介绍另一个实现状态管理的方式&#xff1a;Provider。 Provider优缺点 基…

【阶乘】个人练习-Leetcode-LCP 22. 黑白方格画

题目链接&#xff1a;https://leetcode.cn/problems/ccw6C7/description/ 题目大意&#xff1a;给出一块白方格面积为n*n&#xff0c;给出一个数字k&#xff0c;每一次操作可以把方格的某一整行或者某一整列涂黑&#xff0c;求使得黑色格子数字为k的【最终图案】的个数。 思路…

MySQL 分库分表

分表 分表 将表按照某种规则拆分成多个表。 分表的使用原因 当数据量超大的时候&#xff0c;B-Tree索引效果很变差。 垂直分区 切分原则&#xff1a;把不常用或存储内容比较多的字段分到新的表中可使表存储更多数据。 原因&#xff0c;Innodb主索引叶子节点存储着当前行的所有信…

Linux抽象套接字

在UNIX和类UNIX系统中,socket编程提供了一种机制,允许进程之间进行通信。其中,UNIX域套接字(UNIX domain socket)是一种特殊的套接字,用于同一台机器上的进程间通信(IPC)。UNIX域套接字可以使用两种类型的地址:路径名套接字(pathname socket)和抽象套接字(abstract…

笔记 2 : 课本第 3 章开始,记录 arm 的汇编指令的格式

&#xff08;13&#xff09; 介绍 arm 中的第一个汇编指令的用法 mov &#xff1a; &#xff08;14&#xff09;立即数的概念&#xff1a; &#xff08;15&#xff09; 汇编中的移位写法&#xff1a; 举例 &#xff1a; &#xff08;16&#xff09; 学习一个新的指令 cmp &a…

网络监控工具推荐与对比

网络监控工具在确保网络安全、性能和可用性方面发挥着关键作用。以下是几款流行的网络监控工具的推荐与对比&#xff1a; 1. Nagios 特点&#xff1a; 开放源代码&#xff1a;提供免费的社区版本和付费的企业版本。可扩展性&#xff1a;拥有大量插件&#xff0c;可以监控各种…

芯课堂 | Synwit_UI_Creator(ugui)平台之PC端界面设计篇

​今天小编给大家介绍的是华芯微特面向小尺寸TFT-LCD屏驱市场量身打造的Synwit_UI_Creator&#xff08;ugui&#xff09;自研开发套件。 UI_Creator&#xff08;ugui&#xff09;开发套件分为上位机和下位机&#xff0c;以下如无特指&#xff0c;上位机即为PC端设计器/仿真器&…

虚拟机及其Debian(kali)安装

本机电脑为Windows10系统专业版&#xff0c;在此基础上安装VMware和系统&#xff08;Kali&#xff09; 步骤如下 一、安装 VMware Workstation Pro v16.2.4 安装步骤可参照网上博客&#xff0c;该步骤较简单&#xff0c;此处不做讲解。文件中共计两个&#xff0c;其中一个是激活…

【闲聊】-Perl的基础语法

Perl语言详细介绍 概述 Perl&#xff0c;全称“Practical Extraction and Report Language”&#xff0c;是一种功能强大的编程语言&#xff0c;特别擅长文本处理和系统自动化任务。它最初由Larry Wall于1987年设计&#xff0c;旨在解决UNIX系统管理中的常见问题&#xff0c;…

拆分整数 java

拆分整数 给定一个正整数 n &#xff0c;将其拆分为 k 个 正整数 的和&#xff08; k > 2 &#xff09;&#xff0c;并使这些整数的乘积最大化。 返回 你可以获得的最大乘积 。 示例 1: 输入: n 2输出: 1解释: 2 1 1, 1 1 1。 示例 2: 输入: n 10输出: 36解释: 10 3 …

关于不同集合类型是否重写equals和hashCode的问题

不同集合类型在没有重写 equals 和 hashCode 时的行为&#xff1a; HashSet 和 HashMap: 这些集合依赖于对象的 hashCode 方法来定位元素&#xff0c;然后使用 equals 方法来确认元素是否真的相等。 如果你没有重写 equals 和 hashCode&#xff0c;那么默认的 equals 方法将基…

【ProtoBuf】在 Windows / Linux 安装 ProtoBuf(超详细教程)

一、ProtoBuf 在 Window 下的安装 1、下载 ProtoBuf 编译器 下载地址&#xff1a;github.com 可以不用下载最新版本&#xff0c;具体的下载根据自己电脑情况选择。 下载之后将压缩包解压到本地目录下。解压后的文件内包含 bin、include 文件&#xff0c;以及一个 readme.txt…

基于SSM框架的宠物领养系统【附源码和运行步骤】

基于SSM框架的宠物领养系统 一、项目介绍用户模块宠物模块领养模块管理员模块 二、项目技术栈三、项目运行四、项目演示用户领养界面管理员界面 总结 大家好&#xff0c;这里是程序猿代码之路&#xff01;在当今社会&#xff0c;宠物已经成为许多家庭的重要成员&#xff0c;带给…

如何解决手机游戏因IP代理被封禁无法正常游戏的问题?

在当前的网络环境下&#xff0c;许多手机游戏为了维护游戏的公平性和安全性&#xff0c;会采取措施对使用IP代理的玩家进行封禁&#xff0c;导致他们无法正常访问游戏。这种情况对于一些需要使用IP代理的用户来说可能显得很棘手&#xff0c;但实际上有几种技术性的解决方案可以…