首页 > 其他分享 >ORA-20000: Unable to set values for index xxx: does not exist or insufficient privileges

ORA-20000: Unable to set values for index xxx: does not exist or insufficient privileges

时间:2023-07-04 23:57:08浏览次数:42  
标签:index set privileges object EXPORT TABLE ORA type SCHEMA

使用expdp/impdp导出导入数据时,遇到ORA-2000错误,如下所示:

Processing object type SCHEMA_EXPORT/TABLE/GRANT/OWNER_GRANT/OBJECT_GRANT
Processing object type SCHEMA_EXPORT/TABLE/COMMENT
Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Processing object type SCHEMA_EXPORT/STATISTICS/MARKER
xxxx.xxxxx : sqlerrm = ORA-20000: Unable to set values for index xxx: does not exist or insufficient privileges
Importing statistics failed for 1 object(s); 

导出环境为Oracle 12c,导入的数据库环境为Oracle 19c,具体版本为19.16.0.0.0,查了一下Oracle Support,刚好是遇到了Bug 30978304,关于为什么会出现这个错误,ORA-20000 from Data Pump Import (IMPDP) when PK Constraint does not Create a New Index (Doc ID 2679433.1)[1]中,有详细的案例描述,这里就没有必要自己再构造一个案例来描述出现ORA-20000错误的场景,具体如下所示:

APPLIES TO:
Oracle Database - Enterprise Edition - Version 19.1.0.0.0 and later
Information in this document applies to any platform.
SYMPTOMS
While running Data Pump Import (IMPDP) with STATISTICS, the order of creating indexes and constraints allowed a primary key constraint to reference a user created index rather than creating a new index as it should.
 
A simplified test case:
SQL> drop user INDEXTEST cascade;
SQL> create user INDEXTEST identified by INDEXTEST;
SQL> grant dba to INDEXTEST;
SQL> connect INDEXTEST/INDEXTEST
SQL> create table i_test (id number, t1 varchar2(100), t2 varchar2(100));
SQL> alter table i_test add constraint i_test_pk primary key (id, t1, t2);
SQL> insert into i_test values (1,1,1);
SQL> commit;
SQL> create unique index i_test_idx on i_test(id, t2, t1);
SQL> select index_name from user_indexes;
SQL> select constraint_name from user_constraints;
SQL> EXEC DBMS_STATS.GATHER_SCHEMA_STATS('INDEXTEST');
SQL> !expdp system/<Password> schemas=INDEXTEST dumpfile=INDEXTEST reuse_dumpfiles=y
SQL> connect system/<Password>
SQL> drop user INDEXTEST cascade;
SQL> !impdp system/<Password> schemas=INDEXTEST dumpfile=INDEXTEST

Import: Release 19.0.0.0.0 - Production on Mon Mar 2 19:08:53 2020 Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.

Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Master table "SYSTEM"."SYS_IMPORT_SCHEMA_01" successfully loaded/unloaded
Starting "SYSTEM"."SYS_IMPORT_SCHEMA_01": system/******** schemas=INDEXTEST
dumpfile=INDEXTEST
Processing object type SCHEMA_EXPORT/USER
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
Processing object type SCHEMA_EXPORT/TABLE/TABLE
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
. . imported "INDEXTEST"."I_TEST" 5.898 KB 1 rows
Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Processing object type SCHEMA_EXPORT/STATISTICS/MARKER
INDEXTEST.I_TEST_PK : sqlerrm = ORA-20000: Unable to set values for index I_TEST_PK: does not exist or insufficient privileges Importing statistics failed for 1 object(s);
Job "SYSTEM"."SYS_IMPORT_SCHEMA_01" completed with 2 error(s) at Mon Mar 2
19:09:13 2020 elapsed 0 00:00:19

SQL> connect INDEXTEST/INDEXTEST
SQL> select index_name from user_indexes;
SQL> select constraint_name from user_constraints;
SQL> exit;
 
Note:  It was reported that this issue also exists when the column order is the same, but the user created index has an extra column.
 
CHANGES
The database was upgraded to 19c release or higher.  The issue did not reproduce in 12.2 or 18c environments.
 
CAUSE

This issue is caused by a product defect.
It was investigated in:
     unpublished Bug 30978304 - ORA-20000 DURING IMPDP WITH STATS AND THE UNIQUE INDEX FOR THE PK IS NOT CREATED
Reference:
     Bug 30978304 - ORA-20000 During Data Pump Import While Importing Statistics (Document 30978304.8)

Bug 30978304 - ORA-20000 During Data Pump Import While Importing Statistics (Doc ID 30978304.8)[2]影响的版本还蛮多的,如下截图所示

Bug 30978304的详细描述如下所示:

Description
ORA-20000 error was occurring with Data Pump importing statistics, with certain combinations of indexes.
This has now been fixed.
 
What Happens?
 
After importing a transportable tablespace, extents belonging to an index are
incorrectly marked as unallocated in the tablespace bitmaps. This leads to
objd mismatch asserts because such extents could eventually be allocated to
another object.
 
Conditions
 
The export-side must have the following properties:
 
There is a user-created table with a multi-column PK constraint in the table
DDL. This constraint has a system-generated unique index (say ABC).
There is a user-created unique index (say XYZ) on the same columns as the PK,
but the column ordering differs.
Note that if the column ordering matches, XYZ creation would have failed with
ORA-1408 and this bug wont occur.
 
Fix
 
The fix forces the creation of ABC earlier. This resolves the corruption
 
REDISCOVERY INFORMATION:
 
ORA-20000 occurring while impdp is importing statistics, when two or more indexes exist on a table and
one of them is a primary key index.
 
Additional symptoms:
 
TTS import from a 12.1 DB to 19c corrupts the Tablespace bitmaps which can
result in the following errors being raised for operations on segments
belonging to the Tablespace :
 
1. ORA-8103
2. ORA-600 [kcl_mismatch_1]
3. ORA-600 [kdifind:kcbz_objdchk]
4. ORA-600 [ktrget2:kcbz_objdchk]
5. ORA-600 [ktspffbmb:objdchk_kcbnew_3]
6. ORA-600 [ktspgtb2:kcbz_objdchk]
 
Workaround
None.
 
You can likely get this fix in:
Data Pump Recommended Proactive Patches For 19.10 and Above (Doc ID 2819284.1)

这里记录一下今天遇到的案例,了解一下问题的来龙去脉。

参考资料

[1]

: https://support.oracle.com/epmos/faces/SearchDocDisplay?_adf.ctrl-state=g9qrlq9os_4&_afrLoop=203438157763988

[2]

: https://support.oracle.com/epmos/faces/SearchDocDisplay?_afrLoop=211126172370682&_afrWindowMode=0&_adf.ctrl-state=iqtartzdc_4

标签:index,set,privileges,object,EXPORT,TABLE,ORA,type,SCHEMA
From: https://www.cnblogs.com/kerrycode/p/17527407.html

相关文章

  • vscode打开settings.json方法
    cmd+shift+p,输入settingOpenWorkspaceSettings也会打开UI设置界面;OpenUserSettings(JSON)会打开用户设置settings.json文件;OpenWorkspaceSettings(JSON)会打开工作区设置settings.json文件vscode存在两种设置settings.json的方式UserSettings用户设置:......
  • 为什么Unity使用AssetBundle热更的时候要剔除掉.mainfest文件
    1)为什么Unity使用AssetBundle热更的时候要剔除掉.mainfest文件​2)Addressable热更,断点续传问题3)在线性空间,使用后处理解决UI混合问题这是第341篇UWA技术知识分享的推送,精选了UWA社区的热门话题,涵盖了UWA问答、社区帖子等技术知识点,助力大家更全面地掌握和学习。UWA社区主页:comm......
  • 「Solution Set」7/4
    「SDOI/SXOI2022」无处存储链加链求和。考虑先搞出随机撒点,然后建虚树,这样比较好维护一点。然后就是正常的整块打tag,散块暴力加之类的。我写的好麻烦/kk「LibreOJRound#11」MisakaNetwork与Accelerator我们考虑暴力2-SAT,最多要连\(O(n^2)\)条边,时间空间都接受不......
  • nohup、setsid 与 disown 的不同之处【转】
    nohup、setsid与disown都可以用来让需要长期运行的程序在退出终端后继续在后台运行。然而它们实现这一目的的原理不同,因此使用起来也有一些不同。  退出终端时发生了什么  让我们先看看终端退出时发生什么:  当终端被挂断或伪终端程序被关掉,若终端的CLO......
  • 「Solution Set」7/3
    P4433[COCI2009-2010#1]ALADIN我们发现就是区间加一个等差数列,但是要取模后的。我们考虑加一个首项为\(A\),公差为\(B\),项数为\(n\)的等差数列,还要对\(C\)取模。那么和就是这样的:\(\sum\limits_{i=0}^{n-1}Bi+A-\lfloor\frac{Bi+A}{C}\rfloor\timesC\)然后前面两......
  • 【cs 50】lab4 & problemset4 -ing
    (1)lab4-Smileyhelpers.c#include"helpers.h"voidcolorize(intheight,intwidth,RGBTRIPLEimage[height][width]){//Changeallblackpixelstoacolorofyourchoosingfor(inti=0;i<height;++i){for(intj=0;j<width;++......
  • Inno setup 脚本判断 Microsoft Visual C++ Redistributable 不同版本区别
    有个需要是需要在安装包安装初始化时安装MicrosoftVisualc++2013Redistributable也就是判断软件安装前需不需要运行vcredist_x64.exe和VC_redist.x64.exe这两个程序第一反应就是可以通过注册表判断是否已经安装过环境但测试发现需求的两个版本不同,注册表位置竟然也不......
  • superset(二)基本使用详细示例以及superset权限控制介绍
    Superset系列文章superset(一)详细部署步骤(python3.7.15、windows11)及验证异常处理superset(二)基本使用详细示例以及superset权限控制介绍(文章目录)本文简单的介绍了superset的基本使用步骤的示例,以及superset的权限控制。本文部分数据来源于互联网。本文分为2个部分,即通......
  • django.db.models.query.QuerySet格式的数据输出
    1、deffindmtm2(request):importserializerimportjson#多对多跨表正向查询#res=softlist.objects.filter(hostlists__ip="10.116.6.177").values("softname")res2=softlist.objects.filter(hostlists__ip="10.116.9.233"......
  • ERROR in static/js/*** from UglifyJs Unexpected token: punc (,) [./~/@vant/poppe
     今天打包的时候发现这样的问题,解决方式:找到webpack.base.conf.js文件,加入下边的代码: {test:/\.mjs$/,loader:"babel-loader",include:[resolve("node_modules/@vant/popperjs/dist/index.esm.mjs")]},......