How to get hardware related metrics of SQL Server through query ?
Hi Folks,
I am newbie to the SQL Server programming. I also follow this forum only now. I am not sure if these kind of question had been asked in the past. Let me furnish you more detail about my query. I do like
to get few details regarding the SQL server. I do need the following details to get the information about it through query
SQL Server Installation directory
No. Of CPU(as i read SQL Server standard support 4 cpu and Enterprise support 32 CPU)
CPU Speed of the SQL Server installed machine
Disk Storage details
Operating system on which the SQL Server is installed
Location of the swap file of SQL Server
TempDB directory path
System database directory path
User database location
Log files location
I do like to get information like this through query. Can i know if such information can be get through query or it should be get only thro' WMI. Please drop your ideas in getting these details.
Thanks in Advance,
Regards,
JeiSurya
Try this query in the below link
http://gallery.technet.microsoft.com/Query-to-find-all-the-8fa765e6
you will get the SQL Server and H/W Details like
IP Address
FQDN
CurrentSQLNodeName
SQL Instance Name
SQL Server Product
SQL Server Edition
Service Pack
SQL Server Version
Operating System
OS SP Level
OS Build Number
SystemManufacturer
Processor Type
System Model
Total RAM in MB
NumberOfPhysicalCPUs
NumberOfCoresInEachCPU
TotalNumberOfCores
NumberOfLogicalCPUs
Similar Messages
-
How to create user defined metrics for SQL Server target?
The customer is not able to create a user defined metrics for SQL Server target.
This is very important for him to use this product.
He is asking how to create user defined metrics?
I sent him Note 304952.1 How to Create a User-Defined SQL Metric in EM 10g Grid Control
But it would work for an Oracle DB, but his target is SQL Server DB
Not able to find the "User-Defined Metrics" link from Database home page.
How to create user defined metrics for SQL Server target?http://download-uk.oracle.com/docs/cd/B14099_19/manage.1012/b16241/Monitoring.htm
-
There are links on the pages for various Cummulative Updates for SQL Compact v3.5 SP2 which look to relate to the desktop version, but are these also available for Windows Mobile devices? If so, what is the process to get hold of them?
We are seeing intermittent problems with corrupted databases on devices which are using SQL Compact v3.5 SP2 and have seen that some of the Cumulative Updates do relate to corruption and would like to see if these can help to solve the issue.Just select the KB article, at the top of each there is a link to request a hotfix, you will then get a email with a download link. The 8088 and 8109 hotfixes also apply to Windows Mobile.
http://erikej.blogspot.dk/2010/08/sql-server-compact-35-sp2-downloadable.html
Please mark as answer, if this was it. Visit my SQL Server Compact blog http://erikej.blogspot.com -
How to get Database creation history in sql server
I have delete one database on my server, I want to know what was the MDF path for that Deleted database do we have any way to get that .?
Regards Vikas PathakHello,
Once you delete the database SQL Server keeps information temporarily on the default trace about who deleted a database,
the name of the database (or object), at what time and the transaction number among the information provided. However, the default trace does not provide information about the location of the database files deleted.
Hope this helps.
Regards,
Alberto Morillo
SQLCoffee.com -
How to get Listener Information using PL/SQL code
How to get Listener Information using PL/SQL code
user2075318 wrote:
How to get Listener Information using PL/SQL codeThis approach (somewhat of a hack) can be used - but it does not really provide meaningful data at application layer.
SQL> create or replace function TnsPing( ipAddress varchar2, port number default 1521 ) return varchar2 is
2 type THexArray is table of varchar2(2);
3 --// tnsping packet (should be 10g and 11g listener compatible)
4 TNS_PING_PACKET constant THexArray := new THexArray(
5 '00', '57', '00', '00', '01', '00', '00', '00',
6 '01', '39', '01', '2C', '00', '00', '08', '00',
7 '7F', 'FF', '7F', '08', '00', '00', '01', '00',
8 '00', '1D', '00', '3A', '00', '00', '00', '00',
9 '00', '00', '00', '00', '00', '00', '00', '00',
10 '00', '00', '00', '00', '00', '00', '00', '00',
11 '00', '00', '00', '00', '00', '00', '00', '00',
12 '00', '00', '28', '43', '4F', '4E', '4E', '45',
13 '43', '54', '5F', '44', '41', '54', '41', '3D',
14 '28', '43', '4F', '4D', '4D', '41', '4E', '44',
15 '3D', '70', '69', '6E', '67', '29', '29'
16 );
17
18 socket UTL_TCP.connection;
19 txBytes number;
20 rxBytes number;
21 rawBuf raw(1024);
22 resp varchar2(1024);
23 begin
24 socket := UTL_TCP.open_connection(
25 remote_host => ipAddress,
26 remote_port => port,
27 tx_timeout => 10
28 );
29
30 --// convert hex array into a raw buffer
31 for i in 1..TNS_PING_PACKET.Count loop
32 rawBuf := rawBuf || HexToRaw( TNS_PING_PACKET(i) );
33 end loop;
34
35 --// send packet
36 txBytes := UTL_TCP.write_raw( socket, rawBuf, TNS_PING_PACKET.Count );
37
38 --// read response
39 rxBytes := UTL_TCP.read_raw( socket, rawBuf, 1024 );
40
41 UTL_TCP.close_connection( socket );
42
43 --// convert response to varchar2
44 resp := UTL_RAW.Cast_To_Varchar2( rawBuf );
45
46 --// strip the header from the response and return the text only
47 return( substr(resp,13) );
48 end;
49 /
Function created.
SQL>
SQL> select tnsping( '10.251.93.30' ) as TNSPING from dual;
TNSPING
(DESCRIPTION=(TMP=)(VSNNUM=169869568)(ERR=0)(ALIAS=LISTENER))
SQL> select tnsping( '10.251.95.69' ) as TNSPING from dual;
TNSPING
(DESCRIPTION=(TMP=)(VSNNUM=0)(ERR=0)(ALIAS=LISTENER))
SQL> -
How to delete number (00) in a SQL Server column ?
how to delete number (00) in a SQL Server column ?
example :
column : Births before Births
after
199900
1999
198200
1982
200400
2004
help queryYou use REPLACE function to selectively replace text inside a string in SQL Server. The REPLACE function is easy to use and very handy with an UPDATE statement.
SELECT Replace(births, '00', '')
or
update .....
Also you can use STUFF()
This function can be used for delete a certain length of the string and insert a new string in the deleted place.
Select STUFF ('199900', 5, 2, '')
--result 1900,1982,....
Ahsan Kabir Please remember to click Mark as Answer and Vote as Helpful on posts that help you. This can be beneficial to other community members reading the thread. http://www.aktechforum.blogspot.com/ -
How to get the absolute path of logicalhost server domain on Windows Sun
i am reading a file from Xsql Folder, that is located in the logicalhost Sun\AppServer\domains\domain1\applications\j2ee-apps.(IN Sun Application Server)
I am pretty sure that using the absolute path will solve this issue, so my first question is: How to get the absolute path of logicalhost server domain on Windows?
i tried with System.getProperty("com.sun.aas.instanceRoot").
but i am able to retrive Sun\AppServer\domains\domain1 upto this .i am unable to retrive Sun\AppServer\domains\domain1\applications\j2ee-apps.
please suggest me how u can get absolute path in sun application serverTake a look here
-
How to get the absolute path of logicalhost server domain on Windows?
My logicalhost server domain behaves strangely. I am reading a file from collaboration definiton, that is located in the logicalhost/is/domains/domain1/config folder. I thought, that this folder is used as an application root folder so I can read files like ./file from there. And it worked.
But then I've installed the domain as a Windows service, restarted the PC. When the domain1 gets started, I get exceptions saying that the file can't be found. Then I restart the domain (in domainmgr.bat) and it works again.
I am pretty sure that using the absolute path will solve this issue, so my first question is: How to get the absolute path of logicalhost server domain on Windows?
And my second question is: Why does this happen?The default folder for a Windows Service is the system32 folder contrary to the instance root folder when starting it as a normal process.
That's the why, haven't tried the how, but you should be able to get the value by calling System.getProperty("com.sun.aas.instanceRoot").
Hope this helps
Paul -
How to get the Change node in Production Server!!!!!
Hi Guys,
Kindly let me know how to get the Change node in Production Server for the Transaction Code Pe03 for generating the Acknowledgement No for the year 2008 .
Plz provide me the steps how to get the Change Node for Acknowledgement No so tat i can get the configuration done.
Regards
Ansuman Mohanty.Hi Mr!
If you want to generate the e-file feature 40ACK, do it in our Customization client box (Golden box) & save the request & move to Quality & production.
Still if you need to workout only in Production, than with the help of Basis people you can get the Production change mode for 5 to 10 min time & can generate it. But mostly Basis people wont give us change mode for Production box ... with ur request they can do..try it.
Did u collected 4 quarter TAN no's for 2008 Quarter...if not collect it & generate it at a time.
All the best:-)
Kind Regards,
Saisree.S -
How to use open Row set in sql server 2014
Hello All,
How to open the row set using sql server 2014 using link server connection.Hi denyy,
Are you referring to the OPENROWSET function in SQL Server 2014?
The OPENROWSET method is an alternative to accessing tables in a linked server and is a one-time, ad hoc method of connecting and accessing remote data by using OLE DB. The examples below demonstrate how to use the OPENROWSET function:
A. Using OPENROWSET with SELECT and the SQL Server Native Client OLE DB Provider
SELECT a.*
FROM OPENROWSET('SQLNCLI', 'Server=Seattle1;Trusted_Connection=yes;',
'SELECT GroupName, Name, DepartmentID
FROM AdventureWorks2012.HumanResources.Department
ORDER BY GroupName, Name') AS a;
B. Using the Microsoft OLE DB Provider for Jet
SELECT CustomerID, CompanyName
FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'C:\Program Files\Microsoft Office\OFFICE11\SAMPLES\Northwind.mdb';
'admin';'',Customers);
GO
C. Using OPENROWSET to bulk insert file data into a varbinary(max) column
USE AdventureWorks2012;
GO
CREATE TABLE myTable(FileName nvarchar(60),
FileType nvarchar(60), Document varbinary(max));
GO
INSERT INTO myTable(FileName, FileType, Document)
SELECT 'Text1.txt' AS FileName,
'.txt' AS FileType,
* FROM OPENROWSET(BULK N'C:\Text1.txt', SINGLE_BLOB) AS Document;
GO
D. Using the OPENROWSET BULK provider with a format file to retrieve rows from a text file
SELECT a.* FROM OPENROWSET( BULK 'c:\test\values.txt',
FORMATFILE = 'c:\test\values.fmt') AS a;
Reference:
OPENROWSET (Transact-SQL)
Using the OPENROWSET function in SQL Server
Thanks,
Lydia Zhang
If you have any feedback on our support, please click
here. -
How to insert data from access to sql server ?
How to insert data from access to sql server ?
Please help me
thanksphamtrungkien wrote:
How to insert data from access to sql server by JAVA?The first four words of my last post:
masijade wrote:
JDBC with two connectionsGet a resultset from the jdbc-odbc bridge access connection, cycle through it and add batch insert commands to the jdbc connection to sql server. Give it a try and if the code has an error, then post your code ans ask a question.
The real question, though, is why you think it absolutely necessary to use Java for this. -
How to restore the Password backup in sql server 2005
How to restore the Password backup in sql server 2005
Hello,
THANKS............ BUT
I executed this query
RESTORE DATABASE new_data1
FROM DISK = 'd:\UK_DETAILS.bak'
with password ='selfinity123'
WITH MOVE 'UK_DETAILS.bak' TO 'D:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\new_data1.mdf',
MOVE 'UK_DETAILS.bak' TO 'D:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\new_data1.ldf'
I got the error
Msg 319, Level 15, State 1, Line 4
Incorrect syntax near the keyword 'with'. If this statement is a common table expression or an xmlnamespaces clause, the previous statement must be terminated with a semicolon. -
How to call procedure in Java from SQL Server Database
Hello Every Body
i Have Question about
How to call procedure in Java from SQL Server Database
ThanksHi,
have you tried a Google search? I just gave it a 3 second try and already found: http://stackoverflow.com/questions/6113674/how-do-i-execute-a-ms-sql-server-stored-procedure-in-java-jsp-returning-table-d
Frank -
How to Create PR from exeternal SQL Server through IDOC
Dear all,
I am in trouble while creating PR from exeternal SQL Server through IDOC . although I have created PR from TCODE we19 giving input as well as from function writen below
My scnerio is from external system(Sql) want to send data to sap to create PR return PR No to SQl Server
Not having idea how to do
Basic Type for Idoc : PREQCR01
Message Type : PREQCR
Function Module : BAP_Idoc_Input1
Thanxs in Advanceif you have XI installed,
than it would be easy,
just use JDBC channel->XI->SAP IDOC.
otherwise,
you can export the table from the SQL to CSV file,
and import it with LSMW with IDOC PREQCR01. -
Can anybody tell me how to get INV available quantity of a item through API
Hello,experts.
Can anybody tell me how to get INV available quantity of a item through API?
And offer any example for this.
Thanks in advanceCheck from This table : MTL_ONHAND_QUANTITIES and MTL_ONHAND_QUANTITIES_DETAIL.
Anyway just curious, if you able to access this forum (which requires internet connection), why you can't access TRM and IREP ?
Maybe you are looking for
-
We got a new computer, so I was installing iTunes onto it. I believe the music is still somewhere on my computer, because it was downloaded onto the harddrive from our old computer, I just don't know where I would find it. I do have an external hardd
-
Strange behaviour with Fixed thread pool
Hi all I am trying to learn multithreading. I have written a small snippet of code. After running for around 30 minutes, this code ends up in a deadlock. I am trying to figure out a reason. any help will be really appreciated. Thanks. Following is th
-
I get this pop up screen continuously on my screen. Ever since I switched to Firefox, I was using Safari. The only other Apps open are my Mac Mail and Finder. A script on this page may be busy, or it may have stopped responding. You can stop the scri
-
Out-File to CSV holds on to information
Hey everyone, Here is my issue. I have a Powershell v2.0 application that I created using Sapien Powershell Studios, that sends information to a CSV. Then I have another script(batch) that reads the CSV, but does not find any information until I phys
-
Data Cleansing Before PSA data Load
Hi In BI, one of my field was off of the data type in flat file, so got error while loading flat file to PSA, so whole file failed to load. Do you have some idea how to cleansing the data for data type before loading to PSA or what do we do generally