SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Collecting SQL Server 2000/2005/2008 baseline


Collecting SQL Server 2000/2005/2008 baseline

Author
Message
akhamoshioke
akhamoshioke
SSC Veteran
SSC Veteran (264 reputation)SSC Veteran (264 reputation)SSC Veteran (264 reputation)SSC Veteran (264 reputation)SSC Veteran (264 reputation)SSC Veteran (264 reputation)SSC Veteran (264 reputation)SSC Veteran (264 reputation)

Group: General Forum Members
Points: 264 Visits: 468
Comments posted to this topic are about the item Collecting SQL Server 2000/2005/2008 baseline
Jorge Serres
Jorge Serres
SSC-Enthusiastic
SSC-Enthusiastic (136 reputation)SSC-Enthusiastic (136 reputation)SSC-Enthusiastic (136 reputation)SSC-Enthusiastic (136 reputation)SSC-Enthusiastic (136 reputation)SSC-Enthusiastic (136 reputation)SSC-Enthusiastic (136 reputation)SSC-Enthusiastic (136 reputation)

Group: General Forum Members
Points: 136 Visits: 201
Just change column physical_memory_in_bytes with [physical_memory_kb/1048.576]!! otherwise it'll generate some blood!:-D
akhamoshioke
akhamoshioke
SSC Veteran
SSC Veteran (264 reputation)SSC Veteran (264 reputation)SSC Veteran (264 reputation)SSC Veteran (264 reputation)SSC Veteran (264 reputation)SSC Veteran (264 reputation)SSC Veteran (264 reputation)SSC Veteran (264 reputation)

Group: General Forum Members
Points: 264 Visits: 468
What version of sql server id you run it against?
akhamoshioke
akhamoshioke
SSC Veteran
SSC Veteran (264 reputation)SSC Veteran (264 reputation)SSC Veteran (264 reputation)SSC Veteran (264 reputation)SSC Veteran (264 reputation)SSC Veteran (264 reputation)SSC Veteran (264 reputation)SSC Veteran (264 reputation)

Group: General Forum Members
Points: 264 Visits: 468
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;-)
Robert_sqlapprenticeDOTnet
Robert_sqlapprenticeDOTnet
SSC-Enthusiastic
SSC-Enthusiastic (169 reputation)SSC-Enthusiastic (169 reputation)SSC-Enthusiastic (169 reputation)SSC-Enthusiastic (169 reputation)SSC-Enthusiastic (169 reputation)SSC-Enthusiastic (169 reputation)SSC-Enthusiastic (169 reputation)SSC-Enthusiastic (169 reputation)

Group: General Forum Members
Points: 169 Visits: 341
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.
Jorge Serres
Jorge Serres
SSC-Enthusiastic
SSC-Enthusiastic (136 reputation)SSC-Enthusiastic (136 reputation)SSC-Enthusiastic (136 reputation)SSC-Enthusiastic (136 reputation)SSC-Enthusiastic (136 reputation)SSC-Enthusiastic (136 reputation)SSC-Enthusiastic (136 reputation)SSC-Enthusiastic (136 reputation)

Group: General Forum Members
Points: 136 Visits: 201
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
Summer90
Summer90
SSChampion
SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)

Group: General Forum Members
Points: 12925 Visits: 3899
Great script, thanks!
zuma-1122451
zuma-1122451
Forum Newbie
Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)

Group: General Forum Members
Points: 6 Visits: 66
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!
Iwas Bornready
Iwas Bornready
SSC-Dedicated
SSC-Dedicated (31K reputation)SSC-Dedicated (31K reputation)SSC-Dedicated (31K reputation)SSC-Dedicated (31K reputation)SSC-Dedicated (31K reputation)SSC-Dedicated (31K reputation)SSC-Dedicated (31K reputation)SSC-Dedicated (31K reputation)

Group: General Forum Members
Points: 31964 Visits: 885
Thanks for the script.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum







































































































































































SQLServerCentral


Search