資料遷移出現ORA-39083, ORA-01403,ORA-01403
今天安裝windows系統下的oracle資料庫,版本是11.2.0.1.0在,從linux系統的11.2.0.4.0版本的資料庫匯出,匯入至windows系統下的oracle資料庫下的出現報錯:
———————————————————————————————————————————————————
ORA-39083: 物件型別 INDEX_STATISTICS 建立失敗, 出現錯誤:
ORA-01403: 未找到任何資料
ORA-01403: 未找到任何資料
失敗的 sql 為:
DECLARE I_N VARCHAR2(60); I_O VARCHAR2(60); c DBMS_METADATA.T_VAR_COLL; df varchar2(21) := 'YYYY-MM-DD:HH24:MI:SS'; BEGIN DELETE FROM "SYS"."IMPDP_STATS"; c(1) := DBMS_METADATA.GET_STAT_COLNAME('HAPPYLIFE2','HS_ASSOCIATIONS','''''',NULL,0); DBMS_METADATA.GET_STAT_INDNAME('HAPPYLIFE2','HS_ASSOCIATIONS',c,1,i_o,i_n); INSERT INTO "SYS"."IMPDP_STATS" (type,version,flags,c1,
ORA-39083: 物件型別 INDEX_STATISTICS 建立失敗, 出現錯誤:
ORA-01403: 未找到任何資料
ORA-01403: 未找到任何資料
失敗的 sql 為:
DECLARE I_N VARCHAR2(60); I_O VARCHAR2(60); c DBMS_METADATA.T_VAR_COLL; df varchar2(21) := 'YYYY-MM-DD:HH24:MI:SS'; BEGIN DELETE FROM "SYS"."IMPDP_STATS"; c(1) := DBMS_METADATA.GET_STAT_COLNAME('HAPPYLIFE2','HS_BODEF_PROP','''''',NULL,0); DBMS_METADATA.GET_STAT_INDNAME('HAPPYLIFE2','HS_BODEF_PROP',c,1,i_o,i_n); INSERT INTO "SYS"."IMPDP_STATS" (type,version,flags,c1,c2,c
ORA-39083: 物件型別 INDEX_STATISTICS 建立失敗, 出現錯誤:
ORA-01403: 未找到任何資料
ORA-01403: 未找到任何資料
失敗的 sql 為:
DECLARE I_N VARCHAR2(60); I_O VARCHAR2(60); c DBMS_METADATA.T_VAR_COLL; df varchar2(21) := 'YYYY-MM-DD:HH24:MI:SS'; BEGIN DELETE FROM "SYS"."IMPDP_STATS"; c(1) := DBMS_METADATA.GET_STAT_COLNAME('HAPPYLIFE2','HS_FIELD_GROUP','''''',NULL,0); DBMS_METADATA.GET_STAT_INDNAME('HAPPYLIFE2','HS_FIELD_GROUP',c,1,i_o,i_n); INSERT INTO "SYS"."IMPDP_STATS" (type,version,flags,c1,c2
ORA-39083: 物件型別 INDEX_STATISTICS 建立失敗, 出現錯誤:
ORA-01403: 未找到任何資料
ORA-01403: 未找到任何資料
失敗的 sql 為:
DECLARE I_N VARCHAR2(60); I_O VARCHAR2(60); c DBMS_METADATA.T_VAR_COLL; df varchar2(21) := 'YYYY-MM-DD:HH24:MI:SS'; BEGIN DELETE FROM "SYS"."IMPDP_STATS"; c(1) := DBMS_METADATA.GET_STAT_COLNAME('HAPPYLIFE2','HS_SOLUTION_ACL','''''',NULL,0); DBMS_METADATA.GET_STAT_INDNAME('HAPPYLIFE2','HS_SOLUTION_ACL',c,1,i_o,i_n); INSERT INTO "SYS"."IMPDP_STATS" (type,version,flags,c1,
ORA-39083: 物件型別 INDEX_STATISTICS 建立失敗, 出現錯誤:
ORA-01403: 未找到任何資料
ORA-01403: 未找到任何資料
失敗的 sql 為:
DECLARE I_N VARCHAR2(60); I_O VARCHAR2(60); c DBMS_METADATA.T_VAR_COLL; df varchar2(21) := 'YYYY-MM-DD:HH24:MI:SS'; BEGIN DELETE FROM "SYS"."IMPDP_STATS"; c(1) := DBMS_METADATA.GET_STAT_COLNAME('HAPPYLIFE2','HS_UDB_LOG','''''',NULL,0); DBMS_METADATA.GET_STAT_INDNAME('HAPPYLIFE2','HS_UDB_LOG',c,1,i_o,i_n); INSERT INTO "SYS"."IMPDP_STATS" (type,version,flags,c1,c2,c3,c5,n
ORA-39083: 物件型別 INDEX_STATISTICS 建立失敗, 出現錯誤:
ORA-01403: 未找到任何資料
ORA-01403: 未找到任何資料
失敗的 sql 為:
DECLARE I_N VARCHAR2(60); I_O VARCHAR2(60); c DBMS_METADATA.T_VAR_COLL; df varchar2(21) := 'YYYY-MM-DD:HH24:MI:SS'; BEGIN DELETE FROM "SYS"."IMPDP_STATS"; c(1) := DBMS_METADATA.GET_STAT_COLNAME('HAPPYLIFE2','HS_DISPLAY_LAYOUT','''''',NULL,0); DBMS_METADATA.GET_STAT_INDNAME('HAPPYLIFE2','HS_DISPLAY_LAYOUT',c,1,i_o,i_n); INSERT INTO "SYS"."IMPDP_STATS" (type,version,flags
ORA-39083: 物件型別 INDEX_STATISTICS 建立失敗, 出現錯誤:
ORA-01403: 未找到任何資料
ORA-01403: 未找到任何資料
失敗的 sql 為:
DECLARE I_N VARCHAR2(60); I_O VARCHAR2(60); c DBMS_METADATA.T_VAR_COLL; df varchar2(21) := 'YYYY-MM-DD:HH24:MI:SS'; BEGIN DELETE FROM "SYS"."IMPDP_STATS"; c(1) := DBMS_METADATA.GET_STAT_COLNAME('HAPPYLIFE2','HS_EMAIL_TEMPLATE','''''',NULL,0); DBMS_METADATA.GET_STAT_INDNAME('HAPPYLIFE2','HS_EMAIL_TEMPLATE',c,1,i_o,i_n); INSERT INTO "SYS"."IMPDP_STATS" (type,version,flags
ORA-39083: 物件型別 INDEX_STATISTICS 建立失敗, 出現錯誤:
ORA-01403: 未找到任何資料
ORA-01403: 未找到任何資料
失敗的 sql 為:
DECLARE I_N VARCHAR2(60); I_O VARCHAR2(60); c DBMS_METADATA.T_VAR_COLL; df varchar2(21) := 'YYYY-MM-DD:HH24:MI:SS'; BEGIN DELETE FROM "SYS"."IMPDP_STATS"; c(1) := DBMS_METADATA.GET_STAT_COLNAME('HAPPYLIFE2','HS_GLOBAL_SCRIPT','''''',NULL,0); DBMS_METADATA.GET_STAT_INDNAME('HAPPYLIFE2','HS_GLOBAL_SCRIPT',c,1,i_o,i_n); INSERT INTO "SYS"."IMPDP_STATS" (type,version,flags,c
ORA-39083: 物件型別 INDEX_STATISTICS 建立失敗, 出現錯誤:
ORA-01403: 未找到任何資料
ORA-01403: 未找到任何資料
失敗的 sql 為:
DECLARE I_N VARCHAR2(60); I_O VARCHAR2(60); c DBMS_METADATA.T_VAR_COLL; df varchar2(21) := 'YYYY-MM-DD:HH24:MI:SS'; BEGIN DELETE FROM "SYS"."IMPDP_STATS"; c(1) := DBMS_METADATA.GET_STAT_COLNAME('HAPPYLIFE2','HS_LOCALE_OBJECT','''''',NULL,0); DBMS_METADATA.GET_STAT_INDNAME('HAPPYLIFE2','HS_LOCALE_OBJECT',c,1,i_o,i_n); INSERT INTO "SYS"."IMPDP_STATS" (type,version,flags,c
ORA-39083: 物件型別 INDEX_STATISTICS 建立失敗, 出現錯誤:
ORA-01403: 未找到任何資料
ORA-01403: 未找到任何資料
失敗的 sql 為:
DECLARE I_N VARCHAR2(60); I_O VARCHAR2(60); c DBMS_METADATA.T_VAR_COLL; df varchar2(21) := 'YYYY-MM-DD:HH24:MI:SS'; BEGIN DELETE FROM "SYS"."IMPDP_STATS"; c(1) := DBMS_METADATA.GET_STAT_COLNAME('HAPPYLIFE2','HS_SOLUTION','''''',NULL,0); DBMS_METADATA.GET_STAT_INDNAME('HAPPYLIFE2','HS_SOLUTION',c,1,i_o,i_n); INSERT INTO "SYS"."IMPDP_STATS" (type,version,flags,c1,c2,c3,c5
ORA-39083: 物件型別 INDEX_STATISTICS 建立失敗, 出現錯誤:
ORA-01403: 未找到任何資料
ORA-01403: 未找到任何資料
失敗的 sql 為:
DECLARE I_N VARCHAR2(60); I_O VARCHAR2(60); c DBMS_METADATA.T_VAR_COLL; df varchar2(21) := 'YYYY-MM-DD:HH24:MI:SS'; BEGIN DELETE FROM "SYS"."IMPDP_STATS"; c(1) := DBMS_METADATA.GET_STAT_COLNAME('HAPPYLIFE2','HS_SOL_VERSION','''''',NULL,0); DBMS_METADATA.GET_STAT_INDNAME('HAPPYLIFE2','HS_SOL_VERSION',c,1,i_o,i_n); INSERT INTO "SYS"."IMPDP_STATS" (type,version,flags,c1,c2
ORA-39083: 物件型別 INDEX_STATISTICS 建立失敗, 出現錯誤:
ORA-01403: 未找到任何資料
ORA-01403: 未找到任何資料
失敗的 sql 為:
DECLARE I_N VARCHAR2(60); I_O VARCHAR2(60); c DBMS_METADATA.T_VAR_COLL; df varchar2(21) := 'YYYY-MM-DD:HH24:MI:SS'; BEGIN DELETE FROM "SYS"."IMPDP_STATS"; c(1) := DBMS_METADATA.GET_STAT_COLNAME('HAPPYLIFE2','HS_SOL_VERSION_XML','''''',NULL,0); DBMS_METADATA.GET_STAT_INDNAME('HAPPYLIFE2','HS_SOL_VERSION_XML',c,1,i_o,i_n); INSERT INTO "SYS"."IMPDP_STATS" (type,version,fla
ORA-39083: 物件型別 INDEX_STATISTICS 建立失敗, 出現錯誤:
ORA-01403: 未找到任何資料
ORA-01403: 未找到任何資料
失敗的 sql 為:
DECLARE I_N VARCHAR2(60); I_O VARCHAR2(60); c DBMS_METADATA.T_VAR_COLL; df varchar2(21) := 'YYYY-MM-DD:HH24:MI:SS'; BEGIN DELETE FROM "SYS"."IMPDP_STATS"; c(1) := DBMS_METADATA.GET_STAT_COLNAME('HAPPYLIFE2','HS_STATE','''''',NULL,0); DBMS_METADATA.GET_STAT_INDNAME('HAPPYLIFE2','HS_STATE',c,1,i_o,i_n); INSERT INTO "SYS"."IMPDP_STATS" (type,version,flags,c1,c2,c3,c5,n1,n2
ORA-39083: 物件型別 INDEX_STATISTICS 建立失敗, 出現錯誤:
ORA-01403: 未找到任何資料
ORA-01403: 未找到任何資料
失敗的 sql 為:
DECLARE I_N VARCHAR2(60); I_O VARCHAR2(60); c DBMS_METADATA.T_VAR_COLL; df varchar2(21) := 'YYYY-MM-DD:HH24:MI:SS'; BEGIN DELETE FROM "SYS"."IMPDP_STATS"; c(1) := DBMS_METADATA.GET_STAT_COLNAME('HAPPYLIFE2','HS_STATEFLOW','''''',NULL,0); DBMS_METADATA.GET_STAT_INDNAME('HAPPYLIFE2','HS_STATEFLOW',c,1,i_o,i_n); INSERT INTO "SYS"."IMPDP_STATS" (type,version,flags,c1,c2,c3,
ORA-39083: 物件型別 INDEX_STATISTICS 建立失敗, 出現錯誤:
ORA-01403: 未找到任何資料
ORA-01403: 未找到任何資料
失敗的 sql 為:
DECLARE I_N VARCHAR2(60); I_O VARCHAR2(60); c DBMS_METADATA.T_VAR_COLL; df varchar2(21) := 'YYYY-MM-DD:HH24:MI:SS'; BEGIN DELETE FROM "SYS"."IMPDP_STATS"; c(1) := DBMS_METADATA.GET_STAT_COLNAME('HAPPYLIFE2','HS_STATEFLOW_OBJECT','''''',NULL,0); DBMS_METADATA.GET_STAT_INDNAME('HAPPYLIFE2','HS_STATEFLOW_OBJECT',c,1,i_o,i_n); INSERT INTO "SYS"."IMPDP_STATS" (type,version,f
ORA-39083: 物件型別 INDEX_STATISTICS 建立失敗, 出現錯誤:
ORA-01403: 未找到任何資料
ORA-01403: 未找到任何資料
失敗的 sql 為:
DECLARE I_N VARCHAR2(60); I_O VARCHAR2(60); c DBMS_METADATA.T_VAR_COLL; df varchar2(21) := 'YYYY-MM-DD:HH24:MI:SS'; BEGIN DELETE FROM "SYS"."IMPDP_STATS"; c(1) := DBMS_METADATA.GET_STAT_COLNAME('HAPPYLIFE2','HS_TEXT_BLOB','''''',NULL,0); DBMS_METADATA.GET_STAT_INDNAME('HAPPYLIFE2','HS_TEXT_BLOB',c,1,i_o,i_n); INSERT INTO "SYS"."IMPDP_STATS" (type,version,flags,c1,c2,c3,
ORA-39083: 物件型別 INDEX_STATISTICS 建立失敗, 出現錯誤:
ORA-01403: 未找到任何資料
ORA-01403: 未找到任何資料
失敗的 sql 為:
DECLARE I_N VARCHAR2(60); I_O VARCHAR2(60); c DBMS_METADATA.T_VAR_COLL; df varchar2(21) := 'YYYY-MM-DD:HH24:MI:SS'; BEGIN DELETE FROM "SYS"."IMPDP_STATS"; c(1) := DBMS_METADATA.GET_STAT_COLNAME('HAPPYLIFE2','HS_TRANSITION','''''',NULL,0); DBMS_METADATA.GET_STAT_INDNAME('HAPPYLIFE2','HS_TRANSITION',c,1,i_o,i_n); INSERT INTO "SYS"."IMPDP_STATS" (type,version,flags,c1,c2,c
ORA-39083: 物件型別 INDEX_STATISTICS 建立失敗, 出現錯誤:
ORA-01403: 未找到任何資料
ORA-01403: 未找到任何資料
失敗的 sql 為:
DECLARE I_N VARCHAR2(60); I_O VARCHAR2(60); c DBMS_METADATA.T_VAR_COLL; df varchar2(21) := 'YYYY-MM-DD:HH24:MI:SS'; BEGIN DELETE FROM "SYS"."IMPDP_STATS"; c(1) := DBMS_METADATA.GET_STAT_COLNAME('HAPPYLIFE2','HS_UDB_INFO','''''',NULL,0); DBMS_METADATA.GET_STAT_INDNAME('HAPPYLIFE2','HS_UDB_INFO',c,1,i_o,i_n); INSERT INTO "SYS"."IMPDP_STATS" (type,version,flags,c1,c2,c3,c5
ORA-39083: 物件型別 INDEX_STATISTICS 建立失敗, 出現錯誤:
ORA-01403: 未找到任何資料
ORA-01403: 未找到任何資料
失敗的 sql 為:
DECLARE I_N VARCHAR2(60); I_O VARCHAR2(60); c DBMS_METADATA.T_VAR_COLL; df varchar2(21) := 'YYYY-MM-DD:HH24:MI:SS'; BEGIN DELETE FROM "SYS"."IMPDP_STATS"; c(1) := DBMS_METADATA.GET_STAT_COLNAME('HAPPYLIFE2','HS_USERDB','''''',NULL,0); DBMS_METADATA.GET_STAT_INDNAME('HAPPYLIFE2','HS_USERDB',c,1,i_o,i_n); INSERT INTO "SYS"."IMPDP_STATS" (type,version,flags,c1,c2,c3,c5,n1,
處理物件型別 SCHEMA_EXPORT/VIEW/VIEW
處理物件型別 SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
————————————————————————————————
在網上導了這樣的帖子,挺有有用的轉載一下:
前幾天幫助客戶做了一次資料庫匯出,匯出語句如下:
EXPDP SYSTEM/PASSWORD DIRECTORY=DUMP DUMPFILE=CRM20.DMP LOGFILE=CRM20_EXPDP.LOG SCHEMAS=CRM20
匯出是成功的。
導完後丟給了客戶,因為他們建了一個測試庫,需要這個使用者的資料。
但是,過了幾天客戶反映匯入報錯,如下:
ORA-39083: 物件型別 INDEX_STATISTICS 建立失敗, 出現錯誤:
ORA-01403: 未找到資料
ORA-01403: 未找到資料
失敗的 sql 為:
DECLARE IND_NAME VARCHAR2(60); IND_OWNER VARCHAR2(60); BEGIN DELETE FROM "SYS"."IMPDP_STATS"; SELECT index_name, index_owner INTO IND_NAME, IND_OWNER
FROM (SELECT UNIQUE sgc1.index_name, sgc1.index_owner,
COUNT(*) mycount
FROM sys.ku$_find_sgc_view sgc1,
TABLE (sgc1.col_list) mycol
跑過去一看,其匯入的資料庫版本是10.2.0.1 for windows2003 64bit,但是我匯出的資料庫版本是10.2.0.4 for RHEL AS 5 64bit,便輕率地下了一個結論:資料庫版本差異導致了這個問題。
以為客戶換個版本的資料庫就完了,正常了。結果客戶在10.2.0.4 for AIX5 64bit上問題依舊。
懵了!
開始認真對待---因為客戶也認真了!
網上搜了幾個帖子,沒什麼幫助。關鍵時刻,還得metalink出擊!
於是,懷著試試看的態度,在metalink上搜了一把,收穫真大了去了---BUG:6156708!
有種說不出來的喜悅,可以給客戶交代了,在給客戶交代之前,說下這個BUG:6156708:
#############################################################################
Applies to: Oracle Server - Enterprise Edition - Version: 10.2.0.3 to 11.1.0.6 - Release: 10.2 to 11.1
Information in this document applies to any platform.
SymptomsA DataPump import using the parameter REMAP_SCHEMA reports errors ORA-39083 and ORA-1403 while importing index statistics:
ORA-39083: Object type INDEX_STATISTICS failed to create with error:
ORA-01403: no data found
ORA-01403: no data found
Failing sql is:
DECLARE IND_NAME VARCHAR2(60); IND_OWNER VARCHAR2(60); BEGIN DELETE FROM
"SYS"."IMPDP_STATS"; SELECT index_name, index_owner INTO IND_NAME, IND_OWNER
FROM (SELECT UNIQUE sgc1.index_name, sgc1.index_owner,
COUNT(*) mycount
FROM sys.ku$_find_sgc_view sgc1,
TABLE (sgc1.col_list) myc
CauseHere are the steps to reproduce the issue:
1. Create a table under "TEST0" schema:
$ sqlplus test0/test0
DROP TABLE TEST0 PURGE;
CREATE TABLE TEST0
(
COL1 NUMBER NOT NULL,
COL2 NUMBER NOT NULL,
COL3 NUMBER NOT NULL
)
TABLESPACE USERS;
ALTER TABLE TEST0 ADD (PRIMARY KEY (COL2, COL1, COL3) USING INDEX TABLESPACE USERS);
CREATE INDEX TEST0INDEX ON TEST0 (COL3, COL1, COL2) TABLESPACE USERS;
select object_name, object_type from user_objects;
OBJECT_NAME OBJECT_TYPE
------------------------------ -------------------
TEST0 TABLE
SYS_C009845 INDEX <-- Index associated with PK constraint.
TEST0INDEX INDEX
2. Collect statistics for "TEST0" schema.
sqlplus system/{password}
exec dbms_stats.gather_schema_stats('TEST0',cascade => TRUE);
3. Execute the DataPump export an import process to reproduce the problem.
$ expdp system/oracle schemas=test0 dumpfile=test0.dmp
... (completed successfully without warnings)
$ impdp system/oracle remap_schema=test0:test1 dumpfile=test0.dmp
.
.
Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
ORA-39083: Object type INDEX_STATISTICS failed to create with error:
ORA-01403: no data found
ORA-01403: no data found
Failing sql is:
DECLARE IND_NAME VARCHAR2(60); IND_OWNER VARCHAR2(60); BEGIN DELETE FROM "SYS"."IMPDP_STATS";
SELECT index_name, index_owner INTO IND_NAME, IND_OWNER
FROM (SELECT UNIQUE sgc1.index_name, sgc1.index_owner,
COUNT(*) mycount
FROM sys.ku$_find_sgc_view sgc1,
TABLE (sgc1.col_list) myc
Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Processing object type SCHEMA_EXPORT/POST_SCHEMA/PROCACT_SCHEMA
4.) Open a sqlplus session to check objects created for the import process under "TEST1" schema.
$ sqlplus test1/{password}
col object_name for a30
SELECT OBJECT_NAME, OBJECT_TYPE FROM USER_OBJECTS;
OBJECT_NAME OBJECT_TYPE
------------------------------ -------------------
TEST0 TABLE
TEST0INDEX INDEX
One index is missing, for this reason the impdp utility fails importing the statistics associated to that particular missing index. In this case, the problem is generated because expdp utility puts the CREATE INDEX statements in wrong order into the dumpfile. This causes impdp utility to create a primary key constraint using a wrong index (TEST0INDEX).
This behavior is reported in Bug 6156708.
Reference: Bug 6156708 expdp puts the index creation statements into dump in wrong order
Solution1. Use conventional export / import or
2. Do a datapump import excluding indexes, then import indexes.
(Doing that we guarantee that the index associated to the primary key constraints will be created first).
$ impdp system/oracle remap_schema=test0:test1 exclude=index dumpfile=test0.dmp
$ impdp system/oracle remap_schema=test0:test1 include=index dumpfile=test0.dmp
Output of the import process (include=index)
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
The following query can be executed to check the objects created after the import process is completed.
$ sqlplus test1/{password}
col object_name for a30
SELECT OBJECT_NAME, OBJECT_TYPE FROM USER_OBJECTS;
OBJECT_NAME OBJECT_TYPE
------------------------------ -------------------
TEST0 TABLE
SYS_C009868 INDEX
TEST0INDEX INDEX
ReferencesBUG:6156708- EXPDP PUTS THE INDEX CREATION STATEMENTS INTO DUMP IN WRONG ORDER
##########################################################################
童鞋們,看看吧,還說什麼呢!
於是,再次做了一個草率的決定---要求客戶打這個補丁---p6156708_10204_Generic.zip
客戶同意了我的決定,這個補丁打的比較順利,過程如下:
##########################################################################
Patch Installation Steps:
-------------------------
1. Set your current directory to the directory where the patch is located.
cd <PATCH_TOP>/6156708
2. Apply the patch.
Use the following command to apply the patch to the ORACLE_HOME:
opatch apply
When OPatch starts, it will validate the patch and make sure there
are no conflicts with the software already installed in the ORACLE_HOME.
OPatch categorizes two types of conflicts:
(a) Conflicts with a patch already applied to the ORACLE_HOME
In this case, please stop the patch installation and contact
Oracle Support Services.
(b) Conflicts with subset patch already applied to the ORACLE_HOME
In this case, please continue the install, as the new patch
contains all the fixes from the existing patch in the ORACLE_HOME.
The subset patch will automatically be rolled back prior to the
installation of the new patch.
Patch Post Install Instructions:
--------------------------------
After the patch has been applied please reload the package into
the database. To do this connect as SYS and execute the following;
sqlplus "/ as sysdba"
SQL> @?/rdbms/admin/dbmsmeta.sql
SQL> @?/rdbms/admin/dbmsmeti.sql
SQL> @?/rdbms/admin/dbmsmetu.sql
SQL> @?/rdbms/admin/dbmsmetb.sql
SQL> @?/rdbms/admin/dbmsmetd.sql
SQL> @?/rdbms/admin/catmeta.sql
SQL> @?/rdbms/admin/prvtmeta.plb
SQL> @?/rdbms/admin/prvtmeti.plb
SQL> @?/rdbms/admin/prvtmetu.plb
SQL> @?/rdbms/admin/prvtmetb.plb
SQL> @?/rdbms/admin/prvtmetd.plb
SQL> @?/rdbms/admin/catmet2.sql
##########################################################################
面帶悅色的要求客戶再次匯入試試。
當客戶把匯入日誌發給我看的時候,我幾乎瘋了---錯誤依舊!
哎,換個思路,按照常規的方法來診斷解決吧。
首先檢視資料庫告警日誌,有所發現:
Mon Mar 5 22:02:41 2012
GATHER_STATS_JOB encountered errors. Check the trace file.
Mon Mar 5 22:02:41 2012
Errors in file /u01/app/oracle/admin/ocrmpdb/bdump/ocrmpdb_j000_22888.trc:
ORA-20000: index "CRM20"."IDX_RATIONNO_DEALCONFIRM_TEMP" or partition of such index is in unusable state
並且這個錯誤前面也多次出現。
接著檢視相關的跟蹤檔案:
*** 2012-03-05 22:02:41.676
GATHER_STATS_JOB: GATHER_TABLE_STATS('"CRM20"','"TINF_CONFIRM"','""', ...)
ORA-20000: index "CRM20"."IDX_RATIONNO_DEALCONFIRM_TEMP" or partition of such index is in unusable state
索引的狀態為:
select status from dba_indexes where index_name='IDX_RATIONNO_DEALCONFIRM_TEMP';
STATUS
--------
UNUSABLE
於是嘗試手動收集下該表的統計資訊,報出下面的錯誤:
SQL> exec dbms_stats.gather_table_stats('CRM20','TINF_CONFIRM');
BEGIN dbms_stats.gather_table_stats('CRM20','TINF_CONFIRM'); END;
*
ERROR at line 1:
ORA-20000: index "CRM20"."IDX_RATIONNO_DEALCONFIRM_TEMP" or partition of such index isin unusable state
ORA-06512: at "SYS.DBMS_STATS", line 13437
ORA-06512: at "SYS.DBMS_STATS", line 13457
ORA-06512: at line 1
關鍵的,緊急的,救命的時刻,還得metalink出擊---不過查詢的結果有點小失望:
############################################################
CauseIndex is invalid.
Can check that running
select status from dba_objects where object_name = 'INDEX NAME';
SolutionRebuild the index and gather new stats on the related table
Example:
alter index <INDEX NAME> rebuild;
##############################################################
經過客戶的同意,對IDX_RATIONNO_DEALCONFIRM_TEMP索引做了一個rebuild操作:
SQL> alter index "CRM20"."IDX_RATIONNO_DEALCONFIRM_TEMP" rebuild online;
Index altered.
再次檢視索引的狀態,變成了:
SQL> select status from dba_indexes where index_name='IDX_RATIONNO_DEALCONFIRM_TEMP';
STATUS
--------
VALID
手動收集該表的統計資訊也成功了:
SQL> exec dbms_stats.gather_table_stats('CRM20','TINF_CONFIRM');
PL/SQL procedure successfully completed.
再次匯出匯入,正常,萬歲!
低調吧,別再輕易地給出草率的結論了!
《道德經》里老子說的好:
重為輕根,靜為躁君;輕則失本,躁則失君!
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31547066/viewspace-2219147/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Impdp ORA-39083、ORA-01403報錯問題分析解決
- GoldeGate Discard ORA-01403Go
- ORA-01403: no data found For ORACLE 10GOracle 10g
- ORA-01403:no data found 解決方法兩則
- OGG ora-01403錯誤的快捷處理方案
- virtualbox虛擬機器遷移出現"connot find device eth0"錯誤虛擬機dev
- Hadoop資料傳輸:如何將資料移入和移出Hadoop?Hadoop
- 資料泵匯出匯入物化檢視(ORA-39083)
- 資料泵實現資料遷移到異地庫
- ASM檔案移出後的註冊和開啟資料庫ASM資料庫
- 遷移資料.
- windows10怎麼把收納盒的資料夾移出來Windows
- jQuery滑鼠移入移出jQuery
- 快速實現本地資料備份與FTP遠端資料遷移FTP
- 【資料遷移】使用傳輸表空間遷移資料
- 匯入一個有lob型別欄位的表且存在與匯入表同名的同義詞會報ora-01403錯誤型別
- 【遷移】使用rman遷移資料庫資料庫
- Kafka資料遷移Kafka
- 資料庫遷移資料庫
- redis資料遷移Redis
- 轉資料遷移
- ORACLE 資料遷移Oracle
- DXWB 資料遷移
- 資料的遷移
- Harbor資料遷移
- 快速實現地圖遷移資料視覺化地圖視覺化
- Oracle資料庫資料遷移流程Oracle資料庫
- 資料遷移(1)——通過資料泵表結構批量遷移
- 【資料遷移】RMAN遷移資料庫到ASM(三)遷移onlinelog等到ASM資料庫ASM
- 資料遷移方案 + Elasticsearch在綜合搜尋列表實現Elasticsearch
- 利用MongoDB的SplitVector命令實現併發資料遷移MongoDB
- 9i 克隆+data guard 實現資料庫搬遷資料庫
- gitlab資料遷移Gitlab
- 資料庫遷移 :理解資料庫
- Mysql資料遷移方法MySql
- Fastdfs資料遷移方案AST
- 【Redis】 redis資料遷移Redis
- 【Hive】hive資料遷移Hive