SQL Query for members of dynamic group - Need to include Name, Path and Type

Hello,
I built a custom dynamic group that has all my SQL databases in it using SCOM 2012 SP1.  The group works fine as I can see the Name(ie, Database name), Health State, Path (ie, hostname/instance) and Types (ie; SQL 2005).  Now I'm trying to
build a custom report based off this same information using a SQL query.   I'm no DBA and could use some help.  So far this is what i have
use
select
SourceObjectDisplayName as
'Group Name',
TargetObjectDisplayName,TargetObjectPath
from RelationshipGenericView
where isDeleted=0
AND SourceObjectDisplayName
like
'SQL_Databases_All'
ORDERBY TargetObjectDisplayName
This gets me the Group Name (which i really don't care about), database name, and hostname/instance. What I am missing is the Health State and most importantly the Type (ie, SQL Server 2005 DB, SQL Server 2008DB).
If someone could assist me here I would appreciate it. I believe I need to do some type of INNER JOIN but have no idea where the SQL type info lives or the proper structure to use. Thanks
OperationsManager

Here's the updated Query for OpsMan 2012 R2:
To find all members of a given group (change the group name below):
select SourceObjectDisplayName as 'Group Name', TargetObjectDisplayName as 'Group Members' 
from RelationshipGenericView 
where isDeleted=0 
AND SourceObjectDisplayName = 'Agent Managed Computer
Group' 
ORDER BY TargetObjectDisplayName

Similar Messages

  • SQL Query for full paid invoices and payed out credit notes

    Hi alltogether,
    I have some problems with a sql query.
    I want to export all closed (full paid) invoices and credit notes in a table with the paid date.
    The problem is that I have several internal reconciliations for one invoice or credit note.
    So with my current query I get all these dates in the result but only for invoices, not for credit notes.
    I only need the last internal reconciliation date as payment date for all invoices and credit notes where the open amount is 0.
    In SAP B1 the finance team has service invoices and credit notes imported out of an ERP system.
    These documents are marked with an 'Y" in the coloumn "U_I_Imported" in the table "OINV" or "ORIN".
    SELECT
    OINV.DocTotal - OINV.PaidToDate as Offen, OINV.NumAtCard, OINV.U_I_Imported, ORCT.DocDate as 'Zahlungsdatum'
    SELECT
    OINV.DocTotal - OINV.PaidToDate as Offen, OINV.NumAtCard, OINV.U_I_Imported, ORCT.DocDate as 'Zahlungsdatum'
    FROM
    OJDT inner join
    ORCT on OJDT.BaseRef = ORCT.DocNum inner join
    RCT2 on ORCT.DocNum = RCT2.DocNum inner join
    OINV on RCT2.BaseAbs = OINV.DocEntry
    where
    OINV.DocTotal - OINV.PaidToDate = 0 and  OINV.U_I_Imported = 'Y'
    group by
    OINV.NumatCard, OINV.DocTotal - OINV.PaidToDate, OINV.U_I_Imported, ORCT.DocDate
    order by
    ORCT.DocDate
    I hope you can help me.
    Kind regards,
    Max

    The solution for my problem:
    select
    OINV.DocTotal - OINV.PaidToDate as 'Offen', OINV.CardCode as 'Kundennummer', OINV.NumAtCard as 'DIAMOD Rechnungsnummer', OINV.DocNum as 'Dokumentennummer',  max(ORCT.DocDate) as 'Zahlungsdatum', case when ORCT.DocCurr = (select MainCurncy from OADM) then RCT2.DcntSum else RCT2.DcntSumFC end as 'SkontoRechnungswährung',
        RCT2.DcntSum as 'SkontoFirmenwährung'
    from
        JDT1 inner join
        OJDT on JDT1.TransId = OJDT.TransId inner join
        ORCT on OJDT.BaseRef = ORCT.DocNum inner join
        RCT2 on ORCT.DocNum = RCT2.DocNum inner join
        OINV on RCT2.BaseAbs = OINV.DocEntry
    where
    JDT1.TransType in ('24') and
    OINV.U_I_Imported = 'Y' and
    OINV.DocTotal - OINV.PaidToDate = 0
    group by
    OINV.NumAtCard, OINV.DocNum, OINV.CardCode, OINV.DocTotal - OINV.PaidToDate, ORCT.DocCurr, RCT2.DcntSum, RCT2.DcntSumFC
    union all
    select
    OINV.DocTotal - OINV.PaidToDate as Offen, OINV.CardCode as 'Kundennummer', OINV.NumAtCard as 'DIAMOD Rechnungsnummer', OINV.DocNum as 'Dokumentennummer',  max(OITR.ReconDate) as 'Zahlungsdatum',
        0.0 as 'SkontoRechnungswährung',
        0.0 as 'SkontoFirmenwährung'
    from
    OITR inner join
    ITR1 on OITR.ReconNum = ITR1.ReconNum inner join
    OINV on ITR1.SrcObjAbs = OINV.DocEntry
    where
    OINV.DocTotal - OINV.PaidToDate = 0 and ITR1.SrcObjTyp = 13 and OINV.U_I_Imported = 'Y'
    group by
    OINV.NumatCard, OINV.DocNum, OINV.CardCode, OINV.DocTotal - OINV.PaidToDate
    union all
    select
    ORIN.DocTotal - ORIN.PaidToDate as Offen, ORIN.CardCode as 'Kundennummer', ORIN.NumAtCard as 'DIAMOD Rechnungsnummer', ORIN.DocNum as 'Dokumentennummer',  max(OITR.ReconDate) as 'Zahlungsdatum',
        0.0 as 'SkontoRechnungswährung',
        0.0 as 'SkontoFirmenwährung'
    from
    OITR inner join
    ITR1 on OITR.ReconNum = ITR1.ReconNum inner join
    ORIN on ITR1.SrcObjAbs = ORIN.DocEntry
    where
    ORIN.DocTotal - ORIN.PaidToDate = 0 and ITR1.SrcObjTyp = 14 and ORIN.U_I_Imported = 'Y'
    group by
    ORIN.NumatCard, ORIN.DocNum, ORIN.CardCode, ORIN.DocTotal - ORIN.PaidToDate

  • ORA-00313: open failed for members of log group 3 of thread 1

    Whenever I try to login as a user I get the following:
    sqlplus user/user
    SQL*Plus: Release 10.2.0.2.0 - Production on Fri Nov 9 10:43:39 2007
    Copyright (c) 1982, 2005, Oracle. All Rights Reserved.
    ERROR:
    ORA-01033: ORACLE initialization or shutdown in progress
    So It occurs to me to login as sysdba and restart the DB …
    SQL> connect sys/manager as sysdba
    Connected.
    SQL> shutdown immediate;
    ORA-01109: database not open
    Database dismounted.
    ORACLE instance shut down.
    SQL> startup
    ORACLE instance started.
    Total System Global Area 536870912 bytes
    Fixed Size 1281264 bytes
    Variable Size 150995728 bytes
    Database Buffers 377487360 bytes
    Redo Buffers 7106560 bytes
    Database mounted.
    ORA-00313: open failed for members of log group 3 of thread 1
    ORA-00312: online log 3 thread 1: '/u06/oradata/RKDB/redo03.log'
    ORA-27037: unable to obtain file status
    Intel SVR4 UNIX Error: 2: No such file or directory
    Additional information: 3
    SQL> quit
    I now realized what happened and how this happened. During a clean-up effort this file was accidentally deleted and unfortunately we don’t have any backups.
    I am willing to lose the data. Is there something I can do so that the startup does not try to open this file ?
    All I am able to do now is to mount the database but not open it.
    Thanks in advance,
    Daniel

    this is what I get now ...
    SQL> alter database open resetlogs;
    alter database open resetlogs
    ERROR at line 1:
    ORA-01194: file 1 needs more recovery to be consistent
    ORA-01110: data file 1: '/u02/oradata/RKDB/system01.dbf'
    SQL> Recover database until cancel;
    ORA-00279: change 608619 generated at 11/09/2007 10:00:41 needed for thread 1
    ORA-00289: suggestion : /u05/oradata/RKDB/arch/log1_33_633207859.arc
    ORA-00280: change 608619 for thread 1 is in sequence #33
    Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
    ORA-00308: cannot open archived log
    '/u05/oradata/RKDB/arch/log1_33_633207859.arc'
    ORA-27037: unable to obtain file status
    Intel SVR4 UNIX Error: 2: No such file or directory
    Additional information: 3
    ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
    ORA-01194: file 1 needs more recovery to be consistent
    ORA-01110: data file 1: '/u02/oradata/RKDB/system01.dbf'
    SQL> alter database open resetlogs;
    alter database open resetlogs
    ERROR at line 1:
    ORA-01194: file 1 needs more recovery to be consistent
    ORA-01110: data file 1: '/u02/oradata/RKDB/system01.dbf'
    SQL>

  • Error while executing a sql query for select

    HI All,
    ORA-01652: unable to extend temp segment by 128 in tablespace PSTEMP i'm getting this error while i'm executing the sql query for selecting the data.

    I am having 44GB of temp space, while executing the below query my temp space is getting full, Expert please let us know how the issue can be resolved..
    1. I dont want to increase the temp space
    2. I need to tune the query, please provide your recomendations.
    insert /*+APPEND*/ into CST_DSA.HIERARCHY_MISMATCHES
    (REPORT_NUM,REPORT_TYPE,REPORT_DESC,GAP,CARRIED_ITEMS,CARRIED_ITEM_TYPE,NO_OF_ROUTE_OF_CARRIED_ITEM,CARRIED_ITEM_ROUTE_NO,CARRIER_ITEMS,CARRIER_ITEM_TYPE,CARRIED_ITEM_PROTECTION_TYPE,SOURCE_SYSTEM)
    select
    REPORTNUMBER,REPORTTYPE,REPORTDESCRIPTION ,NULL,
    carried_items,carried_item_type,no_of_route_of_carried_item,carried_item_route_no,carrier_items,
    carrier_item_type,carried_item_protection_type,'PACS'
    from
    (select distinct
    c.REPORTNUMBER,c.REPORTTYPE,c.REPORTDESCRIPTION ,NULL,
    a.carried_items,a.carried_item_type,a.no_of_route_of_carried_item,a.carried_item_route_no,a.carrier_items,
    a.carrier_item_type,a.carried_item_protection_type,'PACS'
    from CST_ASIR.HIERARCHY_asir a,CST_DSA.M_PB_CIRCUIT_ROUTING b ,CST_DSA.REPORT_METADATA c
    where a.carrier_item_type in('Connection') and a.carried_item_type in('Service')
    AND a.carrier_items=b.mux
    and c.REPORTNUMBER=(case
    when a.carrier_item_type in ('ServicePackage','Service','Connection') then 10
    else 20
    end)
    and a.carrier_items not in (select carried_items from CST_ASIR.HIERARCHY_asir where carried_item_type in('Connection') ))A
    where not exists
    (select *
    from CST_DSA.HIERARCHY_MISMATCHES B where
    A.REPORTNUMBER=B.REPORT_NUM and
    A.REPORTTYPE=B.REPORT_TYPE and
    A.REPORTDESCRIPTION=B.REPORT_DESC and
    A.CARRIED_ITEMS=B.CARRIED_ITEMS and
    A.CARRIED_ITEM_TYPE=B.CARRIED_ITEM_TYPE and
    A.NO_OF_ROUTE_OF_CARRIED_ITEM=B.NO_OF_ROUTE_OF_CARRIED_ITEM and
    A.CARRIED_ITEM_ROUTE_NO=B.CARRIED_ITEM_ROUTE_NO and
    A.CARRIER_ITEMS=B.CARRIER_ITEMS and
    A.CARRIER_ITEM_TYPE=B.CARRIER_ITEM_TYPE and
    A.CARRIED_ITEM_PROTECTION_TYPE=B.CARRIED_ITEM_PROTECTION_TYPE
    AND B.SOURCE_SYSTEM='PACS'
    Explain Plan
    ==========
    Plan
    INSERT STATEMENT ALL_ROWSCost: 129 Bytes: 1,103 Cardinality: 1                                                        
         20 LOAD AS SELECT CST_DSA.HIERARCHY_MISMATCHES                                                   
              19 PX COORDINATOR                                              
                   18 PX SEND QC (RANDOM) PARALLEL_TO_SERIAL SYS.:TQ10002 :Q1002Cost: 129 Bytes: 1,103 Cardinality: 1                                         
                        17 NESTED LOOPS PARALLEL_COMBINED_WITH_PARENT :Q1002Cost: 129 Bytes: 1,103 Cardinality: 1                                    
                             15 HASH JOIN RIGHT ANTI NA PARALLEL_COMBINED_WITH_PARENT :Q1002Cost: 129 Bytes: 1,098 Cardinality: 1                               
                                  4 PX RECEIVE PARALLEL_COMBINED_WITH_PARENT :Q1002Cost: 63 Bytes: 359,283 Cardinality: 15,621                          
                                       3 PX SEND BROADCAST PARALLEL_TO_PARALLEL SYS.:TQ10001 :Q1001Cost: 63 Bytes: 359,283 Cardinality: 15,621                     
                                            2 PX BLOCK ITERATOR PARALLEL_COMBINED_WITH_CHILD :Q1001Cost: 63 Bytes: 359,283 Cardinality: 15,621                
                                                 1 MAT_VIEW ACCESS FULL MAT_VIEW PARALLEL_COMBINED_WITH_PARENT CST_ASIR.HIERARCHY :Q1001Cost: 63 Bytes: 359,283 Cardinality: 15,621           
                                  14 NESTED LOOPS ANTI PARALLEL_COMBINED_WITH_PARENT :Q1002Cost: 65 Bytes: 40,256,600 Cardinality: 37,448                          
                                       11 HASH JOIN PARALLEL_COMBINED_WITH_PARENT :Q1002Cost: 65 Bytes: 6,366,160 Cardinality: 37,448                     
                                            8 BUFFER SORT PARALLEL_COMBINED_WITH_CHILD :Q1002               
                                                 7 PX RECEIVE PARALLEL_COMBINED_WITH_PARENT :Q1002Cost: 1 Bytes: 214 Cardinality: 2           
                                                      6 PX SEND BROADCAST PARALLEL_FROM_SERIAL SYS.:TQ10000 Cost: 1 Bytes: 214 Cardinality: 2      
                                                           5 INDEX FULL SCAN INDEX CST_DSA.IDX$$_06EF0005 Cost: 1 Bytes: 214 Cardinality: 2
                                            10 PX BLOCK ITERATOR PARALLEL_COMBINED_WITH_CHILD :Q1002Cost: 63 Bytes: 2,359,224 Cardinality: 37,448                
                                                 9 MAT_VIEW ACCESS FULL MAT_VIEW PARALLEL_COMBINED_WITH_PARENT CST_ASIR.HIERARCHY :Q1002Cost: 63 Bytes: 2,359,224 Cardinality: 37,448           
                                       13 TABLE ACCESS BY INDEX ROWID TABLE PARALLEL_COMBINED_WITH_PARENT CST_DSA.HIERARCHY_MISMATCHES :Q1002Cost: 0 Bytes: 905 Cardinality: 1                     
                                            12 INDEX RANGE SCAN INDEX PARALLEL_COMBINED_WITH_PARENT SYS.HIERARCHY_MISMATCHES_IDX3 :Q1002Cost: 0 Cardinality: 1                
                             16 INDEX RANGE SCAN INDEX PARALLEL_COMBINED_WITH_PARENT CST_DSA.IDX$$_06EF0001 :Q1002Cost: 1 Bytes: 5 Cardinality: 1

  • Problem writing a sql query for a select list based on a static LOV

    Hi,
    I have the following table...
    VALIDATIONS
    ID          Number     (PK)
    APP_ID          Number     
    REQUESTED     Date          
    APPROVED     Date          
    VALID_TIL     Date
    DEPT_ID          Number     (FK)
    I have a search form with the following field item variables...
    P11_DEPT_ID (select list based on dynamic LOV from depts table)
    P11_VALID (select list based on static Yes/No LOV)
    A report on the columns of the Validations table is shown based on the values in the search form. So far, my sql query for the report is...
    SELECT v.APP_ID,
    v.REQUESTED,
    v.APPROVED,
    v.VALID_TIL,
    d.DEPT
    FROM DEPTS d, VALIDATIONS v
    WHERE d.DEPT_ID = v.DEPT_ID(+)
    AND (d.DEPT_ID = :P11_DEPT_ID OR :P11_DEPT_ID = -1)
    This query works so far. My problem is that I don't know how to do a search based on the P11_VALID item - if 'yes' is selected, then the VALID_TIL date is still valid. If 'no' is selected then the VALID_TIL date has passed.
    Can anyone help me to extend my query to include this situation?
    Thanks.

    Hello !
    Let's have a look at my example:create table test
    id        number
    ,valid_til date
    insert into test values( 1, sysdate-3 );
    insert into test values( 2, sysdate-2 );
    insert into test values( 3, sysdate-1 );
    insert into test values( 4, sysdate );
    insert into test values( 5, sysdate+1 );
    insert into test values( 6, sysdate+2 );
    commit;
    select * from test;
    def til=yes
    select *
      from test
      where decode(sign(trunc(valid_til)-trunc(sysdate)),1,1,0,1,-1)
           =decode('&til','yes',1,-1);
    def til=no
    select *                                                                               
      from test                                                                            
      where decode(sign(trunc(valid_til)-trunc(sysdate)),1,1,0,1,-1)
           =decode('&til','yes',1,-1);  
    drop table test;  It's working fine, I've tested it.
    The above changes to my first idea I did because of time portion of the DATE datatype in Oracle and therefore the wrong result for today.
    For understandings:
    1.) TRUNC removes the time part of DATE
    2.) The difference of to date-values is the number of days between.
    3.) SIGN is the mathematical function and gives -1,0 or +1 according to an negative, zero or positiv argument.
    4.) DECODE is like an IF.
    Inspect your LOV for the returning values. According to my example they shoul be 'yes' and 'no'. If your values are different, you may have to modify the DECODE.
    Good luck,
    Heinz

  • How to create sql query for item master with operator LIKE with variables?

    hi all,
    How to create sql query for item master with
    operator LIKE(Contains,Start With,End With) with variables using query generator in SAP B1 ?
    Jeyakanthan

    Hi Jeyakanthan,
    here is an example (put the like statement into the where field)
    SELECT T0.CardCode, T0.CardName FROM OITM T0 WHERE T0.CardName Like '%%test%%'
    The %% sign is a wildcard. If you need start with write 'test%%' and otherwise ends with '%%test'. For contains you need '%%test%%'. You also could combinate this statements like 'test%%abc%%'. This means starts with test and contains abc.
    Regards Steffen

  • How to write sql query for below example.

    Hi,
    I have requirement.
    There are number of rows and I need the result through query as follows.Please help me to proved sql query for below mentioned requirement.
    example: table TEST.
    COLA COLB COLC COLD
    MANAGER 5 NULL null
    SR.MANAGE 6 3 NULL
    VP 5 5 4
    I have to write the sql query if COLA IS MANAGER THEN CONSIDER MANGER RECORD,AND IF ANY COLUMN FILED IS NULL FOR MANGER THEN CONSIDER COLA IS SR.MANGER, AND IF ANY COLUMN FILED IS NULL FOR SR,MANGER THEN CONSIDER VP records.
    I need output as below.
    COLB COLC COLD
    5(MANGER) 3(sr.manger) 5(vp)
    Please provide the for above mentioned output.
    Thanks

    <<if COLA IS MANAGER THEN CONSIDER MANGER RECORD>>
    What does this sentence means? COLA does not cnatin a single record but the number of records with diffrent values.
    Regards
    Arun

  • How to write sql query for below mentioned eaxmple.

    Hi,
    I have requirement.
    There are number of rows and I need the result through query as follows.Please help me to proved sql query for below mentioned requirement.
    example: table TEST.
    COLA COLB COLC COLD COLE COLF MANAGER 5 NULL NULL 3 NULL
    SR.MANAGER 6 3 NULL NULL NULL
    VP 5 5 4 5 5
    I have to write the sql query if COLA IS MANAGER THEN CONSIDER MANGER RECORD,AND IF ANY COLUMN FILED IS NULL FOR MANGER THEN CONSIDER COLA IS SR.MANGER, AND IF ANY COLUMN FILED IS NULL FOR SR,MANGER THEN CONSIDER VP records.
    I need output as below.
    COLB COLC COLD COLE COLF
    5(manager) 3(sr.manger) 4(vp) 3(manger) 3(vp)
    Please provide the for above mentioned output.
    Thanks

    Duplicate thread. please view the answer posted in your first thread.
    how to write sql query.
    And, please don't post any duplicate thread.
    Regards.
    Satyaki De.

  • OIM sql Query for getting the status of the task which got failed

    Hi Everyone,
    We have a requirement like we need to get the status of a particular task(say Create User in OID resource - Completed\Rejected status) for the particular user.We are able to get the status of the resource provisioed to the user but not the status of the particular task getting trigerred for the user.can someone put some light on this.We need to get the SQL query for this.
    Thanks in Advance.
    Regards,
    MKN

    Hi
    Use this sample query to get the task status, also check the cooments
    SELECT USR.USR_LOGIN, OSI.SCH_KEY,SCH.SCH_STATUS,STA.STA_BUCKET FROM
    OSI,SCH,STA,MIL,TOS,PKG,OIU,USR,OBJ,OST
    WHERE OSI.MIL_KEY=MIL.MIL_KEY
    AND SCH.SCH_KEY=OSI.SCH_KEY
    AND STA.STA_STATUS=SCH.SCH_STATUS
    AND TOS.PKG_KEY=PKG.PKG_KEY
    AND MIL.TOS_KEY=TOS.TOS_KEY
    AND OIU.USR_KEY=USR.USR_KEY
    AND OIU.OST_KEY=OST.OST_KEY
    AND OST.OBJ_KEY=OBJ.OBJ_KEY
    AND OSI.ORC_KEY=OIU.ORC_KEY
    AND OBJ.OBJ_NAME='AD User'
    AND OST.OST_STATUS = 'Provisioning' -- filter accordinglly
    AND STA.STA_BUCKET = 'Pending' -- filter accordinglly
    AND PKG.PKG_NAME='AD User' -- filter accordinglly
    AND MIL.MIL_NAME='System Validation' ---- filter accordinglly
    Thanks,
    Kuldeep

  • I want sql query for this output

    hi guys
    could u tell how can i write sql query for this out put
    i have one table like this
    ID ACCOUTID TAX
    1 1 A
    2 1 B
    3 2 C
    4 2 D
    5 3 E
    7 NULL F
    8 NULL G
    MY OUT PUT MUST BE LIKE THIS
    ID AID TAX
    2 1 A
    4 2 D
    7 NULL F
    8 NULL G
    HERE IN THIS OUTPUT I SHOULD HAVE
    MAXIMAM ID VALUE FOR A REPEATED AID VALUES
    AND
    THE ROWS AID VALUES IS NULL ALSO MUST PAPULATED IN THE OUTPUT.
    I KNOW ONE SOLUTION LIKE THIS
    SELECT MAX(ID),AID,TAX
    FROM TABLE T
    GROUP BY AID,TAX
    UNION ALL
    SELECT ID, AIC,TAX
    FROM TABLE T
    WHERE AID IS NULL;
    BUT I WANT SAME RESULT WITH OUT USING LOGICAL OPERATORS.
    COULD U PLZ TELL A SOL.

    Will this help:
    SQL> with t as
      2    (
      3      select 1 ID, 1 ACCOUTID, 'A' TAX from dual union all
      4      select 2, 1, 'B' from dual union all
      5      select 3, 2, 'C' from dual union all
      6      select 4, 2, 'D' from dual union all
      7      select 5, 3, 'E' from dual union all
      8      select 7, NULL, 'F' from dual union all
      9      select 8, NULL, 'G' from dual
    10    )
    11  --
    12  select id, ACCOUTID AID, Tax
    13  from
    14  (
    15    select t.*
    16          ,count(1)       over (partition by t.ACCOUTID) cn
    17          ,row_number()   over (partition by t.ACCOUTID order by id desc) rn
    18    from t
    19  )
    20  where cn > 1
    21  and (rn = 1 or ACCOUTID is null)
    22  /
            ID        AID T
             2          1 B
             4          2 D
             8            G
             7            F
    -- If I leave out the OR condition then you'll get this:
    SQL> ed
    Wrote file afiedt.buf
      1  with t as
      2    (
      3      select 1 ID, 1 ACCOUTID, 'A' TAX from dual union all
      4      select 2, 1, 'B' from dual union all
      5      select 3, 2, 'C' from dual union all
      6      select 4, 2, 'D' from dual union all
      7      select 5, 3, 'E' from dual union all
      8      select 7, NULL, 'F' from dual union all
      9      select 8, NULL, 'G' from dual
    10    )
    11  --
    12  select id, ACCOUTID AID, Tax
    13  from
    14  (
    15    select t.*
    16          ,count(1)       over (partition by t.ACCOUTID) cn
    17          ,row_number()   over (partition by t.ACCOUTID order by id desc) rn
    18    from t
    19  )
    20  where cn > 1
    21* and rn = 1
    SQL> /
            ID        AID T
             2          1 B
             4          2 D
             8            G
    --which follows the description you've given, but not the output

  • Open failed for members of log group

    HI,
    OS : LINUX 5.1
    DB : 10.2.0.3
    i have configured physical standby and its working fine. but in alert log i m getting below error.
    i have checked the physical location of member. it is very much available.
    Mon May 24 23:54:19 2010
    Errors in file /u001/app/oracle/admin/YAHOO/bdump/yahoo_mrp0_3526.trc:
    ORA-00313: open failed for members of log group 1 of thread 1
    ORA-00312: online log 1 thread 1: '/u001/app/oracle/oradata/YAHOO/redo01.log'
    ORA-27037: unable to obtain file status
    Linux Error: 2: No such file or directory
    Additional information: 3
    Mon May 24 23:54:19 2010
    Errors in file /u001/app/oracle/admin/YAHOO/bdump/yahoo_mrp0_3526.trc:
    ORA-00313: open failed for members of log group 1 of thread 1
    ORA-00312: online log 1 thread 1: '/u001/app/oracle/oradata/YAHOO/redo01.log'
    ORA-27037: unable to obtain file status
    Linux Error: 2: No such file or directory
    Additional information: 3
    Clearing online redo logfile 1 /u001/app/oracle/oradata/YAHOO/redo01.log
    Clearing online log 1 of thread 1 sequence number 31
    Mon May 24 23:54:19 2010
    Errors in file /u001/app/oracle/admin/YAHOO/bdump/yahoo_mrp0_3526.trc:
    ORA-00313: open failed for members of log group 1 of thread 1
    ORA-00312: online log 1 thread 1: '/u001/app/oracle/oradata/YAHOO/redo01.log'
    ORA-27037: unable to obtain file status
    Linux Error: 2: No such file or directory
    Additional information: 3
    Mon May 24 23:54:19 2010
    Errors in file /u001/app/oracle/admin/YAHOO/bdump/yahoo_mrp0_3526.trc:
    ORA-19527: physical standby redo log must be renamed
    ORA-00312: online log 1 thread 1: '/u001/app/oracle/oradata/YAHOO/redo01.log'
    can any one suggest?
    Regards,
    BK

    Hi,
    Below note was taken from metalink;
    Symptoms
    Following errors in alert.log of standby database during startup of the standby database:
    ORA-00313: open failed for members of log group 1 of thread 1
    ORA-00312: online log 1 thread 1: '/u03/oradata/prod/redo01b.log'
    ORA-27037: unable to obtain file status
    Cause
    Online Redo logs missing on standby database.
    Solution
    You can safely ignore these messages. Online redo logs will be created automatically when you activate the standby after switchover or failover.
    If you want to fix these messages then please use following steps:
    1. Check and set "log_file_name_convert" parameter if the location of log files are different on primary and standby.
    SQL> alter system set log_file_name_convert = "'<location on primary>','<location on standby>'" scope=spfile;
    If you are using pfile then set the parameter in init file after shutting down the database:
    *.log_file_name_convert = '<location on primary>','<location on standby>'
    For 10gR2 only : Set this parameter even if the location of the redo logs are same on both primary and standby otherwise you may get ORA-19527 and ORA-312 while or after implementing the below steps.
    This is due to internal bug in 10.2.
    2. Cancel Managed Recovery process on the standby:
    SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
    3. Execute the command to clear all log groups on standby for each log group (for each log group):
    SQL>alter database clear logfile group 1;
    4. Check the v$log view to confirm the size and status.
    5. Recreate standby redo logs on standby (only if standby Redo logs are also missing) using:
    (a) Drop the standby redo logfile group(s) (check v$standby_log)
    SQL> alter database drop standby logfile group 4;
    (b) Recreate the standby logfile group(s)
    SQL> alter database add standby logfile group 4 ('/u03/redo/stby01.log') size 50m;
    Hope it helps you.

  • Extracting the Logical sql query for the specified report  in OBIEE 11g

    Hi ,
    I want to extract the logical SQL Query for the Particular report in OBIEE 11.1.1.5.
    Any pointers related to this will be very helpful.
    Thanks,
    Sonali

    for a try please add Logical sql view to ur report it will dispaly the Logical sql for that Report..
    Hope it will helps you.

  • Oracle SQL query for getting specific special characters from a table

    Hi all,
    This is my table
    Table Name- Table1
    S.no    Name
    1          aaaaaaaa
    2          a1234sgjghb
    3          a@3$%jkhkjn
    4          abcd-dfghjik
    5          bbvxzckvbzxcv&^%#
    6          ashgweqfg/gfjwgefj////
    7          sdsaf$([]:'
    8          <-fdsjgbdfsg
    9           dfgfdgfd"uodf
    10         aaaa  bbbbz#$
    11         cccc dddd-/mnm
    The output has to be
    S.no    Name
    3          a@3$%jkhkjn
    5          bbvxzckvbzxcv&^%#
    7          sdsaf$([]:'
    8          <-fdsjgbdfsg
    10         aaaa  bbbbz#$
    It has to return "Name" column which is having special characters,whereas some special chars like -, / ," and space are acceptable.
    The Oracle query has to print columns having special characters excluding -,/," and space
    Can anyone help me to get a SQL query for the above.
    Thanks in advance.

    You can achieve it in multiple ways. Here are few.
    SQL> with t
      2  as
      3  (
      4  select 1 id, 'aaaaaaaa' name from dual union all
      5  select 2 id, 'a1234sgjghb' name from dual union all
      6  select 3 id, 'a@3$%jkhkjn' name from dual union all
      7  select 4 id, 'abcd-dfghjik' name from dual union all
      8  select 5 id, 'bbvxzckvbzxcv&^%#' name from dual union all
      9  select 6 id, 'ashgweqfg/gfjwgefj////' name from dual union all
    10  select 7 id, 'sdsaf$([]:''' name from dual union all
    11  select 8 id, '<-fdsjgbdfsg' name from dual union all
    12  select 9 id, 'dfgfdgfd"uodf' name from dual union all
    13  select 10 id, 'aaaa  bbbbz#$' name from dual union all
    14  select 11 id, 'cccc dddd-/mnm' name from dual
    15  )
    16  select *
    17    from t
    18   where regexp_like(translate(name,'a-/" ','a'), '[^[:alnum:]]');
            ID NAME
             3 a@3$%jkhkjn
             5 bbvxzckvbzxcv&^%#
             7 sdsaf$([]:'
             8 <-fdsjgbdfsg
            10 aaaa  bbbbz#$
    SQL> with t
      2  as
      3  (
      4  select 1 id, 'aaaaaaaa' name from dual union all
      5  select 2 id, 'a1234sgjghb' name from dual union all
      6  select 3 id, 'a@3$%jkhkjn' name from dual union all
      7  select 4 id, 'abcd-dfghjik' name from dual union all
      8  select 5 id, 'bbvxzckvbzxcv&^%#' name from dual union all
      9  select 6 id, 'ashgweqfg/gfjwgefj////' name from dual union all
    10  select 7 id, 'sdsaf$([]:''' name from dual union all
    11  select 8 id, '<-fdsjgbdfsg' name from dual union all
    12  select 9 id, 'dfgfdgfd"uodf' name from dual union all
    13  select 10 id, 'aaaa  bbbbz#$' name from dual union all
    14  select 11 id, 'cccc dddd-/mnm' name from dual
    15  )
    16  select *
    17    from t
    18   where translate
    19         (
    20            lower(translate(name,'a-/" ','a'))
    21          , '.0123456789abcdefghijklmnopqrstuvwxyz'
    22          , '.'
    23         ) is not null;
            ID NAME
             3 a@3$%jkhkjn
             5 bbvxzckvbzxcv&^%#
             7 sdsaf$([]:'
             8 <-fdsjgbdfsg
            10 aaaa  bbbbz#$
    SQL>

  • ORA-00313: open failed for members of log group 4 of thread 2

    Hi.
    i have found the below error in one of RAC instance.Could you please advise on this since i am new to RAC env
    ORA-00313: open failed for members of log group 4 of thread 2
    ORA-00312: online log 4 thread 2: '+NEWDISK_GROUP/DEMO/onlinelog/group_4.1453.1029312423'
    ORA-17503: ksfdopn:2 Failed to open file +NEWDISK_GROUP/DEMO/onlinelog/group_4.1453.1029312423
    ORA-15032: not all alterations performed
    ORA-29702: error occurred in Cluster Group Service operation
    ORA-29702: error occurred in Cluster Group Service operation
    Thanks
    Sai

    any update on this?

  • ORA-00313: open failed for members of log group 1 of thread 1

    Hi
    I'm restoring a database on a different host. I have the backups, from which I want to restore the database. I made the corresponding changes in the initSID.ora file and started the script to do the restore.These are the steps I followed:
    connect target=/
    run{
    startup nomount;
    allocate channel c1 type disk;
    allocate channel c2 type disk;
    allocate channel c3 type disk;
    allocate channel c4 type disk;
    restore controlfile from '/tmp_backups/rman/lev0_open_cf_SID_2826_1';
    alter database mount;
    set newname for all datafiles
    restore database;
    set until logseq = 29317 thread = 1;
    switch datafile all;
    recover database;
    alter database open resetlogs;
    One mistake I made here is that logseq should have been last seq+1, which I did not do. I have it as last seq.
    Restore of datafiles and switching of datafiles was fine. But I get error for redo log files.
    ORA-00313: open failed for members of log group 1 of thread 1
    ORA-00312: online log 1 thread 1: '/u13/oradata/SID/redo02a.log'
    ORA-27037: unable to obtain file status
    SVR4 Error: 2: No such file or directory
    Additional information: 3
    Why is it looking for at the old path yet?
    I'm not sure what I missed and how to proceed. Please help.
    Thanks,
    Mamata

    I do believe that set newname for all datafiles only means actual datafiles and no redo logs. So with open resetlogs, Oracle tries to create new redo logfiles where the backup controlfiles says they are.
    As with creating a auxilliary database in another filesystem, we use DB_NAME_FILE_CONVERT and LOG_FILE_NAME_CONVERT.
    I am not sure if it is possible to type "set newname for all datafiles" and expect also the redo logfiles to change location.
    You might try to set these two parameters and see if it works.
    good luck.
    rgds
    Kjell Ove

Maybe you are looking for