Collecting SQL Server 2000/2005/2008 baseline

  • Comments posted to this topic are about the item Collecting SQL Server 2000/2005/2008 baseline

  • Just change column physical_memory_in_bytes with [physical_memory_kb/1048.576]!! otherwise it'll generate some blood!:-D

  • What version of sql server id you run it against?

  • What we are actually doing with that line of code is converting bytes to MB.

    1024bytes = 1Kb

    1024Kb = 1MB

    therefore; 1MB = (1024 * 1024) = 1048576

    Hence the "physical_memory_in_bytes/1048576" Column being displayed as (physical_memory_in_bytes/1048576) as 'PhysicalMemoryMB'

    You can tweak it to show you in GB or KB or bytes. It's totally up to you.

    No Bloods yet:::

    :-D:-):-D:-):-D;-)

  • Hi,

    unfortunately neither sys.sysdatabases nor sys.databases (or even DATABASEPROPERTYX) can provide any usefull information regarding if the database is subscribed or not. (See Book Online).

    If you want to check this part you should use something like this:

    USE DB

    DECLARE @replication_role NVARCHAR(15) = ''''

    IF OBJECT_ID(''dbo.MSreplication_objects'') IS NOT NULL

    SET @replication_role = ''Subscriber''

    You can wrap up the code into sp_MSforeachdb.

  • Hi, I'm using SQL Server 2014!

    The column name is [[highlight=#ffff11]physical_memory_kb[/highlight]]! There's no column [physical_memory_in_bytes] in sys.dm_os_sys_info;

    Here are all the columns in the DMV sys.dm_os_sys_info

    cpu_ticks

    ms_ticks

    cpu_count

    hyperthread_ratio

    physical_memory_kb

    virtual_memory_kb

    committed_kb

    committed_target_kb

    visible_target_kb

    stack_size_in_bytes

    os_quantum

    os_error_mode

    os_priority_class

    max_workers_count

    scheduler_count

    scheduler_total_count

    deadlock_monitor_serial_number

    sqlserver_start_time_ms_ticks

    sqlserver_start_time

    affinity_type

    affinity_type_desc

    process_kernel_time_ms

    process_user_time_ms

    time_source

    time_source_desc

    virtual_machine_type

    virtual_machine_type_desc

  • Great script, thanks!

  • Jorge Serres (5/18/2014)


    Just change column physical_memory_in_bytes with [physical_memory_kb/1048.576]!! otherwise it'll generate some blood!:-D

    I am running SQL Server Enterprise 2012 SP1. I just changed the line in the quote above and it was good to go.

    Thanks for the great script Patrick!

  • Thanks for the script.

Viewing 9 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic. Login to reply