Thursday, September 19, 2013

[MS SQL Server] DB Size

[MS SQL Server] DB Size


DB Size

Posted: 19 Sep 2013 01:41 AM PDT

Why is the database size different than the physical file size? The general page of the database show 12000MB. If I browse to the location of the MDF, it is 8192000KB. Why don't these match? This is an example DB, the rest of my DB's are the same, but not quite as much of a discrepancy.Thanks,

wait stats precentage?

Posted: 26 Sep 2012 10:41 PM PDT

Hi,[code="sql"]WITH Waits AS(SELECT wait_type, wait_time_ms / 1000. AS wait_time_s,100. * wait_time_ms / SUM(wait_time_ms) OVER() AS pct,ROW_NUMBER() OVER(ORDER BY wait_time_ms DESC) AS rnFROM sys.dm_os_wait_stats WITH (NOLOCK)WHERE wait_type NOT IN (N'CLR_SEMAPHORE',N'LAZYWRITER_SLEEP',N'RESOURCE_QUEUE',N'SLEEP_TASK',N'SLEEP_SYSTEMTASK',N'SQLTRACE_BUFFER_FLUSH',N'WAITFOR', N'LOGMGR_QUEUE',N'CHECKPOINT_QUEUE', N'REQUEST_FOR_DEADLOCK_SEARCH',N'XE_TIMER_EVENT',N'BROKER_TO_FLUSH',N'BROKER_TASK_STOP',N'CLR_MANUAL_EVENT',N'CLR_AUTO_EVENT',N'DISPATCHER_QUEUE_SEMAPHORE', N'FT_IFTS_SCHEDULER_IDLE_WAIT',N'XE_DISPATCHER_WAIT', N'XE_DISPATCHER_JOIN', N'SQLTRACE_INCREMENTAL_FLUSH_SLEEP',N'ONDEMAND_TASK_QUEUE', N'BROKER_EVENTHANDLER', N'SLEEP_BPOOL_FLUSH',-- DIRTY_PAGE_POLL, HADR_FILESTREAM_IOMGR_IOCOMPLETION, and SP_SERVER_DIAGNOSTICS_SLEEP are SQL 2012 onlyN'DIRTY_PAGE_POLL', N'HADR_FILESTREAM_IOMGR_IOCOMPLETION', N'SP_SERVER_DIAGNOSTICS_SLEEP'))SELECT W1.wait_type, CAST(W1.wait_time_s AS DECIMAL(12, 2)) AS wait_time_s,CAST(W1.pct AS DECIMAL(12, 2)) AS pct,CAST(SUM(W2.pct) AS DECIMAL(12, 2)) AS running_pctFROM Waits AS W1INNER JOIN Waits AS W2ON W2.rn <= W1.rnGROUP BY W1.rn, W1.wait_type, W1.wait_time_s, W1.pctHAVING SUM(W2.pct) - W1.pct < 99 OPTION (RECOMPILE); -- percentage threshold[/code]output values for exapmle wait type is CXPACKET,Here which precentage should be consider? pct or running pct.wait type - CXPACKETWAITTIME - 305.65precentage - 1.85Running precentage - 91.39

how to insert powershell values into sql server table

Posted: 18 Sep 2013 09:44 PM PDT

Hi,I am looking to find way to hold values in my sql table. actually i have powershell script it is returning some values, but i want to save those values into my table.can anyone have any idea on it. please help me out.Thanks

No comments:

Post a Comment

Search This Blog