您的位置:首页 > 数据库

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

2009-02-27 16:46 190 查看
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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: