Links
Home
Oracle DBA Forum
Frequent Oracle Errors
TNS:could not resolve the connect identifier specified
Backtrace message unwound by exceptions
invalid identifier
PL/SQL compilation error
internal error
missing expression
table or view does not exist
end-of-file on communication channel
TNS:listener unknown in connect descriptor
insufficient privileges
PL/SQL: numeric or value error string
TNS:protocol adapter error
ORACLE not available
target host or object does not exist
invalid number
unable to allocate string bytes of shared memory
resource busy and acquire with NOWAIT specified
error occurred at recursive SQL level string
ORACLE initialization or shutdown in progress
archiver error. Connect internal only, until freed
snapshot too old
unable to extend temp segment by string in tablespace
Credential retrieval failed
missing or invalid option
invalid username/password; logon denied
unable to create INITIAL extent for segment
out of process memory when trying to allocate string bytes
shared memory realm does not exist
cannot insert NULL
TNS:unable to connect to destination
remote database not found'>ora-02019
exception encountered: core dump
inconsistent datatypes
no data found
TNS:operation timed out
PL/SQL: could not find program
existing state of packages has been discarded
maximum number of processes exceeded
error signaled in parallel query server
ORACLE instance terminated. Disconnection forced
TNS:packet writer failure
see ORA-12699
missing right parenthesis
name is already used by an existing object
cannot identify/lock data file
invalid file operation
quoted string not properly terminated
Partitioning problems - Oracle 8.1.7.4

Partitioning problems - Oracle 8.1.7.4

2005-02-04       - By Tony.Adolph@(protected)

Reply:     1     2     3     4     5     6     7     8  

/*
Hi Oracle partitioning gurus,
I am trying to setup a group of tables partitioned on a date column so
that monthly
a new partition can be added and the oldest partition can be archived.

I have created 2 extra tables for each main table. One is a temporary
table that is used
to swap partitions in an out of and a 3rd table, the archive.

I have tried to use local indexes where possible to simplify the exchange
operation, ie.
reduce the work oracle has to do.  But I have had to create a global index
for the PK index
as the range column is not in the PK.  See below for example setup.

I have written a couple of SPs, one to add a new partition and the other
to swap the oldest
partition from the main table to the archive via temp.

Problems:

1. When adding new partition:
-- ---- ---- ---- ---- ---- --
I understood that to stop any global index going 'UNUSABLE' when adding a
new partition
I must use something like:
       alter table TONYTAB
     split partition P04 at (to_date('200504','yyyymm'))
     into (partition P04, partition p05)
     UPDATE GLOBAL INDEXES;
But I get this error:
ORA-14126 (See ORA-14126.ora-code.com): only a <parallel clause> may follow description(s) of resulting
partitions

When I drop the "UPDATE GLOBAL INDEXES" it seems to work without
invalidating the indexes.

What is going wrong here?  Is it because I have global and local indexes
on the same table?

2. Exchanging partitions:
-- ---- ---- ---- ---- ---

To swap the oldest partition from my main table my SP tries to do this:
alter table TONYTAB
exchange partition P01 with table TONYTAB_TEMP
including indexes without validation;
alter table TONYTAB_ARC
exchange partition P01 with table TONYTAB_TEMP
including indexes without validation;

But I get this error at the first exchange:
ORA-14098 (See ORA-14098.ora-code.com): index mismatch for tables in ALTER TABLE EXCHANGE PARTITION

I tried to drop the temp table's indexes but get the same error.

I can see that the index I_TONYTAB_1 is local for the main table and is a
normal index
for the temp table, but thats it.  I can't be local for the temp table is
its un-partitioned.

I've read Lewis Chpts 12 & 13 a couple of times now but seem to be missing
something
somewhere.

Any help would be greatly appreciated.


Cheers
Tony
*/
create table TONYTAB
       (
         CUSTOMER_ID       NUMBER(19) not null,
         SERVICE_ID        NUMBER(19) not null,
         TRACKING_ID       NUMBER(19) not null,
         TARGET            VARCHAR2(200) not null,
         PASSWORD          VARCHAR2(200) not null,
         SUCCESS           VARCHAR2(3) not null,
         CREATED_DATE      DATE not null,
         CLIENT_IP_ADDRESS VARCHAR2(50)
       )
partition by range (CREATED_DATE) (
partition p01 values less than (to_date('200501','YYYYMM')),
partition p02 values less than (to_date('200502','YYYYMM')),
partition p03 values less than (to_date('200503','YYYYMM')),
partition p04 values less than (maxvalue))
tablespace PAGENT00 pctfree 10 pctused 40 initrans 1 maxtrans 255
 storage (initial 8k next 1k minextents 1 maxextents 121 pctincrease 0);

-- global index as CREATED_DATE is not part of the PK
create unique index PK_TONYTAB on
TONYTAB(CUSTOMER_ID,SERVICE_ID,TRACKING_ID)
tablespace PAGENTX00 online pctfree 10 initrans 2 maxtrans 255
 storage (initial 1k next 1k minextents 1 maxextents 121 pctincrease 0);

alter table TONYTAB
add constraint PK_TONYTAB primary key
(CUSTOMER_ID,SERVICE_ID,TRACKING_ID) using index;

-- local index
create index I_TONYTAB_1 on
TONYTAB (CUSTOMER_ID,SERVICE_ID)
local
 tablespace PAGENTX00 pctfree 10 initrans 2 maxtrans 255
 storage (initial 1k next 1k minextents 1 maxextents 121 pctincrease 0);

-- ---- ---- ------ ARCHIVE TABLE -- ---- ---- ------

create table TONYTAB_ARC
       (
         CUSTOMER_ID       NUMBER(19) not null,
         SERVICE_ID        NUMBER(19) not null,
         TRACKING_ID       NUMBER(19) not null,
         TARGET            VARCHAR2(200) not null,
         PASSWORD          VARCHAR2(200) not null,
         SUCCESS           VARCHAR2(3) not null,
         CREATED_DATE      DATE not null,
         CLIENT_IP_ADDRESS VARCHAR2(50)
       )
partition by range (CREATED_DATE)
       (partition p00 values less than (to_date('01011970','DDMMYYYY')))
tablespace PAGENT00 pctfree 10 pctused 40 initrans 1 maxtrans 255
 storage (initial 8k next 1k minextents 1 maxextents 121 pctincrease 0);

-- global index as CREATED_DATE is not part of the PK
create unique index PK_TONYTAB_ARC on
TONYTAB_ARC(CUSTOMER_ID,SERVICE_ID,TRACKING_ID)
tablespace PAGENTX00 pctfree 10 initrans 2 maxtrans 255
storage (initial 1k next 1k minextents 1 maxextents 121 pctincrease 0);

alter table TONYTAB_ARC
add constraint PK_TONYTAB_ARC primary key
(CUSTOMER_ID,SERVICE_ID,TRACKING_ID) using index;

-- local index
create index I_TONYTAB_ARC_1 on
TONYTAB_ARC (CUSTOMER_ID,SERVICE_ID)
local
tablespace PAGENTX00 pctfree 10 initrans 2 maxtrans 255
storage (initial 1k next 1k minextents 1 maxextents 121 pctincrease 0);

--- TEMP TABLE used for the exchange partition operation (non-partitioned)
-- ---- --

create table TONYTAB_TEMP
       (
         CUSTOMER_ID       NUMBER(19) not null,
         SERVICE_ID        NUMBER(19) not null,
         TRACKING_ID       NUMBER(19) not null,
         TARGET            VARCHAR2(200) not null,
         PASSWORD          VARCHAR2(200) not null,
         SUCCESS           VARCHAR2(3) not null,
         CREATED_DATE      DATE not null,
         CLIENT_IP_ADDRESS VARCHAR2(50)
       )
       tablespace PAGENT00 pctfree 10 pctused 40 initrans 1 maxtrans 255
 storage (initial 8k next 1k minextents 1 maxextents 121 pctincrease 0);

create unique index PK_TONYTAB_TEMP on
TONYTAB_TEMP(CUSTOMER_ID,SERVICE_ID,TRACKING_ID)
tablespace PAGENTX00 pctfree 10 initrans 2 maxtrans 255
storage (initial 1k next 1k minextents 1 maxextents 121 pctincrease 0);

alter table TONYTAB_TEMP
add constraint PK_TONYTAB_TEMP primary key
(CUSTOMER_ID,SERVICE_ID,TRACKING_ID) using index;

create index I_TONYTAB_TEMP_1 on
TONYTAB_TEMP (CUSTOMER_ID,SERVICE_ID)
 tablespace PAGENTX00 pctfree 10 initrans 2 maxtrans 255
 storage (initial 1k next 1k minextents 1 maxextents 121 pctincrease 0);






--
http://www.freelists.org/webpage/oracle-l