MINUS operator fetches invalid record count

Hi,
One of the application team complained that oracle MINUS operator fetches an invalid record count after data load.
Here are the details of the data load:
They are using source as PROD and target as UAT.
They are replicating the data on UAT environment in schema A from fetching the data in PROD from the same schema.
After load when we query the count of records in UAT it shows more records in target, that is in UAT, than PROD.
When they use MINUS operator to fetch the extra records in UAT, it shows no rows selected.
SQL> select 'A' count(1) from A.UAT union all select 'A' count(1) from A.PROD@BISLSPD1;
A COUNT(1)
A.UAT 19105022
A.PROD 19104995
SQL> select distinct count(*) from (select distinct DW_DISCOUNT_KEY, DW_DISCOUNT_MODIFIER_KEY from A.UAT minus select distinct DW_DISCOUNT_KEY, DW_DISCOUNT_MODIFIER_KEY from A.PROD@BISLSPD1);
COUNT(*)
0
SQL> select distinct DW_DISCOUNT_KEY, DW_DISCOUNT_MODIFIER_KEY from A.UAT minus select distinct DW_DISCOUNT_KEY, DW_DISCOUNT_MODIFIER_KEY from A.PROD@BISLSPD1
no rows selected
Please note that both are partitioned tables and they are using Informatica Data Replication 9.5 tool to populate the data from source to target.
Not sure if this could be a bug or an issue.
PROD DB Version: 10.2.0.5
UAT DB Version: 10.2.0.5
Both are in Linux 2.6
Please throw some light on this.

974065 wrote:
SQL> select 'A' count(1) from A.UAT union all select 'A' count(1) from A.PROD@BISLSPD1;
A                  COUNT(1)
A.UAT                     19105022
A.PROD                   19104995
SQL> select distinct count(*) from (select distinct  DW_DISCOUNT_KEY, DW_DISCOUNT_MODIFIER_KEY from A.UAT minus select distinct DW_DISCOUNT_KEY, DW_DISCOUNT_MODIFIER_KEY from A.PROD@BISLSPD1);
COUNT(*)
0
SQL> select distinct  DW_DISCOUNT_KEY, DW_DISCOUNT_MODIFIER_KEY from A.UAT minus select distinct DW_DISCOUNT_KEY, DW_DISCOUNT_MODIFIER_KEY from A.PROD@BISLSPD1
no rows selected
Given that you've go "distinct" in your query, you're eliminating duplicates from each table (and MINUS implicitly means distinct anyway). Check for duplicates (of dw_discount_key, dw_discount_modifier_key) in both tables.
If the combination is actually unique, I would check that you actually had the raw results the right way round - MINUS is not symmetrical, and for a complete picture you need to look at (select from uat minus select from prod) union all (select from prod minus select from uat)
Regards
Jonathan Lewis

Similar Messages

  • Invalid record count - grey screen- Target Mode Cures

    Hi there,
    I have a common problem: I was doing nothing particular that I remember: No fancy file uploads, doanloads, creation, erasing - nothing special:
    Anyway after a customary week, or few days of leaving the macbook permanently on, I think "let's give it a rest".
    Then switch back on:
    - Grey screen, spinning grey progress wheel fine.
    - Takes a while. Strange. After say a minute - it just switches off wordlessly.
    - Reset PRAM: No solution. Take a look with single-user startup in console: Files are all there, OK. Disk not dead.
    - Start up from OS X 10.5 disk:
    Permissions repair fine. Good.
    Verify disk: FAIL! +*Invalid Record Count.Volume check failed.*+
    Next: *Try target disk mode to back up essentials* - that works fine: I now have Time Machine AND a smaller important essentials backup.
    But finally, here's the surprise: Just for kicks, I *shut the macbook down, try a reboot - and it works!*
    But I note that root system files are unchanged since the problem occurred: ".hotfiles.btree" for example (I don't know what that is but suspect it's relevant).
    Then: I tried restarting again - and back to square one, it won't boot.
    Do the "Target disk" firewire mode trick again, and browse a few folders: And it boots (slowly).
    If I just leave the Macbook on permanently - everything seems fine. Not even sluggish.
    So:
    - Why can connecting a disk with an incorrect file system in target disk make the system forget about these problems when booting?
    - Why does the problem return on a successive reboot?
    - Is it related to some system files being ignored if booting straight after a target mode session?
    - What is ".hotfiles.btree", and should it not exist ?
    And the big one:
    - +Can extended Applecare, wot cost me loads of money, help me?+

    Hi Cornelius:
    Having been a faithful Apple-groupie for a while, and despite some problems over the years (hard drive failing, screen going, etc.) this is the first time I'm disappointed with them, because theor Micromat Applecare deal is a ripoff:
    You fork out for Applecare extension: All you get is something that say "Yep, you've got a problem. Now go and buy techtoolpro".
    That is, the TechTool Deluxe is practically useless. Argh.
    Worse: They keep that rather quiet. If you run TechTool deluxe, and it fails: It points you to the Techtool site to
    "download the TechTool Deluxe software with diagnostic and repair capabilities".
    You think "Aha, right, I need an update, or a DMG rather than just the executable".
    Download another 1.25Gb.
    So you try again: Same thing.
    The chiselling little crooks, to quote Ken Livingstone, won't even come out and say "Buy TechTool Pro to fix it". The website as reported above is wrong.
    Result: I'm not happy with them. And I'll never buy anything off Micromat.
    In the meantime, I've got a bootable backup thanks to CC-Cloner (excellent, I'll send him some money), and I'm waiting until I don't have any critical deadlines to allow myself time to restore a daily bootable backup.
    The dodgy files seem to be the Sun Developper Java suite according to CC Cloner.

  • Please help! Invalid node structure and invalid record count

    My MacBook Pro is about 6.5 years old. I upgraded to Snow Leopard 2 years ago and added RAM at the same time. My first problem ever occurred three days ago when my computer got super sluggish, I restarted and got the gray screen with apple and spinning wheel...no boot up. I ran disk utility from the snow leopard install disk and found "invalid node structure" and "invalid record count". After reading on here what to do...try to repair the disk and so on with no success I went out and bought Disk Warrior. Got home expecting to fix everything and Disc Warrior won't boot...I just get a file with a question mark and the disc is ejected. I tried erasing the hard drive but was only able to use the "don't erase data" option. Then I tried to reinstall Snow Leopard with no luck. Now I am stuck. Any ideas? 
    One thing to note is I am to the point of not caring about the files on the hard drive, I was a dummy and never backed them up...lesson learned!  I just want my computer back without having to spend $1000+ for a new one. Then again I am always willing to do that too as a last resort.
    PLEASE HELP!

    When you contact Alsoft, make sure you let them know that you are using Snow Leopard (10.6.8).
    Try the following in the meantime -
    Disconnect all peripherals from your computer.
    Boot from your install disc & run Repair Disk from the utility menu. To use the Install Mac OS X disc, insert the disc, and restart your computer while holding down the C key as it starts up.
    Select your language.
    Once on the desktop, select Utility in the menu bar.
    Select Disk Utility.
    Select the disk or volume in the list of disks and volumes, and then click First Aid.
    Click Repair Disk.
    Restart your computer when done.
    Repair permissions after you reach the desktop-http://support.apple.com/kb/HT2963 and restart your computer.
    Try DiskWarrarior again if it's combatible with the os system.
    YOu cannot reformat until you get your issue corrected.

  • HD crash.  Disk utility says invalid node structure, invalid record count.  Disk utility cannot repair. Now what?

    My hard drive crashed.  The disk utility says it can not repair.  I tried to boot in safe mode but I stopped after 10 minutes.  Is that impatient or how long can it take?
    I have the installation disk but doesn't that erase everything?

    I have never bought a new computer from Apple so I don't know the details of what is covered by the warranty.  You can try taking it to the Apple Store and they may have a copy of DW they can run.  Or maybe not and they will just wipe the drive and reinstall the OS for you and if you haven't made a backup before they do that then tough luck.  I'd check first!
    If you buy Diskwarrior on DVD it will boot the computer.  I think Apple Stores carry it, but you can also buy it directly from the vendor. I also don't use Lion OS so I don't know the details.  You may be able to get their download version and boot from your recovery partition, then run it without a DVD.

  • Disk utility gets "invaild record count"

    Hello, Using Macbook pro running OSX 10.9.2
    Yesterday, i was using my computer searching internet, plugged it in and walked away for about 5 mins. Came back and tried to open iTunes. I 1st choose iTunes using the button w/ the 6 squares on it on the top row of keyboard. Nothing happen and iTunes did not open. 2nd I tried to open iTunes using the dashboard. Again nothing happen. I used the power button to shut down the computer. Then restarted, it came up with a window asking which language I would like to use. I choose English and then a new window opens with 4 choices; "Restore using Time machine", "Reinstall OSX", "Get online help" (which is how I am here now), and "use disk utility". I picked disk utlity and verified the disk which popped up a window say it "stopped and needed to be repaired. I hit the "repair buttom" and got a "Invaild record count" in red. It then stopped and said it could not be repaired.
    Tried to restore using the back-up/restore with Time machine. It found time machine, but on about the 4th screen it asks which volume I would like torestore to. Nothing comes up and just says "searching for disks" None ever come up. I quit disk utility and then choose "Start up disk" under the apple menu. It doesn't find anything. I tried the "command + option + P + R" nothing is different.
    So here I am. each new screen that comes up flickers a lot before clearing.
    Dead hard drive?
    Just can't find it?
    What's next?
    Thank you for being here to help
    Jody

    Thank you dominic23.
    I tried the instructions listed by Chris Watts1 and after running the /sbin/fsck_hfs -yprd /dev/disk0s2
    it never asked for a password just said "starting". After waiting a couple mintues it came back with the following: (which I have no idea what any of it means)
    journal_reply (/dev/disk0s2) returned 22
            using cacheBlockSize = 32K  cacheTotalBlock = 16384  cacheSize = 524288K.
    Executing fsck_hfs (version hfs-226.1.1).
    **Checking journaled HFS Plus volume.
    hfs_swap_BTNode: invalid forward link (0xA9812964)
    hfs_swap_BTNode: invalid backward link (0x0B69B6DB)
    hfs_swap_BTNode: invalid node kind (-124)
    hfs_swap_BTNode: invalid node height (42)
    hfs_swap_BTNode: invalid record count (0x3E6B)
    Invalid record count
    (3, 3)
    **The volume could not be verified completely.
    volume check failed with error 2
    volume type is pure HFS+
    Primary MDB is at Block 0 0x00
    Alternate MDB is at Block 0 0x00
    Primary VHB is at Block 2 0x02
    Alternate VHB is at Block 975093950 0x3a1ec0be
    Sector size = 512 0x200
    VolumeObject flags = 0x07
    total sectors for volume = 975093952 0x3a1ec0c0
    total sectors for embedded volume = 0x00
    CheckHFS returned -1317 , fsmodified = 0
    Does any of this mean anything to you?
    thank you again,
    Jody

  • Invalid Leaf Record Count??

    After Software Update installed new versions of QuickTime and iTunes, my computer hung while doing the required restart. It got stuck at the point where the spinning clock thing appears. I had to force a shutdown by pressing and holding the power button. Now when I run Disk Utility (from an OS X install CD) to repair the disk, I get the following error message:
    Invalid leaf record count.
    It should be 7, instead of 66.
    The repair ends with a message that the disk could not be repaired. However, when I start-up in single-user mode and do a disk repair by typing in “fsck –yf”, I get no error messages, and it says the hard disk appears to be OK. I also ran DiskWarrior, but that did not fix the “invalid leaf record count” problem.
    I would be interested to know what “invalid leaf record count” means and if I should be concerned.
    Thanks.
    Lou

    You can get this error if you use an older Panther CD instead of the Tiger DVD on your 10.4 as per this article.
    http://docs.info.apple.com/article.html?artnum=301266

  • Invalid Leaf Count Record

    When I repaired my startup disk with Disk Utility, an invalid leaf count record error was reported. From looking at other posts, it appears that one of the recommended things to do for this is trying to repair the issue with Disk Utility. I tried this using Disk Utility 4.1. I replaced my directory with the rebuilt directory. Unfortunately, when I started back up from my install CD and ran Repair Disk, the invalid leaf count record error was reported again.
    Any advice would be much appreciated... maybe I did something wrong.
    Thanks

    First, I realized that I had the error message wrong. I should have wrote "Invalid Leaf Record Count" originally instead of "Invalid Leaf Count Record". I doubt this makes a difference, but just in case there it is.
    Secondly, I am running 10.3.9 and have been doing so for quite some time. My understanding based on this is that DiskWarrior 4.1 should work. I took your advice and tried running DiskWarrior again. As I did previously, I simply booted from DiskWarrior because the disk I am trying to fix is my startup disk. I rebuilt and replaced the directory with DiskWarrior 4.1 again. As a matter of fact, I ran it multiple times while I had it going. I even ran it under the scavenge mode.
    After doing this, I restarted the computer, ejected the DiskWarrior disc, and put in my install disc that came with my iMac. I booted from this CD and reran "Repair Disk" with Disk Utility. The error stills shows up. One thing to note is that my install disc came with 10.3.5 on it. Could this somehow cause a problem? My understanding is that you should always use an install disc for the major OS version you are running to run the "Repair Disk" function of Disk Utility. For example use an install disc for 10.3 if you are trying to repair a disk running 10.3.x or use an install disc for 10.4 if you are trying to repair a disk running 10.4.x.
    Prior to ever running DiskWarrior, I used the fsck command from single-user mode. Interestingly, the error did not show up here. I thought the "Repair Disk" function with Disk Utility was similar to this command, but maybe there is enough variation to cause the difference. Do you guys have any idea, which one I should trust?
    Let me know if any of this is incorrect. Any other suggestions regarding this error would be welcomed. I don't really understand what the error itself means. For now, I guess I will just leave it since I don't really know what else to do. Maybe in the future it will get worse and DiskWarrior will recognize it... I know that's asking for a problem!

  • Invalid leaf record count, keys out of order?

    Yesterday I returned home from a month long trip which I did not bring my 13 inch 2011MacBook Pro on.
    I plugged it in and turned it on, and connected my phone to it so i could retrieve some photos. I looked away and looked back to see the grey  "You must hard shut down your computer" error message. Possibly because i think the phone may have been disconnected without being properly ejected? So i turned it off and then later the next day, when I try to turn it on it is stuck on the white apple loading screen forever. When I startup with Command+R and enter disk utility, it tells me:
    Invalid Leaf record count, keys out of order, volume could not be repaired. When I startup in single user mode and use fsck -fy it tells me the same.
    I got it used less than a year ago. I have some pretty heavy applications like MS Office, Photoshop and a few other adobe applications, and The Sims 3.
    Help!

    When Disk Utility can't repair a hard drive, with an error like that, many buy Disk Warrior to do the repair. You can see an answer on the Disk Warrior site here.
    Or, if you have a system backup, erase the hard drive (I would probably do a secure erase and write zero's to the hard drive) and restore it.

  • Invalid leaf record count (it should be 175 of 5069)

    Hi guys,
    Long time Mac user and desperately wanting to bring my old Sunflower IMac back to full life.
    I was having a few problems with it, sometimes had the question mark on boot up, lots of crashing.  Decided to do an archive and reinstall.  I had been running Snow Leopard.
    Seemed to go okay, but then it would accept my password.  (I chose to reinstall importing old usernames/settings.  Hope that wasn't a bit of time save that caused this.)
    Managed to google around and reset the password.  But then it booted into Darwin when it accepted my new password. 
    More googling, and checking these boards, and I ran disk utility repair and the "Invalid leaf record count (it should be 175 of 5069)" came up.  Ram repairs and so on, and it seemed to clear, but the disc wouldn't mount when I tried to verify again.
    Booted with S-command and tried fsck -fy which I'd come across earlier in the day.  (Logged in with my username and new password.)  At **Checking Extended Attributes file the same error came up as I found with disk utility.  Then I had,
    **Checking volume bitmap
    **Checking volume information
    **Repairing volume
    *++++ FILE SYSTEM WAS MODIFIED *****
    sh-2.05a# 0
    I've been reinstalling and trying things all day but I know I've gone as far as I can without your help now.  Hope there's some way to fix this.
    Thanks for reading all that.

    Thank you, baltwo.  I've done that a few times and it shows the same message.  But I'll keep at it for a while.
    I'm thinking maybe I'll need Diskwarrior which I saw mentioned in some threads here.
    *In my OP I meant 'it wouldn't accept my password' in the third paragraph.

  • Best way to Fetch the record

    Hi,
    Please suggest me the best way to fetch the record from the table designed below. It is Oracle 10gR2 on Linux
    Whenever a client visit the office a record will be created for him. The company policy is to maintain 10 years of data on the transaction table but the table holds record count of 3 Million records per year.
    The table has the following key Columns for the Select (sample Table)
    Client_Visit
    ID Number(12,0) --sequence generated number
    EFF_DTE DATE --effective date of the customer (sometimes the client becomes invalid and he will be valid again)
    Create_TS Timestamp(6)
    Client_ID Number(9,0)
    Cascade Flg vahrchar2(1)
    On most of the reports the records are fetched by Max(eff_dte) and Max(create_ts) and cascade flag ='Y'.
    I have following queries but the both of them are not cost effective and takes 8 minutes to display the records.
    Code 1:
    SELECT   au_subtyp1.au_id_k,
                                       au_subtyp1.pgm_struct_id_k
                                  FROM au_subtyp au_subtyp1
                                 WHERE au_subtyp1.create_ts =
                                          (SELECT MAX (au_subtyp2.create_ts)
                                             FROM au_subtyp au_subtyp2
                                            WHERE au_subtyp2.au_id_k =
                                                                au_subtyp1.au_id_k
                                              AND au_subtyp2.create_ts <
                                                     TO_DATE ('2013-01-01',
                                                              'YYYY-MM-DD'
                                              AND au_subtyp2.eff_dte =
                                                     (SELECT MAX
                                                                (au_subtyp3.eff_dte
                                                        FROM au_subtyp au_subtyp3
                                                       WHERE au_subtyp3.au_id_k =
                                                                au_subtyp2.au_id_k
                                                         AND au_subtyp3.create_ts <
                                                                TO_DATE
                                                                    ('2013-01-01',
                                                                     'YYYY-MM-DD'
                                                         AND au_subtyp3.eff_dte < =
                                                                TO_DATE
                                                                    ('2012-12-31',
                                                                     'YYYY-MM-DD'
                                   AND au_subtyp1.exists_flg = 'Y'
    Explain Plan
    Plan hash value: 2534321861
    | Id  | Operation                | Name      | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT         |           |     1 |    91 |       | 33265   (2)| 00:06:40 |
    |*  1 |  FILTER                  |           |       |       |       |            |          |
    |   2 |   HASH GROUP BY          |           |     1 |    91 |       | 33265   (2)| 00:06:40 |
    |*  3 |    HASH JOIN             |           |  1404K|   121M|    19M| 33178   (1)| 00:06:39 |
    |*  4 |     HASH JOIN            |           |   307K|    16M|  8712K| 23708   (1)| 00:04:45 |
    |   5 |      VIEW                | VW_SQ_1   |   307K|  5104K|       | 13493   (1)| 00:02:42 |
    |   6 |       HASH GROUP BY      |           |   307K|    13M|   191M| 13493   (1)| 00:02:42 |
    |*  7 |        INDEX FULL SCAN   | AUSU_PK   |  2809K|   125M|       | 13493   (1)| 00:02:42 |
    |*  8 |      INDEX FAST FULL SCAN| AUSU_PK   |  2809K|   104M|       |  2977   (2)| 00:00:36 |
    |*  9 |     TABLE ACCESS FULL    | AU_SUBTYP |  1404K|    46M|       |  5336   (2)| 00:01:05 |
    Predicate Information (identified by operation id):
       1 - filter("AU_SUBTYP1"."CREATE_TS"=MAX("AU_SUBTYP2"."CREATE_TS"))
       3 - access("AU_SUBTYP2"."AU_ID_K"="AU_SUBTYP1"."AU_ID_K")
       4 - access("AU_SUBTYP2"."EFF_DTE"="VW_COL_1" AND "AU_ID_K"="AU_SUBTYP2"."AU_ID_K")
       7 - access("AU_SUBTYP3"."EFF_DTE"<=TO_DATE(' 2012-12-31 00:00:00', 'syyyy-mm-dd
                  hh24:mi:ss') AND "AU_SUBTYP3"."CREATE_TS"<TIMESTAMP' 2013-01-01 00:00:00')
           filter("AU_SUBTYP3"."CREATE_TS"<TIMESTAMP' 2013-01-01 00:00:00' AND
                  "AU_SUBTYP3"."EFF_DTE"<=TO_DATE(' 2012-12-31 00:00:00', 'syyyy-mm-dd hh24:mi:ss'))
       8 - filter("AU_SUBTYP2"."CREATE_TS"<TIMESTAMP' 2013-01-01 00:00:00')
       9 - filter("AU_SUBTYP1"."EXISTS_FLG"='Y')Code 2:
    I already raised a thread a week back and Dom suggested the following query, it is cost effective but the performance is same and used the same amount of Temp tablespace
    select au_id_k,pgm_struct_id_k from (
    SELECT au_id_k
          ,      pgm_struct_id_k
          ,      ROW_NUMBER() OVER (PARTITION BY au_id_k ORDER BY eff_dte DESC, create_ts DESC) rn,
          create_ts, eff_dte,exists_flg
          FROM   au_subtyp
          WHERE  create_ts < TO_DATE('2013-01-01','YYYY-MM-DD')
          AND    eff_dte  <= TO_DATE('2012-12-31','YYYY-MM-DD') 
          ) d  where rn =1   and exists_flg = 'Y'
    --Explain Plan
    Plan hash value: 4039566059
    | Id  | Operation                | Name      | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT         |           |  2809K|   168M|       | 40034   (1)| 00:08:01 |
    |*  1 |  VIEW                    |           |  2809K|   168M|       | 40034   (1)| 00:08:01 |
    |*  2 |   WINDOW SORT PUSHED RANK|           |  2809K|   133M|   365M| 40034   (1)| 00:08:01 |
    |*  3 |    TABLE ACCESS FULL     | AU_SUBTYP |  2809K|   133M|       |  5345   (2)| 00:01:05 |
    Predicate Information (identified by operation id):
       1 - filter("RN"=1 AND "EXISTS_FLG"='Y')
       2 - filter(ROW_NUMBER() OVER ( PARTITION BY "AU_ID_K" ORDER BY
                  INTERNAL_FUNCTION("EFF_DTE") DESC ,INTERNAL_FUNCTION("CREATE_TS") DESC )<=1)
       3 - filter("CREATE_TS"<TIMESTAMP' 2013-01-01 00:00:00' AND "EFF_DTE"<=TO_DATE('
                  2012-12-31 00:00:00', 'syyyy-mm-dd hh24:mi:ss'))Thanks,
    Vijay

    Hi Justin,
    Thanks for your reply. I am running this on our Test environment as I don't want to run this on Production environment now. The test environment holds 2809605 records (2 Million).
    The query output count is 281699 (2 Hundred Thousand) records and the selectivity is 0.099. The Distinct values of create_ts, eff_dte, and exists_flg is 2808905 records. I am sure the index scan is not going to help out much as you said.
    The core problem is both queries are using lot of Temp tablespace. When we use this query to join the tables, the other table has the same design as below so the temp tablespace grows bigger.
    Both the production and test environment are 3 Node RAC.
    First Query...
    CPU used by this session     4740
    CPU used when call started     4740
    Cached Commit SCN referenced     21393
    DB time     4745
    OS Involuntary context switches     467
    OS Page reclaims     64253
    OS System time used     26
    OS User time used     4562
    OS Voluntary context switches     16
    SQL*Net roundtrips to/from client     9
    bytes received via SQL*Net from client     2487
    bytes sent via SQL*Net to client     15830
    calls to get snapshot scn: kcmgss     37
    consistent gets     52162
    consistent gets - examination     2
    consistent gets from cache     52162
    enqueue releases     19
    enqueue requests     19
    enqueue waits     1
    execute count     2
    ges messages sent     1
    global enqueue gets sync     19
    global enqueue releases     19
    index fast full scans (full)     1
    index scans kdiixs1     1
    no work - consistent read gets     52125
    opened cursors cumulative     2
    parse count (hard)     1
    parse count (total)     2
    parse time cpu     1
    parse time elapsed     1
    physical write IO requests     69
    physical write bytes     17522688
    physical write total IO requests     69
    physical write total bytes     17522688
    physical write total multi block requests     69
    physical writes     2139
    physical writes direct     2139
    physical writes direct temporary tablespace     2139
    physical writes non checkpoint     2139
    recursive calls     19
    recursive cpu usage     1
    session cursor cache hits     1
    session logical reads     52162
    sorts (memory)     2
    sorts (rows)     760
    table scan blocks gotten     23856
    table scan rows gotten     2809607
    table scans (short tables)     1
    user I/O wait time     1
    user calls     11
    workarea executions - onepass     1
    workarea executions - optimal     9
    Second Query
    CPU used by this session     1197
    CPU used when call started     1197
    Cached Commit SCN referenced     21393
    DB time     1201
    OS Involuntary context switches     8684
    OS Page reclaims     21769
    OS System time used     14
    OS User time used     1183
    OS Voluntary context switches     50
    SQL*Net roundtrips to/from client     9
    bytes received via SQL*Net from client     767
    bytes sent via SQL*Net to client     15745
    calls to get snapshot scn: kcmgss     17
    consistent gets     23871
    consistent gets from cache     23871
    db block gets     16
    db block gets from cache     16
    enqueue releases     25
    enqueue requests     25
    enqueue waits     1
    execute count     2
    free buffer requested     1
    ges messages sent     1
    global enqueue get time     1
    global enqueue gets sync     25
    global enqueue releases     25
    no work - consistent read gets     23856
    opened cursors cumulative     2
    parse count (hard)     1
    parse count (total)     2
    parse time elapsed     1
    physical read IO requests     27
    physical read bytes     6635520
    physical read total IO requests     27
    physical read total bytes     6635520
    physical read total multi block requests     27
    physical reads     810
    physical reads direct     810
    physical reads direct temporary tablespace     810
    physical write IO requests     117
    physical write bytes     24584192
    physical write total IO requests     117
    physical write total bytes     24584192
    physical write total multi block requests     117
    physical writes     3001
    physical writes direct     3001
    physical writes direct temporary tablespace     3001
    physical writes non checkpoint     3001
    recursive calls     25
    session cursor cache hits     1
    session logical reads     23887
    sorts (disk)     1
    sorts (memory)     2
    sorts (rows)     2810365
    table scan blocks gotten     23856
    table scan rows gotten     2809607
    table scans (short tables)     1
    user I/O wait time     2
    user calls     11
    workarea executions - onepass     1
    workarea executions - optimal     5Thanks,
    Vijay
    Edited by: Vijayaraghavan Krishnan on Nov 28, 2012 11:17 AM
    Edited by: Vijayaraghavan Krishnan on Nov 28, 2012 11:19 AM

  • How can we split a select query to 3 or 4 if it is fetching much records?

    I am running a query like:
    select * from table_name
    it will be fetching 152940696 records. Now i want to fetch this result as 3 or 4 select statements. That is, in the second query I want to fetch the records from where i stopped in the first query. and similar for the 3rd i have to continue from the 2nd query. And for the 4th query i have to start from where i have stopped in the 3rd query.
    when i tried with rownum we can fetch the records upto < or <= to a particular count like 100000000. But above this count i cannot fetch using rownum. Because > or >= wont work with rownum.
    Is there anyother way to split the select query as i explained.
    Thanks in advance

    I'll assume you want to split the query up for performance reasons.
    The easiest way to do this if you have the license is to use the parallel query option, which can help, hurt or do nothing. The only way to find out is to try. PQO would be best from a performance standpoint if possible, provided it will do what you need.
    Failing that as has been suggested you need a logical, scalable way to divide up the queries. It has already been pointed out that the rownum solution probably will not work correctly. Also, the MINUS with ROWNUM idea has the disadvantage of having to read a lot of the same data twice, making the query run longer.
    Perhaps a range would provide a way to split up the data - something like
    select whatever
      from table
    where primary_key < 10000000;
    select whatever
      from table
    where primary key between 10000001 and 199999999;
    ...

  • Instead of Minus operation any other ?

    Hi,
    Master Table : book_master
    Master_Pk_No Book_Name Version_no I_User Initial_id
    10 Book1 0 XXX 10
    20 Book1 1 XXX 10
    30 Book1 2 XXX 10
    # Initial id will be same as Master_Pk_No first number
    # I have to take the latest version ( 2 ) and compare with the older version if any records
    are availble in older version i have to fetch that and append that with the
    Child Table : source
    C_PK_NO SEQ_SOURCE UNIT_SEQ O_User
    10 1 1 XXX
    10 2 1 abc
    10 3 2 abc
    10 4 1 ggg
    10 5 2 ggg
    10 6 3 abc
    10 7 4 abc
    20 1 1 XXX
    20 2 1 abc
    20 3 2 abc
    20 4 1 ggg
    20 5 2 ggg
    20 6 1 zzz
    30 1 1 XXX
    30 2 1 abc
    30 3 2 abc
    30 4 1 ggg
    30 5 2 ggg
    30 6 2 XXX
    SELECT seq_source, o_user, unit_seq
    FROM SOURCE
    WHERE c_pk_no IN ( SELECT master_pk_no FROM AER
    WHERE book_name = 'Book1'
    AND version_no = 0 )
    MINUS
    SELECT seq_source, o_user, unit_seq
    FROM SOURCE
    WHERE c_pk_no IN ( SELECT master_pk_no FROM AER
    WHERE book_name = 'Book1'
    AND version_no = 2) ;
    If i execute this query i will get the below result .
    C_PK_NO SEQ_SOURCE UNIT_SEQ O_User
    10 6 3 abc
    10 7 4 abc
    SELECT seq_source, o_user, unit_seq
    FROM SOURCE
    WHERE c_pk_no IN ( SELECT master_pk_no FROM AER
    WHERE book_name = 'Book1'
    AND version_no = 1 )
    MINUS
    SELECT seq_source, o_user, unit_seq
    FROM SOURCE
    WHERE c_pk_no IN ( SELECT master_pk_no FROM AER
    WHERE book_name = 'Book1'
    AND version_no = 2) ;
    C_PK_NO SEQ_SOURCE UNIT_SEQ O_User
    20 6 1 zzz
    is it possible to achieve this without minus operation ?
    Regards,
    KBG.

    And here is the test:
    SQL> WITH BOOK_MASTER AS(
      2                      SELECT 10 master_pk_no,'Book1' book_name,0 version_no,'XXX' i_user,10 Initial_id from dual union all
      3                      SELECT 20,'Book1',1,'XXX',10 from dual union all
      4                      SELECT 30,'Book1',2,'XXX',10 from dual
      5                     ),
      6           SOURCE AS (
      7                      SELECT 10 c_pk_no,1 seq_source,1 unit_seq,'XXX' o_user from dual union all
      8                      SELECT 10,2,1,'abc' from dual union all
      9                      SELECT 10,3,2,'abc' from dual union all
    10                      SELECT 10,4,1,'ggg' from dual union all
    11                      SELECT 10,5,2,'ggg' from dual union all
    12                      SELECT 10,6,3,'abc' from dual union all
    13                      SELECT 10,7,4,'abc' from dual union all
    14                      SELECT 20,1,1,'XXX' from dual union all
    15                      SELECT 20,2,1,'abc' from dual union all
    16                      SELECT 20,3,2,'abc' from dual union all
    17                      SELECT 20,4,1,'ggg' from dual union all
    18                      SELECT 20,5,2,'ggg' from dual union all
    19                      SELECT 20,6,1,'zzz' from dual union all
    20                      SELECT 30,1,1,'XXX' from dual union all
    21                      SELECT 30,2,1,'abc' from dual union all
    22                      SELECT 30,3,2,'abc' from dual union all
    23                      SELECT 30,4,1,'ggg' from dual union all
    24                      SELECT 30,5,2,'ggg' from dual union all
    25                      SELECT 30,6,2,'XXX' from dual
    26                     )
    27  SELECT  s.seq_source,
    28          s.o_user,
    29          s.unit_seq
    30    FROM  SOURCE s,
    31          BOOK_MASTER a
    32    WHERE s.c_pk_no = a.master_pk_no
    33      AND a.book_name = 'Book1'
    34      AND a.version_no IN (0,2)
    35    GROUP BY s.seq_source,
    36             s.o_user,
    37             s.unit_seq
    38    HAVING MAX(a.version_no) = 0
    39  /
    SEQ_SOURCE O_U   UNIT_SEQ
             6 abc          3
             7 abc          4
    SQL> WITH BOOK_MASTER AS(
      2                      SELECT 10 master_pk_no,'Book1' book_name,0 version_no,'XXX' i_user,10 Initial_id from dual union all
      3                      SELECT 20,'Book1',1,'XXX',10 from dual union all
      4                      SELECT 30,'Book1',2,'XXX',10 from dual
      5                     ),
      6           SOURCE AS (
      7                      SELECT 10 c_pk_no,1 seq_source,1 unit_seq,'XXX' o_user from dual union all
      8                      SELECT 10,2,1,'abc' from dual union all
      9                      SELECT 10,3,2,'abc' from dual union all
    10                      SELECT 10,4,1,'ggg' from dual union all
    11                      SELECT 10,5,2,'ggg' from dual union all
    12                      SELECT 10,6,3,'abc' from dual union all
    13                      SELECT 10,7,4,'abc' from dual union all
    14                      SELECT 20,1,1,'XXX' from dual union all
    15                      SELECT 20,2,1,'abc' from dual union all
    16                      SELECT 20,3,2,'abc' from dual union all
    17                      SELECT 20,4,1,'ggg' from dual union all
    18                      SELECT 20,5,2,'ggg' from dual union all
    19                      SELECT 20,6,1,'zzz' from dual union all
    20                      SELECT 30,1,1,'XXX' from dual union all
    21                      SELECT 30,2,1,'abc' from dual union all
    22                      SELECT 30,3,2,'abc' from dual union all
    23                      SELECT 30,4,1,'ggg' from dual union all
    24                      SELECT 30,5,2,'ggg' from dual union all
    25                      SELECT 30,6,2,'XXX' from dual
    26                     )
    27  SELECT  s.seq_source,
    28          s.o_user,
    29          s.unit_seq
    30    FROM  SOURCE s,
    31          BOOK_MASTER a
    32    WHERE s.c_pk_no = a.master_pk_no
    33      AND a.book_name = 'Book1'
    34      AND a.version_no IN (1,2)
    35    GROUP BY s.seq_source,
    36             s.o_user,
    37             s.unit_seq
    38    HAVING MAX(a.version_no) = 1
    39  /
    SEQ_SOURCE O_U   UNIT_SEQ
             6 zzz          1
    SQL> SY.

  • Delta package not fetching all records from Delta queue in r/3

    Hello,
    I have loaded Goods Movement Data using 2LIS_03_BF datasource into my BI system.
    The Delta has been initialized and everyday the delta is being moved from r/3.
    I observed that when I execute my delta package not all delta records are fetched into PSA from r/3.
    For Ex: Before starting my delta package I checked in SMQ1 of my R/3 system and see that there are around 1000 records.On executing the delta package I see that the record count is reduced from 1000 to 400 in SMQ1.On executing the delta package again I get the remaining 400 records into my PSA.
    Shouldn't the delta package get all records from the queue on single execution??
    Is there some setting to define the nr of records to be loaded?
    I'm confused with this behaviour.Please help me understand this behaviour.
    Thank You.

    Hello,
          First thing: the data is not transferred from the SMQ1 queue, rather the data is transfered to BW from the RSA7 Delta queue. You need to check the number of records present in the RSA7 queue.
    Since SMQ1 is involved, i think you are using the unserialized V3 update method. In this method, when data is first written to the application tables, it is first transferred to the SMQ1 update queue,then via a job to the LBWQ extractor queue and then to the RSA7 delta queue. So the number of entries that you see in the SMQ1 queue are not the number of entries that have to be transferred to BW but rather the records that are waiting to be transferred to the extractor queue in LBWQ. Similarly, in LBWQ, the number of entries displayed here are not the no of entries that are going to be transferred to BW, they are the no of entries that will be transferred to the delta queue RSA7 when the next v3 update job runs.
    If you want to check the number of records that will be transferred to BW, select the datasource in rsa7 and then click on the display data entries button.
    Hope this helps.
    Regards.

  • Data Load : Number of records count

    Hi Experts,
              I want to document number of records transferred to BW during an infopackage execution.
              I want to automate the process by running a report in background which will fetch a data from SAP tables about number of records been transfered by all my InfoPackage .
    I would like to know how should I proceed with.
             I want to know some System tables which contains same data as that of RSMO transaction displays to us.
    Kindly help with valuable replies.

    HI,
    inorder to get the record counts report you need to create a report based on below tables
    rsseldone, rsreqdone, rsldpiot, rsmonfact
    Check the below link which explain in detail with the report code as well.
    [Data load Quick Stats|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/90215bba-9a46-2a10-07a7-c14e97bdb764]
    This doc also explains how to trigger a mail with the details to all.
    Regards
    KP

  • E: Invalid record in the preferences file, no Pack...

    Ok guys.. Got a problem..
    I was using 5 desktops, custom transitions, Portrait status-bar, Mag Hildon-desktop, swappiness(30) , Page cluster (5) , Mydocs executable , update notifications using Maemodder.
    And today ive changed custom transitions and also selected "Hildon Acceleration".
    Then i installed "tvbgone" app from testing area.I used fasterappmanger for install that.
    After installing no probs occurred.
    Then i tried to install "Desktop-switcher" using x-term.
    x-term showed an error.
    BusyBox v1.10.2 (Debian 3:1.10.2.legal-1osso30+0m5) built-in shell (ash) 
    Enter 'help' for a list of built-in commands. 
    ~ $ sudo gainroot 
    Root shell enabled 
    BusyBox v1.10.2 (Debian 3:1.10.2.legal-1osso30+0m5) built-in shell (ash) 
    Enter 'help' for a list of built-in commands. 
    /home/user # apt-get install desktop-switcher 
    Reading package lists... Done 
    E: Invalid record in the preferences file, no Package header 
    /home/user # apt-get purge tvbgone 
    Reading package lists... Done 
    E: Invalid record in the preferences file, no Package header 
    /home/user # apt-get autoremove 
    Reading package lists... Done 
    E: Invalid record in the preferences file, no Package header 
    /home/user # 
    In inbuilt appmanager gives a "operation failed" message when i open it.This is the log..
    hildon-application-manager 2.2.71
    E: Invalid record in the preferences file, no Package header
    E: Invalid record in the preferences file, no Package header
    E: Invalid record in the preferences file, no Package header
    connected to 4d49b94c-2745-43a7-bf06-3f338acf39cb
    E: Invalid record in the preferences file, no Package header
    E: Invalid record in the preferences file, no Package header
    E: Invalid record in the preferences file, no Package header
    connected to 4d49b94c-2745-43a7-bf06-3f338acf39cb
    W: GPG error: ftp://ftp.mozilla.org chinook Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 667387BFFF445C24
    E: Invalid record in the preferences file, no Package header
    E: Invalid record in the preferences file, no Package header
    Also included the fasterappmanager error.
    ** apt-get update works in x-term. But cannot install, remove any apps.
    *** Ive re-stored everything in Maemodder , removed battery, and also disabled my catalogs and re-enabled them ...but nothing works..Having the same errors again and again..
    *****I know this info might be too much.. But told everything happened. So any ideas...? Without re-flashing and clearing device...? 
    **Thankyou..
    Please help!
    "You may loose faith on us.. But never in your selves! From here, the fight will be your own.."
    _____________[Protect Transformers]_____________
    Solved!
    Go to Solution.
    Attachments:
    Faster app manager error.png ‏185 KB

    Solved it..
    If anyone having this prob, do this..
    Install filebox and enable root access.(from settings in filebox)
    1)Then open file box, go to :
    /etc/apt
    2)Tap about 3 secs on the preferences and select rename. Then rename it as preferences.tmp
    3)Problem solved. 
    Cheers
    "You may loose faith on us.. But never in your selves! From here, the fight will be your own.."
    _____________[Protect Transformers]_____________

Maybe you are looking for