Query help - problems with ROLLUP

I'm trying to make a query i can use for an alert, it generates sales for the past 7 days.
This query works fine:
SELECT
      CASE WHEN GROUPING(T0.[CardCode]) = 0
            THEN CAST (T0.[CardCode] AS CHAR(8))
            ELSE 'ALL'
      END AS Customer#,
      SUM(T0.[Max1099]) AS "Total Sales",
      SUM(T0.[GrosProfit]) AS "Gross Profit" 
FROM OINV T0
WHERE T0.[DocDate] >= DATEADD(dd,DATEDIFF(dd,0,GETDATE())-7,0) AND T0.[Max1099] > 0
GROUP BY T0.[CardCode] WITH ROLLUP
And it gives me this:
#     Customer#*     Total Sales*     Gross Profit*     
1     C2235              8,285.87       4,165.77            
2     C2236           10,191.39              4,197.95            
3     C2253                570.56               311.17          
4     C3008           18,756.76       5,720.21            
5     ALL                   37,804.58    14,395.10            
Which is great. Gives me a total at the end, and substitutes "ALL" for the customer number. Lovely.
Problem #1: I REALLY want it to give the Customer Name NEXT TO the Customer Number. But when I try to add it, i have to add it to the GROUP BY as well. Which changes the query to this:
SELECT
      CASE WHEN GROUPING(T0.[CardCode]) = 0
            THEN CAST (T0.[CardCode] AS CHAR(8))
            ELSE 'ALL'
      END AS Customer#,    
      CardName as "Cust Name",     
      SUM(T0.[Max1099]) AS "Total Sales",
      SUM(T0.[GrosProfit]) AS "Gross Profit"
FROM OINV T0
WHERE T0.[DocDate] >= DATEADD(dd,DATEDIFF(dd,0,GETDATE())-7,0) AND T0.[Max1099] > 0
GROUP BY T0.[CardCode], T0.[CardName] WITH ROLLUP
And changes my output to THIS:
#     Customer#     Cust Name                             Total Sales     Gross Profit     
1     C2235             Acme Products                      8,285.87               4,165.77     
2     C2235          (blanks blanks)                        8,285.87               4,165.77     
3     C2236             Some Other Products             10,191.39               4,197.95     
4     C2236          (blanks blanks blanks)            10,191.39               4,197.95     
5     C2253             Third Customer Name             570.56                  311.17     
6     C2253          (blanks blanks blanks)                570.56                  311.17     
7     C3008             Fourth Customer Name       18,756.76       5,720.21     
8     C3008          (blanks blanks blanks)                                               18,756.76       5,720.21     
9     ALL                                                                  37,804.58     14,395.10     
( I have replaced actual customer names, of course, and replaces actual blanks with the word 'blanks' so it would be more legible.)
I can't figure out a way to simply list the customer name next to the number. Instead , it gives me a summary for the CardCode and a summary for the CardName.
I've tried combining the two into one field, on the fly, but haven't been successful.
Problem #2 - extra credit!
If i really want this done right, i should also have a query that pulls the same data from ORIN (Credit Memos) and do a UNION ALL, but when i do this, is simply rejects me at the word "UNION"
any and all help appreciated, and to test this, you can just cut and past the query into SAP, it will run right there, no mods needed.
oops. I had to change the "Not Equal" symbol to just "greater than" for "Max1099" because it was just dropping the symbol...
Edited by: Dante Amodeo on Jan 18, 2012 6:30 PM

Try:
SELECT CAST (T0.CardCode AS CHAR(8)) AS Customer#,
MAX(T0.CardName) 'Customer Name',
SUM(T0.Max1099) AS 'Total Sales',
SUM(T0.GrosProfit) AS 'Gross Profit'
FROM OINV T0
WHERE DATEDIFF(dd,T0.DocDate,GETDATE())<=7 AND T0.Max1099 > 0
GROUP BY T0.CardCode
UNION ALL
SELECT 'ALL','',SUM(T0.Max1099),
SUM(T0.GrosProfit)
FROM OINV T0
WHERE DATEDIFF(dd,T0.DocDate,GETDATE())<=7 AND T0.Max1099 > 0

Similar Messages

  • Premiere Pro CS5: please help problem with importing a file error output "there was an error decompressing audio or video"

    please help problem with importing a file error output "there was an error decompressing audio or video"

    this is related to what adobe program/version?

  • Modifying  the Ad-hoc Query Infoset : problem with P9105 fields.

    Hi all,
    Am having problem with Infoset of Ad-hoc Query .
    i need to add the Critical role Field Group to ZHR_PA_01 Infoset of Satandard Area.
    for this i have imported that Infotype 9105 and included the following standard fields by drag and drop.
                    1. Role Category
                    2. Role SubCategory
                    3. Global Identifier 
                    4. Personnel Number
    and then Saved and Generated the infoset succesfully.(No syntax errors)
    But
    While testing, using the T-Code:  S_PH0_48000510
    if i select one of these above fields for the report,
    Am getting the message that "Error when generating the report".
    Error Description:The report cannot be generated because the internal description is invalid or incomplete.
    means what may be the problem.?
    if i select other fields its working fine.
    can any body explain me clearly..??
    Regars,
    Kalam A.

    Hi Manoj,
      yes, i have saved the T-code.and generated the Infoset Succesfully.
    and its showing the those additional fields while testing.
    for remaining fields its working fine.
    but am not getting wats problem with the four fields of P9105 infotype.
    could you please suggest me.?
    Regards,
    Kalam A.

  • HELP/Problems with pull-down navigator bar

    Hi everyone,
    I was wondering if I could get some input. I have just
    re-designed our magazine's site, www.easternsurf.com
    I used Pop-Up menu function in Fireworks 8 to generate our
    Navigator bar. For the most part everything has been working well,
    BUT we've had a couple of complaints that the navigator bar's
    pull-down menus get stuck behind the photos/banner ads/etc. instead
    of in front of them when viewing in Internet Explorer. I'm on the
    Mac platform (OSX Tiger/Macromedia Studio 8) and have seen no
    problems viewing in Safari, Firefox and Netscape. The only
    complaints have come from Internet Explorer users. A couple of
    people updated their browser to the newest version and the problem
    disappeared, however we've still had a couple of people that have
    written in that the newest version of IE is still not displaying
    properly.
    Also we've got a strip of button ads running down the left
    hand side of each page and I've also seen another issue that's
    common on sites of this type...when the pulldown menu overlaps with
    a Flash element, there is a problem with the screen re-draw. I've
    seen this on several other sites and know it's a common problem,
    but does anyone know of a workaround where this won't happen? I
    just noticed that signing on to Adobe's site, there almost seems to
    be a command where the menu keeps re-drawing at a very rapid rate
    so this won't happen.
    Any input would be greatly appreciated, although I'm Mac all
    the way, we are a business and have to get this site visible for
    everyone!
    Thanks

    Hi Oldbudge,
    Welcome to the Community,
    Please Perform a Battery Pull Restart like this While Device is Powered On remove the Battery wait for a min. then re-insert it back wait till the device take a long Reboot.And see if that helps.
    Good Luck
    Prince
    Click " Like " if you want to Thank someone.
    If Problem Resolves mark the post(s) as " Solution ", so that other can make use of it.
    Click " Like " if you want to Thank someone.
    If Problem Resolves mark the post(s) as " Solution ", so that other can make use of it.

  • Help - problem with white iphone 4 speaker

    Hi, i have a problem with my white iphone 4 speaker. I know the specs stated that the mic is supposed to be on the left and the right is the speaker but i've compared at least 2 other black iphones 4s and there is some volume from the left side (if you close the right side) whereas mine is practically non-existent. Should i be concerned? Is this specific to the white iphone 4? The local telco has not been helpful - they can only reformat the phone and said that this is a software problem. Anyone with similar experience pls share. Thanks in advance.

    irene sim wrote:
    Hi, i have a problem with my white iphone 4 speaker. I know the specs stated that the mic is supposed to be on the left and the right is the speaker but i've compared at least 2 other black iphones 4s and there is some volume from the left side (if you close the right side) whereas mine is practically non-existent. Should i be concerned? Is this specific to the white iphone 4? The local telco has not been helpful - they can only reformat the phone and said that this is a software problem. Anyone with similar experience pls share. Thanks in advance.
    You already know the answer.  ALL iphones, every single one of them, have but one speaker at the bottom.  You have NO ISSUE at all with your speakers.  None.  Nothing is wrong.  At all.  No problem.  None.

  • Pleaseeeeeee Help - Problems with position of my web page

    Hi, first sorry on my english
    I have problem with position of my page. I had made my web page in Indesign CS5 and exported to swf file. My web page is working fine (www.igor-flytying.com) but the page is not in the middle of the web browser. How can I fix the problem????? I am a beginer in Indesign. I had try to make some changes in html file (salign) but still nothing.
    Please HELLLLLPPPPPP
    Regards
    Aljosa

    Petteri, SWFObject is much better because it loads the JavaScript so you don't see it inside the HTML page, but it still wraps the swf in a div which by default will be positioned in the upperleft of the browser window.
    This is the only way I've been able to center using SWFObject—note that it's the "flashcontent" div style that does the centering not the align embed parameter:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
    <head>
    <title>S W F | Centered</title>
    <meta http-equiv="Content-Type" content="text/html" />
    <!-- Centers the swf on the page. Note: width and height need to match the swf and margin left and right are -.50%-->
    <style type="text/css">
              #flashcontent {width: 1000px; height: 750px; margin-left: -500px; margin-top: -375px; position: absolute; left: 50%; top: 50%;}
    </style>
              <script type="text/javascript" src="swfobject.js"></script>
              <script type="text/javascript">
                        var flashvars = {};
                        flashvars.myFlashVar = "Testing";
                        var params = {}; //Embed parameters: http://kb2.adobe.com/cps/127/tn_12701.html
                        params.quality = "best";
                        params.align="t"
                        //SWFObject parameters: http://code.google.com/p/swfobject/wiki/api
                        swfobject.embedSWF("swftest.swf", "flashcontent", "1000", "750", "10.0", false, flashvars, params);
              </script>
    </head>
    <!-- ALT HTML TEXT-->
    <body style="background-color: #888888">
              <div id="flashcontent">
                        <a href="http://www.adobe.com/go/getflashplayer"><img src="getFlash.gif"  alt="adobe icon" border="0" /></a>
              </div>
    </body>
    </html>

  • Help - Problem with word documents

    Hi
    All of a sudden I am having problems with documents in my word application.  Files I have previously transderred on to my Mac from a memory stick or via email attachments are unable to be altered.  i cannot add to a downloaded document that needs to be filled in or alter a date on a letter that I send out each month.  I am not very compiter literate.
    Beryl

    Hi
    All of a sudden I am having problems with documents in my word application.  Files I have previously transderred on to my Mac from a memory stick or via email attachments are unable to be altered.  i cannot add to a downloaded document that needs to be filled in or alter a date on a letter that I send out each month.  I am not very compiter literate.
    Beryl

  • Please Help-Problem with Optical Drive, it's a Mystery...

    Well I'm a fairly big Imogen Heap fan, and her new CD came out the 25th. So I went to Best Buy and I bought the deluxe version which includes a seperate disc with instrumentals. I got home, put it in, and my Mac made a "scratching" kind of noise, then it spit out the disc. I figured there was a problem with it, I went back to Best Buy, got a new one, and it did the exact same thing.
    HOWEVER, both of the instrumental discs worked just fine, and imported just fine. The normal audio disc also works on my Ubuntu computer, Windows computer, and my other Early 2009 Macbook Pro. I also restarted my Mac, cleaned the disc, and that did nothing.
    So, what's the problem do you think?
    (Also I went to Apple but there were no appointments available, and they were too busy to just look at it without an appointment )

    Hi Mate,
    I didn't do an OS install, I took it to an apple store and made a Genius Bar appointemnt. Explained the proble and after 15min conversation, they diagnosed it as teh following;
    The felt/rubber where you put the CD/DVD had gone hard and the friction is causing the CD/DVD to get stuck and be loaded. They tried to tell me that I need to replace the top case  (£140+VAT) as its in-built into it or I can use a £3 spudger to push the CD's in......needles to say the Spudger works fine.....Shame I wasted £100 on the new optical drive ;o( Maybe sell teh spare on eBay....Happy days!

  • Help, problem with keeping ipod connected..

    When I connect my ipod, it updates in itunes and then disconnects itself from the computer...how do I make it so after it updates it stays connected and keeps flashing "Do Not Disconnect" on the ipod?

    rahul,
    OK, I do understand you may be having some early problems with just a little bit of data with a few tunes. Have you thought about what you will do in the future as you add more? This is my post on that topic:
    I have been trying to find a way to upload my CD library to my new 60GB iPod (that function works fine) and classify / manage my CD library on it (using iTunes)- that function is nearly unworkable. Now, today, I have used my only 'free' direct APPLE Support contact and the basic answer was 'Too Bad for You!! The iPod does not have nor support multi level indexing or playlists!!!! So...go ahead, load 500 or 600 Cd's onto your iPod and then try to find the tracks you wish to play!! It can't be done except for a 'flat' one level filing system!!! What a BUMMER

  • Help - Problem with Java Updating

    In updating to the latest version of Java - 8.45 - I must also load the Unlimited Strength encryption files.  At least, that's what the README file sez ...
    Unfortunately - when I agree to the terms, and download the "Unlimited Policy" zip file, it contains the US Export Policy encryption file, and NOT the Unlimited Policy File. 
    Can someone help me with what's going on here?  Thanks in advance ... !

    My friend looks like that u are using javax.swing.filechooser.FileFilter class as your file filter. Nothing wrong with it, but it works only with JFileChooser and not with the java.io.File.listFiles method. for that u will have to implement the java.io.FileFilter interface.
    He is the code example...
    import javax.swing.*;
    import java.io.*;
    public class FileTest implements FileFilter {
         public static void main (String args[]) throws Exception {
              new FileTest();
         public FileTest() {
              File f = new File(".");
              File [] list = f.listFiles(this);
              for (int i = 0; i < list.length; i++) {
                   System.out.println(list);
    class MyFileFilter implements FileFilter {
         public boolean accept(File pathName) {
              if (pathName.isDirectory()) return true;
              String ext = pathName.getName();
              ext = ext.substring(ext.lastIndexOf(".") + 1, ext.length());
              if (ext.equals("java")) { //check for any extension you want to list
                   return true;
              return false;

  • XML Query Help row with no data

    declare @address table
    AddressID int,
    AddressType varchar(12),
    Address1 varchar(20),
    Address2 varchar(20),
    City varchar(25),
    AgentID int
    insert into @address 
    select 1, 'Home', 'abc', 'xyz road', 'RJ', 1 union all
    select 2, 'Office', 'temp', 'ppp road', 'RJ', 1 union all
    select 3, 'Home', 'xxx', 'aaa road', 'NY', 2 union all
    select 4, 'Office', 'ccc', 'oli Com', 'CL', 2 union all
    select 5, 'Temp', 'eee', 'olkiu road', 'CL', 2 union all
    select 6, 'Home', 'ttt', 'loik road', 'NY', 3
    SELECT a.* from @address a 
    where a.AddressID = 1
    FOR XML path('Addresses')
    SELECT a.* from @address a 
    where a.AddressID = 9
    FOR XML path('Addresses')
    Issue:
    As you can see for second query where AddressID = 9 is not exists so xml is not generated but
    my expected result is for second query is
    <Addresses>
    <AddressID />
    <AddressType />
    <Address1 />
    <Address2 />
    <City />
    <AgentID />
    </Addresses>
    Thanks in advance for all your help. 

    First of all: Your expectation is wrong. Sorry to say that. But your SQL statement for A.AddressID = 9 does not return a row. So no row is converted. I hope you C it: void.
    From the XML viewpoint:
    <Addresses>
    <AddressID />
    <AddressType />
    <Address1 />
    <Address2 />
    <City />
    <AgentID />
    </Addresses>
    is equivalent to
    <Addresses />
    which is equivalent to
    void
    You C. Sorry got infeCted some how ;)
    The only meaningful result in XML would be:
    <Addresses ID="1">
    <AddressType>Home</AddressType>
    <Address1>abc</Address1>
    <Address2>xyz road</Address2>
    <City>RJ</City>
    <AgentID>1</AgentID>
    </Addresses>
    <Addresses ID="9"/>
    Cause now Addresses (Really? A plural form for a single entity?) transports the meaning, well there is no data (no row) for it. We tried to find it, but we failed. In opposite to
    <Addresses>
    <AddressID>9</AddressID>
    <AddressType />
    <Address1 />
    <Address2 />
    <City />
    <AgentID />
    </Addresses>
    <Addresses ID="9">
    <AddressType />
    <Address1 />
    <Address2 />
    <City />
    <AgentID />
    </Addresses>
    Which says: well, we have a row with the ID 9, but the rest of the columns is empty.
    The problem is mere semantics. But it's an important difference.
    Now for your problem: Why do you expect this? Where do can you work with such a kind of informationless result?
    btw, as you're using already a table variable (+1), you should also use
    table value constructors like
    INSERT INTO @address
    VALUES ( 1, 'Home', 'abc', 'xyz road', 'RJ', 1 ),
    ( 2, 'Office', 'temp', 'ppp road', 'RJ', 1 ),
    ( 3, 'Home', 'xxx', 'aaa road', 'NY', 2 ),
    ( 4, 'Office', 'ccc', 'oli Com', 'CL', 2 ),
    ( 5, 'Temp', 'eee', 'olkiu road', 'CL', 2 ),
    ( 6, 'Home', 'ttt', 'loik road', 'NY', 3 );
    I would use a tally table, when you really need this:
    DECLARE @address TABLE
    AddressID INT ,
    AddressType VARCHAR(12) ,
    Address1 VARCHAR(20) ,
    Address2 VARCHAR(20) ,
    City VARCHAR(25) ,
    AgentID INT
    INSERT INTO @address
    VALUES ( 1, 'Home', 'abc', 'xyz road', 'RJ', 1 ),
    ( 2, 'Office', 'temp', 'ppp road', 'RJ', 1 ),
    ( 3, 'Home', 'xxx', 'aaa road', 'NY', 2 ),
    ( 4, 'Office', 'ccc', 'oli Com', 'CL', 2 ),
    ( 5, 'Temp', 'eee', 'olkiu road', 'CL', 2 ),
    ( 6, 'Home', 'ttt', 'loik road', 'NY', 3 );
    WITH n1
    AS ( SELECT *
    FROM ( VALUES ( 1), ( 1), ( 1), ( 1) ) Q ( n )
    n2
    AS ( SELECT a.n
    FROM n1 a ,
    n1 b ,
    n1 c ,
    n1 d
    NumberTally
    AS ( SELECT ROW_NUMBER() OVER ( ORDER BY n ) AS n
    FROM n2
    SELECT NT.n AS [@ID] ,
    a.AddressType ,
    a.Address1 ,
    a.Address2 ,
    a.City ,
    a.AgentID
    FROM NumberTally NT
    LEFT JOIN @address a ON a.AddressID = NT.n
    WHERE NT.n IN ( 1, 9 )
    FOR XML PATH('Address');
    or the void version:
    DECLARE @address TABLE
    AddressID INT ,
    AddressType VARCHAR(12) ,
    Address1 VARCHAR(20) ,
    Address2 VARCHAR(20) ,
    City VARCHAR(25) ,
    AgentID INT
    INSERT INTO @address
    VALUES ( 1, 'Home', 'abc', 'xyz road', 'RJ', 1 ),
    ( 2, 'Office', 'temp', 'ppp road', 'RJ', 1 ),
    ( 3, 'Home', 'xxx', 'aaa road', 'NY', 2 ),
    ( 4, 'Office', 'ccc', 'oli Com', 'CL', 2 ),
    ( 5, 'Temp', 'eee', 'olkiu road', 'CL', 2 ),
    ( 6, 'Home', 'ttt', 'loik road', 'NY', 3 );
    WITH n1
    AS ( SELECT *
    FROM ( VALUES ( 1), ( 1), ( 1), ( 1) ) Q ( n )
    n2
    AS ( SELECT a.n
    FROM n1 a ,
    n1 b ,
    n1 c ,
    n1 d
    NumberTally
    AS ( SELECT ROW_NUMBER() OVER ( ORDER BY n ) AS n
    FROM n2
    SELECT a.AddressID AS [@ID] ,
    a.AddressType ,
    a.Address1 ,
    a.Address2 ,
    a.City ,
    a.AgentID
    FROM NumberTally NT
    LEFT JOIN @address a ON a.AddressID = NT.n
    WHERE NT.n IN ( 1, 9 )
    FOR XML PATH('Address');

  • [HELP] Problem with restore and recovery to new host

    Hi, guys!
    I have been trying for two days, but still cannot get it to work.
    I have taken a full hot(online) backup with archive logs as well as the control file and SPFILE, and then copied the backup to the new host with the same directory structure and settings. Finally, I have tried to restore & recover the database on the new host but failed during the restore process.
    Both the original host and the new host have the same Oracle installed down to the patch level. I couldn't figure out the proper solution to this problem base on my limited knowledge about Oracle DB.
    Could anyone help me out here? Any advice would be appreciated!
    RMAN> restore database until sequence 10 thread 1;
    Starting restore at 08-NOV-11
    using channel ORA_DISK_1
    channel ORA_DISK_1: starting datafile backupset restore
    channel ORA_DISK_1: specifying datafile(s) to restore from backup set
    restoring datafile 00001 to D:\DBDATA\PRODDB\SYSTEM01.DBF
    restoring datafile 00002 to D:\DBDATA\PRODDB\UNDOTBS01.DBF
    restoring datafile 00003 to D:\DBDATA\PRODDB\SYSAUX01.DBF
    restoring datafile 00004 to D:\DBDATA\PRODDB\USERS01.DBF
    restoring datafile 00005 to D:\ORA_DATADATA01.DBF
    restoring datafile 00006 to D:\ORA_DATA\DATA02.DBF
    restoring datafile 00007 to D:\ORA_DATA\INDX01.DBF
    restoring datafile 00008 to D:\ORA_DATA\INDX02.DBF
    channel ORA_DISK_1: reading from backup piece C:\ORACLE\PRODUCT\10.2.0\FLASH_REC
    OVERY_AREA\PRODDB\BACKUPSET\2011_11_07\O1_MF_NNNDF_TAG20111107T175037_7CH6YYVJ_.BK
    P
    failover to previous backup
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of restore command at 11/08/2011 11:41:33
    RMAN-06026: some targets not found - aborting restore
    RMAN-06023: no backup or copy of datafile 4 found to restore
    RMAN-06023: no backup or copy of datafile 3 found to restore
    RMAN-06023: no backup or copy of datafile 2 found to restore
    RMAN-06023: no backup or copy of datafile 1 found to restore
    Here is some extra information that you might want to know about:
    RMAN> list incarnation;
    List of Database Incarnations
    DB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time
    1 1 PRODDB 3774691295 PARENT 1 17-APR-07
    2 2 PRODDB 3774691295 PARENT 521803 06-OCT-11
    3 3 PRODDB 3774691295 PARENT 1595143 20-OCT-11
    4 4 PRODDB 3774691295 PARENT 1600974 20-OCT-11
    5 5 PRODDB 3774691295 PARENT 1952053 27-OCT-11
    6 6 PRODDB 3774691295 CURRENT 2146951 07-NOV-11
    RMAN> list backup recoverable;
    List of Backup Sets
    ===================
    BS Key Type LV Size Device Type Elapsed Time Completion Time
    37 Full 822.34M DISK 00:29:47 07-NOV-11
    BP Key: 37 Status: AVAILABLE Compressed: NO Tag: TAG20111107T175037
    Piece Name: C:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\PRODDB\BACKUPSET\
    2011_11_07\O1_MF_NNNDF_TAG20111107T175037_7CH6YYVJ_.BKP
    List of Datafiles in backup set 37
    File LV Type Ckp SCN Ckp Time Name
    1 Full 2149673 07-NOV-11 D:\DBDATA\PRODDB\SYSTEM01.DBF
    2 Full 2149673 07-NOV-11 D:\DBDATA\PRODDB\UNDOTBS01.DBF
    3 Full 2149673 07-NOV-11 D:\DBDATA\PRODDB\SYSAUX01.DBF
    4 Full 2149673 07-NOV-11 D:\DBDATA\PRODDB\USERS01.DBF
    5 Full 2149673 07-NOV-11 D:\ORA_DATA\DATA01.DBF
    6 Full 2149673 07-NOV-11 D:\ORA_DATA\DATA02.DBF
    7 Full 2149673 07-NOV-11 D:\ORA_DATA\INDX01.DBF
    8 Full 2149673 07-NOV-11 D:\ORA_DATA\INDX02.DBF
    BS Key Type LV Size Device Type Elapsed Time Completion Time
    38 Full 6.95M DISK 00:00:03 07-NOV-11
    BP Key: 38 Status: AVAILABLE Compressed: NO Tag: TAG20111107T182034
    Piece Name: C:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\PRODDB\AUTOBACKUP
    \2011_11_07\O1_MF_S_766606834_7CH8Q439_.BKP
    Control File Included: Ckp SCN: 2151141 Ckp time: 07-NOV-11
    SPFILE Included: Modification time: 07-NOV-11
    BS Key Size Device Type Elapsed Time Completion Time
    39 18.46M DISK 00:00:05 08-NOV-11
    BP Key: 39 Status: AVAILABLE Compressed: NO Tag: TAG20111108T093359
    Piece Name: C:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\PRODDB\BACKUPSET\
    2011_11_08\O1_MF_ANNNN_TAG20111108T093359_7CJY7TG1_.BKP
    List of Archived Logs in backup set 39
    Thrd Seq Low SCN Low Time Next SCN Next Time
    1 1 2146951 07-NOV-11 2149493 07-NOV-11
    1 2 2149493 07-NOV-11 2149519 07-NOV-11
    1 3 2149519 07-NOV-11 2149565 07-NOV-11
    1 4 2149565 07-NOV-11 2149641 07-NOV-11
    1 5 2149641 07-NOV-11 2172859 07-NOV-11
    1 6 2172859 07-NOV-11 2197851 07-NOV-11
    1 7 2197851 07-NOV-11 2220349 08-NOV-11
    1 8 2220349 08-NOV-11 2222621 08-NOV-11
    1 9 2222621 08-NOV-11 2222729 08-NOV-11
    1 10 2222729 08-NOV-11 2223088 08-NOV-11
    BS Key Type LV Size Device Type Elapsed Time Completion Time
    40 Full 6.95M DISK 00:00:00 08-NOV-11
    BP Key: 40 Status: AVAILABLE Compressed: NO Tag: TAG20111108T093411
    Piece Name: C:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\PRODDB\AUTOBACKUP
    \2011_11_08\O1_MF_S_766661651_7CJY84LK_.BKP
    Control File Included: Ckp SCN: 2223097 Ckp time: 08-NOV-11
    SPFILE Included: Modification time: 08-NOV-11
    Thanks in advance!
    Jay

    Thank you for your reply,Hemant K Chitale!
    >
    a) Does the directory structur exist on the new server :
    D:\DBDATA\PRODDB\ --- for files 1 to 4
    D:\ --- for file 5
    D:\ORA_DATA\ --- for files 6 to 8
    >
    Yep, I have doubled check the directory structure that get in the way, and they are all exist.
    Would it be something to do with the folder permissions?
    >
    b) Apparently a RESETLOGS has been issued on 07-Nov. Which controflile backup do you have restored and mounted on the new server ? It should be the one after the RESETLOGS.
    >
    I restored the one included with the backup. Should I take another backup of controlfile seperately and restore from it instead?
    >
    (I assume that you did a RESTORE CONTROLFILE followed by sql "alter database mount" before the attempt to RESTORE DATABASE)
    >
    Yep, that's exactly what I did.
    //executed @ RMAN prompt of the new host
    startup nomount; 'the new host has the right SPFILE to start with so i didn''t bother to RESTORE SPFILE first.
    restore controlfile from autobackup;
    alter database mount;
    restore  database sequence 10 thread 1;
    //get stucked here with RMAN-06026, 06023
    //...the following is not executed yet.... :-(
    recover database until sequence 10;
    alter database open resetlogs;Edited by: HappyJay on 2011/11/08 13:25
    I have made several attemps with your advice, but still get the same type of errors.
    Here is the output:
    RMAN> list backup of controlfile;
    List of Backup Sets
    ===================
    BS Key Type LV Size Device Type Elapsed Time Completion Time
    38 Full 6.95M DISK 00:00:03 07-NOV-11
    BP Key: 38 Status: AVAILABLE Compressed: NO Tag: TAG20111107T182034
    Piece Name: C:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\PRODDB\AUTOBACKUP
    \2011_11_07\O1_MF_S_766606834_7CH8Q439_.BKP
    Control File Included: Ckp SCN: 2151141 Ckp time: 07-NOV-11
    BS Key Type LV Size Device Type Elapsed Time Completion Time
    40 Full 6.95M DISK 00:00:00 08-NOV-11
    BP Key: 40 Status: AVAILABLE Compressed: NO Tag: TAG20111108T093411
    Piece Name: C:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\PRODDB\AUTOBACKUP
    +\2011_11_08\O1_MF_S_766661651_7CJY84LK_.BKP+
    Control File Included: Ckp SCN: 2223097      Ckp time: 08-NOV-11
    as you suggested, this backup piece of controlfile should be right one to be restored.
    RMAN> shutdown;
    database dismounted
    Oracle instance shut down
    RMAN> startup nomount;
    connected to target database (not started)
    Oracle instance started
    Total System Global Area 490733568 bytes
    Fixed Size 1291360 bytes
    Variable Size 364907424 bytes
    Database Buffers 121634816 bytes
    Redo Buffers 2899968 bytes
    RMAN> restore controlfile from autobackup;
    Starting restore at 08-NOV-11
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: sid=157 devtype=DISK
    recovery area destination: C:\oracle\product\10.2.0\flash_recovery_area
    database name (or database unique name) used for search: PRODDB
    channel ORA_DISK_1: autobackup found in the recovery area
    channel ORA_DISK_1: autobackup found: C:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AR
    EA\PRODDB\AUTOBACKUP\2011_11_08\O1_MF_S_766661651_7CJY84LK_.BKP
    channel ORA_DISK_1: control file restore from autobackup complete
    output filename=D:\DBDATA\PRODDB\CONTROL01.CTL
    output filename=D:\DBDATA\PRODDB\CONTROL02.CTL
    output filename=D:\DBDATA\PRODDB\CONTROL03.CTL
    Finished restore at 08-NOV-11
    tried shutdown normally and mount again instead.
    RMAN> shutdown;
    Oracle instance shut down
    RMAN> exit
    Recovery Manager complete.
    C:\>rman target /
    Recovery Manager: Release 10.2.0.3.0 - Production on Tue Nov 8 13:49:42 2011
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    connected to target database (not started)
    RMAN> startup mount;
    Oracle instance started
    database mounted
    Total System Global Area 490733568 bytes
    Fixed Size 1291360 bytes
    Variable Size 369101728 bytes
    Database Buffers 117440512 bytes
    Redo Buffers 2899968 bytes
    RMAN> restore database until sequence 10 thread 1;
    Starting restore at 08-NOV-11
    Starting implicit crosscheck backup at 08-NOV-11
    using target database control file instead of recovery catalog
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: sid=156 devtype=DISK
    Crosschecked 3 objects
    Finished implicit crosscheck backup at 08-NOV-11
    Starting implicit crosscheck copy at 08-NOV-11
    using channel ORA_DISK_1
    Crosschecked 2 objects
    Finished implicit crosscheck copy at 08-NOV-11
    searching for all files in the recovery area
    cataloging files...
    cataloging done
    List of Cataloged Files
    =======================
    File Name: C:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\PRODDB\AUTOBACKUP\2011_11_
    08\O1_MF_S_766661651_7CJY84LK_.BKP
    using channel ORA_DISK_1
    channel ORA_DISK_1: starting datafile backupset restore
    channel ORA_DISK_1: specifying datafile(s) to restore from backup set
    restoring datafile 00001 to D:\DBDATA\PRODDB\SYSTEM01.DBF
    restoring datafile 00002 to D:\DBDATA\PRODDB\UNDOTBS01.DBF
    restoring datafile 00003 to D:\DBDATA\PRODDB\SYSAUX01.DBF
    restoring datafile 00004 to D:\DBDATA\PRODDB\USERS01.DBF
    restoring datafile 00005 to D:\ORA_DATA\DATA01.DBF
    restoring datafile 00006 to D:\ORA_DATA\DATA02.DBF
    restoring datafile 00007 to D:\ORA_DATA\INDX01.DBF
    restoring datafile 00008 to D:\ORA_DATA\INDX02.DBF
    channel ORA_DISK_1: reading from backup piece C:\ORACLE\PRODUCT\10.2.0\FLASH_REC
    OVERY_AREA\PRODDB\BACKUPSET\2011_11_07\O1_MF_NNNDF_TAG20111107T175037_7CH6YYVJ_.BK
    P
    failover to previous backup
    //however, still get the same results(ended up with errors)
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of restore command at 11/08/2011 13:50:29
    RMAN-06026: some targets not found - aborting restore
    RMAN-06023: no backup or copy of datafile 4 found to restore
    RMAN-06023: no backup or copy of datafile 3 found to restore
    RMAN-06023: no backup or copy of datafile 2 found to restore
    RMAN-06023: no backup or copy of datafile 1 found to restore
    Edited by: HappyJay on 2011/11/08 13:59

  • I have a Mac Book Pro - HELP - problems with bootcamp = too full

    I have have a Mac Book Pro.  My drive is full.  Sadly I had the partition set up at a store that should have known what they were doing (NOT an apple store, but a certified store that carries only Apple products), anyway.. I am now at the point where my bootcamp is full.  I've tried reading a number of posts, but some things apply to me, some things don't so here is my situation:
    Mac Book Pro
    OS X 10.8.2
    Processor: 2.53 GHz Intel Core i5
    Memory 4 GB 1067 MHz DDR3
    Startup Disk: Macintosh HD
    Using Bootcamp with Windows 7
    I purchased Camptunes by Paragon and tried repartioning my drive that way.  It looked like it was going to work until the following error message happend:
    Windows filesystem verification failed.  Please, repair Windows volume and try again.  Windows is not letting me do this because I don't have enough room. Round and round the problem goes.
    Initially when I was trying to clear out my Windows side I found a bulky .NET program I wanted to delete.  It would not delete it for me (I can retry to look for that error message), but essentially it wouldn't delete it at all.  I have no temporary internet files I can delete, cookies or other programs (except my printer drivers), but essentially - I can't figure out what to do next.
    I read another post about a person who didn't want to backup their files first.  This is not me.  I do back up to a LACIE back up drive that has a 999.86 GB capacity with 872.11GB free.  What I want to know is do I have to buy another back up to keep it all completely separate?  What other program do you recommend to create a virtual drive?  Can I get a step by step on what to do?  I have the original windows disk if that helps in the equasion.....
    My head hurts.... help!

    interenet wasn't working properly and i couldn't finish
    Try restarting while holding down the Option key. That should prompt the startup manager window where you can select the startup disk and reboot.
    Then try reformatting (erase) using OS X Recovery  About OS X Recovery
    Keep in mind, Apple does recommend a high speed broadband internet connection for OS X Recovery. A slow connection may time out before recovery is finished.

  • Help - problems with Credit Memo's

    Hi
    Can anyone help. We're running Financials 10.7 and have a problem. We've tried to create a credit memo to cancel an invoice. The credit memo and invoice tie up and are linked all through the line until the 'Invoice Installments' screen where there appears to be no link. This give s the impression that the Invoice is still outstanding.
    Can anyone help with a work-around.
    Many thanks
    Martin.

    Hi there,
    Yes. If both the credit memo & the invoice use the same pricing procedure, then they can be copied from the invoice.
    But there is no direct copy from the invoice to the credit memo.
    Credit memo is a billing doc type which is raised either against a returns order or against an invoice correction request.
    So if you wish to copy the pricing, then you will need to maintain copy controls from invoice to returns order / invoice correction req 1st, then from returns / invoice correction request to credit memo.
    So checkif your company is using the same pricing for invoice & returns. Then maintain F2 to RE order in VTAF 1st, then from RE order to CR in VTFA.
    In that case at item level pricing, you will have to choose the option G or D. Option B cary new pricing is used when the docs have different pricing procedure.
    Regards,
    Sivanand

  • Help - problem with credit memo's

    Hi
    Can anyone help. We're running Financials 10.7 and have a problem. We've tried to create a credit memo to cancel an invoice. The credit memo and invoice tie up and are linked all through the line until the 'Invoice Installments' screen where there appears to be no link. This give s the impression that the Invoice is still outstanding.
    Can anyone help with a work-around.
    Many thanks
    Martin.
    null

    Dear,
    please kindly open a message into Your market place for for such a problem. You need a fix.
    Thanks.
    Mauri

Maybe you are looking for

  • Can't restore iPod in Windows XP

    Hey everybody, I just had my iPod replaced and now have a newly restored monochrome iPod c/w in front of me. It came with instructions stating that it had been formatted for Mac, and that I would need to use the updater to get it ready for my PC. So,

  • Bought a Flash Photo Gallery

    Hi there. I recently purchased this photo gallery: http://www.entheosweb.com/Flash/Photo_Gallery3/index.asp ( After which I saw people here advertising for MUCH nicer ones ) Anyhow: I have been able to get it to work on my desktop, but do not know ho

  • Mail not working for local users

    I have sunOS 5.9 running on sun sparc mail is not working on this system even for local users. I have tried from the command prompt mail username Test email ^D nothing happens after control D, I don't get command prompt. I also tried mail username Te

  • How continuously write data to a txt file

    hello,  first of all, sorry for bad English, but I have a problem to continuously write data to the txt file.... I have one 2D array with values of some function and based on 2 sliders (values of the sliders) i want to interpolate value using bilinea

  • Re: B2B Customer Protocol Inbound Operation

    Hi All, It was a very good discussion. I am also facing the same problem. B2B-50029:  B2B runtime error: oracle.xml.parser.v2.XMLParseException: Start of root element expected. So, I do need to change the ecs file in order to get problem resolved. Is