Commit 09b7a171 authored by Giuseppe Lo Presti's avatar Giuseppe Lo Presti
Browse files

[migration] minor fixes following review

parent 7a6229d0
......@@ -23,6 +23,7 @@ The tools are designed to work as follows, for any given VO:
1. Initiate the export from CASTOR by running the `begin_vo_export_to_cta.sh` script. Example:
* `bash begin_vo_export_to_cta.sh --doit /atlas /grid/atlas`
Alternatively, for a test import without blocking access to CASTOR, import all relevant directories one by one using `eos-import-dirs`. Example:
* `eos-import-dirs /atlas`
* `eos-import-dirs /grid/atlas`
......
......@@ -34,6 +34,7 @@ CREATE TABLE CTAFilesHelper (fileid INTEGER NOT NULL PRIMARY KEY, parent_fileid
CREATE INDEX I_CTAFiles_parent_id ON CTAFilesHelper (parent_fileid);
CREATE INDEX I_CTAFiles_vid_filesize ON CTAFilesHelper (vid, filesize);
CREATE INDEX I_CTAFiles_copyno ON CTAFilesHelper (copyno);
CREATE INDEX I_CTAFiles_classid ON CTAFilesHelper (classid);
CREATE TABLE CTAFiles2ndCopyHelper (fileid INTEGER NOT NULL PRIMARY KEY, filesize INTEGER,
vid VARCHAR2(6), fseq INTEGER, blockId INTEGER, s_mtime INTEGER);
......@@ -110,7 +111,7 @@ END;
/* Procedure to prepare the files and segments metadata for export to CTA */
create or replace PROCEDURE filesForCTAExport(inPoolName IN VARCHAR2, out2ndCopyPoolName OUT VARCHAR2) AS
CREATE OR REPLACE PROCEDURE filesForCTAExport(inPoolName IN VARCHAR2, out2ndCopyPoolName OUT VARCHAR2) AS
nbFiles INTEGER;
var2ndCopy INTEGER;
BEGIN
......@@ -167,12 +168,11 @@ BEGIN
ctaLog(out2ndCopyPoolName, 'Preparing export of the second-copy tape pool following export of '|| inPoolName);
-- populate the 2nd copy helper table
INSERT /*+ APPEND PARALLEL(CTAFiles2ndCopyHelper) */ INTO CTAFiles2ndCopyHelper (
SELECT /*+ PARALLEL(F) PARALLEL(S) */
F.fileid, S.segsize as filesize, S.vid, S.fseq,
utl_raw.cast_to_binary_integer(S.blockId), S.lastModificationTime as s_mtime
FROM Cns_file_metadata F, Cns_seg_metadata S
WHERE F.fileid = S.s_fileid
AND S.vid IN (
SELECT /*+ PARALLEL(F) */
s_fileid, segsize as filesize, vid, fseq,
utl_raw.cast_to_binary_integer(blockId), lastModificationTime as s_mtime
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
......
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