Manjot
Manjot

Reputation: 11516

TSQL memory related queries

I need to find if /3GB switch and /PAE is enabled on a server.

Also, I want to know the size of page file and physical RAM on the server.

I can check them manually but how can I check them using TSQL on both SQL 2000 and SQL 2005?

Upvotes: 1

Views: 858

Answers (2)

Remus Rusanu
Remus Rusanu

Reputation: 294227

Use WMI:

To run WMI queries, use ExecuteWQL from the Policy Based Management framework (which you should be using anyway for the audit task you describe, see Administering Servers by Using Policy-Based Management).

PowerShell can also read WMI. Ultimately, WQL queries can be run straight from T-SQL using sp_OACreate and friends.

Upvotes: 2

Patrick Kafka
Patrick Kafka

Reputation: 9892

this looks like one http://sugeshkr.blogspot.com/2007/12/check-if-3gb-is-configured-or-not.html

 If(Select Virtual_Memory_In_Bytes/1024/(2048*1024) from Sys.dm_os_Sys_Info) < 1
Begin

PRINT '/3GB Switch Not Configured in Boot.Ini (CHECK)'

End

Upvotes: 0

Related Questions