- Community Home
- >
- Servers and Operating Systems
- >
- HPE ProLiant
- >
- Server Management - Systems Insight Manager
- >
- How to run oSQL queries
Server Management - Systems Insight Manager
1820879
Members
4912
Online
109628
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-21-2004 03:42 AM
тАО08-21-2004 03:42 AM
How to run oSQL queries
Can someone help me figure out what basic tsql commands I should be using to transpose "Show SQL Queries" sample output from SIM console, to execute properly from CLI osql.exe MSDE tool?
I figure this is what is required:
1-"USE databasename"
2-cut'n'pasted query command
3-"GO" command
How can we figure out what database name to use, and am I missing anything in the above recipe?
Thanks!
I figure this is what is required:
1-"USE databasename"
2-cut'n'pasted query command
3-"GO" command
How can we figure out what database name to use, and am I missing anything in the above recipe?
Thanks!
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-22-2004 08:39 AM
тАО08-22-2004 08:39 AM
Re: How to run oSQL queries
I use OSQL as it's a bit better.
I also put the Select Query into a separate file.
Typically you need the following:
osql -S YourSQLServer -U UserAccount -P Password
-d INSIGHT_v1_0_15758423 -w 132 -n -h-1
-i d:\Server_Description.osql
-o d:\Server_Description.txt
You can often replace the -U and -P construct with -E (no paramaeters) if it is being triggered from a suitable privileged account.
My Input file would look something like:
SET NOCOUNT ON
go
select etc. etc.
go
quit
I also put the Select Query into a separate file.
Typically you need the following:
osql -S YourSQLServer -U UserAccount -P Password
-d INSIGHT_v1_0_15758423 -w 132 -n -h-1
-i d:\Server_Description.osql
-o d:\Server_Description.txt
You can often replace the -U and -P construct with -E (no paramaeters) if it is being triggered from a suitable privileged account.
My Input file would look something like:
SET NOCOUNT ON
go
select etc. etc.
go
quit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-23-2004 01:57 AM
тАО08-23-2004 01:57 AM
Re: How to run oSQL queries
#1- After a bit of research, I found out that we can first locate the Insight Manager database name by issueing the following: osql -E -dmaster -Q"select * from sysdatabases"
#2- Then, use that variable database name in an osql command with -U -P options, or -E if currently admin priveleges, and -Q option with cut'n'pasted SQL query withint double-quotes, such as in :
osql -E -dInsight_v1_0_222955644 -Q "select R_Inventory.DeviceName, R_Inventory.ProductType, R_Inventory.ProductName, R_Inventory.SerialNumber, R_Inventory.OSName from R_Inventory WHERE ((R_Inventory.SnapShotID=-1) OR (R_Inventory.SnapShotID is NULL)) AND DeviceKey in (select devices.deviceKey from devices JOIN notices ON devices.deviceKey = notices.deviceKey and notices.NoticeType = 1 JOIN consolidatedNodeAuths ON devices.mxGuid = consolidatedNodeAuths.NodeId and consolidatedNodeAuths.userID = '00000000864162de0000000400000006' WHERE ( ( devices.productType = 1) ) ) order by R_Inventory.DeviceName ASC"
#2- Then, use that variable database name in an osql command with -U -P options, or -E if currently admin priveleges, and -Q option with cut'n'pasted SQL query withint double-quotes, such as in :
osql -E -dInsight_v1_0_222955644 -Q "select R_Inventory.DeviceName, R_Inventory.ProductType, R_Inventory.ProductName, R_Inventory.SerialNumber, R_Inventory.OSName from R_Inventory WHERE ((R_Inventory.SnapShotID=-1) OR (R_Inventory.SnapShotID is NULL)) AND DeviceKey in (select devices.deviceKey from devices JOIN notices ON devices.deviceKey = notices.deviceKey and notices.NoticeType = 1 JOIN consolidatedNodeAuths ON devices.mxGuid = consolidatedNodeAuths.NodeId and consolidatedNodeAuths.userID = '00000000864162de0000000400000006' WHERE ( ( devices.productType = 1) ) ) order by R_Inventory.DeviceName ASC"
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Learn About
News and Events
Support
© Copyright 2025 Hewlett Packard Enterprise Development LP