当前位置: 代码迷 >> Oracle开发 >> oracle导一个库失败后 全部用户都不能删了
  详细解决方案

oracle导一个库失败后 全部用户都不能删了

热度:135   发布时间:2016-04-24 06:31:40.0
oracle导一个库失败后 所有用户都不能删了
报00604 20000 06512错误
我怀疑哪个系统表被删掉了 
trace文件怎么看呀  看不懂

TKPROF: Release 10.2.0.1.0 - Production on 星期三 1月 7 18:26:29 2015

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Trace file: E:\admin\orcl\udump\orcl_ora_5904.trc
Sort options: default

********************************************************************************
count    = number of times OCI procedure was executed
cpu      = cpu time in seconds executing 
elapsed  = elapsed time in seconds executing
disk     = number of physical reads of buffers from disk
query    = number of buffers gotten for consistent read
current  = number of buffers gotten in current mode (usually for update)
rows     = number of rows processed by the fetch or execute call
********************************************************************************

The following statement encountered a error during parse:

select count(*) from mdsys.rdf_rulebase$ where owner = :

Error encountered: ORA-00942
********************************************************************************

error connecting to database using: sys/orcl@limit
ORA-28009: connection as SYS should be as SYSDBA or SYSOPER

EXPLAIN PLAN option disabled.
********************************************************************************

BEGIN
  BEGIN
    IF (xdb.DBMS_XDBZ0.is_hierarchy_enabled_internal(sys.dictionary_obj_owner, sys.dictionary_obj_name, sys.dictionary_obj_owner)) THEN
      xdb.XDB_PITRIG_PKG.pitrig_truncate(sys.dictionary_obj_owner, sys.dictionary_obj_name);
    END IF;
  EXCEPTION
    WHEN OTHERS THEN
     null;
  END;
  BEGIN
    IF (xdb.DBMS_XDBZ0.is_hierarchy_enabled_internal(sys.dictionary_obj_owner, sys.dictionary_obj_name, sys.dictionary_obj_owner, xdb.DBMS_XDBZ.IS_ENABLED_RESMETADATA)) THEN
      xdb.XDB_PITRIG_PKG.pitrig_dropmetadata(sys.dictionary_obj_owner, sys.dictionary_obj_name);
    END IF;
  EXCEPTION
    WHEN OTHERS THEN
     null;
  END;
END;

call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        1      0.00       0.00          0          0          0           0
Execute      1      0.01       0.01          0          0          0           1
Fetch        0      0.00       0.00          0          0          0           0
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total        2      0.01       0.01          0          0          0           1

Misses in library cache during parse: 0
Optimizer mode: ALL_ROWS
Parsing user id: 38     (recursive depth: 1)
********************************************************************************

SELECT USER_ID 
FROM
 ALL_USERS WHERE USERNAME = :B1 


call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        1      0.00       0.00          0          0          0           0
Execute      2      0.01       0.01          0          0          0           0
Fetch        2      0.00       0.00          0          0          0           0
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total        5      0.01       0.01          0          0          0           0

Misses in library cache during parse: 0
Optimizer mode: ALL_ROWS
Parsing user id: 38     (recursive depth: 2)
********************************************************************************

declare
   stmt varchar2(200);
   rdf_exception EXCEPTION;   pragma exception_init(rdf_exception, -20000);
BEGIN
     if dictionary_obj_type = 'USER' THEN
       BEGIN
         EXECUTE IMMEDIATE
          'begin ' ||
            'mdsys.rdf_apis_internal.' ||
            'notify_drop_user(''' || dictionary_obj_name || '''); ' ||
          'end;';
         EXCEPTION
           WHEN rdf_exception THEN RAISE;
           WHEN OTHERS        THEN NULL;
       END;
    end if;
end;

call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        1      0.00       0.00          0          0          0           0
Execute      1      0.00       0.00          0          0          0           1
Fetch        0      0.00       0.00          0          0          0           0
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total        2      0.00       0.00          0          0          0           1

Misses in library cache during parse: 0
Optimizer mode: ALL_ROWS
Parsing user id: 46     (recursive depth: 1)
********************************************************************************

begin mdsys.rdf_apis_internal.notify_drop_user('CFIFOC'); end;


call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        1      0.00       0.00          0          0          0           0
Execute      1      0.00       0.01          0          0          0           1
Fetch        0      0.00       0.00          0          0          0           0
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total        2      0.00       0.01          0          0          0           1

Misses in library cache during parse: 0
Optimizer mode: ALL_ROWS
Parsing user id: 46     (recursive depth: 2)
********************************************************************************

select count(*) 
from
 mdsys.rdf_rulebase$ where owner = :1


call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        1      0.00       0.00          0          0          0           0
Execute      0      0.00       0.00          0          0          0           0
Fetch        0      0.00       0.00          0          0          0           0
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total        1      0.00       0.00          0          0          0           0

Misses in library cache during parse: 1
Optimizer mode: ALL_ROWS
Parsing user id: 46     (recursive depth: 3)
********************************************************************************

select dummy 
from
 dual where  ora_dict_obj_type = 'TABLE'


call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        1      0.00       0.00          0          0          0           0
Execute      1      0.01       0.00          0          0          0           0
Fetch        1      0.00       0.00          0          0          0           0
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total        3      0.01       0.00          0          0          0           0

Misses in library cache during parse: 0
Optimizer mode: ALL_ROWS
Parsing user id: 46     (recursive depth: 1)

Rows     Row Source Operation
-------  ---------------------------------------------------
      0  FILTER  (cr=0 pr=0 pw=0 time=291 us)
      0   TABLE ACCESS FULL DUAL (cr=0 pr=0 pw=0 time=0 us)

********************************************************************************

begin
 if (sys.login_user!='SYSTEM') then
    raise_application_error(
    num=>-20000,
    msg=>'You can not delete table '||ora_dict_obj_name()||'!');
 end if;
end;

call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        1      0.00       0.00          0          0          0           0
Execute      1      0.00       0.00          0          0          0           0
Fetch        0      0.00       0.00          0          0          0           0
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total        2      0.00       0.00          0          0          0           0

Misses in library cache during parse: 0
Optimizer mode: ALL_ROWS
Parsing user id: 78     (recursive depth: 1)



********************************************************************************

OVERALL TOTALS FOR ALL NON-RECURSIVE STATEMENTS

call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        3      0.00       0.00          0          0          0           0
Execute      4      0.03       0.07          0          0          0           0
Fetch        0      0.00       0.00          0          0          0           0
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total        7      0.03       0.07          0          0          0           0

Misses in library cache during parse: 2


OVERALL TOTALS FOR ALL RECURSIVE STATEMENTS

call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        7      0.00       0.00          0          0          0           0
Execute      7      0.04       0.04          0          0          0           3
Fetch        3      0.00       0.00          0          0          0           0
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total       17      0.04       0.04          0          0          0           3

Misses in library cache during parse: 1

  
------解决思路----------------------
The following statement encountered a error during parse:

select count(*) from mdsys.rdf_rulebase$ where owner = :

Error encountered: ORA-00942
********************************************************************************

error connecting to database using: sys/orcl@limit
ORA-28009: connection as SYS should be as SYSDBA or SYSOPER


主要错误信息就上面这些
1、ORA-00942: 表或视图不存在,即:没有mdsys.rdf_rulebase$这个表,或是当前连接的用户没有对此表的访问权限
2、使用sys用户连接数据库时必须后面加上as sysdba,否则就会报ORA-28009的错误
  相关解决方案