ITPub博客

首页 > 数据库 > Oracle > ORA-00001: unique CONSTRAINT (RCAT.TF_U2) violated

ORA-00001: unique CONSTRAINT (RCAT.TF_U2) violated

原创 Oracle 作者:bulkaunt 时间:2008-03-21 11:38:38 0 删除 编辑

每天的备份出错,信息如下:

connected to target database: GZDM (DBID=1879443745)
connected to recovery catalog database

RMAN> 2> 3> 4> 5> 6> 7> 8> 9> 10> 11> 12> 13> 14> 15> 16> 17> 18> 19> 20> 21> 22> 23> 24> 25> 26> 27> 28> 29> 30> 31> 32> 33>
34> 35> 36> 37> 38> 39> 40> 41> 42> RMAN> 2> 3> 4> 5> 6> 7> 8> 9> 10> 11> 12> 13> 14> 15> 16> 17> 18> 19> 20> 21> 22> 23> 24
> 25> 26> 27> 28> 29> 30> 31> 32> 33> 34> 35> 36> 37> 38> 39> 40> 41> 42>
starting full resync of recovery catalog
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of allocate command at 03/19/2008 20:49:50
RMAN-03014: implicit resync of recovery catalog failed
RMAN-03009: failure of full resync command on default channel at 03/19/2008 20:49:50
ORA-00001: unique CONSTRAINT (RCAT.TF_U2) violated

[@more@]

解决过程:

SQL> select dbms_metadata.get_ddl('CONSTRAINT','TF_U2','RCAT') from dual;

DBMS_METADATA.GET_DDL('CONSTRAINT','TF_U2','RCAT')
--------------------------------------------------------------------------------

ALTER TABLE "RCAT"."TF" ADD CONSTRAINT "TF_U2" UNIQUE ("DBINC_KEY", "TS#", "TS_CREATE_SCN", "FILE#")
USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
TABLESPACE "RMAN" ENABLE

SQL> select DBID,NAME,DBINC_KEY, RESETLOGS_CHANGE#, RESETLOGS_TIME from rcat.rc_database_incarnation where dbid=1879443745

DBID NAME DBINC_KEY RESETLOGS_CHANGE# RESETLOGS_TI
---------- -------- ---------- ----------------- ------------
1879443745 GZDM 110472 1 07-MAR-07

SQL> select distinct "DBINC_KEY", "TS#", "TS_CREATE_SCN", "FILE#" from rcat.tf where DBINC_KEY=110472;

DBINC_KEY TS# TS_CREATE_SCN FILE#
---------- ---------- ------------- ----------
110472 3 7327 1
110472 3 7327 2
110472 3 7327 3
110472 3 7327 4
110472 3 7327 5
110472 3 7327 6
110472 3 7327 7
110472 3 7327 8
110472 3 7327 9
110472 3 7327 10
110472 3 7327 11
110472 3 7327 12
110472 3 7327 13
110472 3 7327 14
110472 3 7327 15
110472 3 7327 16
110472 3 7327 17
110472 3 7327 18
110472 3 7327 19
110472 3 7327 20
110472 3 7327 21
110472 3 7327 22
110472 3 7327 23
110472 3 7327 24
110472 3 7327 25
110472 3 7327 26
110472 3 7327 27
110472 3 7327 28
110472 3 7327 29
110472 3 7327 30
110472 3 7327 31
110472 3 7327 32
110472 3 7327 33
110472 3 7327 34
110472 3 7327 35
110472 3 7327 36
110472 3 7327 37
110472 3 7327 38
110472 3 7327 39
110472 3 7327 40
110472 3 7327 41
110472 3 7327 42
110472 3 7327 43
110472 3 7327 44
110472 3 7327 45
110472 3 7327 46
110472 3 7327 47
110472 3 7327 48
110472 3 7327 49
110472 3 7327 50

50 rows selected.

SQL> connect rcat/rcat
Connected.
SQL> select index_name ,status from user_indexes where index_name='TF_U2';

INDEX_NAME STATUS
------------------------------ --------
TF_U2 VALID

SQL> create table bulk as select *from rcat.tf where DBINC_KEY=110472;

Table created.

SQL> delete from rcat.tf where DBINC_KEY=110472 and FILE#=50;

1 row deleted.

SQL> commit;

Commit complete.

SQL> delete from rcat.tf where DBINC_KEY=110472;

49 rows deleted.

SQL> commit;

Commit complete.

SQL> select distinct "DBINC_KEY", "TS#", "TS_CREATE_SCN", "FILE#" from rcat.tf where DBINC_KEY=110472;

no rows selected

SQL> select distinct "DBINC_KEY", "TS#", "TS_CREATE_SCN", "FILE#" from rcat.tf where DBINC_KEY=110472;

no rows selected

SQL> select distinct "DBINC_KEY", "TS#", "TS_CREATE_SCN", "FILE#" from rcat.tf where DBINC_KEY=110472;

DBINC_KEY TS# TS_CREATE_SCN FILE#
---------- ---------- ------------- ----------
110472 3 7327 1
110472 3 7327 2
110472 3 7327 3
110472 3 7327 4
110472 3 7327 5
110472 3 7327 6
110472 3 7327 7
110472 3 7327 8
110472 3 7327 9
110472 3 7327 10
110472 3 7327 11
110472 3 7327 12
110472 3 7327 13
110472 3 7327 14
110472 3 7327 15
110472 3 7327 16
110472 3 7327 17
110472 3 7327 18
110472 3 7327 19
110472 3 7327 20
110472 3 7327 21
110472 3 7327 22
110472 3 7327 23
110472 3 7327 24
110472 3 7327 25
110472 3 7327 26
110472 3 7327 27
110472 3 7327 28
110472 3 7327 29
110472 3 7327 30
110472 3 7327 31
110472 3 7327 32
110472 3 7327 33
110472 3 7327 34
110472 3 7327 35
110472 3 7327 36
110472 3 7327 37
110472 3 7327 38
110472 3 7327 39
110472 3 7327 40
110472 3 7327 41
110472 3 7327 42
110472 3 7327 43
110472 3 7327 44
110472 3 7327 45
110472 3 7327 46
110472 3 7327 47
110472 3 7327 48
110472 3 7327 49
110472 3 7327 50

50 rows selected.

再执行备份,或者连接RMAN,随便敲命令,如:SHOW ALL等,已经不再报错

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/58242/viewspace-1001269/ ,如需转载,请注明出处,否则将追究法律责任。

下一篇: 物化视图总结
请登录后发表评论 登录
全部评论

注册时间:2012-09-21

  • 博文量
    15
  • 访问量
    1144758