首页 » ORACLE 9i-23ai » Troubleshooting ORA-12012&ORA-29283&ORA-06512 issue

Troubleshooting ORA-12012&ORA-29283&ORA-06512 issue

数据库ALERT 中发现了下面的问题,简单的记录

# DB ALERT LOG

ORA-12012: error on auto execute of job “ORACLE_OCM”.”MGMT_CONFIG_JOB_2_2″
ORA-29283: invalid file operation
ORA-06512: at “SYS.UTL_FILE”, line 536
ORA-29283: invalid file operation
ORA-06512: at “ORACLE_OCM.MGMT_DB_LL_METRICS”, line 2436
ORA-06512: at line 1

sql>@jobs

JOB_NAME                                 PROGRAM_NAME                             JOBS_STATE      START_DATE       NEXT_RUN_DATE    ENABL
---------------------------------------- ---------------------------------------- --------------- ---------------- ---------------- -----
...
MGMT_STATS_CONFIG_JOB                                                             SCHEDULED       2014-12-30 17:49 2015-06-01 01:01 TRUE
MGMT_CONFIG_JOB                                                                   SCHEDULED                                         TRUE
...


SQL> select owner,job_name from dba_scheduler_jobs where job_name='MGMT_CONFIG_JOB';

OWNER                          JOB_NAME
------------------------------ ------------------------------
ORACLE_OCM                     MGMT_CONFIG_JOB


SQL> select status,ACTUAL_START_DATE,ADDITIONAL_INFO from DBA_SCHEDULER_JOB_RUN_DEtails where rownum<5 and JOB_NAME='MGMT_CONFIG_JOB_2_1';

STATUS                         ACTUAL_START_DATE
------------------------------ ---------------------------------------------------------------------------
ADDITIONAL_INFO
-------------------------------------------------------------------------------------------------------------------
FAILED                         27-APR-15 10.00.09.926565 PM +08:00
ORA-29283: invalid file operation
ORA-06512: at "SYS.UTL_FILE", line 536
ORA-29283: invalid file operation
ORA-06512: at "ORACLE_OCM.MGMT_DB_LL_METRICS", line 2436
ORA-06512: at line 1

FAILED                         29-APR-15 10.00.07.070978 PM +08:00
ORA-29283: invalid file operation
ORA-06512: at "SYS.UTL_FILE", line 536
ORA-29283: invalid file operation
ORA-06512: at "ORACLE_OCM.MGMT_DB_LL_METRICS", line 2436
ORA-06512: at line 1

FAILED                         22-APR-15 10.00.02.460150 PM +08:00
ORA-29283: invalid file operation
ORA-06512: at "SYS.UTL_FILE", line 536
ORA-29283: invalid file operation
ORA-06512: at "ORACLE_OCM.MGMT_DB_LL_METRICS", line 2436
ORA-06512: at line 1

FAILED                         26-APR-15 06.00.02.422695 AM +08:00
ORA-29283: invalid file operation
ORA-06512: at "SYS.UTL_FILE", line 536
ORA-29283: invalid file operation
ORA-06512: at "ORACLE_OCM.MGMT_DB_LL_METRICS", line 2436
ORA-06512: at line 1

SQL>  select * from dba_directories where DIRECTORY_NAME like '%OCM_CONFIG%';

OWNER                          DIRECTORY_NAME
------------------------------ ------------------------------
DIRECTORY_PATH
------------------------------------------------------------------
SYS                            ORACLE_OCM_CONFIG_DIR
/oracle/app/oracle/product/11.2.0.3/dbhome_1/ccr/state


oracle@anbob2:/home/oracle/scifmation/scripts> $ORACLE_HOME/ccr/bin/deployPackages -l
/usr/bin/ksh: /oracle/app/oracle/product/11.2.0.3/dbhome_1/ccr/bin/deployPackages: cannot execute


oracle@anbob2:/oracle/app/oracle/product/11.2.0.3/dbhome_1/ccr/bin> ll
total 286
-rw-r--r--   1 oracle     oinstall      3539 Apr 14 17:45 OCMJarUtil.class
-rw-------   1 oracle     oinstall     46199 Apr 14 17:45 deployPackages
-rwx------   1 oracle     oinstall      5881 Apr 14 17:45 emSnapshotEnv
-rwx------   1 oracle     oinstall      9063 Apr 14 17:45 emocmrsp
-rwx------   1 oracle     oinstall      6116 Apr 14 17:45 lockfile
-rwxr-----   1 oracle     oinstall      1630 Apr 14 17:45 ocmJarUtil
-rwx------   1 oracle     oinstall     70250 Apr 14 17:45 setupCCR
-rw-r--r--   1 oracle     oinstall       903 Apr 14 17:45 strip_path.awk

oracle@anbob2:/oracle/app/oracle/product/11.2.0.3/dbhome_1/ccr/bin> chmod +x deployPackages

oracle@anbob2:/oracle/app/oracle/product/11.2.0.3/dbhome_1/ccr/bin> deployPackages -l
The Oracle Configuration Manager state/writeable directory structure is incomplete.
OCM is not configured for this host or ORACLE_CONFIG_HOME. Please configure OCM first.

Solution:

1, 禁用

SQL> create or replace procedure oracle_ocm.disjob
  2  is
  3  begin
  4    DBMS_SCHEDULER.disable (name => 'MGMT_CONFIG_JOB');
  5  end;
  6  /

Procedure created.

SQL> exec oracle_ocm.disjob;

PL/SQL procedure successfully completed.

TIP:
如果直接用非job owner 的用户名执行会报下面的错误
SQL> exec DBMS_SCHEDULER.disable (name => ‘MGMT_CONFIG_JOB’);
BEGIN DBMS_SCHEDULER.disable (name => ‘MGMT_CONFIG_JOB’); END;

*
ERROR at line 1:
ORA-27476: “SYS.MGMT_CONFIG_JOB” does not exist
ORA-06512: at “SYS.DBMS_ISCHED”, line 4407
ORA-06512: at “SYS.DBMS_SCHEDULER”, line 2737
ORA-06512: at line 1

OR

修复OCM 参考 MOS 1615561.1

Connect as sysdba

SQL> @ORACLE_HOME/ccr/admin/scripts/ocmjb10.sql
SQL> @ORACLE_HOME/ccr/admin/scripts/execute execocm.sql
Depending on OCM and/or Oracle Databases releases the scripts location may change.
Example:
SQL> @ORACLE_HOME/rdbms/admin/ocmjb10.sql
SQL> @ORACLE_HOME/rdbms/admin/execocm.sql
打赏

对不起,这篇文章暂时关闭评论。