Env:- 2 node RAC Database
DB Version: 12.2.0.1
Platform:- Exadata x6
OS- OEL 7
Recently , while
working on a crucial database upgrade project (12.2.0.1 to 19c), I came across
with one observation .
For upgrade , I ran
preupgrade.jar script which generally throws a list of recommendations along
with fixes . After checking the recommendations I found out one of the recommendation,
was related to validation of invalid objects that was residing inside SYS or SYSTEM schema in PDB$SEED
.
Now generally we run
utlrp.sql to validate the invalid objects , so I did the same to fix the
invalid objects
|
SQL> @?/rdbms/admin/utlrp |
In short, it failed as
the pdb$seed pdb is in read only mode.
|
SQL> show pdbs
CON_ID CON_NAME
OPEN MODE RESTRICTED ---------- ------------------------------
---------- ----------
2 PDB$SEED
READ ONLY NO |
So to validate the
invalid objects in PDB$SEED I followed the following steps :-
|
sqlplus / as sysdba SQL> ALTER SESSION SET CONTAINER =
PDB$SEED; SQL> show con_name; CON_NAME ------------------------------ PDB$SEED -- I Set a hidden parameter at session level SQL> alter session set
"_oracle_script" = true instances=all; -- Now lets try to open the pdb$seed instance
SQL> alter pluggable database pdb$seed
close immediate instances=all; SQL> alter pluggable database pdb$seed
open read write instances=all; SQL> show pdbs
CON_ID CON_NAME
OPEN MODE RESTRICTED ---------- ------------------------------
---------- ----------
2 PDB$SEED
READ WRITE NO SQL> @?/rdbms/admin/utlrp.sql SQL> select count(*) from dba_objects
where status='INVALID' AND OWNER IN ('SYS','SYSTEM');
COUNT(*) ----------
0 SQL> alter session set
"_oracle_script" = true instances=all; SQL> alter pluggable database pdb$seed
close instances=all; <Make sure there is no session active to pdb$seed
database from any other terminal> SQL> alter pluggable database pdb$seed
OPEN READ ONLY instances=all; |
So this way I
validated all the invalid objects in pdb$seed PDB.