Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Manual Partitioning - with check constraints for pruning

user2282685Jul 7 2014 — edited Jul 8 2014

I've got a client who won't pay for real partitioning, but has a single monster table on a data warehouse that needs to be broken into pieces for optimal performance of queries.

What I would like to do is manually partition the table, create a union all join view that sits on top, then have oracle prune the execution plans of queries to allow me to only hit the tables I need to to fulfill the result set.


-- Create table
create table a_tbl
(
  col1 varchar2(20),
  col2 varchar2(20),
  col3 varchar2(20),
  col4 varchar2(20)
)
tablespace AAA_DATA;

-- Create/Recreate check constraints
alter table a_tbl
  add constraint a_tbl_restrict
  check (col1='aaa');
 
create table b_tbl
(
  col1 varchar2(20),
  col2 varchar2(20),
  col3 varchar2(20),
  col4 varchar2(20)
)
tablespace AAA_DATA;

-- Create/Recreate check constraints
alter table b_tbl
  add constraint b_tbl_restrict
  check (col1='bbb');
 
create table c_tbl
(
  col1 varchar2(20),
  col2 varchar2(20),
  col3 varchar2(20),
  col4 varchar2(20)
)
tablespace AAA_DATA;

-- Create/Recreate check constraints
alter table c_tbl
  add constraint c_tbl_restrict
  check (col1='ccc');
 
alter table A_TBL
  add constraint a_tbl_pk primary key (COL1, COL2)
  using index
  tablespace AAA_INDEX;

alter table B_TBL
  add constraint b_tbl_pk primary key (COL1, COL2)
  using index
  tablespace AAA_INDEX;

alter table C_TBL
  add constraint c_tbl_pk primary key (COL1, COL2)
  using index
  tablespace AAA_INDEX;
 
create view abc_v as
select * from a_tbl
union all
select * from b_tbl
union all
select * from c_tbl;

When I execute a query against the view that should eliminate two of the tables, I don't see the pruning happening.

select * from abc_v

where col1 = 'aaa' and col2 < '100'

order by col2

SELECT STATEMENT, GOAL = ALL_ROWS   3 1 48

SORT ORDER BY   3 1 48

  VIEW TAS ABC_V 2 1 48

   UNION-ALL    

    TABLE ACCESS BY INDEX ROWID TAS A_TBL 4 2 96

     INDEX RANGE SCAN TAS A_TBL_PK 3 2

    FILTER    

     TABLE ACCESS BY INDEX ROWID TAS B_TBL 2 1 48

      INDEX RANGE SCAN TAS B_TBL_PK 2 1

    FILTER    

     TABLE ACCESS BY INDEX ROWID TAS C_TBL 2 1 48

      INDEX RANGE SCAN TAS C_TBL_PK 2 1

Am I doing something that just isn't possible without "true" partitioning?  Or did I set it up wrong in some way?

Thanks!

Cory Aston

This post has been answered by Martin Preiss on Jul 7 2014
Jump to Answer

Comments

top.gun

See the following:

Oracle Database Software Downloads | Oracle Technology Network | Oracle

Previous Database Release Software

Oracle Database 10.2 and 11.1 are no longer available for download. The software is available as a media or FTP request for those customers who own a valid Oracle Database product license for any edition. To request access to these releases, follow the instructions in Oracle Support Document 1071023.1 (Requesting Physical Shipment or Download URL for Software Media) from My Oracle Support. NOTE: for Oracle Database 10.2, you should request 10.2.0.1 even if you want to install a later patch set. Once you install 10.2.0.1 you can then apply any 10.2 patch set. Similarly, for 11.1 request 11.1.0.6 which must be applied before installing 11.1.0.7. Patch sets can be downloaded from the Patches and Updates tab on My Oracle Support.

user10686033

When I go to

edelivery.oracle.com

and do a search with 10.2.0.5

I only get

Enterprise Manager Grid Control 10.2.0.5.0

Dude!

Oracle 10g database is no longer available from any legal or public Oracle sources. You have to contact Oracle sales or support.

Zoltan Kecskemethy

See e.g. this old thread

Also 10.2.0.x is not supported on Linux 6 - so likely getting hold of the media will be the easy part ;-)

Rasheed_

Directly you cannot start 10g installation on rhel 6 , before install

Edit the "/etc/redhat-release" file replacing the current release information (Red Hat Enterprise Linux Server release 6 ) with the following:

redhat-4

After installation you can reset it back .(Its just for skipping installer version check skip)

Srini Chavali-Oracle

Rasheed_ wrote:

Directly you cannot start 10g installation on rhel 6 , before install

Edit the "/etc/redhat-release" file replacing the current release information (Red Hat Enterprise Linux Server release 6 ) with the following:

redhat-4

After installation you can reset it back .(Its just for skipping installer version check skip)

Can you point to a doc where this is the supported method ?

Rasheed_

Workaround #2: On Oracle Linux 5 and Red Hat Enterprise Linux 5, the installation will pass the operating system prerequisite checks if you change each Oracle Linux 5 and Red Hat Enterprise Linux 5 to Oracle Linux 4 and Red Hat Enterprise Linux 4 in the /etc/redhat-release file. Ensure that you replace the original values in the /etc/redhat-release file after the Oracle installation is complete.



From below oracle doc link


https://docs.oracle.com/cd/B19306_01/relnotes.102/b15659/toc.htm

Dude!

That applies to EL 5, but not EL 6. EL 6 is way too far ahead regarding software per-requisites. I'm not saying it cannot be done, but it is not supported and has a few other challenges. Perhaps in the case of the OP, the best way is to run 10g under EL 6 inside VirtualBox using OL 5.

1 - 9
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Aug 5 2014
Added on Jul 7 2014
11 comments
2,973 views