Commit 633a28d2 authored by Michael Davis's avatar Michael Davis
Browse files

Deletes disk_file_path from CASTOR to CTA migration scripts

parent 5676e669
......@@ -174,8 +174,6 @@ END;
CREATE OR REPLACE PROCEDURE populateCTAFilesFromCASTOR(inEOSCTAInstance VARCHAR2, inTapePool VARCHAR2) AS
CONSTRAINT_VIOLATED EXCEPTION;
PRAGMA EXCEPTION_INIT(CONSTRAINT_VIOLATED, -1);
varLenCastorPrefix INTEGER := length('/castor/cern.ch/');
varNamespacePrefix VARCHAR2(20);
varIs2ndCopy INTEGER;
nbPreviousErrors INTEGER;
nbMissingImports INTEGER;
......@@ -214,24 +212,14 @@ BEGIN
COMMIT;
CNS_ctaLog(inTapePool, 'Storage classes import completed');
-- Determine the namespace prefix in CTA, by stripping 'eoscta' or 'eos' from the instance name
IF instr(inEOSCTAInstance, 'eoscta') = 1 THEN
varNamespacePrefix := substr(inEOSCTAInstance, 7);
ELSIF instr(inEOSCTAInstance, 'eos') = 1 THEN
varNamespacePrefix := substr(inEOSCTAInstance, 4);
ELSE
varNamespacePrefix := inEOSCTAInstance;
END IF;
-- Populate the CTA catalogue with the CASTOR file metadata: this runs in a single transaction
INSERT /*+ APPEND PARALLEL(Archive_File) */ INTO Archive_File
(archive_file_id, disk_instance_name, disk_file_id, disk_file_path,
(archive_file_id, disk_instance_name, disk_file_id,
disk_file_uid, disk_file_gid, size_in_bytes, checksum_adler32,
storage_class_id, creation_time, reconciliation_time, is_deleted) (
SELECT /*+ PARALLEL(F) PARALLEL(D) */
F.fileid, inEOSCTAInstance, F.fileid,
'/eos/' || varNamespacePrefix
|| substr(D.path, varLenCastorPrefix) || '/' || F.filename,
F.disk_uid, F.disk_gid, F.filesize, F.checksum, F.classid, F.btime, 0, '0'
F.fileid, inEOSCTAInstance, F.fileid, F.disk_uid, F.disk_gid, F.filesize, F.checksum,
F.classid, F.btime, 0, '0'
FROM CNS_CTAFilesHelper F, CNS_Dirs_Full_Path D
WHERE F.parent_fileid = D.fileid
-- no need to exclude already existing files because of dual copies
......
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