模擬ORA-04043並解決(dba_* does not exist)

atlantisholic發表於2012-07-02

建立兩張模擬表

SQL> select * from v$version;
  
BANNER
------------------------------------------------------------------
Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
PL/SQL Release 9.2.0.4.0 - Production
CORE    9.2.0.3.0       Production
TNS for Linux: Version 9.2.0.4.0 - Production
NLSRTL Version 9.2.0.4.0 - Production
  
SQL> create table sys_xifenfei as
  2  select * from dba_tables;
  
Table created.
  
SQL> create table chf.chf_xifenfei as
  2  select * from dba_tables;
  
Table created.

啟動資料庫到mount狀態查詢表

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.
  
Total System Global Area  353441008 bytes
Fixed Size                   451824 bytes
Variable Size             184549376 bytes
Database Buffers          167772160 bytes
Redo Buffers                 667648 bytes
Database mounted.
SQL> desc dba_tables;
ERROR:
ORA-04043: object dba_tables does not exist
  
SQL> desc sys_xifenfei
ERROR:
ORA-04043: object sys_xifenfei does not exist
  
SQL> desc chf.chf_xifenfei
ERROR:
ORA-04043: object chf.chf_xifenfei does not exist

開啟資料庫查詢

SQL> alter database open;
  
Database altered.
  
SQL> select count(*) from sys_xifenfei;
select count(*) from sys_xifenfei
                     *
ERROR at line 1:
ORA-00942: table or view does not exist
  
SQL> select count(*) from chf.chf_xifenfei;
  
  COUNT(*)
----------
       868
  
SQL> select count(*) from dba_tables;
select count(*) from dba_tables
                     *
ERROR at line 1:
ORA-00942: table or view does not exist

解決問題

SQL> alter system flush shared_pool;
  
System altered.
  
SQL> select count(*) from dba_tables;
  
  COUNT(*)
----------
       869
  
SQL> select count(*) from sys_xifenfei;
  
  COUNT(*)
----------
       867

MOS解釋
ORA-4043 On DBA_* Views If They Are Described In Mount Stage [ID 296235.1]

Available workarounds are:
1) Don't describe the dba_* views at mount stage.
OR
2) If you issue DESC of any DBA_*views at mount stage,
    then shutdown and restart the DB instance.
OR
3) Flush the shared pool.
SQL> Alter system flush shared_pool;
and then reissue the failing command.

在10g中open庫後提示也為類此ORA-04043: object dba_tables does not exist

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/23071790/viewspace-734309/,如需轉載,請註明出處,否則將追究法律責任。

相關文章