ORA-12012、ORA-20000錯誤解決過程
ORA-12012、ORA-20000錯誤解決過程
[testdb]#tail alert_testdb.log
Thu Feb 13 22:00:01 2014
Errors in file /u01/app/oracle/admin/testdb/bdump/testdb_j000_24348.trc:
ORA-12012: error on auto execute of job 8888
ORA-20000: ORA-20000: Content of the tablespace specified is not permanent or tablespace name is invalid
ORA-06512: at "SYS.PRVT_ADVISOR", line 1624
ORA-06512: at "SYS.DBMS_ADVISOR", line 186
ORA-06512: at "SYS.DBMS_SPACE", line 1338
ORA-06512: at "SYS.DBMS_SPACE", line 1554
Thu Feb 13 23:20:26 2014
[testdb]#cat /u01/app/oracle/admin/testdb/bdump/testdb_j000_24348.trc
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining Scoring Engine options
ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1
System name: Linux
Node name: testdb
Release: 2.6.9-67.ELsmp
Version: #1 SMP Wed Nov 7 13:56:44 EST 2007
Machine: x86_64
Instance name: testdb
Redo thread mounted by this instance: 1
Oracle process number: 69
Unix process pid: 18648, image: oracle@testdb (J000)
*** ACTION NAME:(AUTO_SPACE_ADVISOR_JOB) 2014-02-12 22:00:04.285
*** MODULE NAME:(DBMS_SCHEDULER) 2014-02-12 22:00:04.285
*** SERVICE NAME:(SYS$USERS) 2014-02-12 22:00:04.285
*** SESSION ID:(1031.63832) 2014-02-12 22:00:04.285
*** 2014-02-12 22:00:04.285
ORA-12012: error on auto execute of job 8888
ORA-20000: ORA-20000: Content of the tablespace specified is not permanent or tablespace name is invalid
ORA-06512: at "SYS.PRVT_ADVISOR", line 1624
ORA-06512: at "SYS.DBMS_ADVISOR", line 186
ORA-06512: at "SYS.DBMS_SPACE", line 1338
ORA-06512: at "SYS.DBMS_SPACE", line 1554
? 怎麼找出job name
參考文件:How to Find the Job Name if a Scheduled Job Fails with ORA-12012 (文件 ID 744645.1)
首先,ORA-12012: error on auto execute of job 8888中的8888可理解為job id,那麼首先想到dba_jobs中的job,例如:
SQL>select job, what from dba_jobs ;
JOB WHAT
---------- ----------------------------------------------------------
1 EMD_MAINTENANCE.EXECUTE_EM_DBMS_JOB_PROCS();
21 BEGIN MGMT_BSLN.COMPUTE_ALL_STATISTICS;/*DB*/END;
22 BEGIN MGMT_BSLN.SET_ALL_THRESHOLDS;/*DB*/END;
其次,如果dba_jobs中無相關資訊,則要找scheduler相關資訊;如,DBA_SCHEDULER_JOBS,但是該檢視中無job id相關欄位,不好找對應關係;DBMS_SCHEDULER執行的job id是儲存在sys.scheduler$_job下的obj#列的;則,
SQL>select obj# , object_name from sys.scheduler$_job , dba_objects where obj# = object_id;
另外,還可以在指定的trace file中找到job_name;例如檔案中的action name;
[10.6.1.7:testdb]#cat /u01/app/oracle/admin/testdb/bdump/testdb_j000_24348.trc
*** ACTION NAME:(AUTO_SPACE_ADVISOR_JOB) 2014-02-12 22:00:04.285
? ORA-12012、ORA-20000本例原因
由於原有某個表空間不存在,導致在AUTO_SPACE_ADVISOR_JOB執行時報錯,其根本原因是Bug 4707226(需要補丁)
參考文件:AUTO_SPACE_ADVISOR_JOB May Fail With ORA-20000 if Tablespace No Longer Exists (文件 ID 551190.1)
? 解決方法
方法一.建立缺失的表空間,再執行job,然後再刪除表空間
SQL> CREATE TABLESPACE
Run the space advisor:
SQL> EXEC dbms_space.auto_space_advisor_job_proc;
Drop the tablespace again:
SQL> DROP
TABLESPACE
要找到哪個表空間缺失,則需要對比dba_auto_segadv_ctl與dba_tablespaces檢視;
TABLESPACE_NAME(dba_auto_segadv_ctl) TABLESPACE_NAME(dba_tablespaces)
------------------------------ - -----------------------------
SYSAUX SYSTEM
MON813_INDEXES UNDOTBS1
USERS SYSAUX
MON813_TABLES TEMP
MIDDLETBS USERS
MON105_TABLES MON813_TABLES
MON813_INDEXES
MIDDLETBS
方法二、手動remove相關檢視中相關記錄;(未驗證)
原文:Workaround
Manually remove the tablespace candidate from DBA_AUTO_SEGADV_CTL.
SQL> DELETE FROM dba_auto_segadv_ctl where tablespace_name not in (select tablespace_name from dba_tablespaces);
/
SQL>desc dbms_metadata
FUNCTION GET_DDL RETURNS CLOB
Argument Name Type In/Out Default?
------------------------------ ----------------------- ------ --------
OBJECT_TYPE VARCHAR2 IN
NAME VARCHAR2 IN
SCHEMA VARCHAR2 IN DEFAULT
VERSION VARCHAR2 IN DEFAULT
MODEL VARCHAR2 IN DEFAULT
TRANSFORM VARCHAR2 IN DEFAULT
SQL> set long 5000
SQL> SELECT dbms_metadata.get_ddl('VIEW','DBA_AUTO_SEGADV_CTL') A FROM DUAL;
A
--------------------------------------------------------------------------------
CREATE OR REPLACE FORCE VIEW "SYS"."DBA_AUTO_SEGADV_CTL" ("AUTO_TASKID", "TABLESPACE_NAME", "SEGMENT_OWNER", "SEGMENT_NAME", "SEGMENT_TYPE", "PARTITION_NAME", "STATUS", "REASON", "REASON_VALUE", "CREATION_TIME", "PROCESSED_TASKID", "END_TIME") AS
select stats.auto_taskid, stats.tablespace_name, stats.segment_owner,
stats.segment_name, stats.segment_type, stats.partition_name,
stats.status, stats.reason, stats.reason_value,
stats.creation_time, stats.proc_taskid, stats.end_time
from wri$_segadv_objlist stats
方法三、打補丁
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/16976507/viewspace-1266115/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 一個 ExpressionChangedAfterItHasBeenCheckedError 錯誤的解決過程ExpressError
- ORA-2049錯誤解決過程
- ORA-600(17069)錯誤的解決過程
- tensorflow安裝使用過程錯誤及解決方法
- sql server資料庫附加錯誤的解決過程SQLServer資料庫
- 解決儲存過程擷取錯誤的問題儲存過程
- 解決ORA-600(16164)錯誤的過程(二)
- 解決ORA-600(16164)錯誤的過程(一)
- ORA-30012錯誤的解決過程
- 掉電引起的ORA-1172錯誤解決過程(二)
- 掉電引起的ORA-1172錯誤解決過程(一)
- 掉電引起的ORA-1172錯誤解決過程(三)
- 11g rac 安裝過程中常見錯誤解決辦法
- Windows 下 Laravel Mix 資源編譯過程以及產生的錯誤解決WindowsLaravel編譯
- nvidia驅動安裝過程中報已有nouveau驅動錯誤解決
- ORA-03113 +0RA-07445 錯誤的痛苦解決過程
- ORA-03113 +0RA-07445 錯誤的痛苦解決過程
- 手動建庫過程錯誤
- Ocelot錯誤解決
- 安裝sysbench過程報錯,解決辦法
- Oracle 11.2.0.3 ORA-12012 ORA-29280 ORA-06512 錯誤 解決方法Oracle
- VIM 常用錯誤解決
- sqldeveloper for windows 錯誤解決SQLDeveloperWindows
- Idea開發JAVA過程中遇到的錯誤集合以及解決方法,持續更新IdeaJava
- Adobe 系列安裝過程中出現錯誤程式碼107解決方法
- 一次刪除歸檔遇ORA-15028錯誤的解決過程
- ORA-20000的解決方法
- 【轉】Oracle 11.2.0.3 ORA-12012 ORA-29280 ORA-06512 錯誤解決方法Oracle
- exp/imp出現錯誤通過expdp/impdp來解決
- 在使用Kafka過程中遇到的錯誤Kafka
- vsftpd 錯誤:530 and 500 錯誤解決方法FTP
- 應用儲存過程執行報錯解決方案儲存過程
- mysql ab主從複製出錯及解決過程MySql
- latex 錯誤以及解決方案
- ora-27504錯誤解決
- Datastore error in 'dirbdb'錯誤解決ASTError
- ORA-27054 錯誤解決
- mysql與php錯誤解決MySqlPHP