Bad Plan After Exchange Partition

Jul 30, 2012

I ran exchange partition from non-partitioned table to a partitioned table with the following params: WITHOUT VALIDATION UPDATE GLOBAL INDEXES since we have a GLOBAL index( the GLOBAL is a must). After the exchange , if I'm running a simple query on the first column of the PK the plan is very bad and the EM Adviser advices me to build an index based on that column. I'm using 11.2.0.2

View 1 Replies


ADVERTISEMENT

SQL & PL/SQL :: Exchange A Partition - ORA-14096?

May 9, 2013

I am trying to exchange a partition and I am seeing an ORA-14096. I've done this several time before with other tables without problem. I am pretty sure my columns and index really does match.

Connected to Oracle Database 11g Enterprise Edition Release 11.2.0.3.0

SQL> ALTER TABLE se_keywords EXCHANGE PARTITION p_user_1068 WITH TABLE se_keywords_1068 INCLUDING INDEXES WITHOUT VALIDATION;
ALTER TABLE se_keywords EXCHANGE PARTITION p_user_1068 WITH TABLE se_keywords_1068 INCLUDING INDEXES WITHOUT VALIDATION

ORA-14096: tables in ALTER TABLE EXCHANGE PARTITION must have the same number of columns

SQL> SELECT COUNT(*) cnt
2 FROM all_tab_columns a
3 FULL OUTER JOIN all_tab_columns b ON a.column_name = b.column_name
4 AND b.owner = USER

[code]...

View 3 Replies View Related

Server Administration :: Exchange Partition With Update Indexes

Nov 7, 2011

I exchange a partition with into a normal table with UPDATE INDEXES,but i found the index of both table are marked UNUSABLE?

SQL> Create Table tb_hxl_list_part
2 (
3 statedate Number,
4 provcode Number
5 )
6 Partition By List(provcode)
7 (
8 Partition p_1 Values(1)
9 );

Table created.

SQL> Create Unique Index idx_tb_hxl_list_part On tb_hxl_list_part(provcode) Local;

Index created.

SQL> Insert Into tb_hxl_list_part Values(20111101,1);

1 row created.

SQL> commit;

Commit complete.

SQL> Select status From dba_ind_partitions aa
2 Where aa.index_name = 'IDX_TB_HXL_LIST_PART';

STATUS
--------
USABLE

SQL> Create Table tb_hxl_list_part_bak
2 (
3 statedate Number,
4 provcode Number
5 );

Table created.

SQL> Create Unique Index idx_hxl_list_part_bak On tb_hxl_list_part_bak(provcode);

Index created.

SQL> Select status From dba_indexes bb
2 Where bb.index_name = 'IDX_HXL_LIST_PART_BAK';

STATUS
--------
VALID

SQL> Alter Table tb_hxl_list_part
2 Exchange Partition p_1
3 With Table TB_HXL_LIST_PART_bak UPDATE Indexes;

Table altered.

SQL> Select status From dba_ind_partitions aa
2 Where aa.index_name = 'IDX_TB_HXL_LIST_PART';

STATUS
--------
UNUSABLE

SQL> Select status From dba_indexes bb
2 Where bb.index_name = 'IDX_HXL_LIST_PART_BAK';

STATUS
--------
UNUSABLE

View 4 Replies View Related

PL/SQL :: Oracle Exchange Partition Feature Not Working As Expected?

Aug 17, 2012

I used the Exchange Partition feature to swap segments between 2 tables- one Partitioned, and one Non-Partitioned. The exchange went well. However, all the data in the partitioned table has gone to the partition which stores the maxbound values.

/** actual table names changed due to client confidentiality issues */

-- Drop the 2 intermediate tables if they already exist

drop table ordered_inv_bkp cascade constraints ;
drop table ordered_inv_t cascade constraints ;
/**

1st create a Non-Partitioned Table from ORDERED_INV and then add the primary key and unique index(s):

*/
create table ordered_inv_bkp as select * from ordered_inv ;
alter table ordered_inv_bkp add constraint ordinvb_pk primary key (ordinv_id) ;
--
create unique index ordinv_scinv_uix on ordered_inv_bkp(
SCP_ID ASC,

[code]....

-- Next, we have to create a partitioned table ORDERED_INV_T with a similar

-- structure as ORDERED_INV.

-- This is a bit tricky, and involves a pl/sql code

declare
l_dt_start DATE;
l_ptn VARCHAR2(50);
cnt PLS_INTEGER;
l_cnt_initial PLS_INTEGER;
ts_name VARCHAR2(50);
l_sql VARCHAR2(10000);
ts_indx VARCHAR2(100);

[code]....

-- Add section to set default values for the intermediate table OL_ORDERED_INV_T

FOR crec_cols IN (
SELECT u.column_name ,u.nullable, u.data_default,u.table_name
FROM USER_TAB_COLUMNS u WHERE
u.table_name ='ORDERED_INV' AND
u.data_default IS NOT NULL )
LOOP

[code]....

-- Next, use exchange partition for actual swipe

-- Between ordered_inv_t and ordered_inv_bkp

-- Analyze both tables : ordered_inv_t and ordered_inv_bkp

BEGIN
DBMS_STATS.GATHER_TABLE_STATS(OWNNAME => 'HENRY220', TABNAME => 'ORDERED_INV_T');
DBMS_STATS.GATHER_TABLE_STATS(OWNNAME => 'HENRY220', TABNAME =>'ORDERED_INV_BKP');
END;
/
SET TIMING ON;

[code]....

View 2 Replies View Related

Server Administration :: Partition Exchange In Hash Partitioned Table

Mar 13, 2012

While trying partition exchange feature of Oracle with 2 hash partitioned tables, I come to know that I can't directly exchange partitions between 2 partitioned tables

I have two hash partitioned tables , so to move partition data from one table to another will include-

1) Exchange from partitioned table to non-partitioned table.
2) exchange from non-partitioned table to new partitioned table.

But I am not sure in which hash partition my data will go in new partitioned table (data need to be moved has single key value on basis of which tables are partitioned),

View 2 Replies View Related

PL/SQL :: Obtaining Execution Plan Of Currently Executing Plan In 9i

Jun 15, 2012

the most accurate/efficient way of obtaining the execution plan for a piece of running SQL in Oracle 9i. in 10g and 11g obviously dbms_xplan.display_cursor(sql_id) can be used,

How can this be achieved in 9i, currently I am simply obtaining the SQL_TEXT and then running an explain plan ("EXPLAIN PLAN FOR..") - I believe this is not necessarily the same explain plan that will be used for the sql that is executing though

View 7 Replies View Related

SQL & PL/SQL :: Dropping Sub-partition / Range-partition And List Sub-partition

May 28, 2010

i have table with range partition and list sub-partition..can i add one more list sub-partition if it is not possible , i have to drop first sub-partition.

View 6 Replies View Related

Windows / .NET :: Microsoft Exchange To Retrieve Data From Oracle DB

Aug 8, 2012

My company already work with Oracle 10g, I developed an application using this database and asp.NET. It allows the management of BD and exploitation of these data by clients via ASP pages.

Now I must use Microsoft Exchange (especially the calendar) to retrieve data from the Oracle database and embed links to setup my ASP pages to the calendar.

Being new to Exchange, my questions are:

- It can be done?
- Should I use a particular driver?
- Some idea ?

View 0 Replies View Related

SQL & PL/SQL :: ORA-27369 - Job Of Type EXECUTABLE Failed With Exit Code - Exchange Full

Jul 8, 2011

I am trying to xcom the file from Linux server location to Windows server location through shell script. When i execute my DBMS_SCHEDULER to trigger the shell script i am getting the below mentioned error.

Error report:
ORA-27369: job of type EXECUTABLE failed with exit Exchange full
ORA-06512: at "SYS.DBMS_ISCHED", line 150
ORA-06512: at "SYS.DBMS_SCHEDULER", line 441
ORA-06512: at "CUSTDOMAIN.TSC_041_REPORT_PRC", line 50
[code]....

View 2 Replies View Related

SQL & PL/SQL :: Create Normal Partition Range On Date And Sub Partition List On Batch ID

Mar 17, 2011

I Know we can create dynamic partitions on table in oracle 11g. Is it possible to create normal partition and sub partition both dynamically.I have to create Normal partition range on date and sub partition list on Batch ID (varchar).

View 3 Replies View Related

Performance Tuning :: Select Partition Table With Non-partition Key Condition?

Jun 26, 2010

I have a table that partitioned into six partitions. each partitions placed in different table space and every two table space placed it on a different hardisk

when I will do query select with the non-partition keys condition, how the search process ? whether the sequence (scan sequentially from partition 1 to partition 6) or partition in a hardisk is accessed at the same time with other partition in other hardisk. ( in the image, partition 1,4 accessed at the same time with partition 2,5 and 3,6)

View 3 Replies View Related

SQL & PL/SQL :: Apply Redefinition And Create Range Partition And Hash Sub-partition?

Apr 3, 2013

At present we have a non partitioned table.

Can we apply redefinition and create range partition and hash sub partition on it?

View 2 Replies View Related

SQL & PL/SQL :: Exchange Partitions Between Actual Table From It's Corresponding Staging Table

Nov 26, 2012

We have a table with interval partition. This table is accessed very frequently. We are suppose to exchange partitions between this actual table from it's corresponding staging table.

In order to keep the newly created partitions empty, is there a way to restrict other applications from using it before we push data from staging table to it's actual table.

View 4 Replies View Related

SQL & PL/SQL :: Add Range Sub-Partition To Hash Partition Table

Jan 2, 2013

Can I add range sub partition to a hash partition table. Example like this.

CREATE TABLE test
(
test_id VARCHAR2(10 ) ,
test_TYPE VARCHAR2(5) ,
CREATE_DATE date
)
partition by hash (test_id, test_type)
Partitions 3
SUBPARTITION BY RANGE (CREATE_DATE);

When Tried, I am getting syntax error as invalid option.

View 8 Replies View Related

SQL & PL/SQL :: Tables Activity - Inserted Partition Key Does Not Map To Any Partition

Sep 22, 2011

I have two tables Activity and Activity1.

Activity Structure
ACTIVITY_TYPE CHAR (1) NOT NULL,
ACTIVITY_DATE DATE DEFAULT sysdate NOT NULL,
ACTIVITY_ON VARCHAR2 (30) NOT NULL,
REFERENCE_NO VARCHAR2 (19),
CHILD_REFERENCE_NO VARCHAR2 (19),
USER_ID VARCHAR2 (30) DEFAULT user NOT NULL,
TERMINAL VARCHAR2 (30) DEFAULT userenv ('TERMINAL') NOT NULL )

Activity1 Structure Which I have Done Partitioning When I insert data from Activity to Activity1 it gives that error ORA-14400: inserted partition key does not map to any partition what I am doing wrong

CREATE TABLE ACTIVITY1(
ACTIVITY_TYPE CHAR (1) NOT NULL,
ACTIVITY_DATE DATE DEFAULT sysdate NOT NULL,
ACTIVITY_ON VARCHAR2 (30) NOT NULL,
REFERENCE_NO VARCHAR2 (19),

[code]....

Insert Statement

insert into ACTIVITY1(ACTIVITY_TYPE,
ACTIVITY_DATE,
ACTIVITY_ON,
REFERENCE_NO,
CHILD_REFERENCE_NO,

[code]....

View 2 Replies View Related

SQL & PL/SQL :: Adding A New Partition To Existing Partition Table

Jun 14, 2011

i want to create a new partition for version 2

existing table is as below

create table test
(
name varchar2(100),
version NUMBER(12)
)

[Code]....

View 15 Replies View Related

SQL & PL/SQL :: Can Drop Partition Based Indexes From A Particular Partition

Mar 3, 2011

I have partition based table one the basis of year month. And we have 8 local indexes on this table. Every month we have to create a new partition and load data into this partition and the volume of the data is around 14million and the load process is taking long time due to indexes. Is it possible to drop the indexes from particular partition?

View 8 Replies View Related

SQL & PL/SQL :: Partitioned Table - Inserted Partition Key Does Not Map To Any Partition

Jul 10, 2012

I have two tables in which one is partitioned table with the following details.

CREATE TABLE "SCOTT"."TBL_MITTAL"
("ACCOUNT_NAME" VARCHAR2(50 BYTE),
"BILL_NO" VARCHAR2(50 BYTE),
"BILL_DATE" VARCHAR2(50 BYTE),
"CLI" VARCHAR2(50 BYTE),
"ANI" VARCHAR2(50 BYTE),

[code].....

When I am trying to insert record from tbl_mittal into tbl_temp table. I am facing "ORA-14400: inserted partition key does not map to any partition" error

SQL> insert into tbl_temp select * from tbl_mittal;
insert into tbl_temp select * from tbl_mittal
*
ERROR at line 1:
ORA-14400: inserted partition key does not map to any partition

AS tbl_mittal is having hugh number of records so I am providing only few rows from tbl_mittal table as test data.

ACCOUNT_NAMEBILL_NOBILL_DATECLIANICHARGE_START_DATEDURFROM_LOCATIONTO_LOCATIONINVOICE_IDCIRCLE
10000010357423128271095119301-Feb-111723006000931488182328-JAN-11 11.30.54.000000000 AM59.04CHANDIGARHJAIPUR271095119
10000011844187128348720198715-Jun-121409470011825531896615-MAY-12 09.10.36.000000000 AM28.03CHANDIGARHBANTWAL348720198
10000011844187128348720198715-Jun-121409470011825531927115-MAY-12 09.10.41.000000000 AM38.32CHANDIGARHBANTWAL348720198
10000011844187128348720198715-Jun-121409470011825531933015-MAY-12 09.10.46.000000000 AM28.81CHANDIGARHBANTWAL348720198
10000011844187128348720198715-Jun-121409470011825531930215-MAY-12 09.10.53.000000000 AM28.96CHANDIGARHBANTWAL348720198

[code].....

I also tried to upload the same data using sqlldr.

sqlldr log file contents is as follows:

Total logical records skipped: 0
Total logical records read: 1857532
Total logical records rejected: 801092
Total logical records discarded: 37

[code].....

So some sqlldr bad file contents is as follows.

100000118441871,283487201987,15-JUN-12,1723958000,9355115251,10-JUN-12 05.56.05.000000 PM,36.99,CHANDIGARH,AMBALA,348720198,,
100000118441871,283487201987,15-JUN-12,1723958000,7520533825,10-JUN-12 05.56.14.000000 PM,44.12,CHANDIGARH,AGRA,348720198,,
100000118441871,283487201987,15-JUN-12,1723958000,9356452151,10-JUN-12 05.56.17.000000 PM,116.83,CHANDIGARH,JALANDHAR,348720198,,
100000118441871,283487201987,15-JUN-12,1723958000,9331223048,10-JUN-12 05.56.21.000000 PM,28.33,CHANDIGARH,KOLKATA,348720198,,
100000118441871,283487201987,15-JUN-12,1723958000,7827927893,10-JUN-12 05.56.24.000000 PM,3384.33,CHANDIGARH,DELHI,348720198,,

[code].....

View 2 Replies View Related

SQL & PL/SQL :: Updated PartitionID With Partition Number For Each Partition Set

Apr 12, 2010

needed in stored procedure to achieve this...how to get this..(stored procedure)

table:
studentid,sname,partitonid
901,x,null
902,y,null
903,z,null
904,p,null
905,q,null
906,a,null
907,b,null
908,d,null
909,f,null
910,m,null

For the above data set i need to divide into 5 partittions and need to updated the partitonid with the partition number for each partition set,like the below result set

studentid,sname,partitonid
901,x,p1
902,y,p1
903,z,p2
904,p,p2
905,q,p3
906,a,p3
907,b,p4
908,d,p4
909,f,p5
910,m,p5

View 3 Replies View Related

PL/SQL :: Alter Script For Adding Partition And Sub-partition

Mar 28, 2013

write ALTER STATEMENT for adding new partition P1 and SUBPARTITION P1_201001 and P1_201002.

TABLE
=======
CREATE TABLE TEST
(
"REPORT_ID"    NUMBER,
"MONTH_ID"      NUMBER,
"GROUP_ID"      NUMBER,
"AGE_GROUP_ID"  NUMBER,
[code]...........  

View 4 Replies View Related

Partition Size In A Partition Table

Jun 8, 2011

How to find the size pf a partition in a partition table?I guess we need to query views like dba_tab_partitions but I am not very sure. will running dbms_stats.gather_table_stats('schema_name,'table_name,'partition_name')

View 3 Replies View Related

How To See Query Plan

May 12, 2013

How to use see the query plan.

View 1 Replies View Related

Using 10g Sql Plan In 11gR2

Aug 13, 2012

After we have upgraded our database from 10g to 11gR2 one of the sql started running very slow, is there any way to use the 10g sql plan for this query in 11gR2..? the 10g sql plan still shows up in history table along with it hash value.

We have tried using SPM but due select_workload_repository is set to basic(default) in 10g, the plans are not getting populated into profiles.

View 1 Replies View Related

Change In Plan Even After Using Outline?

Dec 30, 2011

I observed a strange behaviour of a query after using stored outline on it. I created a stored outline for a query in one database before creating the outline i had set 2 session level parameters optimizer_index_caching and optimizer_cost adjust. i then took an export of the stored outline and then imported into another db. but here the plan of the query seems to be different from the database from which the outline was taken. why is this change? My version of oracle is 10.2.0.5.0

View 3 Replies View Related

How To Stable Execution Plan Of SQL

Oct 8, 2010

[font="Lucida Console"][/font]

Issue: For this sql statement client is changing the date and this sql is running fine in development and taking time in production.So I created the sql profile and push it ot prodcution so for EFFDT <= '25-APR-2010' it was running fine as plan is same as development .....but then again client changed the EFFDT <= '28-AUG-2010' is changed then plan neglected my sql profile because of hardcoded value and so it has parsed the sql again.

How we can fix this plan ? there application is like that so they are goin to pass the hardoce value like this only.....so they can not use bind variable... they are going to fire the sql from one session can we set on the session level like cursor sharing or some hints to get the development plan *for proper formating see the attached file* Statement :

SELECT
DECODE(SUBSTR(JL.PAYGROUP,1,1),'P','P','T','P','C'), JL.DEPTID_CF, JL.OPERATING_UNIT, JL.FUND_CODE,
JL.CLASS_FLD, JL.PROGRAM_CODE, PC.EMPLID, PC.EMPL_RCD, BUGL.BUSINESS_UNIT, JL.ACCOUNT,
SUM(DECODE(JL.GL_NBR,'REGER',JL.AMOUNT,0)), 'Regular Earnings', SUM(DECODE(JL.GL_NBR,'OTERN',JL.AMOUNT,0)), 'Overtime', SUM(DECODE(JL.GL_NBR,'NRTAL',JL.AMOUNT,0)),

[code]....

View 3 Replies View Related

SQL & PL/SQL :: Fix Execution Plan Using Hints

Mar 6, 2012

I am executing below query, but optimizer generating 2 different plans for the same. I don't want to use sql profiles to fix execution plan.

Query
SELECT R.VENDOR_RECORD_SEQ_NO ,
R.VENDOR_SUBJECT_SEQ_NO ,
NVL(D.RESOLVED_VALUE, D.ORIGINAL_VALUE) VAL,
D.CONTROL_COLUMN_SEQ_NO
[code]....

View 3 Replies View Related

View To Find SQL Plan Changes

Jul 4, 2012

The view that can be used to find the changes the plans (hash_value,plan_hash_value for a particular sql statement).

I have a particular sql statement for which the execution plan changes but, unfortunately i cannot find regarding which view can be used to find the details regarding this. V$SQL_PLAN_MONITOR is not working as well.    

View 4 Replies View Related

Performance Tuning :: How To Assure Partition Table Is Better Than Non-partition Table

Mar 25, 2011

I think that performance better partition table than non-partition table. How to assure partition table is better than non-partition table at SELECT operation?

I have compare a specific query EXPLAIN PLAN at partition table and non-partition table. both tables data is same. Is it true way or not?

View 11 Replies View Related

Performance Tuning :: Different Execution Plan In Different DB

Jul 20, 2013

Why the query is behaving differently with the different database.(execution plan)

Whatever the production database is having same database instance replicated to a new schema. I tried both the queries running on both environment.In prod the index has been used but in newdev it is not. This case existing primary key index were not been used.

View 6 Replies View Related

PL/SQL :: Add Consumer Group To System Plan

Mar 6, 2013

I am trying to write a SQL statement that will do the following:

2. Add the APPUSER consumer group to the SYSTEM_PLAN resource plan. Change the level 3 CPU resource allocation percentages: 60% for the APPUSER consumer group and 40% for the LOW_GROUP consumer group.

SQL>BEGIN
DBMS_RESOURCE_MANAGER.CREATE_SYSTEM_PLAN (SYSTEM_PLAN => ‘system_plan’,
CONSUMER_GROUP1 => ‘APPUSER’, GROUP1_CPU3 => 60,
CONSUMER_GROUP2 => ‘LOW_GROUP’, GROUP2_CPU3 => 40);
END;
/

When executing the statement, I get the following error message:

Error message:

ERROR at line 2:
ORA-06550: line 2, column 23:
PLS-00302: component 'CREATE_SYSTEM_PLAN' must be declared
ORA-06550: line 2, column 1:
PL/SQL: Statement ignored

View 11 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved