11g interval partitioning and global index maintenance
hi gurus,
in 11g interval partitioning system can automatically manage the creation of new partitions based on data.
in this case do we need to manage global indexes?
in earlier versions, we have to update global indexes whenever there is a partition maintenance operation.
please suggest.
thanks,
charles
user570138 wrote:
in earlier versions, we have to update global indexes whenever there is a partition maintenance operation.In 10gR2 you don't need to update/rebuild a global index after adding a partition to the base table.
So it should be the same when using interval partitioning.
Regards
Maurice
Similar Messages
-
Table partitioning and global indexing
hello all,
the requirement is to do table partitioning with global indexing! & also thr r almost 60 crores of rows are there! so can you tell me the way which can be done better and also please provide me the procedure with documents?
thanks in advance!Hi,
have a look at online redefinition of a table, see Oracle Manual (10.2): http://download.oracle.com/docs/cd/B19306_01/server.102/b14231/tables.htm#ADMIN01514
The steps are described in the manual.
Herald ten Dam
Superconsult.nl -
Oracle 11g interval partitioning - meaningfull partition-names
Hello,
On 11g, when creating interval partitions, the partitions get automatically created just fine. Very nice feature. But is it possible to supply meaningfull names to them?
Now they get names SYS_nnn, but I would like to name them for instance SALES_2007.
Here is one example on how to use interval partitioning:
http://download.oracle.com/docs/cd/B28359_01/server.111/b32024/part_admin.htm#BAJHFFBE
And here is the syntax guide:
http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/statements_7002.htm#sthref7644
I don't see how to accomplish meaningfull names (automatically!). Do you?No I don't think it is possible. This is what is written in Oracle documentation..
http://download.oracle.com/docs/cd/B28359_01/server.111/b32024/partition.htm#CACHFHHF
>
The range partitioning key value determines the high value of the range partitions, which is called the transition point, and the database creates interval partitions for data beyond that transition point.
> -
Range - Interval Partition and List Subpartition.
Hi
I am trying to create the Range(Interval) Partition with List Sub partition (dynamically). Here the LOCATION_CD List is Dynamic. Basically Location_CD is Country name. e.g USA, IND,GER.....
Below Works good...
CREATE TABLE TEMP
SEQUENCE_ID NUMBER,
RESERVATION_DATE TIMESTAMP,
LOCATION_CD VARCHAR2(5)
PARTITION BY RANGE (RESERVATION_DATE)
INTERVAL (NUMTOYMINTERVAL(1,'MONTH'))
SUBPARTITION BY LIST(LOCATION_CD)
SUBPARTITION TEMPLATE
( SUBPARTITION CD_01 VALUES ('USA'),
SUBPARTITION CD_02 VALUES ('IND'),
SUBPARTITION CD_03 VALUES ('GER')
PARTITION TEMP values LESS THAN (TO_DATE('01-JAN-2000','DD-MON-YYYY'))
Today there are 3 Countries but going forward it can be more or less.
I like the Interval Range Partition concept, where the new partition is automatically gets added.
But at the same time can the new list sub partition be added ? If this doesn't work...can we have another alternative approach or partition technique ?
Please suggest.
Thanks
Jitesh R.Why didn't you just perform two inserts and answer the question yourself?
orabase> CREATE TABLE T (
2 SEQUENCE_ID NUMBER,
3 RESERVATION_DATE TIMESTAMP,
4 LOCATION_CD VARCHAR2(5))
5 PARTITION BY RANGE (RESERVATION_DATE)
6 INTERVAL (NUMTOYMINTERVAL(1,'MONTH'))
7 SUBPARTITION BY LIST(LOCATION_CD)
8 SUBPARTITION TEMPLATE (
9 SUBPARTITION CD_01 VALUES ('USA'),
10 SUBPARTITION CD_02 VALUES ('IND'),
11 SUBPARTITION CD_03 VALUES ('GER')) (
12 PARTITION root values LESS THAN (TO_DATE('01-JAN-2000','DD-MON-YYYY')));
Table created.
orabase> insert into t values (1, TO_DATE('02-JAN-2000'), 'USA');
1 row created.
orabase> select partition_name, subpartition_name
2 from user_tab_subpartitions
3 where table_name = 'T';
PARTITION_NAME SUBPARTITION_NAME
ROOT ROOT_CD_03
ROOT ROOT_CD_02
ROOT ROOT_CD_01
SYS_P84 SYS_SUBP83
SYS_P84 SYS_SUBP82
SYS_P84 SYS_SUBP81
6 rows selected.
orabase> insert into t values (1, TO_DATE('02-JAN-2000')+400, 'USA');
1 row created.
orabase> select partition_name, subpartition_name
2 from user_tab_subpartitions
3 where table_name = 'T';
PARTITION_NAME SUBPARTITION_NAME
SYS_P88 SYS_SUBP85
SYS_P88 SYS_SUBP86
SYS_P88 SYS_SUBP87
SYS_P84 SYS_SUBP81
SYS_P84 SYS_SUBP82
SYS_P84 SYS_SUBP83
ROOT ROOT_CD_01
ROOT ROOT_CD_02
ROOT ROOT_CD_03
9 rows selected. -
Drop Partition update Global Indexes
hello Gurus,
what will happen internally when issue a command
alter table tab_name drop partition part_name update global indexes;
why my insert statement waiting to complete this task on " cursor: pin S wait on X "
thanks in advance ..Several times i also noticed that wait event for some jobs on 10 2 0 4 on hpux.
I didn't found out what was the reason.
It seems this wait event can be easly related to some bugs.
http://karenmorton.blogspot.com/2008/08/strange-parsing-behavior.html
http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/waitevents003.htm#sthref3012 -
A question regarding database table partitioning and table indexes in 10g
We are considering partitioning a large table in our 10g database, in order to improve response time. I believe I understand the various partitioning options, but am wondering about the indexes built over the table. When the table is partitioned, will the indexes also be partitioned "automatically"? Or do I need to also partition the indexes as well?
Thank you in advance to any and all who respond to this question.Hello,
When you build your partiton table you just need to create indexes locally and they will be partitioned automatically, see following example
CREATE TABLE YY_EVENT
PART_KEY DATE NOT NULL,
SUBPART_VALUE NUMBER NULL,
EVENT_NAME VARCHAR2(30 BYTE) NULL,
EVENT_VALUE NUMBER NULL
TABLESPACE TEST_DATA
PARTITION BY RANGE (PART_KEY)
PARTITION Y_EVENT_200901 VALUES LESS THAN (TO_DATE(' 2009-02-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
TABLESPACE TEST_DATA,
PARTITION Y_EVENT_200902 VALUES LESS THAN (TO_DATE(' 2009-03-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
TABLESPACE TEST_DATA
-- This will create paritioned indexes automatically
CREATE INDEX MY_IDX ON YY_EVENT
(EVENT_NAME)
TABLESPACE TEST_DATA
LOGGING
LOCAL;Regards
Edited by: OrionNet on Feb 25, 2009 12:05 PM -
11G Interval Partitioning range based on number
All the Oracle documentation states that interval partitioning can be range partitioned on a column that is NUMBER or DATE datatype, but the examples all show just for a DATE column and for a monthly interval.
I need an interval by year, where the partition column is NUMBER and contains 4 digit numbers for year like 2010.
.Does anyone have a working example for creating an interval partitioned table on a NUMBER datatype column?Please do not refer people to the old, non-maintained psoug site. I have asked this several times in the past.
You do people no favor sending them to the old site contains as it contains inaccurate information I am unable to access and fix.
The new site is www.morganslibrary.org.
And I am a bit of an expert on the subject ... as I am "Morgan."
Thank you. -
Split Oracle 11g Table Partition and Insert new rows
Hi,
I have a doubt that i would like to be clarified. I need to split a partition of a table with more than 800 Million records, but at the same time (during the split operation) i need to insert new records (not in the partition that is being splited). Is there any problem/risk doing this? Is the insert ETL process going to fail ?
Thanks in advance
Greetings.
Nuno
Edited by: user13512889 on 1/Set/2011 3:25Hi Enrique,
Thanks for posting in MSDN.
Based on the description, you want to modify the formula for the A1 and B1 cell when you insert a new rows.
Yes, we can use Worksheet.Change to dermin the change of data on the worksheet then we can modify the formula as we wanted. Here is a sample for your reference:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Me.Range("A1").Formula = "=MAX($A2:$A" & Me.UsedRange.Rows.Count & ")"
Me.Range("B1").Formula = "=MIN($B2:$B" & Me.UsedRange.Rows.Count & ")"
End Sub
You can more detail about Excel VBA developing from link below:
Getting Started with VBA in Excel 2010
Welcome to the Excel 2013 developer reference
Regards & Fei
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
Non-Partitioned Global Index on Range-Partitioned Table.
Hi All,
Is it possible to create Non-Partitioned Global Index on Range-Partitioned Table?
We have 4 indexes on CS_BILLING range-partitioned table, in which one is CBS_CLIENT_CODE(*local partitioned index*) and others are unknown types of index to me??
Means other 3 indexes are what type indexes ...either non-partitioned global index OR non-partitioned normal index??
Also if we create index as :(create index i_name on t_name(c_name)) By default it will create Global index. Please correct me......
Please help me in identifying other 3 indexes types by referring below ouputs!!!
select INDEX_NAME,TABLE_NAME,PARTITIONING_TYPE,LOCALITY from dba_part_indexes where TABLE_NAME='CS_BILLING';
INDEX_NAME TABLE_NAME PARTITI LOCALI
CSB_CLIENT_CODE CS_BILLING RANGE LOCAL
select index_name,index_type,table_name,table_type,PARTITIONED from dba_indexes where table_name='CS_BILLING';
INDEX_NAME INDEX_TYPE TABLE_NAME TABLE_TYPE PAR
CSB_CREATE_DATE NORMAL CS_BILLING TABLE NO
CSB_SUBMIT_ORDER NORMAL CS_BILLING TABLE NO
CSB_CLIENT_CODE NORMAL CS_BILLING TABLE YES
CSB_ORDER_NBR NORMAL CS_BILLING TABLE NO
select INDEX_OWNER,INDEX_NAME,TABLE_NAME,COLUMN_NAME from dba_ind_columns where TABLE_NAME='CS_BILLING';
INDEX_OWNER INDEX_NAME TABLE_NAME COLUMN_NAME
RPADMIN CSB_CREATE_DATE CS_BILLING CREATE_DATE
RPADMIN CSB_SUBMIT_ORDER CS_BILLING SUBMIT_TO_INVOICE
RPADMIN CSB_SUBMIT_ORDER CS_BILLING ORDER_NBR
RPADMIN CSB_CLIENT_CODE CS_BILLING CLIENT_CODE
RPADMIN CSB_ORDER_NBR CS_BILLING ORDER_NBR
select dip.index_name, dpi.locality, dip.partition_name, dip.status
from dba_part_indexes dpi, dba_ind_partitions dip
where dpi.table_name ='CS_BILLING'
and dpi.index_name = dip.index_name;
INDEX_NAME LOCALI PARTITION_NAME STATUS
CSB_CLIENT_CODE LOCAL CSB_2006_4Q USABLE
CSB_CLIENT_CODE LOCAL CSB_2006_3Q USABLE
CSB_CLIENT_CODE LOCAL CSB_2007_1Q USABLE
CSB_CLIENT_CODE LOCAL CSB_2007_2Q USABLE
CSB_CLIENT_CODE LOCAL CSB_2007_3Q USABLE
CSB_CLIENT_CODE LOCAL CSB_2007_4Q USABLE
CSB_CLIENT_CODE LOCAL CSB_2008_1Q USABLE
CSB_CLIENT_CODE LOCAL CSB_2008_2Q USABLE
CSB_CLIENT_CODE LOCAL CSB_2008_3Q USABLE
CSB_CLIENT_CODE LOCAL CSB_2008_4Q USABLE
CSB_CLIENT_CODE LOCAL CSB_2009_1Q USABLE
CSB_CLIENT_CODE LOCAL CSB_2009_2Q USABLE
CSB_CLIENT_CODE LOCAL CSB_2009_3Q USABLE
CSB_CLIENT_CODE LOCAL CSB_2009_4Q USABLE
select * from dba_part_indexes
where table_name ='CS_BILLING'
and locality = 'GLOBAL';
no rows selected
-Yasser
Edited by: YasserRACDBA on Mar 5, 2009 11:45 PMYaseer,
Is it possible to create Non-Partitioned and Global Index on Range-Partitioned Table?
Yes
We have 4 indexes on CS_BILLING range-partitioned table, in which one is CBS_CLIENT_CODE(*local partitioned index*) and others are unknown types of index to me??
Means other 3 indexes are what type indexes ...either non-partitioned global index OR non-partitioned normal index??
You got local index and 3 non-partitioned "NORMAL" b-tree tyep indexes
Also if we create index as :(create index i_name on t_name(c_name)) By default it will create Global index. Please correct me......
Above staement will create non-partitioned index
Here is an example of creating global partitioned indexes
CREATE INDEX month_ix ON sales(sales_month)
GLOBAL PARTITION BY RANGE(sales_month)
(PARTITION pm1_ix VALUES LESS THAN (2)
PARTITION pm2_ix VALUES LESS THAN (3)
PARTITION pm3_ix VALUES LESS THAN (4)
PARTITION pm12_ix VALUES LESS THAN (MAXVALUE));Regards -
Creation of Hash Partitioned Global Index
Hash Partion Index creation
Hi friends,
Could you suggest me whether we can create a hash partitioned index by using syntax as below in 9i.
CREATE INDEX hgidx ON tab (c1,c2,c3) GLOBAL
PARTITION BY HASH (c1,c2)
(PARTITION p1 TABLESPACE tbs_1,
PARTITION p2 TABLESPACE tbs_2,
PARTITION p3 TABLESPACE tbs_3,
PARTITION p4 TABLESPACE tbs_4);
I am getting error ORA-14005 Missing Key word Range.
Thanks in advance for your help.Yaseer,
Is it possible to create Non-Partitioned and Global Index on Range-Partitioned Table?
Yes
We have 4 indexes on CS_BILLING range-partitioned table, in which one is CBS_CLIENT_CODE(*local partitioned index*) and others are unknown types of index to me??
Means other 3 indexes are what type indexes ...either non-partitioned global index OR non-partitioned normal index??
You got local index and 3 non-partitioned "NORMAL" b-tree tyep indexes
Also if we create index as :(create index i_name on t_name(c_name)) By default it will create Global index. Please correct me......
Above staement will create non-partitioned index
Here is an example of creating global partitioned indexes
CREATE INDEX month_ix ON sales(sales_month)
GLOBAL PARTITION BY RANGE(sales_month)
(PARTITION pm1_ix VALUES LESS THAN (2)
PARTITION pm2_ix VALUES LESS THAN (3)
PARTITION pm3_ix VALUES LESS THAN (4)
PARTITION pm12_ix VALUES LESS THAN (MAXVALUE));Regards -
Local index vs global index in partitioned tables
Hi,
I want to know the differences between a global and a local index.
I'm working with partitioned tables about 10 millons rows and 40 partitions.
I know that when your table is partitioned and your index non-partitioned is possible that
some database operations make your index unusable and you have tu rebuid it, for example
when yo truncate a partition your global index results unusable, is there any other operation
that make the global index unusable??
I think that the advantage of a global index is that takes less space than a local and is easier to rebuild,
and the advantage of a local index is that is more effective resolving a query isn't it???
Any advice and help about local vs global index in partitioned tables will be greatly apreciatted.
Thanks in advancehere is the documentation -> http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14220/partconc.htm#sthref2570
In general, you should use global indexes for OLTP applications and local indexes for data warehousing or DSS applications. Also, whenever possible, you should try to use local indexes because they are easier to manage. When deciding what kind of partitioned index to use, you should consider the following guidelines in order:
1. If the table partitioning column is a subset of the index keys, use a local index. If this is the case, you are finished. If this is not the case, continue to guideline 2.
2. If the index is unique, use a global index. If this is the case, you are finished. If this is not the case, continue to guideline 3.
3. If your priority is manageability, use a local index. If this is the case, you are finished. If this is not the case, continue to guideline 4.
4. If the application is an OLTP one and users need quick response times, use a global index. If the application is a DSS one and users are more interested in throughput, use a local index.
Kind regards,
Tonguç -
Re-org oracle 11.1.0.7 partitioned and sub partitioned index not validiting
Hi,
As part of maintenance i did the following thing on the oracle 11.1.0.7 on windows (no archive log mode);
Re-orgnaized the tables in application- data tablespace - done
Re-orgnaized large table in SYSAUX tablespace - only one table (alter table sys.WRI$_OPTSTAT_HISTGRM_HISTORY move tablespace sysaux
alter index sys.I_WRI$_OPTSTAT_H_OBJ#_ICOL#_ST rebuild nologging;
alter index sys.I_WRI$_OPTSTAT_H_ST rebuild nologging;)
Re-built the indexes on applicaton index tbs- done
Re-built the partition indexes on application index tbs - done
rebuilding of indexes in SYSAUX - done since it was invalid
Run the analyze job –
Re-claim the space at database level and OS level
but i have the issues of partitioned and subpartition indexes are not validating..how to validate the indexes i am using the below querires but:
ORA-14287: cannot REBUILD a partition of a Composite Range partitioned ii am using the below sqls:
set head off
set linesize 200
select 'alter index '||index_owner||'.'||index_name||' rebuild partition '||partition_name||' ; ' from dba_ind_partitions where status <> 'VALID' and index_owner not in ('SYS','SYSTEM')
set head off
set linesize 200
select 'alter index '||index_owner||'.'||index_name||' rebuild subpartition '||subpartition_name||' ;'
from dba_ind_subpartitions
where status <> 'VALID' -
Interval Partition naming Issue (Oracle 11g R2 )
I need help on identifying latest partition:
I am using Interval Partition for my table,which creates partition every month end based on inserted data.
When oracle creates partition assigning its own name but users have automated reports using partition names like Table_name_YYYYMM.
I tested following ways to identify partition then renamed,worked fine but in long run do i get any problems ?
or any other way to identify the latest partition ?
1)Using max partition position :
select partition_name from dba_tab_partitions a where partition_position = (select max(partition_position)
from user_tab_partitions b where a.table_name=b.table_name
and b.table_name = 'INTRVL_PARTITION');
2)Using Sub Object max creation date :
SELECT SUBOBJECT_NAME FROM dba_objects
WHERE OBJECT_TYPE='TABLE PARTITION'
AND OWNER='ABCD'
AND OBJECT_NAME='INTRVL_PARTITION'
AND CREATED=(SELECt MAX(CREATED) FROM DBA_OBJECTS
WHERE OBJECT_TYPE='TABLE PARTITION'
AND OWNER='ABCD'
AND OBJECT_NAME='INTRVL_PARTITION');
Thanks in advance .
Edited by: user607128 on Mar 2, 2012 7:09 AMYour initial question said you were already using interval partitioning.
>
I am using Interval Partition for my table
now users asking to convert Range to Interval Partition and keeping existing partitions same name.
>
So is your issue that you want to use interval partitining for a table now is now using range partitioning? Why are your users driving this change? That should be a decision made by the DBA and technical management since the difference is mainly on of management.
Though there is one BIG difference that is data related. With interval partitioning if data (even erroneous data) is inserted for a partition that does not exist Oracle will create one. So if you have an insert statement that inserts 12 records for the year '2038' you will get 12 new partitions even though the data may be bogus.
Now your management problem is detecting the problem, deleting the data (or fixing the date to move it to the right partition) and then dropping the partitions and storage.
With 'interval' partitioning you had better be absolutely sure your data is clean in terms of the partitioning key values.
That said, you can use table redefinition or just create a new interval partitioned table and do partition exchanges with the existing partitions to move the data. -
Hi,
I am aware that Local Index and Global Index methods are attached with Partitions, like local is pertaining to a particular partition. We need to update global index while dropping a partition or using exchange partitions.
What I know is very little, please provide more details, thank you.http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_3001.htm#SQLRF01001
http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_3001.htm#i2087440
http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_3001.htm#i2131064
http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_3001.htm#i2151566
http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_3001.htm#CIHCAAGD
Regards
Etbin
Edited by: Etbin on 13.3.2011 15:55
First two links added in order to start with alter table -
How to search data dictionary for interval partitions?
Oracle 11.2.0.3
When I query DBA_PART_TABLES.PARTITIONING_TYPE it says 'range'. I want to be able to differential an interval from other range based partitions in the data dictionary?
used this example. shows 'range'
http://www.rittmanmead.com/2008/09/investigating-oracle-11g-interval-partitioning/
Oracle Docs list 'SYSTEM' as a partitioning_type which I thought would be intervals.
ALL_PART_TABLES
[code]
1 CREATE TABLE interval_sales
2 ( prod_id NUMBER(6)
3 , cust_id NUMBER
4 , time_id DATE
5 , channel_id CHAR(1)
6 , promo_id NUMBER(6)
7 , quantity_sold NUMBER(3)
8 , amount_sold NUMBER(10,2)
9 )
10 PARTITION BY RANGE (time_id)
11 INTERVAL(NUMTOYMINTERVAL(1, 'MONTH'))
12 ( PARTITION p0 VALUES LESS THAN (TO_DATE('1-1-2005', 'DD-MM-YYYY')),
13 PARTITION p1 VALUES LESS THAN (TO_DATE('1-1-2006', 'DD-MM-YYYY')),
14 PARTITION p2 VALUES LESS THAN (TO_DATE('1-7-2006', 'DD-MM-YYYY')),
15* PARTITION p3 VALUES LESS THAN (TO_DATE('1-1-2007', 'DD-MM-YYYY')) )
SQL>/
Table created.
Elapsed: 00:00:00.01
SQL> select partitioning_type from user_part_tables where table_name = 'INTERVAL_SALES';
PARTITION
RANGE
[/code]CREATE TABLE junk1
( id NUMBER )
PARTITION BY RANGE (id)
INTERVAL(5)
( PARTITION p0 VALUES LESS THAN (5),
PARTITION p1 VALUES LESS THAN (10),
PARTITION p2 VALUES LESS THAN (15),
PARTITION p3 VALUES LESS THAN (20) )
CREATE TABLE junk2
( id NUMBER )
PARTITION BY RANGE (id)
( PARTITION p0 VALUES LESS THAN (5),
PARTITION p1 VALUES LESS THAN (10),
PARTITION p2 VALUES LESS THAN (15),
PARTITION p3 VALUES LESS THAN (20) )
select owner, table_name, partitioning_type, interval
from dba_part_tables
where table_name in ('JUNK1', 'JUNK2')
OWNER TABLE_NAME PARTITIONING_TYPE INTERVAL
GREGS JUNK1 RANGE 5
GREGS JUNK2 RANGE
2 rows selected.
Maybe you are looking for
-
External drive stuck in limbo - no errors, data intact, still won't mount?
Background story: -I had an external enclosure with two drives (one Hitachi, one WD, both SATA) running seperately inside as storage. Things were good. One day something went wrong, because I turned it on and weird clicking could be heard and the dri
-
My 2711x screen is blank, I try pressing f10 process but it's not working...what should be done? to turn on screen? Please help...
-
How to open ports in Leopard?
I need to open some ports for an application. The applet in System Preferences for this is gone since Leopard. Where do you configure ports in OS X 10.5?
-
Numbers App or better than Mint!
Can someone recommend an app that can be exported into pre-established numbers spread sheet? or excell??? I like to keep track of my cash expenditures, for deductions....Mint is not right for this and Quick Bank exported into non mac friendly text do
-
Won't boot to DVD drive.
Hi friends, Could anyone help me figure out why my iMac will not boot to the DVD Drive while I hold down the "C" key? It just starts-up to my main drive, as usual. I've tried several bootable discs including Tiger Install 1 and DiskWarrior. No dice.