change / stop the query using bad plan
I use 11.2.0.3. I'm wrong a script with multiple insert into... Select. One of the insert running for hours because it is using bad plan because of State statistics. I've now updated the statistics. Is - it there anyway I can do oracle raise this insert or ignore this insert and continue with the other inserts in my script. (I don't want to kill the session, I want to run other sqls).
Also, for the future is there a way to make oracle dynamic sampling rather than obsolete statistics usage?
I was able to cancel the query in another session to help
execDBMS_RESOURCE_MANAGER.SWITCH_CONSUMER_GROUP_FOR_SESS (sid, serial#, 'CANCEL_SQL');
Tags: Database
Similar Questions
-
steps to optimize the query on explain plan
Hello
Please find the described explain the plan of a query, and suggest me where and how can grant us the request.
{code}
-----------------------------------------------------------------------------------------------------------------------
| ID | Operation | Name | Lines | Bytes | TempSpc | Cost (% CPU). Time |
-----------------------------------------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 352K | 60 M | | 17677 (12) | 00:03:33 |
| 1. TRANSFORMATION OF THE TEMPORARY TABLE. | | | | | |
| 2. LOAD SELECT ACE | SYS_TEMP_0FD9FCB72_F58FAD20 | | | | | |
| 3. VIEW | | 22G | 3684G | | 96 M (100) | 320:57:19 |
| 4. UNIQUE FATE | | 22G | 4837G | 436G | 96 M (1) | 320:57:19 |
| 5. CONCATENATION. | | | | | |
|* 6 | HASH JOIN | | 1792M | 392G | | 52682 (26) | 00:10:33 |
| 7. VIEW | STAG_MASTER_VW | 39985 | 468K | | 2229 (1) | 00:00:27 |
|* 8 | MAT_VIEW FULL ACCESS | STAG_MASTER_MV | 39985 | 468K | | 2229 (1) | 00:00:27 |
|* 9 | HASH JOIN | | 1792M | 372G | 9320K | 43943 (16) | 00:08:48 |
| 10. VIEW | STAG_MANAME_MV | 264K | 6208K | | 974 (1) | 00:00:12 |
| 11. MAT_VIEW FULL ACCESS | STAG_AANAME_MV | 264K | 6208K | | 974 (1) | 00:00:12 |
| * 12 | EXTERNAL RIGHT HASH JOIN | | 676K | 128 M | 19 M | 29255 (1) | 00:05:52 |
| 13. VIEW | ABC_CDE_INDEX_CHG_VW | 818K | 10 M | | 2448 (1) | 00:00:30 |
| * 14 | TABLE ACCESS FULL | ABC_CDE_INDEX_CHG | 818K | 10 M | | 2448 (1) | 00:00:30 |
| * 15 | HASH JOIN | | 195K | 34 M | 9240K | 24001 (1) | 00:04:49 |
| 16. VIEW | STAG_NAMADDS_VW | 248K | 6316K | | 872 (1) | 00:00:11 |
| 17. MAT_VIEW FULL ACCESS | STAG_NAMADDS_MV | 248K | 6316K | | 872 (1) | 00:00:11 |
| * 18. OUTER HASH JOIN | | 114K | 17 M | 12 M | 21748 (1) | 00:04:21 |
| * 19. MAT_VIEW FULL ACCESS | STAG_ANAME_MV | 113K | 10 M | | 1085 (2) | 00:00:14 |
| 20. VIEW | ABC_CDE_INDEX_AST_VW | 1898K | 110 M | | 13499 (1) | 00:02:42 |
| * 21. TABLE ACCESS FULL | ABC_CDE_INDEX_AST | 1898K | 110 M | | 13499 (1) | 00:02:42 |
| * 22. HASH JOIN | | 89 M | 19G | | 46498 (16) | 00:09:18 |
| 23. VIEW | STAG_MASTER_VW | 39985 | 468K | | 2229 (1) | 00:00:27 |
| * 24. MAT_VIEW FULL ACCESS | STAG_MASTER_MV | 39985 | 468K | | 2229 (1) | 00:00:27 |
| * 25. HASH JOIN | | 89 M | 18G | 9320K | 43943 (16) | 00:08:48 |
| 26. VIEW | STAG_MANAME_MV | 264K | 6208K | | 974 (1) | 00:00:12 |
| 27. MAT_VIEW FULL ACCESS | STAG_AANAME_MV | 264K | 6208K | | 974 (1) | 00:00:12 |
| * 28. EXTERNAL RIGHT HASH JOIN | | 676K | 128 M | 19 M | 29255 (1) | 00:05:52 |
| 29. VIEW | ABC_CDE_INDEX_CHG_VW | 818K | 10 M | | 2448 (1) | 00:00:30 |
| * 30 | TABLE ACCESS FULL | ABC_CDE_INDEX_CHG | 818K | 10 M | | 2448 (1) | 00:00:30 |
| * 31. HASH JOIN | | 195K | 34 M | 9240K | 24001 (1) | 00:04:49 |
| 32. VIEW | STAG_NAMADDS_VW | 248K | 6316K | | 872 (1) | 00:00:11 |
| 33. MAT_VIEW FULL ACCESS | STAG_NAMADDS_MV | 248K | 6316K | | 872 (1) | 00:00:11 |
| * 34 | OUTER HASH JOIN | | 114K | 17 M | 12 M | 21748 (1) | 00:04:21 |
| * 35 | MAT_VIEW FULL ACCESS | STAG_ANAME_MV | 113K | 10 M | | 1085 (2) | 00:00:14 |
| 36. VIEW | ABC_CDE_INDEX_AST_VW | 1898K | 110 M | | 13499 (1) | 00:02:42 |
| * 37 | TABLE ACCESS FULL | ABC_CDE_INDEX_AST | 1898K | 110 M | | 13499 (1) | 00:02:42 |
| * 38 | HASH JOIN | | 4480K | 1004M | | 46189 (15) | 00:09:15 |
| 39. VIEW | STAG_MASTER_VW | 39985 | 468K | | 2229 (1) | 00:00:27 |
| * 40 | MAT_VIEW FULL ACCESS | STAG_MASTER_MV | 39985 | 468K | | 2229 (1) | 00:00:27 |
| * 41. HASH JOIN | | 4480K | 952 M | 9320K | 43943 (16) | 00:08:48 |
| 42. VIEW | STAG_MANAME_MV | 264K | 6208K | | 974 (1) | 00:00:12 |
| 43. MAT_VIEW FULL ACCESS | STAG_AANAME_MV | 264K | 6208K | | 974 (1) | 00:00:12 |
| * 44 | EXTERNAL RIGHT HASH JOIN | | 676K | 128 M | 19 M | 29255 (1) | 00:05:52 |
| 45. VIEW | ABC_CDE_INDEX_CHG_VW | 818K | 10 M | | 2448 (1) | 00:00:30 |
| * 46 | TABLE ACCESS FULL | ABC_CDE_INDEX_CHG | 818K | 10 M | | 2448 (1) | 00:00:30 |
| * 47 | HASH JOIN | | 195K | 34 M | 9240K | 24001 (1) | 00:04:49 |
| 48. VIEW | STAG_NAMADDS_VW | 248K | 6316K | | 872 (1) | 00:00:11 |
| 49. MAT_VIEW FULL ACCESS | STAG_NAMADDS_MV | 248K | 6316K | | 872 (1) | 00:00:11 |
| * 50 | OUTER HASH JOIN | | 114K | 17 M | 12 M | 21748 (1) | 00:04:21 |
| * 51 | MAT_VIEW FULL ACCESS | STAG_ANAME_MV | 113K | 10 M | | 1085 (2) | 00:00:14 |
| 52. VIEW | ABC_CDE_INDEX_AST_VW | 1898K | 110 M | | 13499 (1) | 00:02:42 |
| * 53 | TABLE ACCESS FULL | ABC_CDE_INDEX_AST | 1898K | 110 M | | 13499 (1) | 00:02:42 |
| * 54 | OUTER HASH JOIN | | 224KO | 50 M | 14 M | 32597 (4) | 00:06:32 |
| * 55 | HASH JOIN | | 64775 | 13 M | 7696K | 28458 (5) | 00:05:42 |
| * 56 | OUTER HASH JOIN | | 37855. 7245K | 5416K | 26763 (5) | 00:05:22 |
| * 57 | HASH JOIN | | 37675 | 4966K | | 6436 (18) | 00:01:18 |
| 58. VIEW | STAG_MASTER_VW | 39985 | 468K | | 2229 (1) | 00:00:27 |
| * 59 | MAT_VIEW FULL ACCESS | STAG_MASTER_MV | 39985 | 468K | | 2229 (1) | 00:00:27 |
| * 60 | HASH JOIN | | 37675 | 4525K | 9320K | 4206 (27) | 00:00:51 |
| 61. VIEW | STAG_MANAME_MV | 264K | 6208K | | 974 (1) | 00:00:12 |
| 62. MAT_VIEW FULL ACCESS | STAG_AANAME_MV | 264K | 6208K | | 974 (1) | 00:00:12 |
| * 63. MAT_VIEW FULL ACCESS | STAG_ANAME_MV | 113K | 10 M | | 1085 (2) | 00:00:14 |
| 64. VIEW | ABC_CDE_INDEX_AST_VW | 1898K | 110 M | | 13499 (1) | 00:02:42 |
| * 65 | TABLE ACCESS FULL | ABC_CDE_INDEX_AST | 1898K | 110 M | | 13499 (1) | 00:02:42 |
| 66. VIEW | STAG_NAMADDS_VW | 248K | 6316K | | 872 (1) | 00:00:11 |
| 67. MAT_VIEW FULL ACCESS | STAG_NAMADDS_MV | 248K | 6316K | | 872 (1) | 00:00:11 |
| 68. VIEW | ABC_CDE_INDEX_CHG_VW | 818K | 10 M | | 2448 (1) | 00:00:30 |
| * 69 | TABLE ACCESS FULL | ABC_CDE_INDEX_CHG | 818K | 10 M | | 2448 (1) | 00:00:30 |
| * 70 | OUTER HASH JOIN | | 11201 | 2570K | | 23267 (6) | 00:04:40 |
| * 71 | HASH JOIN | | 3239 | 702K | | 20816 (6) | 00:04:10 |
| * 72 | OUTER HASH JOIN | | 1893 | 362K | | 19942 (7) | 00:04:00 |
| * 73 | HASH JOIN | | 1884 | 248K | | 6435 (18) | 00:01:18 |
| * 74 | HASH JOIN | | 1884 | 226K | 9320K | 4206 (27) | 00:00:51 |
| 75. VIEW | STAG_MANAME_MV | 264K | 6208K | | 974 (1) | 00:00:12 |
| 76. MAT_VIEW FULL ACCESS | STAG_AANAME_MV | 264K | 6208K | | 974 (1) | 00:00:12 |
| * 77 | MAT_VIEW FULL ACCESS | STAG_ANAME_MV | 113K | 10 M | | 1085 (2) | 00:00:14 |
| 78. VIEW | STAG_MASTER_VW | 39985 | 468K | | 2229 (1) | 00:00:27 |
| * 79 | MAT_VIEW FULL ACCESS | STAG_MASTER_MV | 39985 | 468K | | 2229 (1) | 00:00:27 |
| 80. VIEW | ABC_CDE_INDEX_AST_VW | 1898K | 110 M | | 13499 (1) | 00:02:42 |
| * 81 | TABLE ACCESS FULL | ABC_CDE_INDEX_AST | 1898K | 110 M | | 13499 (1) | 00:02:42 |
| 82. VIEW | STAG_NAMADDS_VW | 248K | 6316K | | 872 (1) | 00:00:11 |
| 53 M | MAT_VIEW FULL ACCESS | STAG_NAMADDS_MV | 248K | 6316K | | 872 (1) | 00:00:11 |
| 84. VIEW | ABC_CDE_INDEX_CHG_VW | 818K | 10 M | | 2448 (1) | 00:00:30 |
| * 85 | TABLE ACCESS FULL | ABC_CDE_INDEX_CHG | 818K | 10 M | | 2448 (1) | 00:00:30 |
| * 86 | OUTER HASH JOIN | | 560. 128K | | 23267 (6) | 00:04:40 |
| * 87. HASH JOIN | | 162. 35964 | | 20816 (6) | 00:04:10 |
| * 88. OUTER HASH JOIN | | 95. 18620 | | 19942 (7) | 00:04:00 |
| * 89 | HASH JOIN | | 94. 12690 | | 6435 (18) | 00:01:18 |
| * 90 | HASH JOIN | | 94. 11562 | 9320K | 4206 (27) | 00:00:51 |
| 91. VIEW | STAG_MANAME_MV | 264K | 6208K | | 974 (1) | 00:00:12 |
| 92. MAT_VIEW FULL ACCESS | STAG_AANAME_MV | 264K | 6208K | | 974 (1) | 00:00:12 |
| * 93 | MAT_VIEW FULL ACCESS | STAG_ANAME_MV | 113K | 10 M | | 1085 (2) | 00:00:14 |
| 94. VIEW | STAG_MASTER_VW | 39985 | 468K | | 2229 (1) | 00:00:27 |
| * 95 | MAT_VIEW FULL ACCESS | STAG_MASTER_MV | 39985 | 468K | | 2229 (1) | 00:00:27 |
| 96. VIEW | ABC_CDE_INDEX_AST_VW | 1898K | 110 M | | 13499 (1) | 00:02:42 |
| * 97 | TABLE ACCESS FULL | ABC_CDE_INDEX_AST | 1898K | 110 M | | 13499 (1) | 00:02:42 |
| 98. VIEW | STAG_NAMADDS_VW | 248K | 6316K | | 872 (1) | 00:00:11 |
| 99. MAT_VIEW FULL ACCESS | STAG_NAMADDS_MV | 248K | 6316K | | 872 (1) | 00:00:11 |
| 100. VIEW | ABC_CDE_INDEX_CHG_VW | 818K | 10 M | | 2448 (1) | 00:00:30 |
| * 101 | TABLE ACCESS FULL | ABC_CDE_INDEX_CHG | 818K | 10 M | | 2448 (1) | 00:00:30 |
| * 102 | OUTER HASH JOIN | | 28. 6580. | 23267 (6) | 00:04:40 |
| * 103 | HASH JOIN | | 8. 1776 | | 20816 (6) | 00:04:10 |
| * 104 | OUTER HASH JOIN | | 5. 980. | 19942 (7) | 00:04:00 |
| * 105 | HASH JOIN | | 5. 675. | 6435 (18) | 00:01:18 |
| * 106 | HASH JOIN | | 5. 615 | 9320K | 4206 (27) | 00:00:51 |
| 107. VIEW | STAG_MANAME_MV | 264K | 6208K | | 974 (1) | 00:00:12 |
| 108. MAT_VIEW FULL ACCESS | STAG_AANAME_MV | 264K | 6208K | | 974 (1) | 00:00:12 |
| * 109 | MAT_VIEW FULL ACCESS | STAG_ANAME_MV | 113K | 10 M | | 1085 (2) | 00:00:14 |
| 110. VIEW | STAG_MASTER_VW | 39985 | 468K | | 2229 (1) | 00:00:27 |
| * 111 | MAT_VIEW FULL ACCESS | STAG_MASTER_MV | 39985 | 468K | | 2229 (1) | 00:00:27 |
| 112. VIEW | ABC_CDE_INDEX_AST_VW | 1898K | 110 M | | 13499 (1) | 00:02:42 |
| * 113 | TABLE ACCESS FULL | ABC_CDE_INDEX_AST | 1898K | 110 M | | 13499 (1) | 00:02:42 |
| 114. VIEW | STAG_NAMADDS_VW | 248K | 6316K | | 872 (1) | 00:00:11 |
| 115. MAT_VIEW FULL ACCESS | STAG_NAMADDS_MV | 248K | 6316K | | 872 (1) | 00:00:11 |
| 116. VIEW | ABC_CDE_INDEX_CHG_VW | 818K | 10 M | | 2448 (1) | 00:00:30 |
| * 117 | TABLE ACCESS FULL | ABC_CDE_INDEX_CHG | 818K | 10 M | | 2448 (1) | 00:00:30 |
| * 118 | OUTER HASH JOIN | | 1. 235. | 23267 (6) | 00:04:40 |
| * 119 | OUTER HASH JOIN | | 1. 174. | 9760 (12) | 00:01:58 |
| * 120 | HASH JOIN | | 1. 161. | 7309 (16) | 00:01:28 |
| * 121 | HASH JOIN | | 1. 135. | 6435 (18) | 00:01:18 |
| * 122 | HASH JOIN | | 1. 123 | 9320K | 4206 (27) | 00:00:51 |
| 123 | VIEW | STAG_MANAME_MV | 264K | 6208K | | 974 (1) | 00:00:12 |
| 124. MAT_VIEW FULL ACCESS | STAG_AANAME_MV | 264K | 6208K | | 974 (1) | 00:00:12 |
| * 125 | MAT_VIEW FULL ACCESS | STAG_ANAME_MV | 113K | 10 M | | 1085 (2) | 00:00:14 |
| 126. VIEW | STAG_MASTER_VW | 39985 | 468K | | 2229 (1) | 00:00:27 |
| * 127 | MAT_VIEW FULL ACCESS | STAG_MASTER_MV | 39985 | 468K | | 2229 (1) | 00:00:27 |
| 128. VIEW | STAG_NAMADDS_VW | 248K | 6316K | | 872 (1) | 00:00:11 |
| 129. MAT_VIEW FULL ACCESS | STAG_NAMADDS_MV | 248K | 6316K | | 872 (1) | 00:00:11 |
| 130. VIEW | ABC_CDE_INDEX_CHG_VW | 818K | 10 M | | 2448 (1) | 00:00:30 |
| * 131 | TABLE ACCESS FULL | ABC_CDE_INDEX_CHG | 818K | 10 M | | 2448 (1) | 00:00:30 |
| 132. VIEW | ABC_CDE_INDEX_AST_VW | 1898K | 110 M | | 13499 (1) | 00:02:42 |
| * 133 | TABLE ACCESS FULL | ABC_CDE_INDEX_AST | 1898K | 110 M | | 13499 (1) | 00:02:42 |
| * 134 | OUTER HASH JOIN | | 1. 235. | 23267 (6) | 00:04:40 |
| * 135 | OUTER HASH JOIN | | 1. 174. | 9760 (12) | 00:01:58 |
| * 136 | HASH JOIN | | 1. 161. | 7309 (16) | 00:01:28 |
| * 137 | HASH JOIN | | 1. 135. | 6435 (18) | 00:01:18 |
| * 138 | HASH JOIN | | 1. 123 | 9320K | 4206 (27) | 00:00:51 |
| 139. VIEW | STAG_MANAME_MV | 264K | 6208K | | 974 (1) | 00:00:12 |
| 140. MAT_VIEW FULL ACCESS | STAG_AANAME_MV | 264K | 6208K | | 974 (1) | 00:00:12 |
| * 141 | MAT_VIEW FULL ACCESS | STAG_ANAME_MV | 113K | 10 M | | 1085 (2) | 00:00:14 |
| 142. VIEW | STAG_MASTER_VW | 39985 | 468K | | 2229 (1) | 00:00:27 |
| * 143 | MAT_VIEW FULL ACCESS | STAG_MASTER_MV | 39985 | 468K | | 2229 (1) | 00:00:27 |
| 144. VIEW | STAG_NAMADDS_VW | 248K | 6316K | | 872 (1) | 00:00:11 |
| 145. MAT_VIEW FULL ACCESS | STAG_NAMADDS_MV | 248K | 6316K | | 872 (1) | 00:00:11 |
| 146. VIEW | ABC_CDE_INDEX_CHG_VW | 818K | 10 M | | 2448 (1) | 00:00:30 |
| * 147 | TABLE ACCESS FULL | ABC_CDE_INDEX_CHG | 818K | 10 M | | 2448 (1) | 00:00:30 |
| 148. VIEW | ABC_CDE_INDEX_AST_VW | 1898K | 110 M | | 13499 (1) | 00:02:42 |
| * 149 | TABLE ACCESS FULL | ABC_CDE_INDEX_AST | 1898K | 110 M | | 13499 (1) | 00:02:42 |
| * 150 | OUTER HASH JOIN | | 1. 235. | 23267 (6) | 00:04:40 |
| * 151 | OUTER HASH JOIN | | 1. 174. | 9760 (12) | 00:01:58 |
| * 152 | HASH JOIN | | 1. 161. | 7309 (16) | 00:01:28 |
| * 153 | HASH JOIN | | 1. 135. | 6435 (18) | 00:01:18 |
| * 154 | HASH JOIN | | 1. 123 | 9320K | 4206 (27) | 00:00:51 |
| 155. VIEW | STAG_MANAME_MV | 264K | 6208K | | 974 (1) | 00:00:12 |
| 156. MAT_VIEW FULL ACCESS | STAG_AANAME_MV | 264K | 6208K | | 974 (1) | 00:00:12 |
| * 157 | MAT_VIEW FULL ACCESS | STAG_ANAME_MV | 113K | 10 M | | 1085 (2) | 00:00:14 |
| 158. VIEW | STAG_MASTER_VW | 39985 | 468K | | 2229 (1) | 00:00:27 |
| * 159 | MAT_VIEW FULL ACCESS | STAG_MASTER_MV | 39985 | 468K | | 2229 (1) | 00:00:27 |
| 160. VIEW | STAG_NAMADDS_VW | 248K | 6316K | | 872 (1) | 00:00:11 |
| 161. MAT_VIEW FULL ACCESS | STAG_NAMADDS_MV | 248K | 6316K | | 872 (1) | 00:00:11 |
| 162. VIEW | ABC_CDE_INDEX_CHG_VW | 818K | 10 M | | 2448 (1) | 00:00:30 |
| * 163 | TABLE ACCESS FULL | ABC_CDE_INDEX_CHG | 818K | 10 M | | 2448 (1) | 00:00:30 |
| 164. VIEW | ABC_CDE_INDEX_AST_VW | 1898K | 110 M | | 13499 (1) | 00:02:42 |
| * 165 | TABLE ACCESS FULL | ABC_CDE_INDEX_AST | 1898K | 110 M | | 13499 (1) | 00:02:42 |
| * 166 | OUTER HASH JOIN | | 1. 235. | 37689 (26) | 00:07:33 |
| * 167 | HASH JOIN | | 1. 222. | 35237 (28) | 00:07:03 |
| * 168 | HASH JOIN | | 1. 210 | | 33008 (29) | 00:06:37 |
| * 169 | HASH JOIN | | 9781. 1776K | | 22622 (1) | 00:04:32 |
| * 170 | FILTER | | | | | | |
| * 171 | OUTER HASH JOIN | | 5716 | 893K | 12 M | 21748 (1) | 00:04:21 |
| * 172 | MAT_VIEW FULL ACCESS | STAG_ANAME_MV | 113K | 10 M | | 1085 (2) | 00:00:14 |
| 173. VIEW | ABC_CDE_INDEX_AST_VW | 1898K | 110 M | | 13499 (1) | 00:02:42 |
| * 174 | TABLE ACCESS FULL | ABC_CDE_INDEX_AST | 1898K | 110 M | | 13499 (1) | 00:02:42 |
| 175. VIEW | STAG_NAMADDS_VW | 248K | 6316K | | 872 (1) | 00:00:11 |
| 176. MAT_VIEW FULL ACCESS | STAG_NAMADDS_MV | 248K | 6316K | | 872 (1) | 00:00:11 |
| * 177 | VIEW | STAG_MANAME_MV | 264K | 6208K | | 974 (1) | 00:00:12 |
| 178. MAT_VIEW FULL ACCESS | STAG_AANAME_MV | 264K | 6208K | | 974 (1) | 00:00:12 |
| 179. VIEW | STAG_MASTER_VW | 39985 | 468K | | 2229 (1) | 00:00:27 |
| * 180 | MAT_VIEW FULL ACCESS | STAG_MASTER_MV | 39985 | 468K | | 2229 (1) | 00:00:27 |
| 181. VIEW | ABC_CDE_INDEX_CHG_VW | 818K | 10 M | | 2448 (1) | 00:00:30 |
| * 182 | TABLE ACCESS FULL | ABC_CDE_INDEX_CHG | 818K | 10 M | | 2448 (1) | 00:00:30 |
| 183. LOAD SELECT ACE | SYS_TEMP_0FD9FCB73_F58FAD20 | | | | | |
| 184. VIEW | | 145K | 18 M | | 187 M (1) | 625:08:34 |
| 185. UNIQUE FATE | | 145K | 22 M | 1215G | 187 M (1) | 625:08:34 |
| * 186 | HASH JOIN | | 7487M | 1122G | | 274K (98) | 00:54:59 |
| 187. VIEW | STAG_MASTER_VW | 39985 | 468K | | 2229 (1) | 00:00:27 |
| * 188 | MAT_VIEW FULL ACCESS | STAG_MASTER_MV | 39985 | 468K | | 2229 (1) | 00:00:27 |
| * 189 | HASH JOIN | | 7487M | 1039G | 9320K | 245K (98) | 00:49:06 |
| 190. VIEW | STAG_MANAME_MV | 264K | 6208K | | 974 (1) | 00:00:12 |
| 191. MAT_VIEW FULL ACCESS | STAG_AANAME_MV | 264K | 6208K | | 974 (1) | 00:00:12 |
| * 192 | HASH JOIN | | 248K | 29 M | 9240K | 2995 (1) | 00:00:36 |
| 193. VIEW | STAG_NAMADDS_VW | 248K | 6316K | | 872 (1) | 00:00:11 |
| 194. MAT_VIEW FULL ACCESS | STAG_NAMADDS_MV | 248K | 6316K | | 872 (1) | 00:00:11 |
| * 195 | MAT_VIEW FULL ACCESS | STAG_ANAME_MV | 113K | 10 M | | 1075 (1) | 00:00:13 |
| 196. UNIQUE FATE | | 352K | 60 M | 72 M | 17677 (12) | 00:03:33 |
| 197. UNION-ALL | | | | | | |
| * 198 | VIEW | | 352K | 60 M | | 1883 (1) | 00:00:23 |
| 199. TABLE ACCESS FULL | SYS_TEMP_1234_5678 | 352K | 60 M | | 1883 (1) | 00:00:23 |
| * 200 | FILTER | | | | | | |
| * 201 | OUTER HASH JOIN | | 1. 150. | 1982 (1) | 00:00:24 |
| * 202 | HASH JOIN | | 1. 142. | 97 (2) | 00:00:02 |
| 203. VIEW | | 11540 | 92320 | | 48 (0) | 00:00:01 |
| 204. TABLE ACCESS FULL | SYS_TEMP_3456_0987F0 | 11540 | 1 510 K | | 48 (0) | 00:00:01 |
| 205. VIEW | | 11540 | 1 510 K | | 48 (0) | 00:00:01 |
| 206. TABLE ACCESS FULL | SYS_TEMP_0987F0_3456 | 11540 | 1 510 K | | 48 (0) | 00:00:01 |
| 207. VIEW | | 352K | 2757K | | 1883 (1) | 00:00:23 |
| 208. TABLE ACCESS FULL | SYS_TEMP_09kjhn0_3456 | 352K | 60 M | | 1883 (1) | 00:00:23 |
-----------------------------------------------------------------------------------------------------------------------
{code}
Thank you.
Well, that was just a guess because you don't want to share the query, nor execution plan with actual cardinalities. The goal is probably to avoid the separate.
-
How can I stop the process using the trigger Disqualification?
How can I stop and start the process using triggers in Disqualification? While planning a job, I can not able to see the folder of trigger / trigger name in the tool palette? What kind of file should be placed in the Triggers folder. If you know someone, let me know. If someone has shared an example script which is very useful for me.
Thanks in advance.
Malila Chandra.
It is a common use case.
You create a job that has a closed Web Services trigger configured before executing the first phase (right click on the stage in the Task Manager, select Configure, you will then see this screen below), with the work or or jobs you need to added stop. This must be configured to be 'blocking', i.e. the rest of the work expected on the triggering comprehensive action.
Work should have a phase which refreshes the data staging, and another phase (or a phase of post trigger) that returns your work in normal real time (using the trigger on the job).
-
Example of
Currently, when the user enters the page interactive report runs (unless the user hitting ' go') and - does no data found because one "parameterized" field is required and the sql is not set to NULL values.
I'm looking for a way to not run a query at all -until the user hits go for the first time on the page - each time that they re - enter the page in the same session, it would be OK to auto submit the query.
I believe that I can install a hidden item and check on my interactive report E1 not null. Then create a 'calculation' on 'after bid"that would set this value to a value - say 1.
I can't seem to be able to get this to work however.
In my interactive report - I wonder what 'type condition' should I use. Any thoughts would be greatly appreciated.
You have two regions, research and order Type. You have items in the two regions. However, I think you are talking about the area "Search" when you say 2 parameters.
If you want to just display IR when the user clicks on 'Go' or click on 'Go' earlier in the same session, then I suggest,
- Create a new item of the hidden page, P6_SHOW_IR
- Create page process that runs when the user clicks on the button 'Go '. Here to update the value of P6_SHOW_IR 'Y '.
- Create a branch that connects to the same page with "State of Session saving" checked (connections conditional, when click on the button "Go")
- Set "Conditions" for the region of infrared, so it displays only when the value of the P6_SHOW_IR element is Y
Kind regards
Hari
-
Hello Experts
I can't in select the record_sequence in the output. Please see the part of the desired effect.
Please help solve this problem.
Is the version of Oracle, I'm working on that
Oracle Database 11 g Enterprise Edition Release 11.1.0.7.0 - 64 bit Production
With partitioning, OLAP, Data Mining and Real Application Testing options
Thank you
RB
TABLE1 AS
(
SELECT '28' EXAM_CD1, EXAM_CD2 '29', '10' EXAM_CD3, 111' CAND_ID FROM DUAL UNION ALL
SELECT '21' EXAM_CD1, EXAM_CD2 '39', '20' EXAM_CD3, 112' CAND_ID FROM DUAL UNION ALL
SELECT '22' EXAM_CD1, EXAM_CD2 '49', '30' EXAM_CD3, 113' CAND_ID FROM DUAL UNION ALL
SELECT 'EXAM_CD1 23', '59' EXAM_CD2, EXAM_CD3 ' 40', 114' CAND_ID FROM DUAL UNION ALL
SELECT '24' EXAM_CD1, EXAM_CD2 '69', '50' EXAM_CD3, 115' DOUBLE CAND_ID)
AS TABLE2
(
SELECT EXAM_CD '28', '111' CANDID, 1 RECORD_SEQ OF DOUBLE UNION ALL
SELECT '30' EXAM_CD, '113' CANDID, 2 RECORD_SEQ FROM DUAL UNION ALL
SELECT EXAM_CD '94', '111' CANDID, 3 RECORD_SEQ OF DOUBLE UNION ALL
SELECT EXAM_CD '69', '115' CANDID, 4 DOUBLE RECORD_SEQ)
(
SELECT EXAM_CD FROM TABLE2, CANDID
LESS
SELECT CAND_ID,
MAX (L CASE WHEN 1 EXAM_CD1 THEN WHEN 2 THEN of OTHER EXAM_CD2 EXAM_CD3 END) exam_code
FROM TABLE1,
(SELECT LEVEL L FROM DUAL CONNECT BY LEVEL < = 3)
CAND_ID GROUP, L)
The aim is
CAND_ID, EXAM_CD, RECORD_SEQ
* 111, 94, 3 *.Hello
Rb2000rb65 wrote:
The solution use not less as long as I get my results using the latest features, it is good with me.Good idea!
UNMIS is not the best tool for this task. The saved query gets the exam_cd and the Candide you want, but you can't find the record_seq because there of nothing like record_seq in table1.You can do this way:
SELECT * FROM table2 m WHERE NOT EXISTS ( SELECT 1 FROM table1 WHERE m.candid = candid AND m.exam_cd IN ( exam_cd1 , exam_cd2 , exam_cd3 ) ) ;
I guess you could use LESS, like this
SELECT * FROM table2 WHERE (exam_cd, candid) IN ( SELECT ... -- The MINUS query you posted goes here ) ;
but it is unecessarily complicated.
-
How to stop the query takes too long
Is there a way to tell oracle to stop a query that takes too long to run?
I'm trying to end a way to prevent some users from running any querys that takes more than 2 minutes... any help?
I use 10g
Thank you!Hello
You can create a profile... and limit...
CREATE a PROFILE prof_low LIMIT
CPU_PER_CALL 3000 (about 30 seconds)
PRIVATE_SGA 500K
LOGICAL_READS_PER_CALL 1000;ALTER USER myuser PROFILE prof_low;
Concerning
Joao Oliveira -
Helps the query using summary on partition
I don't know that miss me something small here. I need to make an inventory of end.
The formula is the following:
For the 501, end = store inventory
-closing inventory 7292.19
-supplies - 30,64 closing stock
-closing inventory for buns - 1002.34
= -----------
6259.21
I can get the stock of closing with analytics, but cannot end inventory.
My dollar gap is also swollen. It should be 780.55 for store 501;
-= = So I separated it and still get incorrect resultCREATE TABLE "SUBQUERY_CATEGORIES" ( "STOREID" NUMBER NOT NULL ENABLE, "WEEK_NBR" NUMBER, "DESCRIPTION" VARCHAR2(100 BYTE) NOT NULL ENABLE, "OPEN_INVENTORY" NUMBER, "CLOSING_INVENTORY" NUMBER, "TRANSFER_IN_COST" NUMBER, "TRANSFER_OUT_COST" NUMBER, "DELV_COST" NUMBER, "PREV_DELV_COST" NUMBER, "TOTAL_COST" NUMBER, "DOLLAR_VARIANCE" NUMBER ) ; Insert into SUBQUERY_CATEGORIES (STOREID,WEEK_NBR,DESCRIPTION,OPEN_INVENTORY,CLOSING_INVENTORY,TRANSFER_IN_COST,TRANSFER_OUT_COST,DELV_COST,PREV_DELV_COST,TOTAL_COST,DOLLAR_VARIANCE) values (501,1,'Other Foods-I',880.04,837.16,17.32,0,491.92,880.044,837.158,35124.92); Insert into SUBQUERY_CATEGORIES (STOREID,WEEK_NBR,DESCRIPTION,OPEN_INVENTORY,CLOSING_INVENTORY,TRANSFER_IN_COST,TRANSFER_OUT_COST,DELV_COST,PREV_DELV_COST,TOTAL_COST,DOLLAR_VARIANCE) values (27,1,'Shortening-I',199.7,200.32,0,0,99.85,199.7,200.324,390.45); Insert into SUBQUERY_CATEGORIES (STOREID,WEEK_NBR,DESCRIPTION,OPEN_INVENTORY,CLOSING_INVENTORY,TRANSFER_IN_COST,TRANSFER_OUT_COST,DELV_COST,PREV_DELV_COST,TOTAL_COST,DOLLAR_VARIANCE) values (25,1,'Meat-I',154.69,464.06,168.75,42.188,1406.25,154.688,464.063,1239.85); Insert into SUBQUERY_CATEGORIES (STOREID,WEEK_NBR,DESCRIPTION,OPEN_INVENTORY,CLOSING_INVENTORY,TRANSFER_IN_COST,TRANSFER_OUT_COST,DELV_COST,PREV_DELV_COST,TOTAL_COST,DOLLAR_VARIANCE) values (25,1,'Bacon-I',74.99,62.63,19.405,0,154.16,74.992,62.628,1239.85); Insert into SUBQUERY_CATEGORIES (STOREID,WEEK_NBR,DESCRIPTION,OPEN_INVENTORY,CLOSING_INVENTORY,TRANSFER_IN_COST,TRANSFER_OUT_COST,DELV_COST,PREV_DELV_COST,TOTAL_COST,DOLLAR_VARIANCE) values (501,1,'Repairs & Maint',0,0,0,0,195,0,0,780.55); Insert into SUBQUERY_CATEGORIES (STOREID,WEEK_NBR,DESCRIPTION,OPEN_INVENTORY,CLOSING_INVENTORY,TRANSFER_IN_COST,TRANSFER_OUT_COST,DELV_COST,PREV_DELV_COST,TOTAL_COST,DOLLAR_VARIANCE) values (501,1,'Supplies',25.92,30.64,0,0,139.43,25.923,30.637,37466.58); Insert into SUBQUERY_CATEGORIES (STOREID,WEEK_NBR,DESCRIPTION,OPEN_INVENTORY,CLOSING_INVENTORY,TRANSFER_IN_COST,TRANSFER_OUT_COST,DELV_COST,PREV_DELV_COST,TOTAL_COST,DOLLAR_VARIANCE) values (25,1,'Drinks-I',585.06,750.36,0,0,715.87,585.058,750.358,8678.93); Insert into SUBQUERY_CATEGORIES (STOREID,WEEK_NBR,DESCRIPTION,OPEN_INVENTORY,CLOSING_INVENTORY,TRANSFER_IN_COST,TRANSFER_OUT_COST,DELV_COST,PREV_DELV_COST,TOTAL_COST,DOLLAR_VARIANCE) values (501,1,'Chili Ingridients-I',177.99,214.47,5.918,5.918,302.88,177.995,214.466,4683.32); Insert into SUBQUERY_CATEGORIES (STOREID,WEEK_NBR,DESCRIPTION,OPEN_INVENTORY,CLOSING_INVENTORY,TRANSFER_IN_COST,TRANSFER_OUT_COST,DELV_COST,PREV_DELV_COST,TOTAL_COST,DOLLAR_VARIANCE) values (27,1,'Meat-I',540,264.38,14.063,28.125,1181.25,540,264.375,780.89); Insert into SUBQUERY_CATEGORIES (STOREID,WEEK_NBR,DESCRIPTION,OPEN_INVENTORY,CLOSING_INVENTORY,TRANSFER_IN_COST,TRANSFER_OUT_COST,DELV_COST,PREV_DELV_COST,TOTAL_COST,DOLLAR_VARIANCE) values (27,1,'Paper-I',955.71,839.86,0,15.308,600.54,955.71,839.859,19131.9); Insert into SUBQUERY_CATEGORIES (STOREID,WEEK_NBR,DESCRIPTION,OPEN_INVENTORY,CLOSING_INVENTORY,TRANSFER_IN_COST,TRANSFER_OUT_COST,DELV_COST,PREV_DELV_COST,TOTAL_COST,DOLLAR_VARIANCE) values (27,1,'Supplies',11.78,9.43,0,0,158.85,11.783,9.427,17570.11); Insert into SUBQUERY_CATEGORIES (STOREID,WEEK_NBR,DESCRIPTION,OPEN_INVENTORY,CLOSING_INVENTORY,TRANSFER_IN_COST,TRANSFER_OUT_COST,DELV_COST,PREV_DELV_COST,TOTAL_COST,DOLLAR_VARIANCE) values (27,1,'Produce-I',180.5,98.64,0,0,206,180.498,98.638,3904.47); Insert into SUBQUERY_CATEGORIES (STOREID,WEEK_NBR,DESCRIPTION,OPEN_INVENTORY,CLOSING_INVENTORY,TRANSFER_IN_COST,TRANSFER_OUT_COST,DELV_COST,PREV_DELV_COST,TOTAL_COST,DOLLAR_VARIANCE) values (25,1,'Condiments-I',170.14,153.46,8.668,0,164.86,170.14,153.456,6819.16); Insert into SUBQUERY_CATEGORIES (STOREID,WEEK_NBR,DESCRIPTION,OPEN_INVENTORY,CLOSING_INVENTORY,TRANSFER_IN_COST,TRANSFER_OUT_COST,DELV_COST,PREV_DELV_COST,TOTAL_COST,DOLLAR_VARIANCE) values (27,1,'Repairs & Maint',0,0,0,0,500,0,0,390.45); Insert into SUBQUERY_CATEGORIES (STOREID,WEEK_NBR,DESCRIPTION,OPEN_INVENTORY,CLOSING_INVENTORY,TRANSFER_IN_COST,TRANSFER_OUT_COST,DELV_COST,PREV_DELV_COST,TOTAL_COST,DOLLAR_VARIANCE) values (25,1,'Fries-I',78.22,120.33,54.15,18.05,631.75,78.217,120.333,619.92); Insert into SUBQUERY_CATEGORIES (STOREID,WEEK_NBR,DESCRIPTION,OPEN_INVENTORY,CLOSING_INVENTORY,TRANSFER_IN_COST,TRANSFER_OUT_COST,DELV_COST,PREV_DELV_COST,TOTAL_COST,DOLLAR_VARIANCE) values (501,1,'Paper-I',1113.09,1093.63,50.884,14.07,846.22,1113.089,1093.633,43711.01); Insert into SUBQUERY_CATEGORIES (STOREID,WEEK_NBR,DESCRIPTION,OPEN_INVENTORY,CLOSING_INVENTORY,TRANSFER_IN_COST,TRANSFER_OUT_COST,DELV_COST,PREV_DELV_COST,TOTAL_COST,DOLLAR_VARIANCE) values (27,1,'Cheese-I',63.78,58.7,0,0,197.07,63.783,58.704,1171.34); Insert into SUBQUERY_CATEGORIES (STOREID,WEEK_NBR,DESCRIPTION,OPEN_INVENTORY,CLOSING_INVENTORY,TRANSFER_IN_COST,TRANSFER_OUT_COST,DELV_COST,PREV_DELV_COST,TOTAL_COST,DOLLAR_VARIANCE) values (501,1,'Produce-I',201.56,304.85,0,0,554.85,201.56,304.847,7805.54); Insert into SUBQUERY_CATEGORIES (STOREID,WEEK_NBR,DESCRIPTION,OPEN_INVENTORY,CLOSING_INVENTORY,TRANSFER_IN_COST,TRANSFER_OUT_COST,DELV_COST,PREV_DELV_COST,TOTAL_COST,DOLLAR_VARIANCE) values (27,1,'Buns-I',1064.44,793.73,0,0,191.36,1064.44,793.73,780.89); Insert into SUBQUERY_CATEGORIES (STOREID,WEEK_NBR,DESCRIPTION,OPEN_INVENTORY,CLOSING_INVENTORY,TRANSFER_IN_COST,TRANSFER_OUT_COST,DELV_COST,PREV_DELV_COST,TOTAL_COST,DOLLAR_VARIANCE) values (27,1,'Bacon-I',251.95,155.9,0,0,115.62,251.95,155.902,780.89); Insert into SUBQUERY_CATEGORIES (STOREID,WEEK_NBR,DESCRIPTION,OPEN_INVENTORY,CLOSING_INVENTORY,TRANSFER_IN_COST,TRANSFER_OUT_COST,DELV_COST,PREV_DELV_COST,TOTAL_COST,DOLLAR_VARIANCE) values (25,1,'Paper-I',806.87,871.74,12.113,8.448,674.56,806.871,871.741,30376.25); Insert into SUBQUERY_CATEGORIES (STOREID,WEEK_NBR,DESCRIPTION,OPEN_INVENTORY,CLOSING_INVENTORY,TRANSFER_IN_COST,TRANSFER_OUT_COST,DELV_COST,PREV_DELV_COST,TOTAL_COST,DOLLAR_VARIANCE) values (501,1,'Chicken-I',561.16,570.93,94.457,0,1568.81,561.156,570.929,5463.88); Insert into SUBQUERY_CATEGORIES (STOREID,WEEK_NBR,DESCRIPTION,OPEN_INVENTORY,CLOSING_INVENTORY,TRANSFER_IN_COST,TRANSFER_OUT_COST,DELV_COST,PREV_DELV_COST,TOTAL_COST,DOLLAR_VARIANCE) values (25,1,'Chicken-I',285.86,534.67,73.007,35.97,1402.86,285.858,534.67,4339.46); Insert into SUBQUERY_CATEGORIES (STOREID,WEEK_NBR,DESCRIPTION,OPEN_INVENTORY,CLOSING_INVENTORY,TRANSFER_IN_COST,TRANSFER_OUT_COST,DELV_COST,PREV_DELV_COST,TOTAL_COST,DOLLAR_VARIANCE) values (27,1,'Drinks-I',1061.6,1040.97,0,0,584.59,1061.597,1040.971,5466.26); Insert into SUBQUERY_CATEGORIES (STOREID,WEEK_NBR,DESCRIPTION,OPEN_INVENTORY,CLOSING_INVENTORY,TRANSFER_IN_COST,TRANSFER_OUT_COST,DELV_COST,PREV_DELV_COST,TOTAL_COST,DOLLAR_VARIANCE) values (501,1,'Breakfast-I',437.9,376.44,0,0,272.42,437.904,376.438,12488.86); Insert into SUBQUERY_CATEGORIES (STOREID,WEEK_NBR,DESCRIPTION,OPEN_INVENTORY,CLOSING_INVENTORY,TRANSFER_IN_COST,TRANSFER_OUT_COST,DELV_COST,PREV_DELV_COST,TOTAL_COST,DOLLAR_VARIANCE) values (27,1,'Condiments-I',173.67,159.72,0,3.251,187.55,173.671,159.721,4294.92); Insert into SUBQUERY_CATEGORIES (STOREID,WEEK_NBR,DESCRIPTION,OPEN_INVENTORY,CLOSING_INVENTORY,TRANSFER_IN_COST,TRANSFER_OUT_COST,DELV_COST,PREV_DELV_COST,TOTAL_COST,DOLLAR_VARIANCE) values (25,1,'Chili Ingridients-I',93.59,149.49,2.445,0,253.85,93.594,149.489,3719.54); Insert into SUBQUERY_CATEGORIES (STOREID,WEEK_NBR,DESCRIPTION,OPEN_INVENTORY,CLOSING_INVENTORY,TRANSFER_IN_COST,TRANSFER_OUT_COST,DELV_COST,PREV_DELV_COST,TOTAL_COST,DOLLAR_VARIANCE) values (25,1,'Buns-I',873.54,914.48,0,0,441.6,873.54,914.48,1239.85); Insert into SUBQUERY_CATEGORIES (STOREID,WEEK_NBR,DESCRIPTION,OPEN_INVENTORY,CLOSING_INVENTORY,TRANSFER_IN_COST,TRANSFER_OUT_COST,DELV_COST,PREV_DELV_COST,TOTAL_COST,DOLLAR_VARIANCE) values (501,1,'Fries-I',39.11,126.35,36.1,36.1,884.45,39.108,126.35,780.55); Insert into SUBQUERY_CATEGORIES (STOREID,WEEK_NBR,DESCRIPTION,OPEN_INVENTORY,CLOSING_INVENTORY,TRANSFER_IN_COST,TRANSFER_OUT_COST,DELV_COST,PREV_DELV_COST,TOTAL_COST,DOLLAR_VARIANCE) values (25,1,'Supplies',4.71,4.71,0,0,195.53,4.713,4.713,27896.56); Insert into SUBQUERY_CATEGORIES (STOREID,WEEK_NBR,DESCRIPTION,OPEN_INVENTORY,CLOSING_INVENTORY,TRANSFER_IN_COST,TRANSFER_OUT_COST,DELV_COST,PREV_DELV_COST,TOTAL_COST,DOLLAR_VARIANCE) values (25,1,'Other Foods-I',615.63,627.42,1.701,0,374.4,615.63,627.419,26656.71); Insert into SUBQUERY_CATEGORIES (STOREID,WEEK_NBR,DESCRIPTION,OPEN_INVENTORY,CLOSING_INVENTORY,TRANSFER_IN_COST,TRANSFER_OUT_COST,DELV_COST,PREV_DELV_COST,TOTAL_COST,DOLLAR_VARIANCE) values (27,1,'Chicken-I',702.5,471.66,0,65.64,1120.39,702.502,471.664,2733.13); Insert into SUBQUERY_CATEGORIES (STOREID,WEEK_NBR,DESCRIPTION,OPEN_INVENTORY,CLOSING_INVENTORY,TRANSFER_IN_COST,TRANSFER_OUT_COST,DELV_COST,PREV_DELV_COST,TOTAL_COST,DOLLAR_VARIANCE) values (501,1,'Dairy-I',176.9,128.3,0,0,332.14,176.904,128.304,5463.88); Insert into SUBQUERY_CATEGORIES (STOREID,WEEK_NBR,DESCRIPTION,OPEN_INVENTORY,CLOSING_INVENTORY,TRANSFER_IN_COST,TRANSFER_OUT_COST,DELV_COST,PREV_DELV_COST,TOTAL_COST,DOLLAR_VARIANCE) values (27,1,'Dairy-I',171.78,85.3,0,0,109.38,171.783,85.297,2342.68); Insert into SUBQUERY_CATEGORIES (STOREID,WEEK_NBR,DESCRIPTION,OPEN_INVENTORY,CLOSING_INVENTORY,TRANSFER_IN_COST,TRANSFER_OUT_COST,DELV_COST,PREV_DELV_COST,TOTAL_COST,DOLLAR_VARIANCE) values (25,1,'Dairy-I',122.71,89.86,0,0,288.98,122.706,89.856,3719.54); Insert into SUBQUERY_CATEGORIES (STOREID,WEEK_NBR,DESCRIPTION,OPEN_INVENTORY,CLOSING_INVENTORY,TRANSFER_IN_COST,TRANSFER_OUT_COST,DELV_COST,PREV_DELV_COST,TOTAL_COST,DOLLAR_VARIANCE) values (25,1,'Cheese-I',140.03,109.46,0,0,131.38,140.028,109.461,1859.77); Insert into SUBQUERY_CATEGORIES (STOREID,WEEK_NBR,DESCRIPTION,OPEN_INVENTORY,CLOSING_INVENTORY,TRANSFER_IN_COST,TRANSFER_OUT_COST,DELV_COST,PREV_DELV_COST,TOTAL_COST,DOLLAR_VARIANCE) values (25,1,'Produce-I',151.15,169.85,0,3.44,270.85,151.148,169.852,6199.23); Insert into SUBQUERY_CATEGORIES (STOREID,WEEK_NBR,DESCRIPTION,OPEN_INVENTORY,CLOSING_INVENTORY,TRANSFER_IN_COST,TRANSFER_OUT_COST,DELV_COST,PREV_DELV_COST,TOTAL_COST,DOLLAR_VARIANCE) values (501,1,'Shortening-I',249.63,259.61,0,0,259.61,249.625,259.61,780.55); Insert into SUBQUERY_CATEGORIES (STOREID,WEEK_NBR,DESCRIPTION,OPEN_INVENTORY,CLOSING_INVENTORY,TRANSFER_IN_COST,TRANSFER_OUT_COST,DELV_COST,PREV_DELV_COST,TOTAL_COST,DOLLAR_VARIANCE) values (501,1,'Bacon-I',116.58,115.62,0,0,308.32,116.581,115.62,1561.11); Insert into SUBQUERY_CATEGORIES (STOREID,WEEK_NBR,DESCRIPTION,OPEN_INVENTORY,CLOSING_INVENTORY,TRANSFER_IN_COST,TRANSFER_OUT_COST,DELV_COST,PREV_DELV_COST,TOTAL_COST,DOLLAR_VARIANCE) values (25,1,'Repairs & Maint',0,0,0,0,200,0,0,619.92); Insert into SUBQUERY_CATEGORIES (STOREID,WEEK_NBR,DESCRIPTION,OPEN_INVENTORY,CLOSING_INVENTORY,TRANSFER_IN_COST,TRANSFER_OUT_COST,DELV_COST,PREV_DELV_COST,TOTAL_COST,DOLLAR_VARIANCE) values (501,1,'Cheese-I',130.9,174.52,0,0,328.45,130.897,174.516,2341.66); Insert into SUBQUERY_CATEGORIES (STOREID,WEEK_NBR,DESCRIPTION,OPEN_INVENTORY,CLOSING_INVENTORY,TRANSFER_IN_COST,TRANSFER_OUT_COST,DELV_COST,PREV_DELV_COST,TOTAL_COST,DOLLAR_VARIANCE) values (501,1,'Condiments-I',225.65,207.39,0,0,247.81,225.645,207.394,8586.09); Insert into SUBQUERY_CATEGORIES (STOREID,WEEK_NBR,DESCRIPTION,OPEN_INVENTORY,CLOSING_INVENTORY,TRANSFER_IN_COST,TRANSFER_OUT_COST,DELV_COST,PREV_DELV_COST,TOTAL_COST,DOLLAR_VARIANCE) values (27,1,'Chili Ingridients-I',159.45,109.79,5.918,0,159.6,159.45,109.788,2342.68); Insert into SUBQUERY_CATEGORIES (STOREID,WEEK_NBR,DESCRIPTION,OPEN_INVENTORY,CLOSING_INVENTORY,TRANSFER_IN_COST,TRANSFER_OUT_COST,DELV_COST,PREV_DELV_COST,TOTAL_COST,DOLLAR_VARIANCE) values (501,1,'Meat-I',752.34,696.09,0,28.125,1800,752.344,696.094,1561.11); Insert into SUBQUERY_CATEGORIES (STOREID,WEEK_NBR,DESCRIPTION,OPEN_INVENTORY,CLOSING_INVENTORY,TRANSFER_IN_COST,TRANSFER_OUT_COST,DELV_COST,PREV_DELV_COST,TOTAL_COST,DOLLAR_VARIANCE) values (501,1,'Buns-I',1090.2,1002.34,0,0,524.4,1090.2,1002.34,1561.11); Insert into SUBQUERY_CATEGORIES (STOREID,WEEK_NBR,DESCRIPTION,OPEN_INVENTORY,CLOSING_INVENTORY,TRANSFER_IN_COST,TRANSFER_OUT_COST,DELV_COST,PREV_DELV_COST,TOTAL_COST,DOLLAR_VARIANCE) values (27,1,'Fries-I',147.41,88.75,0,0,595.65,147.408,88.746,390.45); Insert into SUBQUERY_CATEGORIES (STOREID,WEEK_NBR,DESCRIPTION,OPEN_INVENTORY,CLOSING_INVENTORY,TRANSFER_IN_COST,TRANSFER_OUT_COST,DELV_COST,PREV_DELV_COST,TOTAL_COST,DOLLAR_VARIANCE) values (27,1,'Other Foods-I',658.37,645.92,0,1.701,373.34,658.375,645.925,16789.22); Insert into SUBQUERY_CATEGORIES (STOREID,WEEK_NBR,DESCRIPTION,OPEN_INVENTORY,CLOSING_INVENTORY,TRANSFER_IN_COST,TRANSFER_OUT_COST,DELV_COST,PREV_DELV_COST,TOTAL_COST,DOLLAR_VARIANCE) values (501,1,'Drinks-I',1290.03,1153.85,0,0,689.84,1290.032,1153.848,12488.86); Insert into SUBQUERY_CATEGORIES (STOREID,WEEK_NBR,DESCRIPTION,OPEN_INVENTORY,CLOSING_INVENTORY,TRANSFER_IN_COST,TRANSFER_OUT_COST,DELV_COST,PREV_DELV_COST,TOTAL_COST,DOLLAR_VARIANCE) values (25,1,'Shortening-I',159.76,179.73,0,0,199.7,159.76,179.73,619.92); SET DEFINE OFF with categorycosts as ( SELECT storeid , week_nbr , UPPER(TRIM(description)) description , NVL(prev_delv_cost + transfer_in_cost + delv_cost - transfer_out_cost - total_cost, 0) AS cost , open_inventory , dollar_variance , sum(closing_inventory ) over (partition by storeid, week_nbr ) closing_inventory -- , closing_inventory from subquery_categories where storeid = 501 ) , pivoted_cat_costs AS (SELECT storeid , week_nbr , MAX(DECODE(closing_inventory, 0, 0, closing_inventory)) - NVL(MAX(DECODE(UPPER(TRIM(description)), 'SUPPLIES', cost)), 0) - NVL(MAX(DECODE(UPPER(TRIM(description)), 'BUNS-I', cost)), 0) as closing_inventory , MAX(DECODE(dollar_variance, 0, 0, dollar_variance)) as dollar_variance , NVL(MAX(DECODE(UPPER(TRIM(description)), 'SUPPLIES', cost)), 0) supplies , NVL(MAX(DECODE(UPPER(TRIM(description)), 'REPAIRS & MAINT', cost)), 0) repairs_and_maint , NVL(MAX(DECODE(UPPER(TRIM(description)), 'BUNS-I', cost)), 0) as buns FROM categorycosts GROUP BY storeid, week_nbr ) select * from pivoted_cat_costs;
The results should be:SELECT storeid , week_nbr , UPPER(TRIM(description)) description , NVL(prev_delv_cost + transfer_in_cost + delv_cost - transfer_out_cost - total_cost, 0) AS cost , open_inventory , dollar_variance -- , sum(closing_inventory ) over (partition by storeid, week_nbr ) closing_inventory , closing_inventory from subquery_categories;
There is an anomaly out Bill so it can produce the vairiance of good quality, but inv variance that my request is back is swollen.store 501 ending inventory = 6259.21 buns s/b 1002.34 inv variance 780.55 Store 27 ending inventory = 4220 buns s/b = 793.73 inv variance 390.45 Store 25 ending inventory = 4283 buns 914.48 inv variance 619.92
Can someone tell me what I am doing wrong?
Published by: TheHTMLDJ on December 9, 2009 06:42
SET DEFINE OFF has added and removed the subquery_categories schema nameWell, I asked for the logic as the specification and not necessarily a query. :)
Here's the query that gets your inventory of desired end.with categorycosts as ( SELECT storeid , week_nbr , UPPER(TRIM(description)) description , NVL(prev_delv_cost + transfer_in_cost + delv_cost - transfer_out_cost - total_cost, 0) AS cost , open_inventory , dollar_variance , sum(closing_inventory ) over (partition by storeid, week_nbr ) closing_inventory , DECODE(UPPER(TRIM(description)), 'SUPPLIES', closing_inventory) supp_cls_inv , DECODE(UPPER(TRIM(description)), 'BUNS-I', closing_inventory) bun_cls_inv from subquery_categories where storeid = 501 ) , pivoted_cat_costs AS (SELECT storeid , week_nbr , MAX(DECODE(closing_inventory, 0, 0, closing_inventory)) - NVL(MAX(supp_cls_inv), 0) - NVL(MAX(bun_cls_inv), 0) as closing_inventory , MAX(DECODE(dollar_variance, 0, 0, dollar_variance)) as dollar_variance , NVL(MAX(DECODE(UPPER(TRIM(description)), 'SUPPLIES', cost)), 0) supplies , NVL(MAX(DECODE(UPPER(TRIM(description)), 'REPAIRS & MAINT', cost)), 0) repairs_and_maint , NVL(MAX(DECODE(UPPER(TRIM(description)), 'BUNS-I', cost)), 0) as buns FROM categorycosts GROUP BY storeid, week_nbr ) select * from pivoted_cat_costs;
I still don't know the logic (or specifications) to derive your dollor expected variance.
-
Update the query using nulls update box
I need to update a column according to the conditions that I've used below, the update query, I used is updated as well to null values. How can I stop this and keep the old values when no match was found for the case.
create table sample (name varchar2(10),eno number(10),salary number(10)); insert into sample (name,eno,salary) values ('emp1',1,100); insert into sample (name,eno,salary) values ('emp2',2,200); insert into sample (name,eno,salary) values ('emp3',3,300); select * from sample; update sample set salary = case when salary = 100 then 10000 else case when salary = 150 then 15000 else case when salary = 200 then 20000 end end end where name is not null; Actual o/p: emp1 1 10000 emp2 2 20000 emp3 3 Required o/p: emp1 1 10000 emp2 2 20000 emp3 3 300
Hello
The updated control WHERE clause lines.
If you do not have a WHERE clause, then updates all rows in the table.update sample set salary = case when salary = 100 then 10000 when salary = 150 then 15000 when salary = 200 then 20000 end where salary IN (100, 150, 200) ;
Note that you do not need to nest BOX icies expressions (or almost anywhere else). If the 'salary = 100' condition is true, then its correspondent WHEN the value is returned, and the remaining terms will not be evaluated. If the first condition is not true, then only will be the "salary = 150" condition to be evaluated. (The terms are mutually exclusive in this example anyway, so it does not matter.)
Published by: Frank Kulash, June 5, 2012 13:09
-
Application of setting fit the values of the query using CFSPREADSHEET
I'm trying to understand how to correctly apply my border line personalized to my values of query only on an automated report of formatting. Currently, I have where it is hard coded, but long term it would not work because the new values will be added to the database and query of the report values would be generated without the formatting of boundary line, unless I have change the line numbers manually whenever.
Here's the formatting that I use:
format4. TopBorder = "Thin";
format4.topBorderColor = "grey_40_percent";
format4. BottomBorder = "Thin";
format4.bottomBorderColor = "grey_40_percent";
format4. LeftBorder = "Thin";
format4.leftBorderColor = "grey_40_percent";
format4. RightBorder = "Thin";
format4.rightbordercolor = "grey_40_percent";
SpreadsheetFormatCellRange (report, format4, 2,1,26,8);
Have you attempted to assign a variable equal to the number of records that you pull from the database? I did it in several cfspreadsheets and it works as defining a counter to count the number off loops through the data.
-
iOS10: two changes in the App music Bad
Hello guys!
I have a 6 and recently upgraded iPhone updated to iOS10. IMessage changes are fun, but I wish that I never changed.
I have a fairly large music library (more than 2,000 songs) and a large part of my time in-app music. There are two changes in this version of iOS who really made the worst experience for me:
1 music forget how I want to sort my music library: for example, I like sorting my music by "artist". Music used to remember and kept this sort, even if I closed the application. Now, I must again specify the sort I prefer every time that I re - open the app.
2. no option to sort the albums in chronological order: now when I choose an artist, all of their albums are sorted alphabetically. I'm all for the OPTION sort by reverse chronogical order more, but why remove the ability to sort chronologically? It's very frustrating for artists like Michael Jackson, who have more than five decades of albums.
For your first problem: go to settings > music > songs of sorting & Albums > select 'by the artist. For your second problem, provide your feedback to Apple here: http://www.apple.com/feedback/
-
How can I get the changes to the office using the stick to Firefox?
Have a new computer with Windows 8.1. Put Mozilla by using Internet Explorer. Finally able to turn off the Explorer to avoid their default values, but by default the display of Mozilla understand programs that I don't want. Cannot turn them off. I want to use MyYahoo homepage, and even if the program keeps asking me if I want it to be registered, and my answer is YES, when I close and reopen it goes back to the default values. How can I get what I put to stay put? Thank you.
You can see the attached screenshot: it's the integrated Firefox 28 homepage. Is this the one that comes up, or something else?
If the problem is that the homepage integrated returns...
There are some security/utility programs that cancel the changes made to the settings of your browser. This is to protect you, but obstruction also make changes, you want to do. There are also some malicious programs that will do this.
(1) check your Windows Control Panel, uninstall a program (or equivalent) to ensure that you don't have what we call research protect. If you find it, delete it. You can also do a few scans of additional malware. See: Firefox troubleshooting problems caused by malware.
(2) If you have Advanced SystemCare, disable surf Protection feature. Check your security software to something similar like homepage Protection, browser Protection, etc.
(3) see this article for more information on other known issues: How to fix preferences that will not save.
If a different page is loading...
The problem may be caused by an add-on, specifically, an extension. Even if you have not yet installed modules, Firefox will find those that other software had already placed on your system, so it is useful to check.
Open to the top of the page modules using either:
- CTRL + SHIFT + a
- Firefox orange (or the Tools menu) button > Add ons
In the left column, click Extensions. Then, when in doubt, turn off.
Typically, a link will appear above at least an extension disabled to restart Firefox. You can complete your work on the tab and click one of the links in the last step.
Any improvement?
-
Changes to the distribution model weekly planning after deployment/creat
Hi all
Hope someone can help me answer this request:
I have create a planning application. I've set up currencies, distributions weekly patterns etc and deploy the application.
Can I now go ahead and change the weekly distribution of 4-4-5-5-4-4
Thanks in advanceHi, you cannot change distribution weeks via interface after the deployment of the application. Regardless, it is classic or EPMA app.
But you can do it via SQL directly in the planning system. And then you must restart the web planning serviceTo be sure to see also Re: Distribution planning
PS. funny that it is one of the issue of the review
-
The migration using GG plan quesitons
Hi, I have following questions. I've been playing with GG for a few months now on and outside.
Right now we migrate a prod environment to a new platform.
my questions are:
(1) for a database with size of 1.5 to and large table a lobsegmnents, what is the best way for the initial charge?
(2) the initial charge of using the transportable tablespace method, can we use the physical standby make rman tablespace convert? Since the day physical before already in read-only mode, we can directly with rman to convert the tablespace, right?
(3) If, after the initial load of the db pending physical, can we using a gg on the changes on physical standby db to replicate to the new linux environment?
If all the above is possible, we will have no downtime with production db.
Please advice. Thanks in advance for your thoughts and suggestions.I suggest using the Transportable tablespace. See the link below
http://www.oracleracexpert.com/2009/08/transportable-tablespace-export-import.html
http://www.oracleracexpert.com/2009/10/cross-platform-transportable-tablespace.htmlConcerning
http://www.oracleracexpert.com -
Optimize the query using SUBSTR
Hi, I wrote the following to get the string 'abc' in the following input strings
' 2010/abc' and
' 2010/inv/abc '.
I have to get the string ("abc") that is after the last ' / '.
In the entrance of the channels the ' / ' can be 1 or 2
So I tried the following
The Select query above is even working for the string "abc/2010/inv" (until the 2nd "/" only it works)select substr(substr('2010/abc',(instr('2010/abc','/',1,1)+1),length('2010/abc inst')), (instr(substr('2010/abc',(instr('2010/abc','/',1,1)+1),length('2010/abc inst')), '/',1,1)+1),length (substr('2010/abc',(instr('2010/abc','/',1,1)+1),length('2010/abc inst')))) str from dual
Could please minimize the above query, and which may even work you for same 3rd or 4th ' / '.
Thank youHello
Alternatively, you can use regexp if you want:
Scott@my10g SQL>l 1 with data as ( 2 select '2010/abc' str from dual 3 union all select 'inv/2010/abc' from dual 4 union all select 'inv/2010/inv/2010/abc' from dual 5 union all select 'abc' from dual 6 ) 7* select str, regexp_substr(str,'[^/]+$') sstr from data Scott@my10g SQL>/ STR SSTR --------------------- ---------- 2010/abc abc inv/2010/abc abc inv/2010/inv/2010/abc abc abc abc
It would be up to the end of the string from the last source / (or early if no / in the source string)
-
Need help with the query using the aggregation
If I have a table, defined as follows:
CREATE TABLE range_test
(
range_id NUMBER (20) NOT NULL,
rank of char (1) NOT NULL,
lower_bound_of_range NUMBER (5.2) NOT NULL,
upper_bound_of_range NUMBER (5.2) NOT NULL,
received_date_time_stamp SYSTIMESTAMP NOT NULL DEFAULT TIMESTAMP
);
And I wanted to query the table to find the range associated with the last line inserted for each 'class' (for example 'A', 'B', 'C', etc.), how would I go about this?
I want something like the following, but I know that it will not work right:
SELECT
grade,
lower_bounding_of_range,
upper_bounding_of_range,
Max (received_date_time_stamp)
Of
range_test GROUP BY received_date_time_stamp;
Thanks for your help... I am frustrated with this one and I think that it should be possible without having to use the PL/SQL (i.e. the functions of SQL aggregation or subqueries should work).Perhaps something along the lines of...
SQL> ed Wrote file afiedt.buf 1 select deptno, empno, ename, hiredate 2 from emp 3* order by deptno, empno SQL> / DEPTNO EMPNO ENAME HIREDATE ---------- ---------- ---------- -------------------- 10 7782 CLARK 09-JUN-1981 00:00:00 10 7839 KING 17-NOV-1981 00:00:00 10 7934 MILLER 23-JAN-1982 00:00:00 20 7369 SMITH 17-DEC-1980 00:00:00 20 7566 JONES 02-APR-1981 00:00:00 20 7788 SCOTT 19-APR-1987 00:00:00 20 7876 ADAMS 23-MAY-1987 00:00:00 20 7902 FORD 03-DEC-1981 00:00:00 30 7499 ALLEN 20-FEB-1981 00:00:00 30 7521 WARD 22-FEB-1981 00:00:00 30 7654 MARTIN 28-SEP-1981 00:00:00 30 7698 BLAKE 01-MAY-1981 00:00:00 30 7844 TURNER 08-SEP-1981 00:00:00 30 7900 JAMES 03-DEC-1981 00:00:00 14 rows selected. SQL> ed Wrote file afiedt.buf 1 select deptno, empno, ename, hiredate 2 from ( 3 select deptno, empno, ename, hiredate 4 ,row_number() over (partition by deptno order by hiredate desc) as rn 5 from emp 6 ) 7 where rn = 1 8* order by deptno, empno SQL> / DEPTNO EMPNO ENAME HIREDATE ---------- ---------- ---------- -------------------- 10 7934 MILLER 23-JAN-1982 00:00:00 20 7876 ADAMS 23-MAY-1987 00:00:00 30 7900 JAMES 03-DEC-1981 00:00:00 SQL>
Maybe you are looking for
-
now everytime I open LPX he again analyze the audio devices
Hi all LPX last... now - everytime I open LPX he again analyzing audio devices - again and again... How can I do to don't forget and stop doing every time?
-
Satellite M70 do not charge the battery
My satellite M71 do not charge the battery, not only when works now, but also when power is off. Do not charge batteries supplied with the adapter plugged.
-
I have a TOMTOM portablw GPS model 530/540 XXL A and unable to use it because I can't download TOMTOMHome.com suchj that it is compatible with the computer and is detected by the device. The error is in the computer system itself; I get a message fr
-
The screen brightness setting does not appear in the mobility Center
original title: how is the screen brightness control does not appear in the center of mobility? In the past the mobility of my laptop Vistas Center contained a slider to set the brightness of the screen. My computer screen is dark and I want to adap
-
Smartphones using blackBerry is unable to access the address book in the menu
A phone for 3 weeks - worked fine until today. Before today, I could access the address book by pressing the key of speed left - now when I press it, nothing happens. I could also access by pressing the trackball after highlighting from the menu sc