Commit 5d8bb384 authored by Giuseppe Lo Presti's avatar Giuseppe Lo Presti
Browse files

Cosmetic changes and minor refactoring

parent 54c90e22
......@@ -41,7 +41,3 @@ CREATE GLOBAL TEMPORARY TABLE TEMP_TAPE_FILE_INSERTION_BATCH(
)
ON COMMIT DELETE ROWS;
CREATE INDEX TEMP_T_F_I_B_ARCHIVE_FILE_ID_I ON TEMP_TAPE_FILE_INSERTION_BATCH(ARCHIVE_FILE_ID);
CREATE GLOBAL TEMPORARY TABLE TEMP_REMOVE_CASTOR_METADATA(
ARCHIVE_FILE_ID UINT64TYPE
)
ON COMMIT DELETE ROWS;
......@@ -137,7 +137,7 @@ BEGIN
raise_application_error(-20000, 'No such tape pool or no valid files found, aborting the export');
END IF;
ctaLog(inPoolName, 'Intermediate table for files prepared, '|| nbFiles ||' files to be exported. ETA: '||
prettyTime(nbFiles/5200/60));
prettyTime(nbFiles/5000/60));
-- check for dual tape copies if any: first, abort if this tape pool already contains some 2nd copies
SELECT COUNT(*) INTO nbFiles FROM CTAFilesHelper WHERE copyno <> 1;
......@@ -156,8 +156,8 @@ BEGIN
WHERE T.vid IN (
SELECT S.vid
FROM Cns_seg_metadata S, CTAFilesHelper F
WHERE s_fileid = F.fileid
AND S.copyno = 2
WHERE S.s_fileid = F.fileid
AND S.copyno = 2
);
EXCEPTION WHEN TOO_MANY_ROWS THEN
-- more than one tape pool found for the second copies of the selected files
......@@ -169,17 +169,18 @@ BEGIN
-- populate the 2nd copy helper table
INSERT /*+ APPEND PARALLEL(CTAFiles2ndCopyHelper) */ INTO CTAFiles2ndCopyHelper (
SELECT /*+ PARALLEL(F) */
s_fileid, segsize as filesize, vid, fseq,
utl_raw.cast_to_binary_integer(blockId), lastModificationTime as s_mtime
s_fileid, segsize, vid, fseq, utl_raw.cast_to_binary_integer(blockId), lastModificationTime
FROM Cns_seg_metadata
WHERE vid IN (
SELECT vid FROM Vmgr_tape_side
WHERE poolName = out2ndCopyPoolName
AND BITAND(status, 2) = 0 AND BITAND(status, 32) = 0 -- not already EXPORTED or ARCHIVED
)
WHERE vid IN (
SELECT vid FROM Vmgr_tape_side
WHERE poolName = out2ndCopyPoolName
AND BITAND(status, 2) = 0 AND BITAND(status, 32) = 0 -- not already EXPORTED or ARCHIVED
)
);
COMMIT;
ctaLog(inPoolName, 'Intermediate table for second-copy files prepared');
ELSE
ctaLog(inPoolName, 'Seaerch for dual tape copies completed');
END IF;
END;
/
......
......@@ -44,6 +44,8 @@ CREATE OR REPLACE SYNONYM Vmgr_tape_dgnmap FOR &vmgrSchema..Vmgr_tape_dgnmap;
-- Used by removeCASTORMetadata
CREATE OR REPLACE TYPE NUMLIST IS TABLE OF INTEGER;
CREATE GLOBAL TEMPORARY TABLE Temp_Remove_CASTOR_Metadata (archive_file_id INTEGER PRIMARY KEY)
ON COMMIT DELETE ROWS;
-- Enable parallel inserts
ALTER TABLE Archive_File PARALLEL;
......
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