Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cta
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dCache
cta
Commits
77600897
Commit
77600897
authored
11 years ago
by
Giuseppe Lo Presti
Browse files
Options
Downloads
Patches
Plain Diff
Created a LateMigrationsView view for exposing in a generic way
the files that are stuck on their migration to tape.
parent
76a56a62
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
castor/db/oracleCommon.schema.sql
+18
-0
18 additions, 0 deletions
castor/db/oracleCommon.schema.sql
upgrades/stager_2.1.14-2_to_2.1.14-3.sql
+19
-1
19 additions, 1 deletion
upgrades/stager_2.1.14-2_to_2.1.14-3.sql
with
37 additions
and
1 deletion
castor/db/oracleCommon.schema.sql
+
18
−
0
View file @
77600897
...
...
@@ -342,6 +342,7 @@ CREATE UNIQUE INDEX I_CastorFile_FileIdNsHost ON CastorFile (fileId, nsHost);
ALTER
TABLE
CastorFile
ADD
CONSTRAINT
CK_CastorFile_TapeStatus
CHECK
(
tapeStatus
IN
(
0
,
1
,
2
));
CREATE
INDEX
I_CastorFile_tapeStatus
ON
CastorFile
(
tapeStatus
);
/* SQL statement for table SubRequest */
CREATE
TABLE
SubRequest
...
...
@@ -1308,6 +1309,23 @@ ALTER TABLE Disk2DiskCopyJob
ADD
CONSTRAINT
CK_Disk2DiskCopyJob_type
CHECK
(
replicationType
IN
(
0
,
1
,
2
,
3
));
/* A view to spot late or stuck migrations */
/*******************************************/
/* It returns all files that are not yet on tape, that are existing in the namespace
* and for which migration is pending for more than 24h.
*/
CREATE
VIEW
LateMigrationsView
AS
SELECT
/*+ LEADING(CF DC MJ CnsFile) INDEX_RS_ASC(CF I_CastorFile_TapeStatus) INDEX_RS_ASC(DC I_DiskCopy_CastorFile) INDEX_RS_ASC(MJ I_MigrationJob_CastorFile) */
CF
.
fileId
,
CF
.
lastKnownFileName
as
filePath
,
DC
.
creationTime
as
dcCreationTime
,
decode
(
MJ
.
creationTime
,
NULL
,
-
1
,
getTime
()
-
MJ
.
creationTime
)
as
mjElapsedTime
,
nvl
(
MJ
.
status
,
-
1
)
as
mjStatus
FROM
CastorFile
CF
,
DiskCopy
DC
,
MigrationJob
MJ
,
cns_file_metadata
@
remotens
CnsFile
WHERE
CF
.
fileId
=
CnsFile
.
fileId
AND
DC
.
castorFile
=
CF
.
id
AND
MJ
.
castorFile
(
+
)
=
CF
.
id
AND
CF
.
tapeStatus
=
0
-- CASTORFILE_NOTONTAPE
AND
DC
.
creationTime
<
getTime
()
-
86400
ORDER
BY
DC
.
creationTime
DESC
;
/*****************/
/* logon trigger */
/*****************/
...
...
This diff is collapsed.
Click to expand it.
upgrades/stager_2.1.14-2_to_2.1.14-3.sql
+
19
−
1
View file @
77600897
...
...
@@ -71,8 +71,26 @@ BEGIN
END
;
/
/* small schema change : added
an
index */
/* small schema change : added index
es
*/
CREATE
INDEX
I_DLFLogs_Msg
ON
DLFLogs
(
msg
);
CREATE
INDEX
I_CastorFile_TapeStatus
ON
CastorFile
(
tapeStatus
);
/* A view to spot late or stuck migrations */
/*******************************************/
/* It returns all files that are not yet on tape, that are existing in the namespace
* and for which migration is pending for more than 24h.
*/
CREATE
VIEW
LateMigrationsView
AS
SELECT
/*+ LEADING(CF DC MJ CnsFile) INDEX_RS_ASC(CF I_CastorFile_TapeStatus) INDEX_RS_ASC(DC I_DiskCopy_CastorFile) INDEX_RS_ASC(MJ I_MigrationJob_CastorFile) */
CF
.
fileId
,
CF
.
lastKnownFileName
as
filePath
,
DC
.
creationTime
as
dcCreationTime
,
decode
(
MJ
.
creationTime
,
NULL
,
-
1
,
getTime
()
-
MJ
.
creationTime
)
as
mjElapsedTime
,
nvl
(
MJ
.
status
,
-
1
)
as
mjStatus
FROM
CastorFile
CF
,
DiskCopy
DC
,
MigrationJob
MJ
,
cns_file_metadata
@
remotens
CnsFile
WHERE
CF
.
fileId
=
CnsFile
.
fileId
AND
DC
.
castorFile
=
CF
.
id
AND
MJ
.
castorFile
(
+
)
=
CF
.
id
AND
CF
.
tapeStatus
=
0
-- CASTORFILE_NOTONTAPE
AND
DC
.
creationTime
<
getTime
()
-
86400
ORDER
BY
DC
.
creationTime
DESC
;
/* Update and revalidation of PL-SQL code */
/******************************************/
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment