"DROP USER" fails with error: ORA-00942 and ORA-00604 (二)

zhanglei_itput發表於2011-05-24
Drop User command fails with errors ORA-00604 and ORA-00942 [ID 375954.1]
--------------------------------------------------------------------------------
Applies to:
Oracle Server - Enterprise Edition - Version: 9.2.0.1 to 11.2.0.2 - Release: 9.2 to 11.2
Information in this document applies to any platform.
Checked for currency 06-Sep-10
Symptoms
When trying to drop a user, the command fails with errors ORA-00604 and ORA-00942
1. Example
SQL> drop user test ;
drop user test
*
ERROR at line 1:
ORA-00604: error occurred at recursive SQL level 1
ORA-00942: table or view does not exist
 
2. sql trace
alter session set sql_trace=true;

alter session set events'10046 trace name context forever,level 4';
 
SQL> drop user test ;
 
alter session set sql_trace=false;
 
SQL trace (10046) trace will show a dml operation performed on system.aq$_internet_agent_privs
table.
----------------------------------------------------------------------------------------------------------
PARSE ERROR #5:len=78 dep=1 uid=0 ct=7 lid=0 tim=1416609304389 err=942
delete from system.aq$_internet_agent_privs WHERE db_username = NLS_UPPER(:1)
EXEC #1:c=70000,e=552054,p=148,cr=448,cu=0,mis=0,r=0,dep=0,og=4,tim=
1416609309213
ERROR #1:err=604 tim=145060793
STAT #2 id=1 cnt=0 pid=0 pos=1 bj=3490 p='TABLE ACCESS FULL OBJ#(3490) '
----------------------------------------------------------------------------------------------------------
 
3.Cause
The table system.aq$_internet_agent_privs is missing.
 
4.Solution
To implement the solution, execute the following steps:
a) Check if system.aq$_internet_agent_privs exist.
SQL> conn / as sysdba
SQL> desc system.aq$_internet_agent_privs
b) Make sure that the default tablespace of SYSTEM user is properly set to SYSTEM tablespace.
SQL> select default_tablespace from dba_users where username='SYSTEM';
DEFAULT_TABLESPACE
------------------------------
SYSTEM
c)If system.aq$_internet_agent_privs does not exist, run $ORACLE_HOME/rdbms/admin/catqueue.sql
script. manually logged in as 'SYS AS SYSDBA'. This will create the system.aq$_internet_agent_privs
table
SQL> conn / as sysdba
SQL> @$ORACLE_HOME/rdbms/admin/catqueue.sql
SQL> exit
d)Confirm that system.aq$_internet_agent_privs is created properly:
SQL> desc system.aq$_internet_agent_privs
Name Null? Type
----------- -------- ------------
AGENT_NAME NOT NULL VARCHAR2(30)
DB_USERNAME NOT NULL VARCHAR2(30)
 
5.Then execute the DROP USER command again.
 
參考文獻:
1. Drop User command fails with errors ORA-00604 and ORA-00942 [ID 375954.1]

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

相關文章