Commit f942db17 authored by Eric Cano's avatar Eric Cano
Browse files

bug #72215: Remove the TAPEGATEWAYREQUEST table from the schema, and drop the...

bug #72215: Remove the TAPEGATEWAYREQUEST table from the schema, and drop the triggers that populate it.

Replaced block comments ( /* ... */ ) by line comments in DDL sections of scripts and SQLplus choques on it. (SQL developper was OK).
parent b7ca8b8b
......@@ -93,9 +93,9 @@ ALTER TABLE TapeGatewayRequest DROP COLUMN startTime;
ALTER TABLE Tape ADD (lastVdqmPingTime NUMBER);
ALTER TABLE TapeGatewayRequest DROP COLUMN lastVdqmPingTime;
/* For Tape reads only */
-- For Tape reads only */
ALTER TABLE Tape ADD (vdqmVolReqId NUMBER);
/* For Tape writes only */
-- For Tape writes only */
ALTER TABLE Stream ADD (vdqmVolReqId NUMBER);
ALTER TABLE TapeGatewayRequest DROP COLUMN vdqmVolReqId;
......@@ -113,8 +113,8 @@ ALTER TABLE TapeGatewayRequest DROP COLUMN id;
ALTER TABLE TapeGatewayRequest DROP COLUMN Stream;
ALTER TABLE TapeGatewayRequest DROP COLUMN TapeRecall;
/*ALTER TABLE TapeGatewayRequest DROP COLUMN Status;*/
/*SQL Error: ORA-12983: cannot drop all columns in a table*/
--ALTER TABLE TapeGatewayRequest DROP COLUMN Status;*/
--SQL Error: ORA-12983: cannot drop all columns in a table*/
DROP TABLE TapeGatewayRequest;
/*******************************************************************************
......
......@@ -42,39 +42,39 @@ ALTER TABLE TAPEGATEWAYSUBREQUEST DROP COLUMN TapeCopy;
ALTER TABLE TapeCopy ADD (TapeGatewayRequest NUMBER (*,0));
ALTER TABLE TapeCopy ADD CONSTRAINT FK_TAPECOPY_TGR FOREIGN KEY (TapeGatewayRequest) REFERENCES TapeGatewayRequest (ID) ENABLE;
ALTER TABLE TAPEGATEWAYSUBREQUEST DROP CONSTRAINT UN_TGSUBREQUEST_TR_DC;
/*ALTER TABLE TapeCopy ADD CONSTRAINT UN_TAPECOPY_CF_TGR UNIQUE (TAPEGATEWAYREQUEST, CASTORFILE) USING INDEX;*/
-- ALTER TABLE TapeCopy ADD CONSTRAINT UN_TAPECOPY_CF_TGR UNIQUE (TAPEGATEWAYREQUEST, CASTORFILE) USING INDEX;
ALTER TABLE TapeCopy DROP CONSTRAINT UN_TAPECOPY_CF_TGR;
ALTER TABLE TapeCopy DROP INDEX UN_TAPECOPY_CF_TGR;
ALTER TABLE TAPEGATEWAYSUBREQUEST DROP COLUMN REQUEST;
ALTER TABLE TapeCopy ADD (DiskCopy NUMBER(*,0));
/* ALTER TABLE TAPEGATEWAYSUBREQUEST DROP COLUMN DISKCOPY; -- Oops: SQL Error: ORA-12983: cannot drop all columns in a table 12983. 00000 - "cannot drop all columns in a table" */
/* There you go: */
-- ALTER TABLE TAPEGATEWAYSUBREQUEST DROP COLUMN DISKCOPY; -- Oops: SQL Error: ORA-12983: cannot drop all columns in a table 12983. 00000 - "cannot drop all columns in a table" */
-- There you go: */
DROP TABLE TAPEGATEWAYSUBREQUEST;
/* Fix wrongly named column in TapeGatewayRequest */
-- Fix wrongly named column in TapeGatewayRequest */
ALTER TABLE TapeGatewayRequest RENAME COLUMN STREAMMIGRATION TO STREAM;
/* Keep track of the Volume ID to which a tapecopy is being migrated */
/* This is necessary as the life cycle of the STAGED tape copy can be longer
* than the one of the tapegatewayrequest, stream and finally tape it points
* to. */
-- Keep track of the Volume ID to which a tapecopy is being migrated */
-- This is necessary as the life cycle of the STAGED tape copy can be longer
-- than the one of the tapegatewayrequest, stream and finally tape it points
-- to. */
ALTER TABLE TapeCopy ADD (VID VARCHAR2(2048 BYTE));
/* We want to query this table by VID */
-- We want to query this table by VID */
CREATE INDEX I_TapeCopy_VID ON TapeCopy(VID);
/* File request number has to be unique or null the life cycle is not clear, so
* we'll throw exception when a null file request ID will be returned to C++ */
-- File request number has to be unique or null the life cycle is not clear, so
-- we'll throw exception when a null file request ID will be returned to C++ */
ALTER TABLE TapeCopy ADD (FileTransactionId NUMBER);
ALTER TABLE TapeCopy ADD CONSTRAINT UN_TAPECOPY_FILETRID
UNIQUE (FileTransactionId) USING INDEX;
/* Create sequence for the File request IDs. */
-- Create sequence for the File request IDs. */
CREATE SEQUENCE TG_FILETRID_SEQ START WITH 1 INCREMENT BY 1;
/* Ensure consistency with a trigger */
/* We MUST have a VID set when entring states SELECTED, STAGED,
* and CAN have it still set when entering states REC_RETRY or MIG_RETRY to log
* the information.
* when entering any other state, it's forbidden.
* This criteria does not need history (it's all :new based) */
-- Ensure consistency with a trigger */
-- We MUST have a VID set when entring states SELECTED, STAGED,
-- and CAN have it still set when entering states REC_RETRY or MIG_RETRY to log
-- the information.
-- when entering any other state, it's forbidden.
-- This criteria does not need history (it's all :new based) */
CREATE OR REPLACE TRIGGER TR_TapeCopy_VID
BEFORE INSERT OR UPDATE OF Status ON TapeCopy
FOR EACH ROW
......@@ -108,9 +108,9 @@ BEGIN
END;
/
/* Fixem, one by one */
-- Fixem, one by one */
/* Replacing all references to TapeGatewaySubrequest */
-- Replacing all references to TapeGatewaySubrequest */
create or replace
PROCEDURE tg_defaultMigrSelPolicy(inStreamId IN INTEGER,
outDiskServerName OUT NOCOPY VARCHAR2,
......
Supports Markdown
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