ORA-00604 and ORA-00942




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 relevance on 14-FEB-2012***

Symptoms

When trying to drop a user, the command fails with errors ORA-00604 and ORA-00942

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

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 oct=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 obj=3490 op='TABLE ACCESS FULL OBJ#(3490) '

----------------------------------------------------------------------------------------------------------

Cause

The table system.aq$_internet_agent_privs is missing.

Solution

To implement the solution, execute the following steps:

1.Check if system.aq$_internet_agent_privs exist.

SQL> conn / as sysdba
SQL> desc system.aq$_internet_agent_privs

2.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

3.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

4.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.

No comments:

ORA-01552: cannot use system rollback segment for non-system tablespace 'TEMP'

 ORA-01552: cannot use system rollback segment for non-system tablespace "string" Cause: Used the system rollback segment for non...