Commit 13923fc2 authored by Dennis Waldron's avatar Dennis Waldron
Browse files

Initial Revision

parent aa6a4e1a
/******************************************************************************
* mon_2.1.8-18_to_2.1.8-18-1.sql
*
* This file is part of the Castor project.
* See http://castor.web.cern.ch/castor
*
* Copyright (C) 2003 CERN
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* This script upgrades a CASTOR v2.1.8-18 MONITORING database into v2.1.8-18-1
*
* @author Castor Dev team, castor-dev@cern.ch
*****************************************************************************/
/* Stop on errors - this only works from sqlplus */
WHENEVER SQLERROR EXIT FAILURE;
/* Version cross check and update */
DECLARE
unused VARCHAR(100);
BEGIN
SELECT release INTO unused FROM CastorVersion WHERE release LIKE '2_1_8_18%';
EXCEPTION WHEN NO_DATA_FOUND THEN
-- Error, we can't apply this script
raise_application_error(-20000, 'PL/SQL release mismatch. Please run previous upgrade scripts before this one.');
END;
/
UPDATE CastorVersion SET release = '2_1_8_18_1';
COMMIT;
/* Schema changes go here */
/**************************/
/* #66846: Data retention period not respected by the monitoring schema */
ALTER TABLE TapeRecall DROP CONSTRAINT FK_TapeRecall_subReqId;
/* Manual execution of the archiveData job to drop tablespaces which previously
* couldn't be dropped.
*/
BEGIN
dbms_scheduler.run_job('ARCHIVEDATAJOB');
END;
/
/* Recompile all invalid procedures, triggers and functions */
/************************************************************/
BEGIN
FOR a IN (SELECT object_name, object_type
FROM user_objects
WHERE object_type IN ('PROCEDURE', 'TRIGGER', 'FUNCTION')
AND status = 'INVALID')
LOOP
IF a.object_type = 'PROCEDURE' THEN
EXECUTE IMMEDIATE 'ALTER PROCEDURE '||a.object_name||' COMPILE';
ELSIF a.object_type = 'TRIGGER' THEN
EXECUTE IMMEDIATE 'ALTER TRIGGER '||a.object_name||' COMPILE';
ELSE
EXECUTE IMMEDIATE 'ALTER FUNCTION '||a.object_name||' COMPILE';
END IF;
END LOOP;
END;
/
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment