Regarding partition table..pls help
I am creating a table
as
CREATE TABLE T3
PARTITION BY RANGE(CREATED)
(PARTITION T1 VALUES LESS THAN (TO_DATE('01-APR-2006','DD-MON-YYYY')),
PARTITION T2 VALUES LESS THAN (TO_DATE('01-JUN-2006','DD-MON-YYYY')))
AS SELECT * FROM T1
am getting error :
ORA-14400: inserted partition key does not map to any partition
since am new to the partitioning concepts, pls help.
Thanks.
Oups :-)
I referenced the source table name (T1) instead on the newly partitionned table (T3) fromyour original post, sory :)
The select should read:
SELECT *
FROM T3 PARTITION (T3);
Thinking of that, you should give another name to the partition in order to avoid confusion!
Yoann.
Similar Messages
-
Query regarding Partition table Explain plan
Hello,
We are amidst a tuning activity, wherein a large table has been partitioned for better administration. During testing, I was analyzing the explain plans for long running sql's and found a piece that I was unable to understand. The PSTART and PSTOP columns show ROWID as its value, which in normal partition pruning scenario be the Partition number or the KEY. I tried to look around for this issue but did not get enough information. Can anybody help me of what it means? Also, if there is a good explanation of the same, it will be extremely helpful.
The snippet from explain plan looks like:
| Id | Operation | Name | Rows | Bytes |TempSpc| Cost (%CPU)| Time | Pstart| Pstop |
7 | TABLE ACCESS BY GLOBAL INDEX ROWID| XXXXXXXXXXXXXXXXXXXX | 43874 | 9083K| | 1386 (1)| 00:00:17 | ROWID | ROWID |
On another similar query it looks like:
| Id | Operation | Name | Rows | Bytes |TempSpc| Cost (%CPU)| Time | Pstart| Pstop |
| 6 | TABLE ACCESS BY GLOBAL INDEX ROWID| XXXXXXXXXXXXXX | 22455 | 4648K| | 456 (1)| 00:00:06 | 9 | 9 |
I have another query with regards to the Partition tables. Does it, require/benefit if, the Indexes to be in partitioned mode? I tried to read about it but did not get a conclusive evidence. I am trying to test it and post here the outcome, but if anybody has experience of working with it, it would be great to have some advice.
Oracle Version:- 10.2.0.4
Regards,
Purvesh.Hi Purvesh.
Great explanation and example on this this topic...
Ask Tom "explain plan on range-partitioned table"
Hope this help. -
Regarding Partition Table:Spilt Partition
Hi ,
I have create one partition table. I did range partitioned on this .original table has 1035 Millions records.
table has data from Jan 2008 to till May.I have create one partition of Jan-2008 to March 2009.
Name is PS_INTRIMDETAIL_TILL_MAR2009 .This Partition has one table space
Which has Five datafile of 20 GB.
Next Onwards Partitions are Apr2009,May2009 this partitons are Monthwise.
Now I want to split this PS_INTRIMDETAIL_TILL_MAR2009 partition on quaterly basis.
Kindly suggest me how can I split this partiton.
I also want to know the appropriate tablespace size for split partition.Hello,
Here;s how you can split your partition by quartely
ALTER TABLE TBLMEDRATINTRIM_DETAIL_ROAM_01
SPLIT PARTITION PS_INTROAM_TILL_MAR2009 AT
(TO_DATE(' 2009-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
INTO (PARTITION PS_INTROAM_TILL_Q4
TABLESPACE TABLESPACE TS_INTROAM_TILL_MAR2009
PARTITION PS_INTROAM_TILL_MAR2009);
ALTER TABLE KLONDIKE.TBLMEDRATINTRIM_DETAIL_ROAM_01
SPLIT PARTITION PS_INTROAM_TILL_Q4 AT
(TO_DATE(' 2008-10-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
INTO (PARTITION PS_INTROAM_TILL_Q3
PARTITION PS_INTROAM_TILL_Q4);
ALTER TABLE KLONDIKE.TBLMEDRATINTRIM_DETAIL_ROAM_01
SPLIT PARTITION PS_INTROAM_TILL_Q3 AT
(TO_DATE(' 2008-07-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
INTO (PARTITION PS_INTROAM_TILL_Q2
PARTITION PS_INTROAM_TILL_Q3);
ALTER TABLE TBLMEDRATINTRIM_DETAIL_ROAM_01
SPLIT PARTITION PS_INTROAM_TILL_Q2 AT
(TO_DATE(' 2008-04-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
INTO (PARTITION PS_INTROAM_TILL_Q1
PARTITION PS_INTROAM_TILL_Q2);To compress old partitions;
You can create one temp compressed for one quaretly partiton, you can repeat this process
1. create table Q1_cmp tablespace <ts_name> compress as select * from TBLMEDRATINTRIM_DETAIL_ROAM_01 where CALLEND between to_date('20080101,'YYYYMMDD') and to_date('20080331','YYYYMMDD');
2. Then exchange Q1 uncompressed partition with Q1_cmp
ALTER TABLE TBLMEDRATINTRIM_DETAIL_ROAM_01
EXCHANGE PARTITION PS_INTROAM_TILL_Q1
WITH TABLE Q1_CMP
EXCLUDING INDEXES
WITHOUT VALIDATION;
3. Then just rename partition back to original nameyou are in telecom and are you saving CDRs or MSUs, so tablespace size depends upon the volume. I suggest to go with the default value of 32 gig and I think it will grow upto 20 G
create tablespace q1_ts datafile '/location/q1_ts/q1_tsdat01.dbf' size 512M autoextend on next 256M maxsize unlimited.Hope this helps
Regards -
Ubuntu wrecked partition table. Help to fix?
(Macbook Pro 2013 15" Crystalwell 4 Core, 500GB SSD 16GB RAM)
I should have known that installing Ubuntu next to Bootcamp was a bad idea.
So here's what's up... Before this whole debacle began I had two separate partitions on my SSD. The primary partition was for Mavericks with 300GB. The second partition was to a Bootcamped Windows 7 with 150 GB of space. I left 50GB free between the two, which still left me at
disk0s1 for EFI, ~200 MB
disk0s2 for Macintosh HD, 300 GB
disk0s3 for Recovery HD 650 MB
disk0s4 for Bootcamp 148 GB
Here's where my problem began. Genius me decided to attempt to install Ubuntu via live USB onto the 50GB space in between. I have reFIT installed so this wasn't a problem. After loading into Ubuntu and realizing that it wouldn't load into the 50GB space, I rebooted and installed alongside Windows (through the Ubuntu live usb) following the install GUI Prompt.
The installation failed after it got hung on a CRON command and drained the battery from my unplugged computer sitting next to me in my bed (I fell asleep waiting for it to finish, even though it was at 100% battery when it started the installation). When I woke up my computer was dead, so I plugged it in. I started reFIT and booted into Windows after seeing that Ubuntu wasn't there. I was given the "Choose OS" prompt from Windows and Ubuntu wouldn't load, so I said screw it and went back to Mavericks. When I opened my Disk utility partitions table to see where it might have gone wrong....
Great Odin's Raven.
I now had ext4 partitions sitting above my bootcamp partition and linux-swap partitions below it. Absolutely no free space. I switched back to Windows, avoiding the failed Ubuntu OS, and uninstalled wubi from Windows (the universal uninstall for ubuntu, I used the Windows "uninstall application" application from Control Center), hopefully deleting the mess it had made of my drive table.
It didn't.
Since I couldn't delete the partitions back to free space around my bootcamp volume using Disk utility (insufficient hfs+ permissions or something like that), I decided to take a more agressive option. I installed partedMagic onto a live USB and once again rebooted my computer into the live USB. I went in and using gParted removed the partitions in front of the bootcamp volume and behind it reducing them to empty space. Good! Hoping for the best I went back to reFIT and booted into Windows...
"No bootable device -- insert boot disk and press any key"
Well crap.
After some more research into why this wasn't working, I was sure that somehow my EFI wasn't loading the right area of my hard drive. Then I think I found out what happened. I ran diskutil list from terminal and saw this..
IceMan-HomeBase:~ Tim$ diskutil list
/dev/disk0
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *500.3 GB disk0
1: EFI EFI 209.7 MB disk0s1
2: Apple_HFS Macintosh HD 300.2 GB disk0s2
3: Apple_HFS Recovery HD 650.0 MB disk0s3
4: Microsoft Basic Data BOOTCAMP 148.0 GB disk0s6
disk0s6. There's the problem. Mac doesn't like anything beyond disk0s4, which is where Bootcamp was originally and where it should be now, at disk0s4.
If it were merely an issue of copying the bootcamp volume and repartitioning the hard drive, that wouldn't be a problem, but even WinClone doesn't like this volume. When I tried to do a copy, it threw an error saying "Invalid partition ID of 6"
Here is my question.
Is there a way to change the IDENTIFIER back to disk0s4 from disk0s6 and save my Windows 7 partition, is there some other way to save my files to a backup and clean install, or is he dead, Jim?
Sorry if this was a little long-winded, but I figured too much information would be better than not enough.
Thank you in advance for anyone brave enough to read this.
TL;DR
Partition table went bogus because of a bad Ubuntu OS install. Windows can't find a bootable device. Disk0s4 is now disk0s6. Possible way to change this?Problem solved, I used iPartition to resize the partition back to its original size after which I could copy all data off.
-
Update a table based on Min value of a column of a Another Table.Pls Help.
Dear All,
Wishes,
Actually I need update statement some thing like below scenario...
Data in table is like below:
I wrote a query to fetch data like below ( actually scenario is each control number can have single or multiple PO under it ) (i used rank by to find parent to tree like show of data)
Table: T20
Control_no P_no Col3
19950021 726473 00
19950036 731016 00
19950072 731990 00
731990 01
19950353 734732 00
734732 01
19950406 736189 00
736588 01
736588 02
736588 03
Table : T30
Control_no P_no col3
19950021 726473
19950036 731016
19950072 731990
731990
19950353 734732
734732
19950406 736189
736588
736588
736588
Now requirement is I need to update Table T30's col3 (which do have values in T20 but not this table) in such a way that , It should take MIN (COL3) from T20 and then update that value to related Col3)
Better I can explain through below new data format in T30 after update:
After update it should like:
Table : T30
Control_no P_no col3 (this is updated column)
19950021 726473 00 -- as this is min value for Pno 726473 belongs to Control NO 199950021 in Table T20 above
19950036 731016 00 -- as this is min value for Pno 726473 belongs to Control NO 199950021 in Table T20 above
19950072 731990 00 -- see here..both Pno should updated as '00' as MIN value col3 in Table T20 related to this
731990 00 record is '00' (out of 00,01 it should select 00 and update that value here)
19950353 734732 00 -- same again both Pno should updated as '00' as MIN value col3 in TableT20 related to this
734732 00 record is '00' (out of 00,01 it should select 00 and update that value here)
19950406 736189 00 -- As there is single col3 value in T20, 00 should be updated here.
736588 01 -- Here it should update col3 as '01' since for this pno(736588)
736588 01 -- Here too it should update col3 as 01 per requirement ,minimum value of this pno in T20
736588 01 -- same here too.. Sorry if my post formatting is not good...
Hope i am clear in my requirement..(update T30 col3 based on min value of col3 of related records)
Please suggest some update sql for this...(ideas would be great)
I am using oracle 10 g version soon will be migrated to 11g..
Regards
Prasanth
Edited by: Onenessboy on Oct 20, 2010 12:13 PM
Edited by: Onenessboy on Oct 20, 2010 12:15 PMOnenessboy wrote:
I am really sorry, my post so nonsense in look..
I used to use for actuall code..
the out put i tryped, i used [pre] , [/pre] but still does not look good..
hmm..thanks for your suggestion hoek..
so any ideas about my requirement...I would suggest spending a bit more time trying hoek's suggestion regarding {noformat}{noformat} tags instead of repeatedly asking for more help.
Because to understand your requirement, people are going to have to read it first. -
Performance issue related to BSIS table:pls help
Theres a select statement which fetches data from BSIS table.
As in the where clause the only key field used is BUKRS its consuming more time.Below is the code.
Could you please tell me how to improvise this piece of code.
I tried to fecth first from BKPF table based on the selection screen paramater t001-bukrs and then for all entries in BKPF fetched from BSIS.But it didnt worked.
your help would be very much appreciated.Thanks in advance.
SELECT bukrs waers ktopl periv
FROM t001
INTO TABLE i_ccode
WHERE bukrs IN s_bukrs.
SELECT bukrs hkont gjahr belnr buzei bldat waers blart monat bschl
shkzg mwskz dmbtr wrbtr wmwst prctr kostl
FROM bsis
INTO TABLE i_bsis
FOR ALL ENTRIES IN i_ccode
WHERE bukrs EQ i_ccode-bukrs
AND budat IN i_date.
Regards
Akmal
Moved by moderator to the correct forum
Edited by: Matt on Nov 6, 2008 4:10 PMDnt go for FOR ALL ENTRIES it will not help in this case .Do like below , you can see a lot of performance improvement.
SELECT bukrs waers ktopl periv
FROM t001
INTO TABLE i_ccode
WHERE bukrs IN s_bukrs.
sort i_ccode by bukrs.
LOOP AT i_ccode.
SELECT bukrs hkont gjahr belnr buzei bldat waers blart monat bschl shkzg mwskz dmbtr wrbtr wmwst prctr kostl
FROM bsis
APPENDING TABLE i_bsis
WHERE bukrs EQ i_ccode-bukrs
AND budat IN i_date.
ENDLOOP.
I dnt know why perform is good for the above query than "bulrs in so_bukrs" .This willl help , i m sure. this approach helped me.
Edited by: Karthik Arunachalam on Nov 6, 2008 8:52 PM -
Problem regarding partitioning tables
hi all....good afternoon
I have a table of huge number of records and thats why I want to do partitioning of that table.
The column upon which I have to make the partition is of varchar2(7) type which contains the data in the format '2009APR', '2010JAN' etc etc..
Now I have to fetch out the first 4 characters of the datas (i.e only the year) and then I can partition the table based on the years.
How can I do that....plss help.
The database is in 10g..
create table test123
(name varchar2(10),
age number,
DOB varchar2(7),
gender varchar2(1)
);user12780416 wrote:
hi all....good afternoon
I have a table of huge number of records and thats why I want to do partitioning of that table.
The column upon which I have to make the partition is of varchar2(7) type which contains the data in the format '2009APR', '2010JAN' etc etc..
Now I have to fetch out the first 4 characters of the datas (i.e only the year) and then I can partition the table based on the years.
How can I do that....plss help.
The database is in 10g..
create table test123
(name varchar2(10),
age number,
DOB varchar2(7),
gender varchar2(1)
);I suggest you instead of this varchar column with date column like dat.And use this column as partition key.For example.
create table test123
(name varchar2(10),
age number,
DOB varchar2(7),
gender varchar2(1),
dat date
partition by range (dat)
partition part1 values LESS THAN (TO_DATE(' 2009-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
partition part2 values LESS THAN (TO_DATE(' 2009-04-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
partition part3 values LESS THAN (TO_DATE(' 2009-07-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
partition part4 values LESS THAN (TO_DATE(' 2009-10-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
partition part5 values LESS THAN (TO_DATE(' 2010-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
) -
IMPORT EMAILS BODY INTO ORACLE TABLE ;;; PLS HELP ME
Hi Every Body,
I would like to import the body of some Emails into one Oracle table in PLSQL Language,
Can Someone help me and tell me how to do it?
Thank you very much
WWhere is the email stored? If on the file system, you can use UTL_FILE to open the file.
http://download-east.oracle.com/docs/cd/B19306_01/appdev.102/b14258/u_file.htm#ARPLS069 -
Doubts regarding partition table.
hi friends,
i'm using oracle 10g (10.2.0.1) on windows server 2003
i've a table, contains more than 2 million records, and it is range partition with quarterly by year.
like values less than('01-05-2008')
values less than('01-09-2008')
selecting multiple partition in single query without union is not possible.
so i fire the query like.
select col1,col2,col3 from table where r_date between ('01-01-2008','25-06-2008');
i would like to know that with this query, it will scan full table or it will scan only those two partitions...?
thanks,i did that..
when i fire the following query...
select /*+ first_rows(1000) */ col1,col2,col3
from table
where r_date between to_date('01-01-2008','dd-mm-yyyy') and to_date('01-03-2008','dd-mm-yyyy');
explain plan:
SELECT STATEMENT, GOAL = HINT: FIRST_ROWS 11 1001 50050 640279 0 1 161
PARTITION RANGE ITERATOR 11 1001 50050 640279 1 1 161
TABLE ACCESS FULL DBO KEY_HISTORY_PART 11 1001 50050 640279 2 1 161
it shows table access full and partition range iterator..
because of that i'm asking..
thanks.. -
Hi,
Below query is taking huge time for returning result(28579 rows 9 mins).IN this query table audit table is partitioned .Here i'm suspecting count (*)is main problem.I'm taking count for pagination, i'm displaying each page 100 rows based on count only i have to do pg nation ..Here year is range partitioned and month is LIST partitioned .Here year,month,school_code and auidt_date only mandatory params rest of them optional.Please advice to improve the performance
Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - 64biQuery
SELECT ia.*--,rank() over(order by year)
,COUNT(year) OVER() AS record_count
-- ROWNUM AS row_num
FROM IBAUDIT.ibis_audit ia
WHERE YEAR = 2012
AND MONTH = 'MAY'
AND audit_date BETWEEN to_date('04/04/2012','dd-mm-yyyy') AND to_date('04/04/2013','dd-mm-yyyy')
AND school = '000008'
AND (:i_candidate IS NULL
OR candidate = :i_candidate)
AND (:i_user IS NULL
OR person_code = :i_user)
AND (:i_person IS NULL
OR active_person_code = :i_person)
AND (:i_element IS NULL
OR element = :i_element)
AND (:i_action IS NULL
OR DECODE(action, 'INSERT', 'ADD', 'UPDATE', 'CHANGE', action) = UPPER(:i_action))
AND EXISTS
(SELECT 1
FROM IBIS.subject_component sc
WHERE sc.year = 2012
AND sc.month = 'MAY'
AND sc.paper_code = ia.paper_code
AND (:i_subject IS NULL
OR sc.subject = :i_subject)
AND (:i_subject_option IS NULL
OR sc.subject_option = :i_subject_option)
AND (:i_lvl IS NULL
OR sc.lvl = :i_lvl)
AND (:i_component IS NULL
OR sc.component = :i_component)
explan
line 1: SQLPLUS Command Skipped: set linesize 130
line 2: SQLPLUS Command Skipped: set pagesize 0
PLAN_TABLE_OUTPUT
Plan hash value: 2770926248
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | Pstart| Pstop |
| 0 | SELECT STATEMENT | | 1 | 369 | 2601 (28)| 00:00:23 | | |
| 1 | WINDOW BUFFER | | 1 | 369 | 2601 (28)| 00:00:23 | | |
|* 2 | TABLE ACCESS BY LOCAL INDEX ROWID | IBIS_AUDIT | 1 | 294 | 2601 (28)| 00:00:23 | 181 | 181 |
| 3 | NESTED LOOPS | | 1 | 369 | 2601 (28)| 00:00:23 | | |
| 4 | SORT UNIQUE | | 1 | 75 | 44 (0)| 00:00:01 | | |
|* 5 | TABLE ACCESS BY INDEX ROWID | SUBJECT_COMPONENT | 1 | 75 | 44 (0)| 00:00:01 | | |
|* 6 | INDEX RANGE SCAN | SUBJECT_COMPONENT_ASSESS_TYPE | 1131 | | 8 (0)| 00:00:01 | | |
| 7 | PARTITION RANGE SINGLE | | | | | | 37 | 37 |
| 8 | PARTITION LIST SINGLE | | | | | | KEY | KEY |
| 9 | BITMAP CONVERSION TO ROWIDS | | | | | | | |
| 10 | BITMAP AND | | | | | | | |
| 11 | BITMAP CONVERSION FROM ROWIDS| | | | | | | |
|* 12 | INDEX RANGE SCAN | IBIS_AUDIT_SCHOOL | 21826 | | 33 (4)| 00:00:01 | 181 | 181 |
| 13 | BITMAP CONVERSION FROM ROWIDS| | | | | | | |
|* 14 | INDEX RANGE SCAN | IBIS_AUDIT_PAPER | 21826 | | 84 (4)| 00:00:01 | 181 | 181 |
Predicate Information (identified by operation id):
2 - filter("YEAR"=2012 AND (:I_CANDIDATE IS NULL OR "CANDIDATE"=:I_CANDIDATE) AND (:I_USER IS NULL OR
"PERSON_CODE"=:I_USER) AND (:I_PERSON IS NULL OR "ACTIVE_PERSON_CODE"=:I_PERSON) AND (:I_ELEMENT IS NULL OR
"ELEMENT"=:I_ELEMENT) AND "AUDIT_DATE">=TO_DATE('2012-04-04 00:00:00', 'yyyy-mm-dd hh24:mi:ss') AND (:I_ACTION IS NULL OR
DECODE("ACTION",'INSERT','ADD','UPDATE','CHANGE',"ACTION")=UPPER(:I_ACTION)) AND "AUDIT_DATE"<=TO_DATE('2013-04-04 00:00:00',
'yyyy-mm-dd hh24:mi:ss') AND "SC"."YEAR"="IA"."YEAR" AND "SC"."MONTH"="IA"."MONTH")
5 - filter((:I_SUBJECT_OPTION IS NULL OR "SC"."SUBJECT_OPTION"=:I_SUBJECT_OPTION) AND (:I_SUBJECT IS NULL OR
"SC"."SUBJECT"=:I_SUBJECT) AND (:I_COMPONENT IS NULL OR "SC"."COMPONENT"=:I_COMPONENT) AND ("SC"."LVL"=:I_LVL OR :I_LVL IS
NULL))
6 - access("SC"."YEAR"=2012 AND "SC"."MONTH"='MAY')
12 - access("SCHOOL"='000008')
14 - access("SC"."PAPER_CODE"="IA"."PAPER_CODE")
36 rows selecteduser575115 wrote:
Hi,
Below query is taking huge time for returning result(28579 rows 9 mins).IN this query table audit table is partitioned .Here i'm suspecting count (*)is main problem.I'm taking count for pagination, i'm displaying each page 100 rows based on count only i have to do pg nation ..Here year is range partitioned and month is LIST partitioned .Here year,month,school_code and auidt_date only mandatory params rest of them optional.Please advice to improve the performance
Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - 64biQuery
SELECT ia.*--,rank() over(order by year)
,COUNT(year) OVER() AS record_count
-- ROWNUM AS row_num
FROM IBAUDIT.ibis_audit ia
WHERE YEAR = 2012
AND MONTH = 'MAY'
AND audit_date BETWEEN to_date('04/04/2012','dd-mm-yyyy') AND to_date('04/04/2013','dd-mm-yyyy')
AND school = '000008'
AND (:i_candidate IS NULL
OR candidate = :i_candidate)
AND (:i_user IS NULL
OR person_code = :i_user)
AND (:i_person IS NULL
OR active_person_code = :i_person)
AND (:i_element IS NULL
OR element = :i_element)
AND (:i_action IS NULL
OR DECODE(action, 'INSERT', 'ADD', 'UPDATE', 'CHANGE', action) = UPPER(:i_action))
AND EXISTS
(SELECT 1
FROM IBIS.subject_component sc
WHERE sc.year = 2012
AND sc.month = 'MAY'
AND sc.paper_code = ia.paper_code
AND (:i_subject IS NULL
OR sc.subject = :i_subject)
AND (:i_subject_option IS NULL
OR sc.subject_option = :i_subject_option)
AND (:i_lvl IS NULL
OR sc.lvl = :i_lvl)
AND (:i_component IS NULL
OR sc.component = :i_component)
);explan
PLAN_TABLE_OUTPUT
Plan hash value: 2770926248
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | Pstart| Pstop |
| 0 | SELECT STATEMENT | | 1 | 369 | 2601 (28)| 00:00:23 | | |
| 1 | WINDOW BUFFER | | 1 | 369 | 2601 (28)| 00:00:23 | | |
|* 2 | TABLE ACCESS BY LOCAL INDEX ROWID | IBIS_AUDIT | 1 | 294 | 2601 (28)| 00:00:23 | 181 | 181 |
| 3 | NESTED LOOPS | | 1 | 369 | 2601 (28)| 00:00:23 | | |
| 4 | SORT UNIQUE | | 1 | 75 | 44 (0)| 00:00:01 | | |
|* 5 | TABLE ACCESS BY INDEX ROWID | SUBJECT_COMPONENT | 1 | 75 | 44 (0)| 00:00:01 | | |
|* 6 | INDEX RANGE SCAN | SUBJECT_COMPONENT_ASSESS_TYPE | 1131 | | 8 (0)| 00:00:01 | | |
| 7 | PARTITION RANGE SINGLE | | | | | | 37 | 37 |
| 8 | PARTITION LIST SINGLE | | | | | | KEY | KEY |
| 9 | BITMAP CONVERSION TO ROWIDS | | | | | | | |
| 10 | BITMAP AND | | | | | | | |
| 11 | BITMAP CONVERSION FROM ROWIDS| | | | | | | |
|* 12 | INDEX RANGE SCAN | IBIS_AUDIT_SCHOOL | 21826 | | 33 (4)| 00:00:01 | 181 | 181 |
| 13 | BITMAP CONVERSION FROM ROWIDS| | | | | | | |
|* 14 | INDEX RANGE SCAN | IBIS_AUDIT_PAPER | 21826 | | 84 (4)| 00:00:01 | 181 | 181 |
Predicate Information (identified by operation id):
2 - filter("YEAR"=2012 AND (:I_CANDIDATE IS NULL OR "CANDIDATE"=:I_CANDIDATE) AND (:I_USER IS NULL OR
"PERSON_CODE"=:I_USER) AND (:I_PERSON IS NULL OR "ACTIVE_PERSON_CODE"=:I_PERSON) AND (:I_ELEMENT IS NULL OR
"ELEMENT"=:I_ELEMENT) AND "AUDIT_DATE">=TO_DATE('2012-04-04 00:00:00', 'yyyy-mm-dd hh24:mi:ss') AND (:I_ACTION IS NULL OR
DECODE("ACTION",'INSERT','ADD','UPDATE','CHANGE',"ACTION")=UPPER(:I_ACTION)) AND "AUDIT_DATE"<=TO_DATE('2013-04-04 00:00:00',
'yyyy-mm-dd hh24:mi:ss') AND "SC"."YEAR"="IA"."YEAR" AND "SC"."MONTH"="IA"."MONTH")
5 - filter((:I_SUBJECT_OPTION IS NULL OR "SC"."SUBJECT_OPTION"=:I_SUBJECT_OPTION) AND (:I_SUBJECT IS NULL OR
"SC"."SUBJECT"=:I_SUBJECT) AND (:I_COMPONENT IS NULL OR "SC"."COMPONENT"=:I_COMPONENT) AND ("SC"."LVL"=:I_LVL OR :I_LVL IS
NULL))
6 - access("SC"."YEAR"=2012 AND "SC"."MONTH"='MAY')
12 - access("SCHOOL"='000008')
14 - access("SC"."PAPER_CODE"="IA"."PAPER_CODE")
36 rows selected
Plan operations look okay although the Nested Loops operation in step 3 looks out of place - would a hash join work better with the bitmaps? Partition elimination looks great! The series of 1 values at the top of the plan in steps 0-4 suggests something is wrong with either the statistics or the optimizer's processing of the query; you are really getting a lot more rows than the optimizer is estimating.
You reported the query runs faster without the COUNT() which you need. How much faster?
AND and OR conditions mixed together in WHERE clause can add overhead. Would using NVL() instead of the AND/OR combinations affect performance (beware index supression)?
The estimated statistics disappear reading the plan from bottom to the top in step 11. Are all of the objects in the plan - tables and indexes both - analyzed with current values? In particular the # of rows in step 2 for IBIS_AUDIT looks odd - 1 row (possibly correct)? Similarly the estimated values ifor the index lookup in step 5 look low.
If necessary a materialized view with automatic query rewrite (provided that this works) is an option but tuning the SQL is a better idea. -
Pls help me any one, ADF Faces EO,VO creation in mutiple table..
problem here:
table1
field1 (pk)
field2 NAME
table2
field1 (pk)
field2 (fk for table1)
field3 NAME
table3
field1 (pk)
field2 (fk for table2)
field3 NAME
Here each table having separate panel tabbed, i want to show table1 of
field2 in third panel tabbed(screen). How i can create EO,VO to show
with success.
When i'm showing the table1 of field2, is not require to do a DML operations.
like this my third screen's adf table
field2(table1) field2(table3) field3(table3)
(showing for
user identify)
Urgent Requirement pls help me.
In case of any query please free to mail @ [email protected]
Thanks & Regards,
Rengaraj
Edited by: user11129216 on May 4, 2009 7:21 AMLike Frank, I'm not 100% sure I'm understanding your requirement, but here are some observations.
Your three tables look like master/detail/detail, let's say it was Regions->Countries->Locations
So, you would build a RegionsView VO to show the Regions information.
You would build a CountriesView VO to show the Countries information.
You would build a LocationsView VO to show the Locations information.
Then you would create a view link between RegionsView and CountriesView to coordinate that master/detail relationship.
Then you would create a view link between CountriesView and LocationsView to coordinate that master/detail relationship.
All of the above will be created automatically for you if you have foreign keys defined in the database when you use the Create Business Components from Tables wizard. (including the underlying entity objects for your database tables, associations that reflect your foreign key relationships).
If you want LocationsView to show information from its parent, you can include the Country EO as an entity usage in the LocationsView and include the attributes from country that you want to appear in that (join) query. You can repeat to also add the Region EO as an entity usage to join all three.
Then, you would drop RegionsView from the data control palette onto tab1, CountriesView onto tab2, and LocationsView onto tab 3. -
Delete duplicate entriess from the internal table its urgent pls help.
Hi friends,
Hope everybody is doing good,Here is m query on delete duplicate data from the intenal table.
I have an internal table which contain data in the following format.
Doc No Comp Cod Vendor Assignment
1500000009 JM11 00000000
1500000008 JM11 20070212(Repeating)
1500000007 JM11 20070212
1500000006 JM11 00000000
1500000005 JM11 00000000
1500000004 JM11 00000000(Repeating)
1500000003 JM11 00000000 (Repeating)
1500000002 JM11 00000000
1500000001 JM11 20050302
1500000000 JM11 00000000
1500000003 JM11 10000088
1500000001 JM11 10000088
1500000030 JM11 10006260
1500000010 JM11 10006269
1500000008 JM11 10006269
1500000006 JM11 10006269
1500000004 JM11 10006269
if you see the document numbers,there are some document number which are repeating here,there are some document numer which contain vendor number but not the assignments,some of the document numbers contain the assignments but not the vendors.
If my internal table contain this kind of data with repeted document numbers than i want the document number which contains only the vendor number.
Pls help me with the appropriate logic,its urgent.
Thanks a lot
mrutyun^Hi,
<u><b>Deleting Adjacent Duplicate Entries</b></u>
To delete adjacent duplicate entries use the following statement:
DELETE ADJACENT DUPLICATE ENTRIES FROM <itab>
[COMPARING <f1> <f2> ...
|ALL FIELDS].
The system deletes all adjacent duplicate entries from the internal table <itab>. Entries are
duplicate if they fulfill one of the following compare criteria:
Without the COMPARING addition, the contents of the key fields of the table must be
identical in both lines.
If you use the addition COMPARING <f1> <f2> ... the contents of the specified fields <f1>
<f2> ... must be identical in both lines. You can also specify a field <fi> dynamically as
the contents of a field <ni> in the form (<ni>). If <ni> is empty when the statement is
executed, it is ignored. You can restrict the search to partial fields by
specifying offset and length.
If you use the addition COMPARING ALL FIELDS the contents of all fields of both lines
must be identical.
You can use this statement to delete all duplicate entries from an internal table if the table is
sorted by the specified compare criterion.
If at least one line is deleted, the system sets SY-SUBRC to 0, otherwise to 4.
Examples
DATA: BEGIN OF LINE,
COL1 TYPE I,
COL2 TYPE I,
END OF LINE.
DATA ITAB LIKE HASHED TABLE OF LINE WITH UNIQUE KEY COL1.
DO 4 TIMES.
LINE-COL1 = SY-INDEX.
LINE-COL2 = SY-INDEX ** 2.
INSERT LINE INTO TABLE ITAB.
ENDDO.
LINE-COL1 = 1.
DELETE TABLE ITAB: FROM LINE,
WITH TABLE KEY COL1 = 3.
LOOP AT ITAB INTO LINE.
WRITE: / LINE-COL1, LINE-COL2.
ENDLOOP.
The output is:
2 4
4 16
The program fills a hashed table with a list of square numbers. The DELETE
statement delete the lines from the table where the key field COL1 has the contents 1 or 3.
Regards,
Bhaskar -
Can someone pls Help me: How to create a Fake target table(Dummy) in DAC
Hi There,
Can someone pls Help me in creating a Fake target table(Dummy) in DAC?
Thanks,
RaghuRaghu
You need to create a task so that you can hook sources and targets together.
First, Design --> Tables tab --> New --> Below 'Edit' -->Table Type (Source) for your source tables.
Design --> Tables tab --> New --> Below 'Edit' -->Check warehouse and Table Type (Fact or Fact Temporary) for your target tables.
Points if helpful
Kris -
Need help with importing data in partition table
Hi,
DB:8.1.7
OS: win 2003 server
I have a table which is 4.5GB in size. I created a new partition table,with local indexes. I exported the original table with all indexes,triggers and procedures.
After creating the empty partitioned table,i imported the dump file. The data isn't loaded. My questions are:
1) Will the indexes be overwritten?
2) Will the data go automatically in allocated partitions?
3) Do i need to export only table data ignoring indexes,triggers etc?
Best Regards,ateeqrahman wrote:
1) Will the indexes be overwritten?Not if they already exist with the same name, or with the same logical definition (ie. same columns are already indexed)
2) Will the data go automatically in allocated partitions?Yes
3) Do i need to export only table data ignoring indexes,triggers etc?Do you need the triggers? do you need indexes that you haven't created manually? What about grants? -
i need to install a fresh copy of OS X onto my macbook pro 13. i did erase the old partition "macintosh hd" & now when i am trying to create a new partition, it shows "partition failed..couldnt unmount disk"...pls help !!
First of all, I have to ask, why to you "need" to install a fresh copy of OSX?
This may mean that your hard drive is failing, so hopefully you have a backup.
I'm assuming you were in your recovery partition when you did this.
I would, from the recovery partition, repair your hard drive and permissions.
When to Run First Aid in Mountain Lion's Disk Utility - For Dummies
And then try to create the partition again.
If that doesn't work, you have a few options:
Try a third party utility like DiskWarrior or TechTool which may be able to repair your hard drive:
DiskWarrior 4 - The Disk Utility for Mac Disk Repair, Mac Directory Repair, Mac Disk Recovery, Mac Data Recovery or Techtool Pro 7
Try internet recovery, perhaps erase the entire hard drive and reinstall ML.
If nothing else works, then I'd replace the HD and start over.
Maybe you are looking for
-
This seems to be happening on emails I send or ones I get from my friends, all "commercial" emails seem to be OK. I tried changing the margins but that did not work. All other print functions, from Word or Excel are working fine, it's only Thunderbir
-
Itunes will not open after upgrading to 9
I cannot run itunes 9 on XP Everything worked fine untill version 9 was released. At that point I reinstalled version 8 and everything was working. Last week I bought an ipad and it forced me to upgrade to the latest version. I opened after installin
-
What I can do with the free download version of Oracle 10g?
I'm new to Oracle. What can/can't do with the free download of Oracle 10g Release 2? What is the difference between Oracle 10g Release 2 and Express edition?
-
Changing the tempo of multitrack drums
Hi guys, I am a Scandinavian songwriter-producer and I'm in the middle of an important project that will be mixed in about a week. We recorded the drums originally at the tempo of 145, but decided to change the tempo to 152 (yeah, it's a drastic chan
-
where on the delivery status or website can i report that my ipad has not been delivered. cant find it anywhwere, asks for an update for online assistance but no idea where to update, i just want to send and e-mail with reference number so they can c