Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Common SQL accumulation in sybase database

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Scenario 1:user connection is configured with 1500, and it is found in the database log that the error connection has been used up. It is necessary to locate which machine or user has generated a large number of connections.

SQL statement:

Select * from (select b.name counts from master..sysprocesses a. Hostname where a.suid=b.suid group by name,hostname,program_name a.programmatic name where a.suid=b.suid group by name,hostname,program_name a. Programmatic name where a.suid=b.suid group by name,hostname,program_name count (*) tmp order by counts desc) tmp order by counts desc

Scenario 2: view long-running statements in the database

SQL:select datediff (mi,starttime, getdate ()) as time, * from master..syslogshold

Scenario 3: view the configuration of a parameter

Method 1: sp_confiugre "parameter name"

Method 2: use the following SQL statement to query:

Select b.name, c.value,c.memory_used, c.minimum_value, c.maximum_value, c.defvalue,c.unit

From master.dbo.sysconfigures b, master.dbo.syscurconfigs c

Where b.config*=c.config and parentaries fragment 19 and b.config > 100 and name like'% parameter name fragment%'

Order by name

Scenario 4: view parameter configuration and historical usage

-- full configuration: sp_monitorconfig 'all'

-- single parameter: sp_monitorconfig "parameter name"

Scenario 5: view memory usage of stored procedures

Dbcc traceon (3604)

Dbcc memusage

Dbcc traceoff (3604)

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report