schema/spacewalk/spacewalk-schema-upgrade | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
New commits:
commit f7ec4688236a39e789f48460920f53273c3292c9
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Thu Sep 2 16:32:54 2010 +0200
After running the schema upgrade, recompile the PL/SQL objects and check that there
are no invalid objects left behind.
diff --git a/schema/spacewalk/spacewalk-schema-upgrade
b/schema/spacewalk/spacewalk-schema-upgrade
index ff6a7b0..937e3f6 100755
--- a/schema/spacewalk/spacewalk-schema-upgrade
+++ b/schema/spacewalk/spacewalk-schema-upgrade
@@ -220,6 +220,23 @@ $in .= <<EOF;
spool $SCHEMA_UPGRADE_LOGDIR/$stamp-end.log append
whenever sqlerror exit sql.sqlcode
+exec dbms_utility.compile_schema(user);
+
+-- check whether all objects are valid
+declare
+ invalid_objects number;
+begin
+ select count(*)
+ into invalid_objects
+ from user_objects
+ where status <> 'VALID' and
+ (object_name, object_type) not in (select object_name, type from recyclebin);
+ if invalid_objects > 0 then
+ RAISE_APPLICATION_ERROR(-20001, 'SCHEMA UPGRADE ENDS WITH INVALD OBJECTS');
+ end if;
+end;
+/
+
insert into rhnVersionInfo
( label, name_id, evr_id, created, modified )
values ('schema', lookup_package_name('$my_schema_name'),
Show replies by date