Query to get unavailability records of a managed entity in OperationManagerDW database
Hi All,
I need a query to get unavailbility records of a managed entity to a report. Are there records in event ou alarm tables? Is there one record to unhealthy state and one to healthy state?
I really appreciate any help you can provide.
Please use this SQL statement to retrieve unavailability records
select c.displayname, a.* from state.vstatedaily a inner join vmanagedentitymonitor b on
a.managedEntityMonitorRowID=b.managedEntityMonitorRowID inner join
vmanagedEntity c on b.ManagedEntityRowID=c.ManagedEntityRowID
where DateTime between '2015-3-15' and '2015-3-17'
Roger
Similar Messages
-
Query to get the records with same last name
I need to write a single sql query to get all records with duplicate last_name's. For example, if tab1 has 4 records:
10 Amit Kumar
20 Kishore Kumar
30 Sachin Gupta
40 Peter Gabriel
then the query should return
10 Amit Kumar
20 Kishore Kumar
id, name,L_name being the 3 columns in table
Apprecite you help.
Thank you
MarySQL> create table mytable (id,name,l_name)
2 as
3 select 10, 'Amit', 'Kumar' from dual union all
4 select 20, 'Kishore', 'Kumar' from dual union all
5 select 30, 'Sachin', 'Gupta' from dual union all
6 select 40, 'Peter', 'Gabriel' from dual
7 /
Table created.
SQL> select id
2 , name
3 , l_name
4 from ( select t.*
5 , count(*) over (partition by l_name) cnt
6 from mytable t
7 )
8 where cnt > 1
9 /
ID NAME L_NAME
10 Amit Kumar
20 Kishore Kumar
2 rows selected.Regards,
Rob. -
SQL Query to get Project Plan Name and Resource Name from Reporting database of Project Server 2007
Can you please help me to write an SQL Query to get Project Plan Name and Resource Name from Reporting database of Project Server 2007. Thanks!!
Refer
http://gallery.technet.microsoft.com/projectserver/Server-20072010-SQL-Get-a99d4bc6
SELECT
dbo.MSP_EpmAssignment_UserView.ProjectUID,
dbo.MSP_EpmAssignment_UserView.TaskUID,
dbo.MSP_EpmProject_UserView.ProjectName,
dbo.MSP_EpmTask_UserView.TaskName,
dbo.MSP_EpmAssignment_UserView.ResourceUID,
dbo.MSP_EpmResource_UserView.ResourceName,
dbo.MSP_EpmResource_UserView.ResourceInitials
INTO #TempTable
FROM dbo.MSP_EpmAssignment_UserView INNER JOIN
dbo.MSP_EpmProject_UserView ON dbo.MSP_EpmAssignment_UserView.ProjectUID = dbo.MSP_EpmProject_UserView.ProjectUID INNER JOIN
dbo.MSP_EpmTask_UserView ON dbo.MSP_EpmAssignment_UserView.TaskUID = dbo.MSP_EpmTask_UserView.TaskUID INNER JOIN
dbo.MSP_EpmResource_UserView ON dbo.MSP_EpmAssignment_UserView.ResourceUID = dbo.MSP_EpmResource_UserView.ResourceUID
SELECT
ProjectUID,
TaskUID,
ProjectName,
TaskName,
STUFF((
SELECT ', ' + ResourceInitials
FROM #TempTable
WHERE (TaskUID = Results.TaskUID)
FOR XML PATH (''))
,1,2,'') AS ResourceInitialsCombined,
STUFF((
SELECT ', ' + ResourceName
FROM #TempTable
WHERE (TaskUID = Results.TaskUID)
FOR XML PATH (''))
,1,2,'') AS ResourceNameCombined
FROM #TempTable Results
GROUP BY TaskUID,ProjectUID,ProjectName,TaskName
DROP TABLE #TempTable
-Prashanth -
MS SQL query to get Subscription list from Operations Manager
Hi Experts,
Is there anyway get Subscription list from Operations Manager DB using SQL query? I lost subscription list, and need to create subscription as it was. Very urgent.
Thanks in advance.
Regards
Karthick MHi,
Hope the powershell command Get-SCOMNotificationSubscription can be helpful for you:
Get-SCOMNotificationSubscription
Retrieves a list of notification subscriptions.
https://technet.microsoft.com/en-us/library/hh918490(v=sc.20).aspx
Regards,
Yan Li
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected] -
Simplify the select query to get single record
Please let me know what is wrong with my query.
Max(p_received_date) is returning null columns too. But i need to have only null record per period, if there is date and null record for the same billing then return the date record. please check november and september records. september should return only 09/13/10 record but it is returning null record too. please help to get expected out put.
SELECT DISTINCT B_BILLING_KEY,
to_char(to_date('01/'||trim(substr(B_REPORT_PERIOD,5,2))||'/'||
trim(substr(B_REPORT_PERIOD,1,4)),'DD/MM/YYYY'),'Month YYYY') Billing,
B_company_id company,
sum((nvl(T.B_ORG_SURCH_AMOUNT,0)+nvl(T.B_ORG_PI_AMOUNT,0))-(nvl(T.P_AMOUNT,0))) "PeriodBalance",
Max(to_char(P_RECEIVED_DATE,'MM/DD/YY')) LastPaymentDate,
decode(sign(
(nvl(T.B_ORG_SURCH_AMOUNT,0)+nvl(T.B_ORG_PI_AMOUNT,0))-(nvl(T.P_AMOUNT,0))), 1,'Yes','No') Outs
FROM mv_program_dict P, tuff_balance_view T WHERE
b_company_id = 'U-7052-C' group by B_REPORT_PERIOD,B_company_id,B_BILLING_KEY,B_ORG_SURCH_AMOUNT,
B_ORG_PI_AMOUNT,P_AMOUNT
order by B_BILLING_KEY desc
Actual
Billing key Billing company periodbalance lastpayment date outs
110631534073 November 2010 U-7052-C 270 Yes
110631534073 November 2010 U-7052-C 690 Yes
110631534073 November 2010 U-7052-C 66 Yes
110461533197 October 2010 U-7052-C 4740 Yes
110461533197 October 2010 U-7052-C 27000 Yes
110461533197 October 2010 U-7052-C 0 No
110251532527 September 2010 U-7052-C 0 09/13/10 No
110251532527 September 2010 U-7052-C 0 No
110251532527 September 2010 U-7052-C -18 09/13/10 No
110251532484 August 2010 U-7052-C 0 09/13/10 No
110251532484 August 2010 U-7052-C 2001 09/13/10 Yes
110251532484 August 2010 U-7052-C 0 No
Expectedoutput(need only following columns)Outs is outstanding balance
Billing key Billing company l astpayment date outs
110631534073 November 2010 U-7052-C Yes
110461533197 October 2010 U-7052-C Yes
110251532527 September 2010 U-7052-C 09/13/10 No
110251532484 August 2010 U-7052-C 09/13/10 YES
By using below query i am getting all output as NO. HOw to modify this query.
SELECT company,
billing,LastPaymentDate,
CASE
WHEN SUM (DECODE (outs, 'YES', 1, 0)) > 0 THEN 'YES'
ELSE 'NO'
END Outstanding
FROM (
SELECT DISTINCT B_BILLING_KEY,
to_char(to_date('01/'||trim(substr(B_REPORT_PERIOD,5,2))||'/'||
trim(substr(B_REPORT_PERIOD,1,4)),'DD/MM/YYYY'),'Month YYYY') Billing,
B_company_id company,
sum((nvl(T.B_ORG_SURCH_AMOUNT,0)+nvl(T.B_ORG_PI_AMOUNT,0))-(nvl(T.P_AMOUNT,0))) "PeriodBalance",
Max(to_char(P_RECEIVED_DATE,'MM/DD/YY')) LastPaymentDate,
decode(sign(
(nvl(T.B_ORG_SURCH_AMOUNT,0)+nvl(T.B_ORG_PI_AMOUNT,0))-(nvl(T.P_AMOUNT,0))), 1,'Yes','No') Outs
FROM mv_program_dict P, tuff_balance_view T WHERE
b_company_id = 'U-7052-C' group by B_REPORT_PERIOD,B_company_id,B_BILLING_KEY,B_ORG_SURCH_AMOUNT,
B_ORG_PI_AMOUNT,P_AMOUNT
order by B_BILLING_KEY desc)
GROUP BY company, billing,LastPaymentDate;
Note:in the actual out put max(lastpayment date) is returing null values. if there is any date in one billing return that date only remove null example is september. in september it should return only 09/13/10 this date not null date. but if there is no other within one biling then consider that as null example november..
Thanks,
vAnother solution is setting NLS_SORT to CI - case insensitive (or whatever_your_language_is_CI) and NLS_COMP to ANSI:
SQL> with t as (
2 select 'HARI' name from dual union all
3 select 'Hari' name from dual union all
4 select 'HaRi' name from dual
5 )
6 select *
7 from t
8 where name = 'hArI'
9 /
no rows selected
SQL> alter session set nls_sort = binary_ci
2 /
Session altered.
SQL> alter session set nls_comp=ansi
2 /
Session altered.
SQL> with t as (
2 select 'HARI' name from dual union all
3 select 'Hari' name from dual union all
4 select 'HaRi' name from dual
5 )
6 select *
7 from t
8 where name = 'hArI'
9 /
NAME
HARI
Hari
HaRi
SQL> SY. -
Query to get all records were AMNT1 AMNT2
Hi,
I have two fields Field1,Field2 and two Key figures-AMNT1,AMNT2. I want to get all the records for which AMNT1 > AMNT2.
Any clues or solutions will be appreciated.
Thanks
SimmiHi simmi
You can put condition for this requirement in the query designer.
When you are in the query designed have a formula with Boolean operation statement "is greater than", as shown.
AMNT1>AMNT2
now go to condition button and add one condition for this formula. the condition can be 'key figure'= formula name, Operator = 'Equal to' and value = '1'.
Aply this condition and execute query with this condition active.
regards
rahul -
Query to get the record with latest date
I have
ACCOUNT_TABLE
account_number
account_event
event_date
ACCOUNT_TABLE
1,Open,12 Jan 2006
1,Open,13 Jan 2006
1,Open,14 Jan 2006
1,Open,15 Jan 2006
1,Open,16 Jan 2006
How can I get the latest record(16 Jan 2006) in one sql statement.
Thx
mif you have more account_event's then...
SQL> with t as
2 (select 1 account_number,'Open' account_event,'12 Jan 2006' event_date from dual union all
3 select 1,'Open','13 Jan 2006' from dual union all
4 select 1,'Open','14 Jan 2006' from dual union all
5 select 1,'Open','15 Jan 2006' from dual union all
6 select 1,'Open','16 Jan 2006' from dual union all
7 select 1,'Close','17 Jan 2006' from dual union all
8 select 1,'Close','18 Jan 2006' from dual union all
9 select 2,'Open','19 Jan 2006' from dual)
10 select * from t a
11 where (a.account_number, account_event,a.event_date) in
12 ((select b.account_number, account_event,max(b.event_date) from t b group by b.account_number,account_event))
13 order by account_number;
ACCOUNT_NUMBER ACCOU EVENT_DATE
1 Close 18 Jan 2006
1 Open 16 Jan 2006
2 Open 19 Jan 2006 -
Help to write query to get records from specified time TO specified time?
I have a table which has large data and the table is updated every min,
Suppose the Table comp(timeid date,sessions varchar2,sid varchar2)
Here time needs to be checked
So now i have to write a query which displays records that have been in the table
for every 5 mins
default timeframe is sysdate-5 then the lower and upper bound is multiple of 5 i.e
Suppose now Time and sysdate: 12-sep-2007 1:22:00pm
From sysdate: 12-sep-2007 1:15:01pm TO sysdate: 12-sep-2007 1:20:00pm
So i need a query to get the records from 1:15:01pm to 1:20pm.
Message was edited by:
user594721Explanation is not clear.Please give sample data and expected o/p.
If you need the data of previous five minutes, do like this...
SQL> select id, to_char(time,'dd/mm/yyyy hh:mi:ss') time
2 from test;
ID TIME
1 13/09/2007 10:29:55
1 13/09/2007 10:29:22
1 13/09/2007 10:20:28
SQL> select id, to_char(time,'dd/mm/yyyy hh:mi:ss') time,
2 to_char(sysdate,'dd/mm/yyyy hh:mi:ss') current_time
3 from test
4 where time between (sysdate - (5/24/60)) and sysdate;
ID TIME CURRENT_TIME
1 13/09/2007 10:29:55 13/09/2007 10:32:45
1 13/09/2007 10:29:22 13/09/2007 10:32:45 -
Call Records from Call Manager
I am trying to figure out how I can get call records from Call Manager. I can get CR form our PBX but cannot figure out the Call Manager... Any ideas?
Thanks,
DennisHello
There are 2 ways to get call record.
Cisco has a built-in CDR Report Analysis. This application is accessable from the CallManager
Go to Application, Install Plugin, install the CDR Reporting and Analysis plugin in CallManager. Then go to Servicability and go to Tools then select CDR Analysis and Reporting
Default login is admin/admin
2nd method is via SQL Server where there is a databae call CDR . You can customize a ASP page to retrive the data you want from there
enjoy -
Need help in SQL query to get only distinct records
Hi all.
I am new to oracle SQL and i want to write a query to get only distinct values from 2 tables.
for example i hade 2 tables table1(employee_id,employee_no,grade) and another table2 with same structure.
for example data in table1 is
Employeeid employeeno Grade
1 101 A
1 101 B
1 101 E
1 101 D
and data in table 2 is
Employeeid employeeno Grade
1 101 A
1 101 B
1 101 E
i want to display only the fourth row like the data that doesnt exist in table2 i,e (1 101 D)
I had too much records in both tables and i jst want to see the records that is in table 1 not in table 2 only.
employeeid and employeeno are the same in both tables
I hope u understand my query. I user left outer join and right outer join bt it displays all the results that and matching and unmatching. I want jst unmatched records.
Any help is highly Appreciated.
Thanx in Advance.
I am using oracle 10G on windowsTry MINUS:
http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/queries004.htm#i2054381
SQL> -- generating sample data:
SQL> with t1 as (
2 select 1 employeeid, 101 employeeno, 'A' grade from dual union
3 select 1, 101, 'B' from dual union
4 select 1, 101, 'E' from dual union
5 select 1, 101, 'D' from dual
6 )
7 , t2 as (
8 select 1 employeeid, 101 employeeno, 'A' grade from dual union
9 select 1, 101, 'B' from dual union
10 select 1, 101, 'E' from dual
11 )
12 --
13 -- actual query:
14 --
15 select employeeid
16 , employeeno
17 , grade
18 from t1
19 minus
20 select employeeid
21 , employeeno
22 , grade
23 from t2;
EMPLOYEEID EMPLOYEENO G
1 101 D
1 row selected. -
Query for getting records max reported timestamp and 2nd max report
query for getting records in between
max reported timestamp and 2nd max reported timestamp
HERE IS ALL RESULT SET
TIME DOMAIN
30:jun:2006:20:08:45 TOMCAT
30:jun:2006:20:08:45 TOMCAT
30:jun:2006:20:07:04 TOMCAT
30:jun:2006:20:07:04 TOMCAT
30:jun:2006:20:07:24 TOMCAT
30:jun:2006:20:07:24 TOMCAT
30:jun:2006:20:07:45 TOMCAT
30:jun:2006:20:07:45 TOMCAT
30:jun:2006:20:08:05 TOMCAT
30:jun:2006:20:07:04 TOMCAT
30:jun:2006:20:08:05 TOMCAT
PD_REPORTED_TIMESTAM PD_USER
30:jun:2006:20:08:25 TOMCAT
30:jun:2006:20:08:25 TOMCAT
30:jun:2006:20:08:45 TOMCAT
30:jun:2006:20:08:45 TOMCAT
30:jun:2006:20:07:24 TOMCAT
30:jun:2006:20:07:04 TOMCAT
30:jun:2006:20:07:24 TOMCAT
30:jun:2006:20:07:45 TOMCAT
30:jun:2006:20:07:45 TOMCAT
30:jun:2006:20:08:05 TOMCAT
30:jun:2006:20:08:05 TOMCAT
PD_REPORTED_TIMESTAM PD_USER
30:jun:2006:20:08:25 TOMCAT
30:jun:2006:20:08:25 TOMCAT
QUERY RESULT TO COME
TIME DOMAIN
TOMCAT 30:jun:2006:20:08:45
TOMCAT 30:jun:2006:20:08:45
TOMCAT 30:jun:2006:20:08:45
TOMCAT 30:jun:2006:20:08:45
Message was edited by:
user517983Hi,
can we write query like this.
1 select pd_user,PD_REPORTED_TIMESTAMP
2 from sp_process_detail_current spdc
3 where host_id='DSCP02469'and pd_user='TOMCAT'
4 and exists(
5 select PD_REPORTED_TIMESTAMP from sp_process_detail_current
6* having max(PD_REPORTED_TIMESTAMP)-spdc.PD_REPORTED_TIMESTAMP=0)
SQL> /
PD_USER PD_REPORTED_TIMESTAM
TOMCAT 30:jun:2006:20:08:45
TOMCAT 30:jun:2006:20:08:45
TOMCAT 30:jun:2006:20:08:45
TOMCAT 30:jun:2006:20:08:45 -
SQL query to get last 6 months records neglect the current month
Hi All;
I need help with
sql query to get last 6 months records neglect the current month
Any help much appreciated
Thanks
Pradnya07SELECT <> FROM tbl WHERE dt >=dateadd(month,-6,GETDATE())
Best Regards,Uri Dimant SQL Server MVP,
http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting:
Large scale of database and data cleansing
Remote DBA Services:
Improves MS SQL Database Performance
SQL Server Integration Services:
Business Intelligence -
SQL query to get last 10 records in the table?
Hi,
Can anyone tell me the SQL query to get last 10 records in the table?
Thanks!!
MCPPlease, define what "last" means. Sets are unordered by definition, so if you want to retrieve rows from a table in a specific order you need to specify what that order is - e.g. by maintaining a value in a column (or a combination of columns) that you can use in the ORDER BY clause of the SELECT statement.
If, for instance, you kept the time when the row was inserted in a special column (InsertedTime), you could use this in your query like this:
select top (10)
<column list>
from <table or view>
where <restriction(s)>
order by InsertedTime desc;
ML
Matija Lah, SQL Server MVP
http://milambda.blogspot.com -
How to modify the query to get max id record
Hi All,
How to modify below query to get proper result.The query is returning some records are duplicated.I need only one record to display from duplicate based on max assetid.
Here is my query:
SELECT *
FROM (
SELECT a.uppertitle, a.composer, a.esongid,
MAX (asset_new.assetid) AS assetid,asset_new.ownerid
FROM (SELECT DISTINCT NVL (esong.title, '~') AS uppertitle,
INITCAP (NVL (esong.composer, '~')
) AS composer,
esong.esongid
FROM esong, esongcountry_us eus
WHERE 1 = 1
AND eus.esongid = esong.esongid
AND eus.isocountrycode IN ('US')
AND esong.title LIKE 'LIVE TO TELL%'
AND ROWNUM < 390) a,
songwebrecording,
recordingasset_new,
asset_new
WHERE a.esongid = songwebrecording.esongid(+)
AND songwebrecording.recordingid = recordingasset_new.recordingid(+)
AND recordingasset_new.assetid = asset_new.assetid(+)
GROUP BY a.uppertitle, a.composer, a.esongid,asset_new.ownerid)
WHERE ROWNUM <= 390
ORDER BY uppertitle
result:
upperlittle composer esongid assetid onwerid
1. LIVE TO TELL Gelb, Howe 480340000 null null
2. LIVE TO TELL FROM THE Madonna (Ca)/ Leonard 125559900 null null
3. LIVE TO TELL FROM THE Madonna (Ca)/ Leonard 125559900 3080366 null
4. LIVE TO TELL FROM THE Madonna (Ca)/ Leonard 125559900 3038107 null
5. LIVE TO TELL THE TALE Holopainen 859841500 nulll nulll
I need the result like this :
upperlittle composer esongid assetid onwerid
1. LIVE TO TELL Gelb, Howe 480340000 null null
2. LIVE TO TELL FROM THE Madonna (Ca)/ Leonard 125559900 3080366 null
3. LIVE TO TELL THE TALE Holopainen 859841500 nulll nulll
Please help me on this regard. oracle version is 9i
Regards,
Rajasekharcan you please format your code with
-
Lookup query to get Manager ID value on object form
Hi ,
I have created a Manager ID field on object form which is of type lookup field.
Can any one please tell me that how can i write Lookup query to get Manager ID value on object form.
Thanks in AdvanceI was looking for something like this today too.
Here's what I came up with:
SELECT fu.user_id, fu.employee_id, fu.user_guid, pe1.full_name, pe2.full_name SUPERVISOR, pe2.employee_id
FROM fnd_user fu
JOIN per_employees_x pe1 on pe1.employee_id = fu.employee_id
JOIN per_employees_x pe2 on pe2.employee_id = pe1.supervisor_id
WHERE fu.user_id = $(user_id)
Edited by: user12232265 on Feb 24, 2010 3:20 PM
Maybe you are looking for
-
In excel sheet tab name is not coming-urgent
hi all, one small rewquirement. if u run this test program it opens a excel sheet which contains signle tab. here tab name is not coming. i dont no hot to display tabname here.anybody can make the changes and send me the code. i am sending my code b
-
Hi sap gurus can any body help me
REPORT ZFIR_GRIR_IPV NO STANDARD PAGE HEADING LINE-SIZE 120 MESSAGE-ID ZFI02. TABLES: BSEG,BKPF. TYPES: BEGIN OF A_FINAL, BUKRS TYPE CHAR12, HKONT_P TYPE CHAR18, GJAHR TYPE CHAR11, BELNR
-
Hello All, This is a IDOC - XI - File scenario. The scenario works fine and the file is generated as expected. But the IDOC ack has error status in SXMB_MONI. The error msg is "Acknowledgement not possible". When I open the msg in SXMB_MONI and doubl
-
Wsdl validation fails for request message payload from custom schema
Hello. I am having a problem which I cannot seem to work around. I have defined a schema to serve as a template for the request message payload of a bpel process. The schema is very simple: <?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:logi
-
JUnit 4 Extension for 10.1.3?
Hi, are there any plans to update the JUnit Extension for JDeveloper 10.1.3 to support JUnit 4? Using the current extension with JUnit 4 has two main drawbacks: a) one loses the ability to run a single test method, and b) successes and failures are n