SlideShare ist ein Scribd-Unternehmen logo
1 von 7
Downloaden Sie, um offline zu lesen
解决 ORA-14098 分区交换
       索引不匹配错误




         by Maclean.liu
               liu.maclean@gmail.com
           www.oracledatabase12g.com

o
w
n
e
r

=

'
&
O
W
N
E
R
1
'
About Me

l Email:liu.maclean@gmail.com
l Blog:www.oracledatabase12g.com
l Oracle Certified Database Administrator Master 10g
and 11g
l Over 6 years experience with Oracle DBA technology
l Over 7 years experience with Linux technology
l Member Independent Oracle Users Group
l Member All China Users Group
l Presents for advanced Oracle topics: RAC,
DataGuard, Performance Tuning and Oracle Internal.
上周在客户一套 BRM 系统上执行分区交换 Exchange Partition 操作的时候出现了 ORA-14098
错误,该错误是由于分区表上的 LOCAL 分区索引与非分区表上的索引不匹配造成的,我们
来看一下这个错误:



[oracle@rh2 ~]$ oerr ora 14098
14098, 00000, "index mismatch for tables in ALTER TABLE EXCHANGE PARTITION"
// *Cause: The two tables specified in the EXCHANGE have indexes which are
//          not equivalent
// *Action: Ensure that the indexes for the two tables have indexes which
//          follow this rule
//          For every non partitioned index for the non partitioned table,
//          there has to be an identical LOCAL index on the partitioned
//          table and vice versa. By identical, the column position, type
//          and size have to be the same.

SQL> ALTER TABLE sales EXCHANGE PARTITION SALES_Q4_2003 with
table SALES_TMP INCLUDING INDEXES WITH VALIDATION UPDATE GLOBAL INDEXES;

ALTER TABLE sales EXCHANGE PARTITION SALES_Q4_2003 with
table SALES_TMP INCLUDING INDEXES WITH VALIDATION UPDATE GLOBAL INDEXES
                                *
ERROR at line 1:
ORA-14098: index mismatch for tables in ALTER TABLE EXCHANGE PARTITION




如果表上有很多的索引,以至于你无法确定到底是哪个索引引发了 ORA-14098 错误,那么
我们可以通过 trace 的方式来协助定位到具体的索引:



SQL>   select * from v$version;

BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
PL/SQL Release 10.2.0.4.0 - Production
CORE    10.2.0.4.0      Production
TNS for Linux: Version 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production

SQL> select * from global_name;

GLOBAL_NAME
--------------------------------------------------------------------------------
www.oracledatabase12g.com

SQL> alter session set max_dump_file_size = unlimited;
Session altered.
SQL> alter session set events '10046 trace name context forever, level 12';
Session altered.

SQL> alter session set events '14098 trace name errorstack forever, level 4';
Session altered.

##SQL> alter system flush buffer_cache;
System altered.

Rerun Exchange Partition DDL

SQL> ALTER TABLE sales EXCHANGE PARTITION SALES_Q4_2003 with table SALES_TMP
INCLUDING INDEXES WITH VALIDATION UPDATE GLOBAL INDEXES;

ALTER TABLE sales EXCHANGE PARTITION SALES_Q4_2003 with table SALES_TMP
INCLUDING INDEXES WITH VALIDATION UPDATE GLOBAL INDEXES
                                *
ERROR at line 1:
ORA-14098: index mismatch for tables in ALTER TABLE EXCHANGE PARTITION

11g 中直接查询 v$diag_info 就可以得到 trace 的路径,10g 执行 gettracename.sql

SELECT     d.VALUE
    || '/'
    || LOWER (RTRIM (i.INSTANCE, CHR (0)))
    || '_ora_'
    || p.spid
    || '.trc' trace_file_name
 FROM (SELECT p.spid
      FROM v$mystat m, v$session s, v$process p
     WHERE m.statistic# = 1 AND s.SID = m.SID AND p.addr = s.paddr) p,
    (SELECT t.INSTANCE
      FROM v$thread t, v$parameter v
     WHERE v.NAME = 'thread'
       AND (v.VALUE = 0 OR t.thread# = TO_NUMBER (v.VALUE))) i,
    (SELECT VALUE
      FROM v$parameter
     WHERE NAME = 'user_dump_dest') d;

TRACE_FILE_NAME
--------------------------------------------------------------------------------
/s01/admin/G10R2/udump/g10r2_ora_17749.trc

==========================10046/errorstack trace
contents========================
PARSING IN CURSOR #1 len=127 dep=0 uid=64 oct=15 lid=64 tim=1277655207436065
hv=1207961095 ad='9098f018'
ALTER TABLE sales EXCHANGE PARTITION SALES_Q4_2003 with table SALES_TMP
INCLUDING INDEXES WITH VALIDATION UPDATE GLOBAL INDEXES
END OF STMT
PARSE #1:c=0,e=1145,p=0,cr=0,cu=0,mis=1,r=0,dep=0,og=1,tim=1277655207436059
BINDS #1:
STAT #2 id=2 cnt=0 pid=1 pos=1 obj=98001 op='INDEX FULL SCAN SALES_UNID_TMP
(cr=1 pr=0 pw=0 time=39 us)'
*** 2011-06-17 21:55:32.417
ksedmp: internal or fatal error
ORA-14098: index mismatch for tables in ALTER TABLE EXCHANGE PARTITION
Current SQL statement for this session:
ALTER TABLE sales EXCHANGE PARTITION SALES_Q4_2003 with table SALES_TMP
INCLUDING INDEXES WITH VALIDATION UPDATE GLOBAL INDEXES

我们可以在 trace 中看到在出现 ORA-14098 错误前,正在对索引 SALES_UNID_TMP 的 Fast Full Scan




除了通过 10046/errorstack 的 trace 信息诊断外,更多的问题可以直接从 DDL 语句中发现,在
以上示例中非分区表的 DDL 语句:
-- Create table
create table SALES_TMP
(
  UNI_ID        NUMBER NOT NULL,
  PROD_ID       NUMBER not null,
  CUST_ID       NUMBER not null,
  TIME_ID       DATE not null,
  CHANNEL_ID    NUMBER not null,
  PROMO_ID      NUMBER not null,
  QUANTITY_SOLD NUMBER(10,2) not null,
  AMOUNT_SOLD   NUMBER(10,2) not null
);

create index SALES_CHANNEL_TMP       ON SALES_TMP (CHANNEL_ID) ;
create index SALES_CUST_TMP          ON SALES_TMP (CUST_ID)    ;
create index SALES_UNID_TMP          ON SALES_TMP (UNI_ID,TIME_ID);   --注意细节
该索引是非 UNIQUE 的
create index SALES_PROD_TMP          ON SALES_TMP (PROD_ID)     ;
create index SALES_PROMO_TMP         ON SALES_TMP (PROMO_ID)    ;
create index SALES_TIME_TMP          ON SALES_TMP (TIME_ID)     ;


下为分区表的 DDL 语句:
-- Create table
create table SALES
(
  UNI_ID        NUMBER NOT NULL,
  PROD_ID       NUMBER not null,
  CUST_ID       NUMBER not null,
  TIME_ID       DATE not null,
  CHANNEL_ID    NUMBER not null,
  PROMO_ID      NUMBER not null,
  QUANTITY_SOLD NUMBER(10,2) not null,
  AMOUNT_SOLD   NUMBER(10,2) not null
)
partition by range (TIME_ID)
...............

create index SALES_CHANNEL       ON SALES (CHANNEL_ID) LOCAL;
create index SALES_CUST          ON SALES (CUST_ID)    LOCAL;
create UNIQUE index SALES_UNID   ON SALES (UNI_ID,TIME_ID) LOCAL;     -- 对应的
索引是 UNIQUE 的
create index SALES_PROD          ON SALES (PROD_ID)    LOCAL;
create index SALES_PROMO         ON SALES (PROMO_ID)   LOCAL;
create index SALES_TIME          ON SALES (TIME_ID)    LOCAL;
解决 ORA-14098 错误的要点是要找出引发错误的原因。当我们交换分区的时候,我们要确
保所有交换表上的索引和分区表上的本地索引匹配。这意味 着如果在分区表上有 N 个
LOCAL INDEXES,那么在交换表上就应当有 N 个等价的索引。这里的等价要求存在映射关
系的 2 个索引,在列的位置、类型、大小及 UNIQUE/NON- UNIQUE 都要一致。


可以利用如下 SQL 语句来找出分区表和交换表上索引的差异:



set linesize 160 pagesize 1400

col   TABLE_NAME for a30
col   INDEX_NAME for a30
col   COLUMN_NAME for a30
col   COLUMN_POSITION for 99
col   COLUMN_LENGTH for 99
col   CHAR_LENGTH for 99
col   DESCEND for a4

Select TABLE_NAME,INDEX_NAME, COLUMN_NAME,COLUMN_POSITION, COLUMN_LENGTH,
CHAR_LENGTH, DESCEND
FROM SYS.DBA_IND_COLUMNS DICN
WHERE INDEX_OWNER = '&own'
 and DICN.TABLE_NAME in ('&TABNAME1','&TABNAME2')
ORDER BY INDEX_NAME, COLUMN_POSITION
/

select TABLE_NAME, INDEX_NAME, INDEX_TYPE, UNIQUENESS, PARTITIONED
  from dba_indexes
 where owner='&OWNER'
   and TABLE_NAME in ('&TABNAME1', '&TABNAME2')
 order by index_name
/
也可以使用 Toad 的 Single Schema Object Compare 功能来对比检验索引:




对于存在主键的分区表,可以在主键上以 DISABLE VALIDATE 方式创建 unique constraint 约
束,以代替全局的主键索引。若交换表(Exchange Table)上存在主键索引的话,那么建议在交
换前暂时将该索引 drop 掉,待交换完成后再重建。

如果实在无法解决该 ORA-14098 错误,那么可以尝试使用 EXCLUDING INDEXES 子句以跳
过索引维护,而在交换完成后重建相关失效索引。




© 2011, www.oracledatabase12g.com. 版权所有.文章允许转载,但必须以链接方式注明源地址,
否则追求法律责任.

Weitere ähnliche Inhalte

Was ist angesagt? (19)

Les01
Les01Les01
Les01
 
Alv interactive ABAPreport
Alv interactive ABAPreportAlv interactive ABAPreport
Alv interactive ABAPreport
 
Building a Hierarchical Data Model Using the Latest IBM Informix Features
Building a Hierarchical Data Model Using the Latest IBM Informix FeaturesBuilding a Hierarchical Data Model Using the Latest IBM Informix Features
Building a Hierarchical Data Model Using the Latest IBM Informix Features
 
Les09
Les09Les09
Les09
 
Data Structures Lab
Data Structures LabData Structures Lab
Data Structures Lab
 
Assignment 2 lab 3 python gpa calculator
Assignment 2 lab 3  python gpa calculatorAssignment 2 lab 3  python gpa calculator
Assignment 2 lab 3 python gpa calculator
 
Example syntax alv grid list
Example syntax alv grid listExample syntax alv grid list
Example syntax alv grid list
 
Open SQL & Internal Table
Open SQL & Internal TableOpen SQL & Internal Table
Open SQL & Internal Table
 
Oracle - Program with PL/SQL - Lession 03
Oracle - Program with PL/SQL - Lession 03Oracle - Program with PL/SQL - Lession 03
Oracle - Program with PL/SQL - Lession 03
 
ABAP Advanced List
ABAP Advanced ListABAP Advanced List
ABAP Advanced List
 
Les03
Les03Les03
Les03
 
Les01 Writing Basic Sql Statements
Les01 Writing Basic Sql StatementsLes01 Writing Basic Sql Statements
Les01 Writing Basic Sql Statements
 
Stored procedure
Stored procedureStored procedure
Stored procedure
 
Oracle - Program with PL/SQL - Lession 07
Oracle - Program with PL/SQL - Lession 07Oracle - Program with PL/SQL - Lession 07
Oracle - Program with PL/SQL - Lession 07
 
Interview qa
Interview qaInterview qa
Interview qa
 
Les11
Les11Les11
Les11
 
Pro PostgreSQL
Pro PostgreSQLPro PostgreSQL
Pro PostgreSQL
 
Les05 Aggregating Data Using Group Function
Les05 Aggregating Data Using Group FunctionLes05 Aggregating Data Using Group Function
Les05 Aggregating Data Using Group Function
 
List Processing in ABAP
List Processing in ABAPList Processing in ABAP
List Processing in ABAP
 

Andere mochten auch

La nuova bibbia
La nuova bibbia La nuova bibbia
La nuova bibbia Eva Previti
 
Pegasystems 7 MySql integration
Pegasystems 7 MySql integrationPegasystems 7 MySql integration
Pegasystems 7 MySql integrationArmen Arzumanyan
 
Que hago y_como_vivo
Que hago y_como_vivoQue hago y_como_vivo
Que hago y_como_vivoalmeri1595
 
Promo summer school for web
Promo summer school for webPromo summer school for web
Promo summer school for webmartaih
 
New Zealand Franchising Confidence Index | October 2016
New Zealand Franchising Confidence Index | October 2016New Zealand Franchising Confidence Index | October 2016
New Zealand Franchising Confidence Index | October 2016Franchize Consultants
 
Material9 plataformes
Material9 plataformesMaterial9 plataformes
Material9 plataformesMaterial9
 
Curriculum fernando muñoz
Curriculum fernando muñozCurriculum fernando muñoz
Curriculum fernando muñozfernando
 
06. b. salinan lampiran permendikbud no. 68 th 2013 ttg kurikulum smp m ts
06. b. salinan lampiran permendikbud no. 68 th 2013 ttg kurikulum smp m ts06. b. salinan lampiran permendikbud no. 68 th 2013 ttg kurikulum smp m ts
06. b. salinan lampiran permendikbud no. 68 th 2013 ttg kurikulum smp m tsIrma Muthiara Sari
 
Planning
PlanningPlanning
PlanningRanolph
 
Creating Relevant Innovation within Changing Expectations
Creating Relevant Innovation within Changing ExpectationsCreating Relevant Innovation within Changing Expectations
Creating Relevant Innovation within Changing ExpectationsEleanor Davies
 
Creating Brand Stories
Creating Brand Stories   Creating Brand Stories
Creating Brand Stories Namrita Sehgal
 
castironknickers
castironknickerscastironknickers
castironknickersannrhi
 
Recruitment Services of M/s. Diverse
Recruitment Services of M/s. DiverseRecruitment Services of M/s. Diverse
Recruitment Services of M/s. DiverseManpowerGroup India
 
【Ask maclean技术分享】oracle dba技能列表 z
【Ask maclean技术分享】oracle dba技能列表 z【Ask maclean技术分享】oracle dba技能列表 z
【Ask maclean技术分享】oracle dba技能列表 zmaclean liu
 
Attitudes & Expectations Energy Field
Attitudes & Expectations Energy FieldAttitudes & Expectations Energy Field
Attitudes & Expectations Energy FieldMario Pinardo
 
Botox london estheticclinique
Botox london estheticcliniqueBotox london estheticclinique
Botox london estheticcliniqueestheticclinique
 
Developing students' reading skills in science education
Developing students' reading skills in science educationDeveloping students' reading skills in science education
Developing students' reading skills in science educationStefaan Vande Walle
 

Andere mochten auch (20)

La nuova bibbia
La nuova bibbia La nuova bibbia
La nuova bibbia
 
Pegasystems 7 MySql integration
Pegasystems 7 MySql integrationPegasystems 7 MySql integration
Pegasystems 7 MySql integration
 
Que hago y_como_vivo
Que hago y_como_vivoQue hago y_como_vivo
Que hago y_como_vivo
 
Promo summer school for web
Promo summer school for webPromo summer school for web
Promo summer school for web
 
Melide
MelideMelide
Melide
 
New Zealand Franchising Confidence Index | October 2016
New Zealand Franchising Confidence Index | October 2016New Zealand Franchising Confidence Index | October 2016
New Zealand Franchising Confidence Index | October 2016
 
Material9 plataformes
Material9 plataformesMaterial9 plataformes
Material9 plataformes
 
Curriculum fernando muñoz
Curriculum fernando muñozCurriculum fernando muñoz
Curriculum fernando muñoz
 
HTML5
HTML5HTML5
HTML5
 
06. b. salinan lampiran permendikbud no. 68 th 2013 ttg kurikulum smp m ts
06. b. salinan lampiran permendikbud no. 68 th 2013 ttg kurikulum smp m ts06. b. salinan lampiran permendikbud no. 68 th 2013 ttg kurikulum smp m ts
06. b. salinan lampiran permendikbud no. 68 th 2013 ttg kurikulum smp m ts
 
Planning
PlanningPlanning
Planning
 
Creating Relevant Innovation within Changing Expectations
Creating Relevant Innovation within Changing ExpectationsCreating Relevant Innovation within Changing Expectations
Creating Relevant Innovation within Changing Expectations
 
Creating Brand Stories
Creating Brand Stories   Creating Brand Stories
Creating Brand Stories
 
castironknickers
castironknickerscastironknickers
castironknickers
 
Recruitment Services of M/s. Diverse
Recruitment Services of M/s. DiverseRecruitment Services of M/s. Diverse
Recruitment Services of M/s. Diverse
 
【Ask maclean技术分享】oracle dba技能列表 z
【Ask maclean技术分享】oracle dba技能列表 z【Ask maclean技术分享】oracle dba技能列表 z
【Ask maclean技术分享】oracle dba技能列表 z
 
Three Way Valve
Three Way ValveThree Way Valve
Three Way Valve
 
Attitudes & Expectations Energy Field
Attitudes & Expectations Energy FieldAttitudes & Expectations Energy Field
Attitudes & Expectations Energy Field
 
Botox london estheticclinique
Botox london estheticcliniqueBotox london estheticclinique
Botox london estheticclinique
 
Developing students' reading skills in science education
Developing students' reading skills in science educationDeveloping students' reading skills in science education
Developing students' reading skills in science education
 

Ähnlich wie 解决Ora 14098分区交换索引不匹配错误

DN 2017 | Reducing pain in data engineering | Martin Loetzsch | Project A
DN 2017 | Reducing pain in data engineering | Martin Loetzsch | Project ADN 2017 | Reducing pain in data engineering | Martin Loetzsch | Project A
DN 2017 | Reducing pain in data engineering | Martin Loetzsch | Project ADataconomy Media
 
New Features of SQL Server 2016
New Features of SQL Server 2016New Features of SQL Server 2016
New Features of SQL Server 2016Mir Mahmood
 
Advanced tips of dbms statas
Advanced tips of dbms statasAdvanced tips of dbms statas
Advanced tips of dbms statasLouis liu
 
Data infrastructure for the other 90% of companies
Data infrastructure for the other 90% of companiesData infrastructure for the other 90% of companies
Data infrastructure for the other 90% of companiesMartin Loetzsch
 
How to transfer bad PLSQL into good (AAAPEKS23)
How to transfer bad PLSQL into good (AAAPEKS23)How to transfer bad PLSQL into good (AAAPEKS23)
How to transfer bad PLSQL into good (AAAPEKS23)Maik Becker
 
Database Development Replication Security Maintenance Report
Database Development Replication Security Maintenance ReportDatabase Development Replication Security Maintenance Report
Database Development Replication Security Maintenance Reportnyin27
 
Database Design Project-Oracle 11g
Database Design  Project-Oracle 11g Database Design  Project-Oracle 11g
Database Design Project-Oracle 11g Sunny U Okoro
 
MySQL Stored Procedures: Building High Performance Web Applications
MySQL Stored Procedures: Building High Performance Web ApplicationsMySQL Stored Procedures: Building High Performance Web Applications
MySQL Stored Procedures: Building High Performance Web ApplicationsOSSCube
 
Distributed Queries in IDS: New features.
Distributed Queries in IDS: New features.Distributed Queries in IDS: New features.
Distributed Queries in IDS: New features.Keshav Murthy
 
The MySQL Query Optimizer Explained Through Optimizer Trace
The MySQL Query Optimizer Explained Through Optimizer TraceThe MySQL Query Optimizer Explained Through Optimizer Trace
The MySQL Query Optimizer Explained Through Optimizer Traceoysteing
 
Sangam 2019 - The Latest Features
Sangam 2019 - The Latest FeaturesSangam 2019 - The Latest Features
Sangam 2019 - The Latest FeaturesConnor McDonald
 
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...Alex Zaballa
 
Data Warehouse and Business Intelligence - Recipe 3
Data Warehouse and Business Intelligence - Recipe 3Data Warehouse and Business Intelligence - Recipe 3
Data Warehouse and Business Intelligence - Recipe 3Massimo Cenci
 
The Ring programming language version 1.9 book - Part 93 of 210
The Ring programming language version 1.9 book - Part 93 of 210The Ring programming language version 1.9 book - Part 93 of 210
The Ring programming language version 1.9 book - Part 93 of 210Mahmoud Samir Fayed
 
Introduction to Parallel Execution
Introduction to Parallel ExecutionIntroduction to Parallel Execution
Introduction to Parallel ExecutionDoug Burns
 

Ähnlich wie 解决Ora 14098分区交换索引不匹配错误 (20)

DN 2017 | Reducing pain in data engineering | Martin Loetzsch | Project A
DN 2017 | Reducing pain in data engineering | Martin Loetzsch | Project ADN 2017 | Reducing pain in data engineering | Martin Loetzsch | Project A
DN 2017 | Reducing pain in data engineering | Martin Loetzsch | Project A
 
Oracle SQL Basics
Oracle SQL BasicsOracle SQL Basics
Oracle SQL Basics
 
PL/SQL and radix tree structure
PL/SQL and radix tree structurePL/SQL and radix tree structure
PL/SQL and radix tree structure
 
New Features of SQL Server 2016
New Features of SQL Server 2016New Features of SQL Server 2016
New Features of SQL Server 2016
 
Advanced tips of dbms statas
Advanced tips of dbms statasAdvanced tips of dbms statas
Advanced tips of dbms statas
 
Data infrastructure for the other 90% of companies
Data infrastructure for the other 90% of companiesData infrastructure for the other 90% of companies
Data infrastructure for the other 90% of companies
 
How to transfer bad PLSQL into good (AAAPEKS23)
How to transfer bad PLSQL into good (AAAPEKS23)How to transfer bad PLSQL into good (AAAPEKS23)
How to transfer bad PLSQL into good (AAAPEKS23)
 
Database Development Replication Security Maintenance Report
Database Development Replication Security Maintenance ReportDatabase Development Replication Security Maintenance Report
Database Development Replication Security Maintenance Report
 
Database Design Project-Oracle 11g
Database Design  Project-Oracle 11g Database Design  Project-Oracle 11g
Database Design Project-Oracle 11g
 
MySQL Stored Procedures: Building High Performance Web Applications
MySQL Stored Procedures: Building High Performance Web ApplicationsMySQL Stored Procedures: Building High Performance Web Applications
MySQL Stored Procedures: Building High Performance Web Applications
 
Distributed Queries in IDS: New features.
Distributed Queries in IDS: New features.Distributed Queries in IDS: New features.
Distributed Queries in IDS: New features.
 
The MySQL Query Optimizer Explained Through Optimizer Trace
The MySQL Query Optimizer Explained Through Optimizer TraceThe MySQL Query Optimizer Explained Through Optimizer Trace
The MySQL Query Optimizer Explained Through Optimizer Trace
 
PHP tips by a MYSQL DBA
PHP tips by a MYSQL DBAPHP tips by a MYSQL DBA
PHP tips by a MYSQL DBA
 
Sangam 2019 - The Latest Features
Sangam 2019 - The Latest FeaturesSangam 2019 - The Latest Features
Sangam 2019 - The Latest Features
 
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...
 
Data Warehouse and Business Intelligence - Recipe 3
Data Warehouse and Business Intelligence - Recipe 3Data Warehouse and Business Intelligence - Recipe 3
Data Warehouse and Business Intelligence - Recipe 3
 
Sap edi idoc
Sap edi idocSap edi idoc
Sap edi idoc
 
SQL Windowing
SQL WindowingSQL Windowing
SQL Windowing
 
The Ring programming language version 1.9 book - Part 93 of 210
The Ring programming language version 1.9 book - Part 93 of 210The Ring programming language version 1.9 book - Part 93 of 210
The Ring programming language version 1.9 book - Part 93 of 210
 
Introduction to Parallel Execution
Introduction to Parallel ExecutionIntroduction to Parallel Execution
Introduction to Parallel Execution
 

Mehr von maclean liu

Mysql企业备份发展及实践
Mysql企业备份发展及实践Mysql企业备份发展及实践
Mysql企业备份发展及实践maclean liu
 
Oracle専用データ復旧ソフトウェアprm dulユーザーズ・マニュアル
Oracle専用データ復旧ソフトウェアprm dulユーザーズ・マニュアルOracle専用データ復旧ソフトウェアprm dulユーザーズ・マニュアル
Oracle専用データ復旧ソフトウェアprm dulユーザーズ・マニュアルmaclean liu
 
【诗檀软件 郭兆伟-技术报告】跨国企业级Oracle数据库备份策略
【诗檀软件 郭兆伟-技术报告】跨国企业级Oracle数据库备份策略【诗檀软件 郭兆伟-技术报告】跨国企业级Oracle数据库备份策略
【诗檀软件 郭兆伟-技术报告】跨国企业级Oracle数据库备份策略maclean liu
 
基于Oracle 12c data guard & far sync的低资源消耗两地三数据中心容灾方案
基于Oracle 12c data guard & far sync的低资源消耗两地三数据中心容灾方案基于Oracle 12c data guard & far sync的低资源消耗两地三数据中心容灾方案
基于Oracle 12c data guard & far sync的低资源消耗两地三数据中心容灾方案maclean liu
 
TomCat迁移步骤简述以及案例
TomCat迁移步骤简述以及案例TomCat迁移步骤简述以及案例
TomCat迁移步骤简述以及案例maclean liu
 
PRM DUL Oracle Database Health Check
PRM DUL Oracle Database Health CheckPRM DUL Oracle Database Health Check
PRM DUL Oracle Database Health Checkmaclean liu
 
dbdao.com 汪伟华 my-sql-replication复制高可用配置方案
dbdao.com 汪伟华 my-sql-replication复制高可用配置方案dbdao.com 汪伟华 my-sql-replication复制高可用配置方案
dbdao.com 汪伟华 my-sql-replication复制高可用配置方案maclean liu
 
Vbox virtual box在oracle linux 5 - shoug 梁洪响
Vbox virtual box在oracle linux 5 - shoug 梁洪响Vbox virtual box在oracle linux 5 - shoug 梁洪响
Vbox virtual box在oracle linux 5 - shoug 梁洪响maclean liu
 
【诗檀软件】Mysql高可用方案
【诗檀软件】Mysql高可用方案【诗檀软件】Mysql高可用方案
【诗檀软件】Mysql高可用方案maclean liu
 
Shoug at apouc2015 4min pitch_biotwang_v2
Shoug at apouc2015 4min pitch_biotwang_v2Shoug at apouc2015 4min pitch_biotwang_v2
Shoug at apouc2015 4min pitch_biotwang_v2maclean liu
 
Apouc 4min pitch_biotwang_v2
Apouc 4min pitch_biotwang_v2Apouc 4min pitch_biotwang_v2
Apouc 4min pitch_biotwang_v2maclean liu
 
使用Oracle osw analyzer工具分析oswbb日志,并绘制系统性能走势图1
使用Oracle osw analyzer工具分析oswbb日志,并绘制系统性能走势图1使用Oracle osw analyzer工具分析oswbb日志,并绘制系统性能走势图1
使用Oracle osw analyzer工具分析oswbb日志,并绘制系统性能走势图1maclean liu
 
诗檀软件 Oracle开发优化基础
诗檀软件 Oracle开发优化基础 诗檀软件 Oracle开发优化基础
诗檀软件 Oracle开发优化基础 maclean liu
 
Orclrecove 1 pd-prm-dul testing for oracle database recovery_20141030_biot_wang
Orclrecove 1 pd-prm-dul testing for oracle database recovery_20141030_biot_wangOrclrecove 1 pd-prm-dul testing for oracle database recovery_20141030_biot_wang
Orclrecove 1 pd-prm-dul testing for oracle database recovery_20141030_biot_wangmaclean liu
 
诗檀软件 – Oracle数据库修复专家 oracle数据块损坏知识2014-10-24
诗檀软件 – Oracle数据库修复专家 oracle数据块损坏知识2014-10-24诗檀软件 – Oracle数据库修复专家 oracle数据块损坏知识2014-10-24
诗檀软件 – Oracle数据库修复专家 oracle数据块损坏知识2014-10-24maclean liu
 
追求Jdbc on oracle最佳性能?如何才好?
追求Jdbc on oracle最佳性能?如何才好?追求Jdbc on oracle最佳性能?如何才好?
追求Jdbc on oracle最佳性能?如何才好?maclean liu
 
使用Virtual box在oracle linux 5.7上安装oracle database 11g release 2 rac的最佳实践
使用Virtual box在oracle linux 5.7上安装oracle database 11g release 2 rac的最佳实践使用Virtual box在oracle linux 5.7上安装oracle database 11g release 2 rac的最佳实践
使用Virtual box在oracle linux 5.7上安装oracle database 11g release 2 rac的最佳实践maclean liu
 
Prm dul is an oracle database recovery tool database
Prm dul is an oracle database recovery tool   databasePrm dul is an oracle database recovery tool   database
Prm dul is an oracle database recovery tool databasemaclean liu
 
Oracle prm dul, jvm and os
Oracle prm dul, jvm and osOracle prm dul, jvm and os
Oracle prm dul, jvm and osmaclean liu
 
Oracle dba必备技能 使用os watcher工具监控系统性能负载
Oracle dba必备技能   使用os watcher工具监控系统性能负载Oracle dba必备技能   使用os watcher工具监控系统性能负载
Oracle dba必备技能 使用os watcher工具监控系统性能负载maclean liu
 

Mehr von maclean liu (20)

Mysql企业备份发展及实践
Mysql企业备份发展及实践Mysql企业备份发展及实践
Mysql企业备份发展及实践
 
Oracle専用データ復旧ソフトウェアprm dulユーザーズ・マニュアル
Oracle専用データ復旧ソフトウェアprm dulユーザーズ・マニュアルOracle専用データ復旧ソフトウェアprm dulユーザーズ・マニュアル
Oracle専用データ復旧ソフトウェアprm dulユーザーズ・マニュアル
 
【诗檀软件 郭兆伟-技术报告】跨国企业级Oracle数据库备份策略
【诗檀软件 郭兆伟-技术报告】跨国企业级Oracle数据库备份策略【诗檀软件 郭兆伟-技术报告】跨国企业级Oracle数据库备份策略
【诗檀软件 郭兆伟-技术报告】跨国企业级Oracle数据库备份策略
 
基于Oracle 12c data guard & far sync的低资源消耗两地三数据中心容灾方案
基于Oracle 12c data guard & far sync的低资源消耗两地三数据中心容灾方案基于Oracle 12c data guard & far sync的低资源消耗两地三数据中心容灾方案
基于Oracle 12c data guard & far sync的低资源消耗两地三数据中心容灾方案
 
TomCat迁移步骤简述以及案例
TomCat迁移步骤简述以及案例TomCat迁移步骤简述以及案例
TomCat迁移步骤简述以及案例
 
PRM DUL Oracle Database Health Check
PRM DUL Oracle Database Health CheckPRM DUL Oracle Database Health Check
PRM DUL Oracle Database Health Check
 
dbdao.com 汪伟华 my-sql-replication复制高可用配置方案
dbdao.com 汪伟华 my-sql-replication复制高可用配置方案dbdao.com 汪伟华 my-sql-replication复制高可用配置方案
dbdao.com 汪伟华 my-sql-replication复制高可用配置方案
 
Vbox virtual box在oracle linux 5 - shoug 梁洪响
Vbox virtual box在oracle linux 5 - shoug 梁洪响Vbox virtual box在oracle linux 5 - shoug 梁洪响
Vbox virtual box在oracle linux 5 - shoug 梁洪响
 
【诗檀软件】Mysql高可用方案
【诗檀软件】Mysql高可用方案【诗檀软件】Mysql高可用方案
【诗檀软件】Mysql高可用方案
 
Shoug at apouc2015 4min pitch_biotwang_v2
Shoug at apouc2015 4min pitch_biotwang_v2Shoug at apouc2015 4min pitch_biotwang_v2
Shoug at apouc2015 4min pitch_biotwang_v2
 
Apouc 4min pitch_biotwang_v2
Apouc 4min pitch_biotwang_v2Apouc 4min pitch_biotwang_v2
Apouc 4min pitch_biotwang_v2
 
使用Oracle osw analyzer工具分析oswbb日志,并绘制系统性能走势图1
使用Oracle osw analyzer工具分析oswbb日志,并绘制系统性能走势图1使用Oracle osw analyzer工具分析oswbb日志,并绘制系统性能走势图1
使用Oracle osw analyzer工具分析oswbb日志,并绘制系统性能走势图1
 
诗檀软件 Oracle开发优化基础
诗檀软件 Oracle开发优化基础 诗檀软件 Oracle开发优化基础
诗檀软件 Oracle开发优化基础
 
Orclrecove 1 pd-prm-dul testing for oracle database recovery_20141030_biot_wang
Orclrecove 1 pd-prm-dul testing for oracle database recovery_20141030_biot_wangOrclrecove 1 pd-prm-dul testing for oracle database recovery_20141030_biot_wang
Orclrecove 1 pd-prm-dul testing for oracle database recovery_20141030_biot_wang
 
诗檀软件 – Oracle数据库修复专家 oracle数据块损坏知识2014-10-24
诗檀软件 – Oracle数据库修复专家 oracle数据块损坏知识2014-10-24诗檀软件 – Oracle数据库修复专家 oracle数据块损坏知识2014-10-24
诗檀软件 – Oracle数据库修复专家 oracle数据块损坏知识2014-10-24
 
追求Jdbc on oracle最佳性能?如何才好?
追求Jdbc on oracle最佳性能?如何才好?追求Jdbc on oracle最佳性能?如何才好?
追求Jdbc on oracle最佳性能?如何才好?
 
使用Virtual box在oracle linux 5.7上安装oracle database 11g release 2 rac的最佳实践
使用Virtual box在oracle linux 5.7上安装oracle database 11g release 2 rac的最佳实践使用Virtual box在oracle linux 5.7上安装oracle database 11g release 2 rac的最佳实践
使用Virtual box在oracle linux 5.7上安装oracle database 11g release 2 rac的最佳实践
 
Prm dul is an oracle database recovery tool database
Prm dul is an oracle database recovery tool   databasePrm dul is an oracle database recovery tool   database
Prm dul is an oracle database recovery tool database
 
Oracle prm dul, jvm and os
Oracle prm dul, jvm and osOracle prm dul, jvm and os
Oracle prm dul, jvm and os
 
Oracle dba必备技能 使用os watcher工具监控系统性能负载
Oracle dba必备技能   使用os watcher工具监控系统性能负载Oracle dba必备技能   使用os watcher工具监控系统性能负载
Oracle dba必备技能 使用os watcher工具监控系统性能负载
 

Kürzlich hochgeladen

Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 

Kürzlich hochgeladen (20)

Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 

解决Ora 14098分区交换索引不匹配错误

  • 1. 解决 ORA-14098 分区交换 索引不匹配错误 by Maclean.liu liu.maclean@gmail.com www.oracledatabase12g.com o w n e r = ' & O W N E R 1 '
  • 2. About Me l Email:liu.maclean@gmail.com l Blog:www.oracledatabase12g.com l Oracle Certified Database Administrator Master 10g and 11g l Over 6 years experience with Oracle DBA technology l Over 7 years experience with Linux technology l Member Independent Oracle Users Group l Member All China Users Group l Presents for advanced Oracle topics: RAC, DataGuard, Performance Tuning and Oracle Internal.
  • 3. 上周在客户一套 BRM 系统上执行分区交换 Exchange Partition 操作的时候出现了 ORA-14098 错误,该错误是由于分区表上的 LOCAL 分区索引与非分区表上的索引不匹配造成的,我们 来看一下这个错误: [oracle@rh2 ~]$ oerr ora 14098 14098, 00000, "index mismatch for tables in ALTER TABLE EXCHANGE PARTITION" // *Cause: The two tables specified in the EXCHANGE have indexes which are // not equivalent // *Action: Ensure that the indexes for the two tables have indexes which // follow this rule // For every non partitioned index for the non partitioned table, // there has to be an identical LOCAL index on the partitioned // table and vice versa. By identical, the column position, type // and size have to be the same. SQL> ALTER TABLE sales EXCHANGE PARTITION SALES_Q4_2003 with table SALES_TMP INCLUDING INDEXES WITH VALIDATION UPDATE GLOBAL INDEXES; ALTER TABLE sales EXCHANGE PARTITION SALES_Q4_2003 with table SALES_TMP INCLUDING INDEXES WITH VALIDATION UPDATE GLOBAL INDEXES * ERROR at line 1: ORA-14098: index mismatch for tables in ALTER TABLE EXCHANGE PARTITION 如果表上有很多的索引,以至于你无法确定到底是哪个索引引发了 ORA-14098 错误,那么 我们可以通过 trace 的方式来协助定位到具体的索引: SQL> select * from v$version; BANNER ---------------------------------------------------------------- Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi PL/SQL Release 10.2.0.4.0 - Production CORE 10.2.0.4.0 Production TNS for Linux: Version 10.2.0.4.0 - Production NLSRTL Version 10.2.0.4.0 - Production SQL> select * from global_name; GLOBAL_NAME -------------------------------------------------------------------------------- www.oracledatabase12g.com SQL> alter session set max_dump_file_size = unlimited; Session altered.
  • 4. SQL> alter session set events '10046 trace name context forever, level 12'; Session altered. SQL> alter session set events '14098 trace name errorstack forever, level 4'; Session altered. ##SQL> alter system flush buffer_cache; System altered. Rerun Exchange Partition DDL SQL> ALTER TABLE sales EXCHANGE PARTITION SALES_Q4_2003 with table SALES_TMP INCLUDING INDEXES WITH VALIDATION UPDATE GLOBAL INDEXES; ALTER TABLE sales EXCHANGE PARTITION SALES_Q4_2003 with table SALES_TMP INCLUDING INDEXES WITH VALIDATION UPDATE GLOBAL INDEXES * ERROR at line 1: ORA-14098: index mismatch for tables in ALTER TABLE EXCHANGE PARTITION 11g 中直接查询 v$diag_info 就可以得到 trace 的路径,10g 执行 gettracename.sql SELECT d.VALUE || '/' || LOWER (RTRIM (i.INSTANCE, CHR (0))) || '_ora_' || p.spid || '.trc' trace_file_name FROM (SELECT p.spid FROM v$mystat m, v$session s, v$process p WHERE m.statistic# = 1 AND s.SID = m.SID AND p.addr = s.paddr) p, (SELECT t.INSTANCE FROM v$thread t, v$parameter v WHERE v.NAME = 'thread' AND (v.VALUE = 0 OR t.thread# = TO_NUMBER (v.VALUE))) i, (SELECT VALUE FROM v$parameter WHERE NAME = 'user_dump_dest') d; TRACE_FILE_NAME -------------------------------------------------------------------------------- /s01/admin/G10R2/udump/g10r2_ora_17749.trc ==========================10046/errorstack trace contents======================== PARSING IN CURSOR #1 len=127 dep=0 uid=64 oct=15 lid=64 tim=1277655207436065 hv=1207961095 ad='9098f018' ALTER TABLE sales EXCHANGE PARTITION SALES_Q4_2003 with table SALES_TMP INCLUDING INDEXES WITH VALIDATION UPDATE GLOBAL INDEXES END OF STMT PARSE #1:c=0,e=1145,p=0,cr=0,cu=0,mis=1,r=0,dep=0,og=1,tim=1277655207436059 BINDS #1: STAT #2 id=2 cnt=0 pid=1 pos=1 obj=98001 op='INDEX FULL SCAN SALES_UNID_TMP (cr=1 pr=0 pw=0 time=39 us)' *** 2011-06-17 21:55:32.417 ksedmp: internal or fatal error ORA-14098: index mismatch for tables in ALTER TABLE EXCHANGE PARTITION Current SQL statement for this session: ALTER TABLE sales EXCHANGE PARTITION SALES_Q4_2003 with table SALES_TMP
  • 5. INCLUDING INDEXES WITH VALIDATION UPDATE GLOBAL INDEXES 我们可以在 trace 中看到在出现 ORA-14098 错误前,正在对索引 SALES_UNID_TMP 的 Fast Full Scan 除了通过 10046/errorstack 的 trace 信息诊断外,更多的问题可以直接从 DDL 语句中发现,在 以上示例中非分区表的 DDL 语句: -- Create table create table SALES_TMP ( UNI_ID NUMBER NOT NULL, PROD_ID NUMBER not null, CUST_ID NUMBER not null, TIME_ID DATE not null, CHANNEL_ID NUMBER not null, PROMO_ID NUMBER not null, QUANTITY_SOLD NUMBER(10,2) not null, AMOUNT_SOLD NUMBER(10,2) not null ); create index SALES_CHANNEL_TMP ON SALES_TMP (CHANNEL_ID) ; create index SALES_CUST_TMP ON SALES_TMP (CUST_ID) ; create index SALES_UNID_TMP ON SALES_TMP (UNI_ID,TIME_ID); --注意细节 该索引是非 UNIQUE 的 create index SALES_PROD_TMP ON SALES_TMP (PROD_ID) ; create index SALES_PROMO_TMP ON SALES_TMP (PROMO_ID) ; create index SALES_TIME_TMP ON SALES_TMP (TIME_ID) ; 下为分区表的 DDL 语句: -- Create table create table SALES ( UNI_ID NUMBER NOT NULL, PROD_ID NUMBER not null, CUST_ID NUMBER not null, TIME_ID DATE not null, CHANNEL_ID NUMBER not null, PROMO_ID NUMBER not null, QUANTITY_SOLD NUMBER(10,2) not null, AMOUNT_SOLD NUMBER(10,2) not null ) partition by range (TIME_ID) ............... create index SALES_CHANNEL ON SALES (CHANNEL_ID) LOCAL; create index SALES_CUST ON SALES (CUST_ID) LOCAL; create UNIQUE index SALES_UNID ON SALES (UNI_ID,TIME_ID) LOCAL; -- 对应的 索引是 UNIQUE 的 create index SALES_PROD ON SALES (PROD_ID) LOCAL; create index SALES_PROMO ON SALES (PROMO_ID) LOCAL; create index SALES_TIME ON SALES (TIME_ID) LOCAL;
  • 6. 解决 ORA-14098 错误的要点是要找出引发错误的原因。当我们交换分区的时候,我们要确 保所有交换表上的索引和分区表上的本地索引匹配。这意味 着如果在分区表上有 N 个 LOCAL INDEXES,那么在交换表上就应当有 N 个等价的索引。这里的等价要求存在映射关 系的 2 个索引,在列的位置、类型、大小及 UNIQUE/NON- UNIQUE 都要一致。 可以利用如下 SQL 语句来找出分区表和交换表上索引的差异: set linesize 160 pagesize 1400 col TABLE_NAME for a30 col INDEX_NAME for a30 col COLUMN_NAME for a30 col COLUMN_POSITION for 99 col COLUMN_LENGTH for 99 col CHAR_LENGTH for 99 col DESCEND for a4 Select TABLE_NAME,INDEX_NAME, COLUMN_NAME,COLUMN_POSITION, COLUMN_LENGTH, CHAR_LENGTH, DESCEND FROM SYS.DBA_IND_COLUMNS DICN WHERE INDEX_OWNER = '&own' and DICN.TABLE_NAME in ('&TABNAME1','&TABNAME2') ORDER BY INDEX_NAME, COLUMN_POSITION / select TABLE_NAME, INDEX_NAME, INDEX_TYPE, UNIQUENESS, PARTITIONED from dba_indexes where owner='&OWNER' and TABLE_NAME in ('&TABNAME1', '&TABNAME2') order by index_name /
  • 7. 也可以使用 Toad 的 Single Schema Object Compare 功能来对比检验索引: 对于存在主键的分区表,可以在主键上以 DISABLE VALIDATE 方式创建 unique constraint 约 束,以代替全局的主键索引。若交换表(Exchange Table)上存在主键索引的话,那么建议在交 换前暂时将该索引 drop 掉,待交换完成后再重建。 如果实在无法解决该 ORA-14098 错误,那么可以尝试使用 EXCLUDING INDEXES 子句以跳 过索引维护,而在交换完成后重建相关失效索引。 © 2011, www.oracledatabase12g.com. 版权所有.文章允许转载,但必须以链接方式注明源地址, 否则追求法律责任.