Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
dCache
cta
Commits
5d8bb384
Commit
5d8bb384
authored
Dec 05, 2019
by
Giuseppe Lo Presti
Browse files
Cosmetic changes and minor refactoring
parent
54c90e22
Changes
3
Hide whitespace changes
Inline
Side-by-side
catalogue/oracle_catalogue_schema_header.sql
View file @
5d8bb384
...
...
@@ -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
;
migration/castor/castorns_ctamigration_schema.sql
View file @
5d8bb384
...
...
@@ -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
/
5
2
00
/
60
));
prettyTime
(
nbFiles
/
5
0
00
/
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
;
/
...
...
migration/oracle_catalogue_castor_migration.sql
View file @
5d8bb384
...
...
@@ -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
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment