在sql server中一些有用的的系统储存过程

To view the current server activity
USE master
EXEC sp_who

To view the data space information for a database

USE examsysdb
EXEC sp_spaceused 'TB_PagePersistenceInfo'

To view the log space information for a database

use master
select * from sysperfinfo

To view general statistics about SQL Server activity and usage
USE master
EXEC sp_monitor

For each column, the statistic is printed in the form number(number)-number% or number(number). The first number refers to the number of seconds (for cpu_busy, io_busy, and idle) or the total  number (for the other variables) since SQL Server was restarted. The number in parentheses refers  to the number of seconds or total number since the last time sp_monitor was run. The percentage   is the percentage of time since sp_monitor was last run. For example, if the report shows cpu_busy   as 4250(215)-68%, the CPU has been busy 4250 seconds since SQL Server was last started up,    215 seconds since sp_monitor was last run, and 68 percent of the total time since sp_monitor  was last run.

Reports the account, the type of account, the privilege level of the account, the mapped login name of the account, and the permission path by which an account has access to Microsoft® SQL Server™.
USE master
exec xp_logininfo

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值