Archive

Archive for March, 2009

10g的一个新花样:skip_unusable_indexes

March 17th, 2009 No comments


关于skip_unusable_indexes这个参数,大家从它的名称就基本上可以理解它是做什么的,但在使用时需要注意一个小问题,非唯一索引在失效(unusable)状态是允许继续对表进行DML操作,但唯一索引在失效状态是不允许DML操作.

这个富有人性化的改进可以避免因为dba的失误而导致很多事务回退,当dba对表进行move操作时,如果表上没有唯一索引,那我们在move时,就不必担心事务回退,所以如果有些表如果insert/delete非重频繁的话,最好不要创建唯一索引.

10g中加强了对unusable索引的监控,如果你move了表,这时将会在alert日志中记录如下信息:Some indexes or index [sub]partitions of table SCOTT.DEPT have been marked unusable

Categories: index Tags:

Customer Introduction to ORA-7445 Errors,&,LIST OF UNIX SIGNALS AND EXPLANATIONS

March 17th, 2009 No comments

 

主题: Customer Introduction to ORA-7445 Errors
  文档 ID: 211909.1 类型: BULLETIN
  Modified Date: 10-OCT-2008 状态: PUBLISHED

 

Purpose

The purpose of this note is to provide an introduction to ORA-7445 errors, and to suggest the next step in diagnosing the error.  The note is written with a UNIX bias, although the concepts are generic.

 

Scope & Application

To be used by the DBA when reporting ORA-7445 errors to Oracle Support Services.
 

What is an ORA-7445 error?

An ORA-7445 error is raised by an Oracle server process when it has received a fatal signal from the operating system.  The error may be raised in either a foreground or background process.  The process will normally

  • write an error to the alert log
  • write a trace file in either user_dump_dest or background_dump_dest
  • create a core dump in core_dump_dest

There are many ‘illegal’ operations that the operating system can trap.  A common example is a process writing to an invalid memory location, and so to protect the system the offending process will be sent a fatal signal.

Typically, the signals seen are SIGBUS (signal 10, bus error) and SIGSEGV (signal 11, segmentation violation).  There are other UNIX signals and exceptions that may happen, however, they are likely caused by OS problems rather than an Oracle problem.  Examples of other signals are: SIGINT, SIGKILL, SIGSYS.  A complete list is available in Note 1038055.6.

An ORA-7445 is a generic error, and can occur from anywhere in the Oracle code.  The precise location of the error is identified by the trace file it produces.

What Does an ORA-7445 Error Look Like?

The appearance of an ORA-7445 error varies slightly from platform to platform.  The two general forms are illustrated here.

Read more…

Categories: 7445, metalink Tags: , , , ,

oracle opatch 工具的使用(oracle小补丁安装)

March 10th, 2009 No comments

   从9.2版开始,Oracle公司设计实现了个别补丁安装管理工具opatch.opatch使用一

个称为inventory的系统数据结构(严格说是与oui共享inventory),集中管理所有已安装的个别补丁;个别

补丁的安装和卸载都使用opatch命令完成,冲突检测也由opatch在安装时自动完成;提供列表命令可以很方

便得到已安装个别补丁的信息。

    10g(10.1和10.2)版本中,opatch作为一个标准工具,在软件安装时自动安装。(安装在

$ORACLE_HOME/OPatch下。)而对于9.2版,需要从metalink下载opatch.无论数据库是哪一个版本,系统中是

否已经安装opatch,在使用之前,应从metalink下载最新版本的opatch.很遗憾,由于系统实现的问题,10.2

使用的opatch与之前版本(10.1和9.2)使用的opatch不兼容,不能混用,这一点必须注意。

    opatch是使用perl编写的脚本程序(其中也使用JAVA API)。编程使用的perl版本是5.6版,虽然在5.6

之前的版本中也可运行,但应尽可能安装5.6或以上的版本的perl.对于DBA来说一个好消息是,如果安装9.2

版软件时保留了HTTP服务器,则在$ORACLE_HOME/Apache下会自动安装perl.(10g会自动安装配置perl和

opatch.)
Read more…

Categories: 未分类 Tags:

Windows Route 路由表命令

March 10th, 2009 No comments

在本地 IP 路由表中显示和修改条目。

语法
route [-f] [-p] [Command [Destination] [mask Netmask] [Gateway] [metric Metric]] [if Interface]]

Read more…

Categories: OS & 小型机, windows Tags: ,

HP-UX下使用EMS

March 10th, 2009 No comments
1. EMS介绍
EMS(Event Monitoring Service)是一项HP-UX的集成服务,它能够对主机硬件进行实时监控,并可以通过指定方式将监控信息报告给系统维护人员,这有助于运维人员及时、准确的发现主机故障,并辅助判定故障所在,提高主机的可用时间。
EMS可以通过MRM(Monitoring Request Manager)进行管理,通过MRM可以对EMS的监控范围、事情报警触发条件、事件信息报警方式进行设置。
MRM调用方法如下:
Read more…
Categories: hp-ux, OS & 小型机 Tags: , ,

关于Oracle几种锁管理的汇总

March 8th, 2009 No comments

Oracle里锁有以下几种模式:
    0:none
    1:null 空
    2:Row-S 行共享(RS):共享表锁,sub share
    3:Row-X 行独占(RX):用于行的修改,sub exclusive
    4:Share 共享锁(S):阻止其他DML操作,share
    5:S/Row-X 共享行独占(SRX):阻止其他事务操作,share/sub exclusive
    6:exclusive 独占(X):独立访问使用,exclusive
   
    数字越大锁级别越高, 影响的操作越多。
   
    1级锁有:Select,有时会在v$locked_object出现。
    2级锁有:Select for update,Lock For Update,Lock Row Share
    select for update当对话使用for update子串打开一个游标时,所有返回集中的数据行都将处于行级(Row-X)独占式锁定,其他对象只能查询这些数据行,不能进行update、delete或select for update操作。
    3级锁有:Insert, Update, Delete, Lock Row Exclusive
    没有commit之前插入同样的一条记录会没有反应, 因为后一个3的锁会一直等待上一个3的锁, 我们必须释放掉上一个才能继续工作。
    4级锁有:Create Index, Lock Share
    locked_mode为2,3,4不影响DML(insert,delete,update,select)操作, 但DDL(alter,drop等)操作会提示ora-00054错误。
    00054, 00000, “resource busy and acquire with NOWAIT specified”
    // *Cause: Resource interested is busy.
    // *Action: Retry if necessary.
    5级锁有:Lock Share Row Exclusive
    具体来讲有主外键约束时update / delete … ; 可能会产生4,5的锁。
    6级锁有:Alter table, Drop table, Drop Index, Truncate table, Lock Exclusive
   
    以DBA角色, 查看当前数据库里锁的情况可以用如下SQL语句:

col owner for a12
    col object_name for a16
    select b.owner,b.object_name,l.session_id,l.locked_mode
    from v$locked_object l, dba_objects b
    where b.object_id=l.object_id

    select t2.username,t2.sid,t2.serial#,t2.logon_time
    from v$locked_object t1,v$session t2
    where t1.session_id=t2.sid order by t2.logon_time
    如果有长期出现的一列,可能是没有释放的锁。我们可以用下面SQL语句杀掉长期没有释放非正常的锁:
   
    alter system kill session ‘sid,serial#’;
   
    如果出现了锁的问题, 某个DML操作可能等待很久没有反应。
   
    当你采用的是直接连接数据库的方式,也不要用OS系统命令 $kill process_num 或者 $kill -9 process_num来终止用户连接,因为一个用户进程可能产生一个以上的锁, 杀OS进程并不能彻底清除锁的问题。

Categories: lock Tags:

sql有绑定变量但是却不能共享的原因及如何诊断…About version_count

March 8th, 2009 No comments
2007-12-13 13:51
library cache 相关的latch 等待并都是因为sql语句没有绑定变量造成的!!!

也有很多种情况会造成相同的sql_id,相同的hash_value而不能share。
这通常都会造成很多的child cursor.

      
查询v$sqlarea中版本数大于10的所有sql的语句:
select sql_id,version_count, sql_text
from   v$sqlarea
where version_count > 10
order by version_count, hash_value;

通常有问题的时候某些sql_id 的 version_count 可能会大于1000,
如果对比的话,sql_text都是完全相同的,那么到底是什么造成如此多的version呢?

例如我们上面的查询找到了sql_id:10xj8nynmpqtq

则执行下面的查询:

select SQL_ID,CHILD_NUMBER,
UNBOUND_CURSOR,
SQL_TYPE_MISMATCH,
OPTIMIZER_MISMATCH,
OUTLINE_MISMATCH,
STATS_ROW_MISMATCH,
LITERAL_MISMATCH,
SEC_DEPTH_MISMATCH,
EXPLAIN_PLAN_CURSOR,
BUFFERED_DML_MISMATCH,
PDML_ENV_MISMATCH,
INST_DRTLD_MISMATCH,
SLAVE_QC_MISMATCH,
TYPECHECK_MISMATCH,
AUTH_CHECK_MISMATCH,
BIND_MISMATCH,
DESCRIBE_MISMATCH,
LANGUAGE_MISMATCH,
TRANSLATION_MISMATCH,
ROW_LEVEL_SEC_MISMATCH,
INSUFF_PRIVS,
INSUFF_PRIVS_REM,
REMOTE_TRANS_MISMATCH,
LOGMINER_SESSION_MISMATCH,
INCOMP_LTRL_MISMATCH
from v$sql_shared_cursor
where sql_id=’10xj8nynmpqtq’;

SQL_ID        CHILD_NUMBER U S O O S L S E B P I S T A B D L T R I I R L I
————- ———— – - – - – - – - – - – - – - – - – - – - – - – -
10xj8nynmpqtq            0 N N N N N N N N N N N N N N N N N N N N N N N N
10xj8nynmpqtq            1 N N N N N N N N N N N N N N N N N N N N N N N N
10xj8nynmpqtq            2 N N N N N N N N N N N N N N Y N N N N N N N N N
10xj8nynmpqtq            3 N N N N N N N N N N N N N N N N N N N N N N N N
10xj8nynmpqtq            4 N N N N N N N N N N N N N N N N N N N N N N N N
10xj8nynmpqtq            5 N N N N N N N N N N N N N N Y N N N N N N N N N
10xj8nynmpqtq            6 N N N N N N N N N N N N N N N N N N N N N N N N
10xj8nynmpqtq            7 N N N N N N N N N N N N N N Y N N N N N N N N N
10xj8nynmpqtq            8 N N N N N N N N N N N N N N N N N N N N N N N N
10xj8nynmpqtq            9 N N N N N N N N N N N N N N Y N N N N N N N N N
10xj8nynmpqtq           10 N N N N N N N N N N N N N N N N N N N N N N N N

SQL_ID        CHILD_NUMBER U S O O S L S E B P I S T A B D L T R I I R L I
————- ———— – - – - – - – - – - – - – - – - – - – - – - – -
10xj8nynmpqtq           11 N N N N N N N N N N N N N N N N N N N N N N N N
10xj8nynmpqtq           12 N N N N N N N N N N N N N N Y N N N N N N N N N
10xj8nynmpqtq           13 N N N N N N N N N N N N N N N N N N N N N N N N
10xj8nynmpqtq           14 N N N N N N N N N N N N N N Y N N N N N N N N N
10xj8nynmpqtq           15 N N N N N N N N N N N N N N N N N N N N N N N N

相应的 Y 列说明了该cursor不能共享的原因:

BIND_MISMATCH – The bind metadata does not match the existing child cursor

除了这些能够查询到的原因之外,还有可能所有的列都是 N ,但是仍然还是有很多version_count .

那么恭喜你中奖了,这种情况可能的BUG:

Bug 4458226 High version count with cursor_sharing=force

Affects:
Product (Component) Oracle Server (Rdbms)
Range of versions believed to be affected Versions < 11
Versions confirmed as being affected 10.1.0.4 ,10.2.0.1

Platforms affected Generic (all / most platforms affected)

Fixed:
This issue is fixed in 9.2.0.8 (Server Patch Set) ,10.1.0.5 (Server Patch Set)
10.2.0.2 (Server Patch Set) ,11g (Future version)

Bug 4701527 Cursors not shared when executing procedures over a dblink

Affects:
Product (Component) Oracle Server (Rdbms)
Range of versions believed to be affected Versions < 11
Versions confirmed as being affected 9.2.0.5 ,9.2.0.7 ,10.1.0.5

Platforms affected Generic (all / most platforms affected)

Fixed:
This issue is fixed in 9.2.0.8 (Server Patch Set) ,10.2.0.4 (Server Patch Set) ,11g (Future version)

Description
A cursor sharing problem exists for INSERT statements that insert into a remote table and are executed via a PLSQL module which itself is being executed remotely.

To be seeing this problem the following must be true:
1. Multiple child cursors are seen for an INSERT statement
2. V$SQL_SHARED_CURSOR will have the INST_DRTLD_MISMATCH column set to ‘Y’
   for the cursor
3. The insert statement is executed remotely via a PLSQL module that is
   executed remotely

Bug 3461251 V$SQL_SHARED_CURSOR shows all N with CURSOR_SHARING=FORCE

Affects:
Product (Component) Oracle Server (Rdbms)
Range of versions believed to be affected Versions < 11.2
Versions confirmed as being affected 9.2.0.4

Platforms affected Generic (all / most platforms affected)

Fixed:
This issue is fixed in 11.2 (Future Release)

Description
New child cursors may be created but V$SQL_SHARED_CURSOR does not have a ‘Y’ in any of the columns that denote the reason why the cursor could not be shared for the cursor in question. This is common when literal replacement is enabled and histograms exist on the columns that are predicates of the SQL statement and have undergone literal replacement.

This fix adds a new column to V$SQL_SHARED_CURSOR called HASH_MATCH_FAILED which is set to “Y” if sharing fails due to a hash mismatch, such as the case with mismatched histogram data.

Workaround:
Check if the unshared child cursors have histogram data on key columns.

Bug 5705795 Win/Linux: Many child cursors possible for SQL using BINDS

This bug is alerted in Note 403616.1
Affects:

    Product (Component)    Oracle Server (Rdbms)
    Range of versions believed to be affected    Versions >= 10.2.0.3 but < 10.2.0.4
    Versions confirmed as being affected   

        * 10.2.0.3

    Platforms affected   

        * Linux 32bit
        * Windows/NT/XP

     It is believed to be a regression in default behaviour thus:
       Regression introduced in 10.2.0.3

Fixed:

    This issue is fixed in   

        * 10.2.0.4 (Server Patch Set)

Symptoms:
   

Description

    This problem is introduced in 10.2.0.3 on Windows 32bit and Linux 32bit only by the fix for bug 4752541.

    10.2.0.3 on other platforms includes the fix for this bug# and so are not affected.

    SQL using bind variables with different bind sizes can lead to a large number of child cursors being
    created leading to excess shared pool usage and latch contention.

Categories: 排错 Tags: , , ,

碰到个Bug: GES: Potential blocker (pid=536584) on resource CI-0000001E-00000002

March 8th, 2009 No comments
2008-08-04 18:16

今天碰到的:

Rac其中一个节点sqlplus / as sysdba都会被挂起,另一个Node没有问题。

alertlog中有这样的信息:
Thread 2 advanced to log sequence 5327
Current log# 3 seq# 5327 mem# 0: /dev/rlvredo21
Mon Aug 4 15:39:00 2008
Thread 2 advanced to log sequence 5328
Current log# 4 seq# 5328 mem# 0: /dev/rlvredo22
Mon Aug 4 15:59:55 2008
GES: Potential blocker (pid=536584) on resource CI-0000001E-00000002;
enqueue info in file /oracle/app/oracle/admin/qasmdm/bdump/qasmdm2_lmd0_438324.trc and DIAG trace file

看trace文件:

[qasmdm2:oracle] /> more /oracle/app/oracle/admin/qasmdm/bdump/qasmdm2_lmd0_438324.trc
/oracle/app/oracle/admin/qasmdm/bdump/qasmdm2_lmd0_438324.trc
Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 – 64bit Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
ORACLE_HOME = /oracle/app/oracle/product/10.2.0
System name:    AIX
Node name:      PEKAX132
Release:        3
Version:        5
Machine:        00002A27D100
Instance name: qasmdm2
Redo thread mounted by this instance: 2
Oracle process number: 6
Unix process pid: 438324, image:
oracle@PEKAX132 (LMD0)

*** 2008-07-30 00:27:17.430
*** SERVICE NAME:() 2008-07-30 00:27:17.429
*** SESSION ID:(551.1) 2008-07-30 00:27:17.429
* kjdrchkdrm: found an RM request in the request queue
Transfer pkey 4294950913 to node 1
*** 2008-07-30 00:27:17.515
Single node DRM(1) – transfer pkey 4294950913 to 1 done
*** 2008-07-30 00:27:17.515
Single node DRM(1) – transfer pkey 4294950914 to 1 done
*** 2008-07-30 00:27:17.515
Single node DRM(1) – transfer pkey 4294950915 to 1 done
*** 2008-07-30 00:27:17.515
Single node DRM(1) – transfer pkey 4294950916 to 1 done
。。。
。。。
Single node DRM(7) – transfer pkey 4294950947 to 1 done
* kjdrchkdrm: found an RM request in the request queue
Transfer pkey 4294950948 to node 1
*** 2008-07-30 00:27:43.465
Single node DRM(9) – transfer pkey 4294950948 to 1 done
* kjdrchkdrm: found an RM request in the request queue
Transfer pkey 4294950956 to node 1
*** 2008-07-30 00:27:43.476
Single node DRM(11) – transfer pkey 4294950956 to 1 done
*** 2008-07-30 00:27:43.476
。。。
。。。
synca inc 4 lvl 1 from 0 rcvd (my inc,lvl: 0,0) (4/5.0.0)
m2s domain info received from 0 (4.6)
* m2s: domain 0 valid = 1 according to instance 0
received master 1 (4.6)
ftd received from node 0 (4/7.0.0)
all ftds received
synca inc 4 lvl 2 from 0 rcvd (my inc,lvl: 4,1) (4/7.0.0)
ftd received from node 0 (4/9.0.0)
all ftds received
synca inc 4 lvl 3 from 0 rcvd (my inc,lvl: 4,2) (4/13.0.0)
ftd received from node 0 (4/14.0.0)
all ftds received

PEKAX132:/>ps -ef|grep 536584
oracle 536584       1   0   Jul 30      – 7:11 ora_lck0_qasmdm2
    root 2064566 2101288   0 16:18:43 pts/6 0:00 grep 536584

来看看lck进程是干什么的:
我们知道:LCKn是一个可选进程,当在并行服务器模式可出现多个锁定进程以利于数据库通信,作用就是锁定当前Instan要使用的资源而避免冲突。

再看trace文件名对应的进程:qasmdm2_lmd0_438324.trc

Lock Manager Daemon ?LMDn
In parallel server environments Oracle synchronizes access to resources that are shared between instances using instance locks. Each instance manages a subset of the instance locks. The LMDn processes service requests for locally managed locks directly, and forward requests for remotely managed locks to the remote node. The LMDn processes are also responsible for the detection of distributed deadlocks. Multiple lock manager processes can be configured for each instance, but one is normally sufficient because the messages are passed asynchronously.

显然是由于Rac资源的锁造成的


因为时间比较紧,没有去细查究竟什么原因造成的这个锁,只是简单的Kill了进程.

可知的相关的bug可以参考:BUG 6271080

Categories: oracle, 排错 Tags: ,

SCRIPT: LATCH PERFORMANCE 判断什么latch才是问题所在

March 8th, 2009 No comments
2008-08-18 14:58

There are two scripts in this document.
The report generated by the first of the two scripts in this document lists information critical to determining if a database instance is experiencing latch contention. Latch contention ratios should remain less than or equal to 1%. If a ratio column is greater than 1%, latch contention exists.  

The report generated by the second script provides the ratios of various sleeps for the latches.
========
Script 1:
========
SET ECHO off
REM NAME:   TFSLATCH.SQL
REM USAGE:”@path/tfslatch”
REM ————————————————————————
REM AUTHOR:  
REM    Virag Saksena, Craig A. Shallahamer, Oracle US      
REM    (c)1994 Oracle Corporation      
REM ————————————————————————
REM Main text of script follows

ttitle -
   center   ‘Latch Contention Report’ skip 3

col name form A25
col gets form 999,999,999,999
col misses form 999.99
col spins form 999.99
col igets form 999,999,999
col imisses form 999.99

select name,gets,misses*100/decode(gets,0,1,gets) misses,
spin_gets*100/decode(misses,0,1,misses) spins, immediate_gets igets,
immediate_misses*100/decode(immediate_gets,0,1,immediate_gets) imisses
from v$latch
where gets<>0
order by gets DESC
/  

NAME                                  GETS MISSES   SPINS        IGETS IMISSES
————————- —————- ——- ——- ———— ——-
cache buffers chains        67,412,367,032     .01   96.73   38,287,986     .01
simulator hash latch         2,414,755,134     .00   99.89            0     .00
simulator lru latch          2,383,067,905     .07   99.89   30,085,656     .03
row cache objects            1,553,956,475     .15   99.98      119,197     .02
session idle bit             1,172,009,931     .00   99.24            0     .00
library cache                  379,801,499     .08   79.42    9,335,054   11.54
shared pool                    225,106,805     .19   83.69            0     .00
SQL memory manager workar      210,967,639     .00   98.48            0     .00

这几列:
name,gets
MISSES=misses*100/decode(gets,0,1,gets) 也就是miss的百分比,不要超过1%

========
Script2:
========  

SET ECHO off
REM NAME:   TFSLTSLP.SQL
REM USAGE:”@path/tfsltslp”
REM ————————————————————————
REM AUTHOR:  
REM    Virag Saksena, Craig A. Shallahamer, Oracle US      
REM    (c)1994 Oracle Corporation
REM ————————————————————————
REM Main text of script follows:

col name form A18 trunc
col gets form 999,999,999,999
col miss form 90.9
col cspins form A6 heading ‘spin|sl06′
col csleep1 form A5 heading ‘sl01|sl07′
col csleep2 form A5 heading ‘sl02|sl08′
col csleep3 form A5 heading ‘sl03|sl09′
col csleep4 form A5 heading ‘sl04|sl10′
col csleep5 form A5 heading ‘sl05|sl11′
col Interval form A12
set recsep off

select a.name
      ,a.gets gets
      ,a.misses*100/decode(a.gets,0,1,a.gets) miss
      ,to_char(a.spin_gets*100/decode(a.misses,0,1
       ,a.misses),’990.9′)||
       to_char(a.sleep6*100/decode(a.misses,0,1
       ,a.misses),’90.9′) cspins
      ,to_char(a.sleep1*100/decode(a.misses,0,1
       ,a.misses),’90.9′)||
       to_char(a.sleep7*100/decode(a.misses,0,1
       ,a.misses),’90.9′) csleep1
      ,to_char(a.sleep2*100/decode(a.misses,0,1
       ,a.misses),’90.9′)||
       to_char(a.sleep8*100/decode(a.misses,0,1
       ,a.misses),’90.9′) csleep2
      ,to_char(a.sleep3*100/decode(a.misses,0,1
       ,a.misses),’90.9′)||
       to_char(a.sleep9*100/decode(a.misses,0,1
       ,a.misses),’90.9′) csleep3
      ,to_char(a.sleep4*100/decode(a.misses,0,1
       ,a.misses),’90.9′)||
       to_char(a.sleep10*100/decode(a.misses,0,1
       ,a.misses),’90.9′) csleep4  
      ,to_char(a.sleep5*100/decode(a.misses,0,1
       ,a.misses),’90.9′)||
       to_char(a.sleep11*100/decode(a.misses,0,1
       ,a.misses),’90.9′) csleep5
from v$latch a
where a.misses <> 0
order by 2 asc
/

                                          spin   sl01 sl02 sl03 sl04 sl05
NAME                           GETS MISS sl06   sl07 sl08 sl09 sl10 sl11
—————— —————- —– —— —– —– —– —– —–
simulator lru latc    2,384,112,093   0.1   99.9   0.0   0.0   0.0   0.0   0.0
                                            0.0    0.0   0.0   0.0   0.0   0.0
simulator hash lat    2,415,800,963   0.0   99.9   0.0   0.0   0.0   0.0   0.0
                                            0.0    0.0   0.0   0.0   0.0   0.0
cache buffers chai   67,442,373,821   0.0   96.7   0.0   0.0   0.0   0.0   0.0
                                            0.0    0.0   0.0   0.0   0.0   0.0

Categories: 脚本, latch Tags: ,

高级复制–ORA-01422

March 8th, 2009 No comments
2008-07-31 17:28

论坛上看到有人说高级复制遭遇:

ORA-1422, 00000, “exact fetch returns more than requested number of rows”
// *Cause: The number specified in exact fetch is less than the rows returned.
// *Action: Rewrite the query or change number of rows requested

其实这个错误最好的找出问题的方法就是做trace,从而能找到引起这个问题的具体原因。

当然了,也有一些经验值:
转自metalink

Subject: ORA-1422 WHEN DEFERRED TRANSACTIONS PUSHED TO THE REMOTE SITE
  Doc ID: Note:1039878.6 Type: PROBLEM
  Last Revision Date: 13-MAY-2002 Status: PUBLISHED


PROBLEM DESCRIPTION:
=====================

You have a replication environment and receive the following error:

ORA-1422, 00000, "exact fetch returns more than requested number of rows"
// *Cause: The number specified in exact fetch is less than the rows returned.
// *Action: Rewrite the query or change number of rows requested

PROBLEM EXPLANATION:
====================

There may be 2 entries in the SYS.DUAL table.
See Note 1067733.6 to resolve this issue.

--OR--

Your replicated tables may not have a primary key or
alternate primary key

SEARCH WORDS:
=============
ORA-1422 replication dbms_defer_sys deftran deferror ORA-01422

SOLUTION DESCRIPTION:
======================
Because two rows may have different row IDs at different replication sites,
Oracle uses the primary key for a table to determine which rows to
compare.  If you do not want to use the primary key for a table or if the
table does not have a primary key, you must use DBMS_REPCAT.SET_COLUMNS
procedure to define an alternate primary key.

SQL> describe sys.dbms_repcat.set_columns
PROCEDURE sys.dbms_repcat.set_columns
 Argument Name                  Type                    In/Out Default?
 ------------------------------ ----------------------- ------ --------
 SNAME                          VARCHAR2                IN
 ONAME                          VARCHAR2                IN
 COLUMN_LIST                    VARCHAR2                IN

Because this key is used to determine matching rows at different sites,
the columns that you specify in the COLUMN_LIST must result in a unique
identifier for the row.  The procedure SET_COLUMNS will NOT enforce
uniqueness.

Videos, Slideshows and Podcasts by Cincopa Wordpress Plugin