DBA BANQ (Static URL of Queries)
1.
sp_helpdb
2.
sp_who2 active
3.
select * from sys.databases
4.
select * from sys.configurations
5.
select * from sys.dm_db_log_info(1) --- 1 is here Database ID
6.
SELECT sqlserver_start_time FROM sys.dm_os_sys_info
7.
select database_id,name, recovery_model_desc from sys.databases where database_id not in (1,2,3,4) order by recovery_model_desc
8. For WaitType Analysis
select * from sys.dm_os_wait_stats where wait_type in ('ASYNC_NETWORK_IO','PAGELATCH_SH','PAGELATCH_EX','PAGEIOLATCH_SH','PAGEIOLATCH_EX','IO_COMPLETION','WRITELOG','ASYNC_IO_COMPLETION','CxPACKET','HADR_FILESTREAM_IOMGR_IOCOMPLETION','OLEDB','MSSQL_XP','LCK_M_IX','LCK_M_X','LCK_M_U','SOS_SCHEDULAR_YIELD','DEADLOCK_ENUM_MUTEX')
9.
select * from msdb.dbo.log_shipping_monitor_error_detail order by log_time desc
10.
--SQL Server Error Log
EXEC xp_readerrorlog 0, 1, N'', N'', NULL, NULL, N'desc'
EXEC xp_readerrorlog 0, 1, N'', N'', NULL, NULL, N'desc'
--SQL Agent Error Log
EXEC xp_readerrorlog 0, 2, N'', N'', NULL, NULL, N'desc'
EXEC xp_readerrorlog 0, 2, N'', N'', NULL, NULL, N'desc'
Send mail to amitvaid2024@gmail.com if you wish to display your query here and share with others with your Name.
Best Regards
Amit Vaid
Note:- Earlier the name of this page was 'DBA Queries BANQ' Later renamed...on 13/Feb/2023.
No comments:
Post a Comment