While testing our upgrade procedure of database using DBUA on AIX from 10.2.0.4 to 11.1.0.7, we got error
ORA-04063: package body "SYS.DBMS_SQLTUNE_INTERNAL" has errors
I ignored the error and continued.
Because of this script utlrp.sql ( to compile invalid objects ) also failed and as a result after the partial upgrade there were 15000 INVALID objects in the database. Just to let you know, now 11g provides direct view to view invalid objects (DBA_INVALID_OBJECTS). Tried to find the problem , the nearest I could find was as discussed in
Metalink note 390221.1, After upgrading 10.2.0.1 to 10.2.0.2 Oracle Database Server component is INVALID.
Cause
SYS.EXTRACT and SYS.EXISTSNODE public synonyms conflicting with synonyms being used to compile
these packages.These objects that do not belong to a 10.2 database. They should had been removed in a previous
upgrade.
Solution
Drop synonyms
drop public synonym existsnode;
drop public synonym extract;
This solution was not applicable for our case as these synonyms were not present in the database.
I opened Oracle Service Request and this is what Oracle
The issue encountered seems to be related with the one described in Note 761961.1 After upgrade to 11.1.0.7 BMS_SQLTUNE_INTERNAL
Package Can Not be Recompiled
Please follow the bellow action plan:
.
ACTION PLAN
============
1. drop the synonym:
SQL> drop public synonym XMLCONCAT;
2. recompile the package
SQL> alter package DBMS_SQLTUNE_INTERNAL compile body;
3. if it works, run utlrp.sql to recompile the other INVALID objects
@?/rdbms/admin/utlrp.sql
For us the above solution worked and we were able to compile SYS.DBMS_SQLTUNE_INTERNAL successfully and utlrp ran successfully, compiling all Invalid objects. The dependent synonym ‘XMLCONCAT’ didn’t had base object.
During next upgrade test I dropped the XMLCONCAT beforehand and upgrade process didn’t give any errors.
I did ask Oracle the following
1. I couldn’t find this when I was researching about the problem on the metalink. Also I couldn’t search document 761961.1 on
the metalink. Is that an internal document?
2. Similar to public synonym XMLCONCAT, there are lots of PUBLIC synonyms whose base objects doesn’t exist.
I used the following query to obtain
the list
select * from
(
select * from dba_synonyms a
where not exists ( select 1
from dba_objects b
where a.table_owner = b.owner
and a.table_name = b.object_name
)
)
where synonym_name not like ‘%/%’
AND DB_LINK IS NULL
What is purpose of such synonyms? Before we start upgrade process, do we need to
drop all public synonyms whose base object doesn’t exist?
Waiting for Oracle’s response.
Hope this Helps some of you…
Thanks!!!
Enjoy 🙂
Sorry for the delay in posting this one.
Here was Oracle’s response in response to query asked earlier
"As per Oracle note Note 761961.1 is still unavailable , since it is in the publishing process.
Regarding the invalid synonyms for which the underlaying objects do not exist, this should not exists in the database and it is better if any is found to be dropped before the upgrade.
I have made some research regarding the objects and part of them are synonyms of the objects created for several Oracle options, which probably have been removed in the past, but not fully cleaned. This is the case for synonyms
for EXFSYS, SYSMAN or PERFSTAT objects. This can be safely deleted from the database."
I have implementd the Oracle’s recomendation and so far have been successfull in testing upgrade process.
Any comments or have any questions, I would be more than Happy to Help.
Hope this helps!!!
Sanjeet
Filed under: oracle | Tagged: 11g (11.1.0.7) upgrade | 3 Comments »