Commit d0d3b082 authored by Cedric Caffy's avatar Cedric Caffy
Browse files

Oracle DB now insert repacked file to the recycle log and deletes the...

Oracle DB now insert repacked file to the recycle log and deletes the associated TAPE_FILE entries. Postgres WIP
parent f4c2830b
......@@ -379,29 +379,29 @@ CREATE TABLE TAPE_FILE_RECYCLE_BIN(
REFERENCES TAPE_FILE_RECYCLE_BIN(VID, FSEQ)
);
CREATE TABLE FILE_RECYCLE_LOG(
FILE_RECYCLE_LOG_ID BIGINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_ID_NN NOT NULL,
VID VARCHAR(100) CONSTRAINT FILE_RECYCLE_LOG_VID_NN NOT NULL,
FSEQ BIGINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_FSEQ_NN NOT NULL,
BLOCK_ID BIGINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_BID_NN NOT NULL,
LOGICAL_SIZE_IN_BYTES BIGINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_LSIB_NN NOT NULL,
COPY_NB TINYINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_COPY_NB_NN NOT NULL,
TAPE_FILE_CREATION_TIME BIGINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_TFCT_NN NOT NULL,
ARCHIVE_FILE_ID BIGINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_AFI_NN NOT NULL,
DISK_INSTANCE_NAME VARCHAR(100) CONSTRAINT FILE_RECYCLE_LOG_DIN_NN NOT NULL,
DISK_FILE_ID BIGINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_DFI_NN NOT NULL,
DISK_FILE_ID_WHEN_DELETED BIGINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_DFIWD_NN NOT NULL,
DISK_FILE_UID BIGINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_DFU_NN NOT NULL,
DISK_FILE_GID BIGINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_DFG_NN NOT NULL,
SIZE_IN_BYTES BIGINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_SIB_NN NOT NULL,
CHECKSUM_BLOB VARBINARY(200),
CHECKSUM_ADLER32 INT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_CA_NN NOT NULL,
STORAGE_CLASS_ID BIGINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_SCI_NN NOT NULL,
CREATION_TIME BIGINT UNSIGNED CONSTRAINT FILE_RECYLE_LOG_CT_NN NOT NULL,
RECONCILIATION_TIME BIGINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_RT_NN NOT NULL,
COLLOCATION_HINT VARCHAR(100),
DISK_FILE_PATH VARCHAR(2000),
REASON_LOG VARCHAR(1000) CONSTRAINT FILE_RECYCLE_LOG_RL_NN NOT NULL,
RECYCLE_LOG_TIME BIGINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_RLT_NN NOT NULL,
FILE_RECYCLE_LOG_ID BIGINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_ID_NN NOT NULL,
VID VARCHAR(100) CONSTRAINT FILE_RECYCLE_LOG_VID_NN NOT NULL,
FSEQ BIGINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_FSEQ_NN NOT NULL,
BLOCK_ID BIGINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_BID_NN NOT NULL,
LOGICAL_SIZE_IN_BYTES BIGINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_LSIB_NN NOT NULL,
COPY_NB TINYINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_COPY_NB_NN NOT NULL,
TAPE_FILE_CREATION_TIME BIGINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_TFCT_NN NOT NULL,
ARCHIVE_FILE_ID BIGINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_AFI_NN NOT NULL,
DISK_INSTANCE_NAME VARCHAR(100) CONSTRAINT FILE_RECYCLE_LOG_DIN_NN NOT NULL,
DISK_FILE_ID BIGINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_DFI_NN NOT NULL,
DISK_FILE_ID_WHEN_DELETED BIGINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_DFIWD_NN NOT NULL,
DISK_FILE_UID BIGINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_DFU_NN NOT NULL,
DISK_FILE_GID BIGINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_DFG_NN NOT NULL,
SIZE_IN_BYTES BIGINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_SIB_NN NOT NULL,
CHECKSUM_BLOB VARBINARY(200),
CHECKSUM_ADLER32 INT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_CA_NN NOT NULL,
STORAGE_CLASS_ID BIGINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_SCI_NN NOT NULL,
ARCHIVE_FILE_CREATION_TIME BIGINT UNSIGNED CONSTRAINT FILE_RECYLE_LOG_CT_NN NOT NULL,
RECONCILIATION_TIME BIGINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_RT_NN NOT NULL,
COLLOCATION_HINT VARCHAR(100),
DISK_FILE_PATH VARCHAR(2000),
REASON_LOG VARCHAR(1000) CONSTRAINT FILE_RECYCLE_LOG_RL_NN NOT NULL,
RECYCLE_LOG_TIME BIGINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_RLT_NN NOT NULL,
CONSTRAINT FILE_RECYCLE_LOG_PK PRIMARY KEY(FILE_RECYCLE_LOG_ID),
CONSTRAINT FILE_RECYCLE_LOG_VID_FK FOREIGN KEY(VID) REFERENCES TAPE(VID),
CONSTRAINT FILE_RECYCLE_LOG_SC_FK FOREIGN KEY(STORAGE_CLASS_ID) REFERENCES STORAGE_CLASS(STORAGE_CLASS_ID)
......
......@@ -411,29 +411,29 @@ CREATE TABLE TAPE_FILE_RECYCLE_BIN(
REFERENCES TAPE_FILE_RECYCLE_BIN(VID, FSEQ)
);
CREATE TABLE FILE_RECYCLE_LOG(
FILE_RECYCLE_LOG_ID NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_ID_NN NOT NULL,
VID VARCHAR2(100) CONSTRAINT FILE_RECYCLE_LOG_VID_NN NOT NULL,
FSEQ NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_FSEQ_NN NOT NULL,
BLOCK_ID NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_BID_NN NOT NULL,
LOGICAL_SIZE_IN_BYTES NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_LSIB_NN NOT NULL,
COPY_NB NUMERIC(3, 0) CONSTRAINT FILE_RECYCLE_LOG_COPY_NB_NN NOT NULL,
TAPE_FILE_CREATION_TIME NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_TFCT_NN NOT NULL,
ARCHIVE_FILE_ID NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_AFI_NN NOT NULL,
DISK_INSTANCE_NAME VARCHAR2(100) CONSTRAINT FILE_RECYCLE_LOG_DIN_NN NOT NULL,
DISK_FILE_ID NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_DFI_NN NOT NULL,
DISK_FILE_ID_WHEN_DELETED NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_DFIWD_NN NOT NULL,
DISK_FILE_UID NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_DFU_NN NOT NULL,
DISK_FILE_GID NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_DFG_NN NOT NULL,
SIZE_IN_BYTES NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_SIB_NN NOT NULL,
CHECKSUM_BLOB RAW(200),
CHECKSUM_ADLER32 NUMERIC(10, 0) CONSTRAINT FILE_RECYCLE_LOG_CA_NN NOT NULL,
STORAGE_CLASS_ID NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_SCI_NN NOT NULL,
CREATION_TIME NUMERIC(20, 0) CONSTRAINT FILE_RECYLE_LOG_CT_NN NOT NULL,
RECONCILIATION_TIME NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_RT_NN NOT NULL,
COLLOCATION_HINT VARCHAR2(100),
DISK_FILE_PATH VARCHAR2(2000),
REASON_LOG VARCHAR2(1000) CONSTRAINT FILE_RECYCLE_LOG_RL_NN NOT NULL,
RECYCLE_LOG_TIME NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_RLT_NN NOT NULL,
FILE_RECYCLE_LOG_ID NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_ID_NN NOT NULL,
VID VARCHAR2(100) CONSTRAINT FILE_RECYCLE_LOG_VID_NN NOT NULL,
FSEQ NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_FSEQ_NN NOT NULL,
BLOCK_ID NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_BID_NN NOT NULL,
LOGICAL_SIZE_IN_BYTES NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_LSIB_NN NOT NULL,
COPY_NB NUMERIC(3, 0) CONSTRAINT FILE_RECYCLE_LOG_COPY_NB_NN NOT NULL,
TAPE_FILE_CREATION_TIME NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_TFCT_NN NOT NULL,
ARCHIVE_FILE_ID NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_AFI_NN NOT NULL,
DISK_INSTANCE_NAME VARCHAR2(100) CONSTRAINT FILE_RECYCLE_LOG_DIN_NN NOT NULL,
DISK_FILE_ID NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_DFI_NN NOT NULL,
DISK_FILE_ID_WHEN_DELETED NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_DFIWD_NN NOT NULL,
DISK_FILE_UID NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_DFU_NN NOT NULL,
DISK_FILE_GID NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_DFG_NN NOT NULL,
SIZE_IN_BYTES NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_SIB_NN NOT NULL,
CHECKSUM_BLOB RAW(200),
CHECKSUM_ADLER32 NUMERIC(10, 0) CONSTRAINT FILE_RECYCLE_LOG_CA_NN NOT NULL,
STORAGE_CLASS_ID NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_SCI_NN NOT NULL,
ARCHIVE_FILE_CREATION_TIME NUMERIC(20, 0) CONSTRAINT FILE_RECYLE_LOG_CT_NN NOT NULL,
RECONCILIATION_TIME NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_RT_NN NOT NULL,
COLLOCATION_HINT VARCHAR2(100),
DISK_FILE_PATH VARCHAR2(2000),
REASON_LOG VARCHAR2(1000) CONSTRAINT FILE_RECYCLE_LOG_RL_NN NOT NULL,
RECYCLE_LOG_TIME NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_RLT_NN NOT NULL,
CONSTRAINT FILE_RECYCLE_LOG_PK PRIMARY KEY(FILE_RECYCLE_LOG_ID),
CONSTRAINT FILE_RECYCLE_LOG_VID_FK FOREIGN KEY(VID) REFERENCES TAPE(VID),
CONSTRAINT FILE_RECYCLE_LOG_SC_FK FOREIGN KEY(STORAGE_CLASS_ID) REFERENCES STORAGE_CLASS(STORAGE_CLASS_ID)
......
......@@ -393,29 +393,29 @@ CREATE TABLE TAPE_FILE_RECYCLE_BIN(
REFERENCES TAPE_FILE_RECYCLE_BIN(VID, FSEQ)
);
CREATE TABLE FILE_RECYCLE_LOG(
FILE_RECYCLE_LOG_ID NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_ID_NN NOT NULL,
VID VARCHAR(100) CONSTRAINT FILE_RECYCLE_LOG_VID_NN NOT NULL,
FSEQ NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_FSEQ_NN NOT NULL,
BLOCK_ID NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_BID_NN NOT NULL,
LOGICAL_SIZE_IN_BYTES NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_LSIB_NN NOT NULL,
COPY_NB NUMERIC(3, 0) CONSTRAINT FILE_RECYCLE_LOG_COPY_NB_NN NOT NULL,
TAPE_FILE_CREATION_TIME NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_TFCT_NN NOT NULL,
ARCHIVE_FILE_ID NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_AFI_NN NOT NULL,
DISK_INSTANCE_NAME VARCHAR(100) CONSTRAINT FILE_RECYCLE_LOG_DIN_NN NOT NULL,
DISK_FILE_ID NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_DFI_NN NOT NULL,
DISK_FILE_ID_WHEN_DELETED NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_DFIWD_NN NOT NULL,
DISK_FILE_UID NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_DFU_NN NOT NULL,
DISK_FILE_GID NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_DFG_NN NOT NULL,
SIZE_IN_BYTES NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_SIB_NN NOT NULL,
CHECKSUM_BLOB BYTEA,
CHECKSUM_ADLER32 NUMERIC(10, 0) CONSTRAINT FILE_RECYCLE_LOG_CA_NN NOT NULL,
STORAGE_CLASS_ID NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_SCI_NN NOT NULL,
CREATION_TIME NUMERIC(20, 0) CONSTRAINT FILE_RECYLE_LOG_CT_NN NOT NULL,
RECONCILIATION_TIME NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_RT_NN NOT NULL,
COLLOCATION_HINT VARCHAR(100),
DISK_FILE_PATH VARCHAR(2000),
REASON_LOG VARCHAR(1000) CONSTRAINT FILE_RECYCLE_LOG_RL_NN NOT NULL,
RECYCLE_LOG_TIME NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_RLT_NN NOT NULL,
FILE_RECYCLE_LOG_ID NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_ID_NN NOT NULL,
VID VARCHAR(100) CONSTRAINT FILE_RECYCLE_LOG_VID_NN NOT NULL,
FSEQ NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_FSEQ_NN NOT NULL,
BLOCK_ID NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_BID_NN NOT NULL,
LOGICAL_SIZE_IN_BYTES NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_LSIB_NN NOT NULL,
COPY_NB NUMERIC(3, 0) CONSTRAINT FILE_RECYCLE_LOG_COPY_NB_NN NOT NULL,
TAPE_FILE_CREATION_TIME NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_TFCT_NN NOT NULL,
ARCHIVE_FILE_ID NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_AFI_NN NOT NULL,
DISK_INSTANCE_NAME VARCHAR(100) CONSTRAINT FILE_RECYCLE_LOG_DIN_NN NOT NULL,
DISK_FILE_ID NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_DFI_NN NOT NULL,
DISK_FILE_ID_WHEN_DELETED NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_DFIWD_NN NOT NULL,
DISK_FILE_UID NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_DFU_NN NOT NULL,
DISK_FILE_GID NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_DFG_NN NOT NULL,
SIZE_IN_BYTES NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_SIB_NN NOT NULL,
CHECKSUM_BLOB BYTEA,
CHECKSUM_ADLER32 NUMERIC(10, 0) CONSTRAINT FILE_RECYCLE_LOG_CA_NN NOT NULL,
STORAGE_CLASS_ID NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_SCI_NN NOT NULL,
ARCHIVE_FILE_CREATION_TIME NUMERIC(20, 0) CONSTRAINT FILE_RECYLE_LOG_CT_NN NOT NULL,
RECONCILIATION_TIME NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_RT_NN NOT NULL,
COLLOCATION_HINT VARCHAR(100),
DISK_FILE_PATH VARCHAR(2000),
REASON_LOG VARCHAR(1000) CONSTRAINT FILE_RECYCLE_LOG_RL_NN NOT NULL,
RECYCLE_LOG_TIME NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_RLT_NN NOT NULL,
CONSTRAINT FILE_RECYCLE_LOG_PK PRIMARY KEY(FILE_RECYCLE_LOG_ID),
CONSTRAINT FILE_RECYCLE_LOG_VID_FK FOREIGN KEY(VID) REFERENCES TAPE(VID),
CONSTRAINT FILE_RECYCLE_LOG_SC_FK FOREIGN KEY(STORAGE_CLASS_ID) REFERENCES STORAGE_CLASS(STORAGE_CLASS_ID)
......
......@@ -365,29 +365,29 @@ CREATE TABLE TAPE_FILE_RECYCLE_BIN(
REFERENCES TAPE_FILE_RECYCLE_BIN(VID, FSEQ)
);
CREATE TABLE FILE_RECYCLE_LOG(
FILE_RECYCLE_LOG_ID INTEGER CONSTRAINT FILE_RECYCLE_LOG_ID_NN NOT NULL,
VID VARCHAR(100) CONSTRAINT FILE_RECYCLE_LOG_VID_NN NOT NULL,
FSEQ INTEGER CONSTRAINT FILE_RECYCLE_LOG_FSEQ_NN NOT NULL,
BLOCK_ID INTEGER CONSTRAINT FILE_RECYCLE_LOG_BID_NN NOT NULL,
LOGICAL_SIZE_IN_BYTES INTEGER CONSTRAINT FILE_RECYCLE_LOG_LSIB_NN NOT NULL,
COPY_NB INTEGER CONSTRAINT FILE_RECYCLE_LOG_COPY_NB_NN NOT NULL,
TAPE_FILE_CREATION_TIME INTEGER CONSTRAINT FILE_RECYCLE_LOG_TFCT_NN NOT NULL,
ARCHIVE_FILE_ID INTEGER CONSTRAINT FILE_RECYCLE_LOG_AFI_NN NOT NULL,
DISK_INSTANCE_NAME VARCHAR(100) CONSTRAINT FILE_RECYCLE_LOG_DIN_NN NOT NULL,
DISK_FILE_ID INTEGER CONSTRAINT FILE_RECYCLE_LOG_DFI_NN NOT NULL,
DISK_FILE_ID_WHEN_DELETED INTEGER CONSTRAINT FILE_RECYCLE_LOG_DFIWD_NN NOT NULL,
DISK_FILE_UID INTEGER CONSTRAINT FILE_RECYCLE_LOG_DFU_NN NOT NULL,
DISK_FILE_GID INTEGER CONSTRAINT FILE_RECYCLE_LOG_DFG_NN NOT NULL,
SIZE_IN_BYTES INTEGER CONSTRAINT FILE_RECYCLE_LOG_SIB_NN NOT NULL,
CHECKSUM_BLOB BLOB(200),
CHECKSUM_ADLER32 INTEGER CONSTRAINT FILE_RECYCLE_LOG_CA_NN NOT NULL,
STORAGE_CLASS_ID INTEGER CONSTRAINT FILE_RECYCLE_LOG_SCI_NN NOT NULL,
CREATION_TIME INTEGER CONSTRAINT FILE_RECYLE_LOG_CT_NN NOT NULL,
RECONCILIATION_TIME INTEGER CONSTRAINT FILE_RECYCLE_LOG_RT_NN NOT NULL,
COLLOCATION_HINT VARCHAR(100),
DISK_FILE_PATH VARCHAR(2000),
REASON_LOG VARCHAR(1000) CONSTRAINT FILE_RECYCLE_LOG_RL_NN NOT NULL,
RECYCLE_LOG_TIME INTEGER CONSTRAINT FILE_RECYCLE_LOG_RLT_NN NOT NULL,
FILE_RECYCLE_LOG_ID INTEGER CONSTRAINT FILE_RECYCLE_LOG_ID_NN NOT NULL,
VID VARCHAR(100) CONSTRAINT FILE_RECYCLE_LOG_VID_NN NOT NULL,
FSEQ INTEGER CONSTRAINT FILE_RECYCLE_LOG_FSEQ_NN NOT NULL,
BLOCK_ID INTEGER CONSTRAINT FILE_RECYCLE_LOG_BID_NN NOT NULL,
LOGICAL_SIZE_IN_BYTES INTEGER CONSTRAINT FILE_RECYCLE_LOG_LSIB_NN NOT NULL,
COPY_NB INTEGER CONSTRAINT FILE_RECYCLE_LOG_COPY_NB_NN NOT NULL,
TAPE_FILE_CREATION_TIME INTEGER CONSTRAINT FILE_RECYCLE_LOG_TFCT_NN NOT NULL,
ARCHIVE_FILE_ID INTEGER CONSTRAINT FILE_RECYCLE_LOG_AFI_NN NOT NULL,
DISK_INSTANCE_NAME VARCHAR(100) CONSTRAINT FILE_RECYCLE_LOG_DIN_NN NOT NULL,
DISK_FILE_ID INTEGER CONSTRAINT FILE_RECYCLE_LOG_DFI_NN NOT NULL,
DISK_FILE_ID_WHEN_DELETED INTEGER CONSTRAINT FILE_RECYCLE_LOG_DFIWD_NN NOT NULL,
DISK_FILE_UID INTEGER CONSTRAINT FILE_RECYCLE_LOG_DFU_NN NOT NULL,
DISK_FILE_GID INTEGER CONSTRAINT FILE_RECYCLE_LOG_DFG_NN NOT NULL,
SIZE_IN_BYTES INTEGER CONSTRAINT FILE_RECYCLE_LOG_SIB_NN NOT NULL,
CHECKSUM_BLOB BLOB(200),
CHECKSUM_ADLER32 INTEGER CONSTRAINT FILE_RECYCLE_LOG_CA_NN NOT NULL,
STORAGE_CLASS_ID INTEGER CONSTRAINT FILE_RECYCLE_LOG_SCI_NN NOT NULL,
ARCHIVE_FILE_CREATION_TIME INTEGER CONSTRAINT FILE_RECYLE_LOG_CT_NN NOT NULL,
RECONCILIATION_TIME INTEGER CONSTRAINT FILE_RECYCLE_LOG_RT_NN NOT NULL,
COLLOCATION_HINT VARCHAR(100),
DISK_FILE_PATH VARCHAR(2000),
REASON_LOG VARCHAR(1000) CONSTRAINT FILE_RECYCLE_LOG_RL_NN NOT NULL,
RECYCLE_LOG_TIME INTEGER CONSTRAINT FILE_RECYCLE_LOG_RLT_NN NOT NULL,
CONSTRAINT FILE_RECYCLE_LOG_PK PRIMARY KEY(FILE_RECYCLE_LOG_ID),
CONSTRAINT FILE_RECYCLE_LOG_VID_FK FOREIGN KEY(VID) REFERENCES TAPE(VID),
CONSTRAINT FILE_RECYCLE_LOG_SC_FK FOREIGN KEY(STORAGE_CLASS_ID) REFERENCES STORAGE_CLASS(STORAGE_CLASS_ID)
......
......@@ -7369,29 +7369,29 @@ namespace catalogue{
" REFERENCES TAPE_FILE_RECYCLE_BIN(VID, FSEQ)"
");"
"CREATE TABLE FILE_RECYCLE_LOG("
" FILE_RECYCLE_LOG_ID NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_ID_NN NOT NULL,"
" VID VARCHAR2(100) CONSTRAINT FILE_RECYCLE_LOG_VID_NN NOT NULL,"
" FSEQ NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_FSEQ_NN NOT NULL,"
" BLOCK_ID NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_BID_NN NOT NULL,"
" LOGICAL_SIZE_IN_BYTES NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_LSIB_NN NOT NULL,"
" COPY_NB NUMERIC(3, 0) CONSTRAINT FILE_RECYCLE_LOG_COPY_NB_NN NOT NULL,"
" TAPE_FILE_CREATION_TIME NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_TFCT_NN NOT NULL,"
" ARCHIVE_FILE_ID NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_AFI_NN NOT NULL,"
" DISK_INSTANCE_NAME VARCHAR2(100) CONSTRAINT FILE_RECYCLE_LOG_DIN_NN NOT NULL,"
" DISK_FILE_ID NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_DFI_NN NOT NULL,"
" DISK_FILE_ID_WHEN_DELETED NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_DFIWD_NN NOT NULL,"
" DISK_FILE_UID NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_DFU_NN NOT NULL,"
" DISK_FILE_GID NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_DFG_NN NOT NULL,"
" SIZE_IN_BYTES NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_SIB_NN NOT NULL,"
" CHECKSUM_BLOB RAW(200),"
" CHECKSUM_ADLER32 NUMERIC(10, 0) CONSTRAINT FILE_RECYCLE_LOG_CA_NN NOT NULL,"
" STORAGE_CLASS_ID NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_SCI_NN NOT NULL,"
" CREATION_TIME NUMERIC(20, 0) CONSTRAINT FILE_RECYLE_LOG_CT_NN NOT NULL,"
" RECONCILIATION_TIME NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_RT_NN NOT NULL,"
" COLLOCATION_HINT VARCHAR2(100),"
" DISK_FILE_PATH VARCHAR2(2000),"
" REASON_LOG VARCHAR2(1000) CONSTRAINT FILE_RECYCLE_LOG_RL_NN NOT NULL, "
" RECYCLE_LOG_TIME NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_RLT_NN NOT NULL,"
" FILE_RECYCLE_LOG_ID NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_ID_NN NOT NULL,"
" VID VARCHAR2(100) CONSTRAINT FILE_RECYCLE_LOG_VID_NN NOT NULL,"
" FSEQ NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_FSEQ_NN NOT NULL,"
" BLOCK_ID NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_BID_NN NOT NULL,"
" LOGICAL_SIZE_IN_BYTES NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_LSIB_NN NOT NULL,"
" COPY_NB NUMERIC(3, 0) CONSTRAINT FILE_RECYCLE_LOG_COPY_NB_NN NOT NULL,"
" TAPE_FILE_CREATION_TIME NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_TFCT_NN NOT NULL,"
" ARCHIVE_FILE_ID NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_AFI_NN NOT NULL,"
" DISK_INSTANCE_NAME VARCHAR2(100) CONSTRAINT FILE_RECYCLE_LOG_DIN_NN NOT NULL,"
" DISK_FILE_ID NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_DFI_NN NOT NULL,"
" DISK_FILE_ID_WHEN_DELETED NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_DFIWD_NN NOT NULL,"
" DISK_FILE_UID NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_DFU_NN NOT NULL,"
" DISK_FILE_GID NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_DFG_NN NOT NULL,"
" SIZE_IN_BYTES NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_SIB_NN NOT NULL,"
" CHECKSUM_BLOB RAW(200),"
" CHECKSUM_ADLER32 NUMERIC(10, 0) CONSTRAINT FILE_RECYCLE_LOG_CA_NN NOT NULL,"
" STORAGE_CLASS_ID NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_SCI_NN NOT NULL,"
" ARCHIVE_FILE_CREATION_TIME NUMERIC(20, 0) CONSTRAINT FILE_RECYLE_LOG_CT_NN NOT NULL,"
" RECONCILIATION_TIME NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_RT_NN NOT NULL,"
" COLLOCATION_HINT VARCHAR2(100),"
" DISK_FILE_PATH VARCHAR2(2000),"
" REASON_LOG VARCHAR2(1000) CONSTRAINT FILE_RECYCLE_LOG_RL_NN NOT NULL, "
" RECYCLE_LOG_TIME NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_RLT_NN NOT NULL,"
" CONSTRAINT FILE_RECYCLE_LOG_PK PRIMARY KEY(FILE_RECYCLE_LOG_ID),"
" CONSTRAINT FILE_RECYCLE_LOG_VID_FK FOREIGN KEY(VID) REFERENCES TAPE(VID),"
" CONSTRAINT FILE_RECYCLE_LOG_SC_FK FOREIGN KEY(STORAGE_CLASS_ID) REFERENCES STORAGE_CLASS(STORAGE_CLASS_ID)"
......@@ -7788,29 +7788,29 @@ namespace catalogue{
" REFERENCES TAPE_FILE_RECYCLE_BIN(VID, FSEQ)"
");"
"CREATE TABLE FILE_RECYCLE_LOG("
" FILE_RECYCLE_LOG_ID BIGINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_ID_NN NOT NULL,"
" VID VARCHAR(100) CONSTRAINT FILE_RECYCLE_LOG_VID_NN NOT NULL,"
" FSEQ BIGINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_FSEQ_NN NOT NULL,"
" BLOCK_ID BIGINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_BID_NN NOT NULL,"
" LOGICAL_SIZE_IN_BYTES BIGINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_LSIB_NN NOT NULL,"
" COPY_NB TINYINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_COPY_NB_NN NOT NULL,"
" TAPE_FILE_CREATION_TIME BIGINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_TFCT_NN NOT NULL,"
" ARCHIVE_FILE_ID BIGINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_AFI_NN NOT NULL,"
" DISK_INSTANCE_NAME VARCHAR(100) CONSTRAINT FILE_RECYCLE_LOG_DIN_NN NOT NULL,"
" DISK_FILE_ID BIGINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_DFI_NN NOT NULL,"
" DISK_FILE_ID_WHEN_DELETED BIGINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_DFIWD_NN NOT NULL,"
" DISK_FILE_UID BIGINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_DFU_NN NOT NULL,"
" DISK_FILE_GID BIGINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_DFG_NN NOT NULL,"
" SIZE_IN_BYTES BIGINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_SIB_NN NOT NULL,"
" CHECKSUM_BLOB VARBINARY(200),"
" CHECKSUM_ADLER32 INT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_CA_NN NOT NULL,"
" STORAGE_CLASS_ID BIGINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_SCI_NN NOT NULL,"
" CREATION_TIME BIGINT UNSIGNED CONSTRAINT FILE_RECYLE_LOG_CT_NN NOT NULL,"
" RECONCILIATION_TIME BIGINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_RT_NN NOT NULL,"
" COLLOCATION_HINT VARCHAR(100),"
" DISK_FILE_PATH VARCHAR(2000),"
" REASON_LOG VARCHAR(1000) CONSTRAINT FILE_RECYCLE_LOG_RL_NN NOT NULL, "
" RECYCLE_LOG_TIME BIGINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_RLT_NN NOT NULL,"
" FILE_RECYCLE_LOG_ID BIGINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_ID_NN NOT NULL,"
" VID VARCHAR(100) CONSTRAINT FILE_RECYCLE_LOG_VID_NN NOT NULL,"
" FSEQ BIGINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_FSEQ_NN NOT NULL,"
" BLOCK_ID BIGINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_BID_NN NOT NULL,"
" LOGICAL_SIZE_IN_BYTES BIGINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_LSIB_NN NOT NULL,"
" COPY_NB TINYINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_COPY_NB_NN NOT NULL,"
" TAPE_FILE_CREATION_TIME BIGINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_TFCT_NN NOT NULL,"
" ARCHIVE_FILE_ID BIGINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_AFI_NN NOT NULL,"
" DISK_INSTANCE_NAME VARCHAR(100) CONSTRAINT FILE_RECYCLE_LOG_DIN_NN NOT NULL,"
" DISK_FILE_ID BIGINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_DFI_NN NOT NULL,"
" DISK_FILE_ID_WHEN_DELETED BIGINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_DFIWD_NN NOT NULL,"
" DISK_FILE_UID BIGINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_DFU_NN NOT NULL,"
" DISK_FILE_GID BIGINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_DFG_NN NOT NULL,"
" SIZE_IN_BYTES BIGINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_SIB_NN NOT NULL,"
" CHECKSUM_BLOB VARBINARY(200),"
" CHECKSUM_ADLER32 INT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_CA_NN NOT NULL,"
" STORAGE_CLASS_ID BIGINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_SCI_NN NOT NULL,"
" ARCHIVE_FILE_CREATION_TIME BIGINT UNSIGNED CONSTRAINT FILE_RECYLE_LOG_CT_NN NOT NULL,"
" RECONCILIATION_TIME BIGINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_RT_NN NOT NULL,"
" COLLOCATION_HINT VARCHAR(100),"
" DISK_FILE_PATH VARCHAR(2000),"
" REASON_LOG VARCHAR(1000) CONSTRAINT FILE_RECYCLE_LOG_RL_NN NOT NULL, "
" RECYCLE_LOG_TIME BIGINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_RLT_NN NOT NULL,"
" CONSTRAINT FILE_RECYCLE_LOG_PK PRIMARY KEY(FILE_RECYCLE_LOG_ID),"
" CONSTRAINT FILE_RECYCLE_LOG_VID_FK FOREIGN KEY(VID) REFERENCES TAPE(VID),"
" CONSTRAINT FILE_RECYCLE_LOG_SC_FK FOREIGN KEY(STORAGE_CLASS_ID) REFERENCES STORAGE_CLASS(STORAGE_CLASS_ID)"
......@@ -8192,29 +8192,29 @@ namespace catalogue{
" REFERENCES TAPE_FILE_RECYCLE_BIN(VID, FSEQ)"
");"
"CREATE TABLE FILE_RECYCLE_LOG("
" FILE_RECYCLE_LOG_ID INTEGER CONSTRAINT FILE_RECYCLE_LOG_ID_NN NOT NULL,"
" VID VARCHAR(100) CONSTRAINT FILE_RECYCLE_LOG_VID_NN NOT NULL,"
" FSEQ INTEGER CONSTRAINT FILE_RECYCLE_LOG_FSEQ_NN NOT NULL,"
" BLOCK_ID INTEGER CONSTRAINT FILE_RECYCLE_LOG_BID_NN NOT NULL,"
" LOGICAL_SIZE_IN_BYTES INTEGER CONSTRAINT FILE_RECYCLE_LOG_LSIB_NN NOT NULL,"
" COPY_NB INTEGER CONSTRAINT FILE_RECYCLE_LOG_COPY_NB_NN NOT NULL,"
" TAPE_FILE_CREATION_TIME INTEGER CONSTRAINT FILE_RECYCLE_LOG_TFCT_NN NOT NULL,"
" ARCHIVE_FILE_ID INTEGER CONSTRAINT FILE_RECYCLE_LOG_AFI_NN NOT NULL,"
" DISK_INSTANCE_NAME VARCHAR(100) CONSTRAINT FILE_RECYCLE_LOG_DIN_NN NOT NULL,"
" DISK_FILE_ID INTEGER CONSTRAINT FILE_RECYCLE_LOG_DFI_NN NOT NULL,"
" DISK_FILE_ID_WHEN_DELETED INTEGER CONSTRAINT FILE_RECYCLE_LOG_DFIWD_NN NOT NULL,"
" DISK_FILE_UID INTEGER CONSTRAINT FILE_RECYCLE_LOG_DFU_NN NOT NULL,"
" DISK_FILE_GID INTEGER CONSTRAINT FILE_RECYCLE_LOG_DFG_NN NOT NULL,"
" SIZE_IN_BYTES INTEGER CONSTRAINT FILE_RECYCLE_LOG_SIB_NN NOT NULL,"
" CHECKSUM_BLOB BLOB(200),"
" CHECKSUM_ADLER32 INTEGER CONSTRAINT FILE_RECYCLE_LOG_CA_NN NOT NULL,"
" STORAGE_CLASS_ID INTEGER CONSTRAINT FILE_RECYCLE_LOG_SCI_NN NOT NULL,"
" CREATION_TIME INTEGER CONSTRAINT FILE_RECYLE_LOG_CT_NN NOT NULL,"
" RECONCILIATION_TIME INTEGER CONSTRAINT FILE_RECYCLE_LOG_RT_NN NOT NULL,"
" COLLOCATION_HINT VARCHAR(100),"
" DISK_FILE_PATH VARCHAR(2000),"
" REASON_LOG VARCHAR(1000) CONSTRAINT FILE_RECYCLE_LOG_RL_NN NOT NULL, "
" RECYCLE_LOG_TIME INTEGER CONSTRAINT FILE_RECYCLE_LOG_RLT_NN NOT NULL,"
" FILE_RECYCLE_LOG_ID INTEGER CONSTRAINT FILE_RECYCLE_LOG_ID_NN NOT NULL,"
" VID VARCHAR(100) CONSTRAINT FILE_RECYCLE_LOG_VID_NN NOT NULL,"
" FSEQ INTEGER CONSTRAINT FILE_RECYCLE_LOG_FSEQ_NN NOT NULL,"
" BLOCK_ID INTEGER CONSTRAINT FILE_RECYCLE_LOG_BID_NN NOT NULL,"
" LOGICAL_SIZE_IN_BYTES INTEGER CONSTRAINT FILE_RECYCLE_LOG_LSIB_NN NOT NULL,"
" COPY_NB INTEGER CONSTRAINT FILE_RECYCLE_LOG_COPY_NB_NN NOT NULL,"
" TAPE_FILE_CREATION_TIME INTEGER CONSTRAINT FILE_RECYCLE_LOG_TFCT_NN NOT NULL,"
" ARCHIVE_FILE_ID INTEGER CONSTRAINT FILE_RECYCLE_LOG_AFI_NN NOT NULL,"
" DISK_INSTANCE_NAME VARCHAR(100) CONSTRAINT FILE_RECYCLE_LOG_DIN_NN NOT NULL,"
" DISK_FILE_ID INTEGER CONSTRAINT FILE_RECYCLE_LOG_DFI_NN NOT NULL,"
" DISK_FILE_ID_WHEN_DELETED INTEGER CONSTRAINT FILE_RECYCLE_LOG_DFIWD_NN NOT NULL,"
" DISK_FILE_UID INTEGER CONSTRAINT FILE_RECYCLE_LOG_DFU_NN NOT NULL,"
" DISK_FILE_GID INTEGER CONSTRAINT FILE_RECYCLE_LOG_DFG_NN NOT NULL,"
" SIZE_IN_BYTES INTEGER CONSTRAINT FILE_RECYCLE_LOG_SIB_NN NOT NULL,"
" CHECKSUM_BLOB BLOB(200),"
" CHECKSUM_ADLER32 INTEGER CONSTRAINT FILE_RECYCLE_LOG_CA_NN NOT NULL,"
" STORAGE_CLASS_ID INTEGER CONSTRAINT FILE_RECYCLE_LOG_SCI_NN NOT NULL,"
" ARCHIVE_FILE_CREATION_TIME INTEGER CONSTRAINT FILE_RECYLE_LOG_CT_NN NOT NULL,"
" RECONCILIATION_TIME INTEGER CONSTRAINT FILE_RECYCLE_LOG_RT_NN NOT NULL,"
" COLLOCATION_HINT VARCHAR(100),"
" DISK_FILE_PATH VARCHAR(2000),"
" REASON_LOG VARCHAR(1000) CONSTRAINT FILE_RECYCLE_LOG_RL_NN NOT NULL, "
" RECYCLE_LOG_TIME INTEGER CONSTRAINT FILE_RECYCLE_LOG_RLT_NN NOT NULL,"
" CONSTRAINT FILE_RECYCLE_LOG_PK PRIMARY KEY(FILE_RECYCLE_LOG_ID),"
" CONSTRAINT FILE_RECYCLE_LOG_VID_FK FOREIGN KEY(VID) REFERENCES TAPE(VID),"
" CONSTRAINT FILE_RECYCLE_LOG_SC_FK FOREIGN KEY(STORAGE_CLASS_ID) REFERENCES STORAGE_CLASS(STORAGE_CLASS_ID)"
......@@ -8622,29 +8622,29 @@ namespace catalogue{
" REFERENCES TAPE_FILE_RECYCLE_BIN(VID, FSEQ)"
");"
"CREATE TABLE FILE_RECYCLE_LOG("
" FILE_RECYCLE_LOG_ID NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_ID_NN NOT NULL,"
" VID VARCHAR(100) CONSTRAINT FILE_RECYCLE_LOG_VID_NN NOT NULL,"
" FSEQ NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_FSEQ_NN NOT NULL,"
" BLOCK_ID NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_BID_NN NOT NULL,"
" LOGICAL_SIZE_IN_BYTES NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_LSIB_NN NOT NULL,"
" COPY_NB NUMERIC(3, 0) CONSTRAINT FILE_RECYCLE_LOG_COPY_NB_NN NOT NULL,"
" TAPE_FILE_CREATION_TIME NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_TFCT_NN NOT NULL,"
" ARCHIVE_FILE_ID NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_AFI_NN NOT NULL,"
" DISK_INSTANCE_NAME VARCHAR(100) CONSTRAINT FILE_RECYCLE_LOG_DIN_NN NOT NULL,"
" DISK_FILE_ID NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_DFI_NN NOT NULL,"
" DISK_FILE_ID_WHEN_DELETED NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_DFIWD_NN NOT NULL,"
" DISK_FILE_UID NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_DFU_NN NOT NULL,"
" DISK_FILE_GID NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_DFG_NN NOT NULL,"
" SIZE_IN_BYTES NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_SIB_NN NOT NULL,"
" CHECKSUM_BLOB BYTEA,"
" CHECKSUM_ADLER32 NUMERIC(10, 0) CONSTRAINT FILE_RECYCLE_LOG_CA_NN NOT NULL,"
" STORAGE_CLASS_ID NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_SCI_NN NOT NULL,"
" CREATION_TIME NUMERIC(20, 0) CONSTRAINT FILE_RECYLE_LOG_CT_NN NOT NULL,"
" RECONCILIATION_TIME NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_RT_NN NOT NULL,"
" COLLOCATION_HINT VARCHAR(100),"
" DISK_FILE_PATH VARCHAR(2000),"
" REASON_LOG VARCHAR(1000) CONSTRAINT FILE_RECYCLE_LOG_RL_NN NOT NULL, "
" RECYCLE_LOG_TIME NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_RLT_NN NOT NULL,"
" FILE_RECYCLE_LOG_ID NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_ID_NN NOT NULL,"
" VID VARCHAR(100) CONSTRAINT FILE_RECYCLE_LOG_VID_NN NOT NULL,"
" FSEQ NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_FSEQ_NN NOT NULL,"
" BLOCK_ID NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_BID_NN NOT NULL,"
" LOGICAL_SIZE_IN_BYTES NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_LSIB_NN NOT NULL,"
" COPY_NB NUMERIC(3, 0) CONSTRAINT FILE_RECYCLE_LOG_COPY_NB_NN NOT NULL,"
" TAPE_FILE_CREATION_TIME NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_TFCT_NN NOT NULL,"
" ARCHIVE_FILE_ID NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_AFI_NN NOT NULL,"
" DISK_INSTANCE_NAME VARCHAR(100) CONSTRAINT FILE_RECYCLE_LOG_DIN_NN NOT NULL,"
" DISK_FILE_ID NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_DFI_NN NOT NULL,"
" DISK_FILE_ID_WHEN_DELETED NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_DFIWD_NN NOT NULL,"
" DISK_FILE_UID NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_DFU_NN NOT NULL,"
" DISK_FILE_GID NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_DFG_NN NOT NULL,"
" SIZE_IN_BYTES NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_SIB_NN NOT NULL,"
" CHECKSUM_BLOB BYTEA,"
" CHECKSUM_ADLER32 NUMERIC(10, 0) CONSTRAINT FILE_RECYCLE_LOG_CA_NN NOT NULL,"
" STORAGE_CLASS_ID NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_SCI_NN NOT NULL,"
" ARCHIVE_FILE_CREATION_TIME NUMERIC(20, 0) CONSTRAINT FILE_RECYLE_LOG_CT_NN NOT NULL,"
" RECONCILIATION_TIME NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_RT_NN NOT NULL,"
" COLLOCATION_HINT VARCHAR(100),"
" DISK_FILE_PATH VARCHAR(2000),"
" REASON_LOG VARCHAR(1000) CONSTRAINT FILE_RECYCLE_LOG_RL_NN NOT NULL, "
" RECYCLE_LOG_TIME NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_RLT_NN NOT NULL,"
" CONSTRAINT FILE_RECYCLE_LOG_PK PRIMARY KEY(FILE_RECYCLE_LOG_ID),"
" CONSTRAINT FILE_RECYCLE_LOG_VID_FK FOREIGN KEY(VID) REFERENCES TAPE(VID),"
" CONSTRAINT FILE_RECYCLE_LOG_SC_FK FOREIGN KEY(STORAGE_CLASS_ID) REFERENCES STORAGE_CLASS(STORAGE_CLASS_ID)"
......
/*
* The CERN Tape Archive (CTA) project
* Copyright (C) 2019 CERN
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <string>
#include "TapeItemWritten.hpp"
#include "TapeFileWritten.hpp"
namespace cta { namespace catalogue {
struct InsertFileRecycleLog {
std::string vid;
uint64_t fseq;
uint64_t blockId;
uint64_t logicalSizeInBytes;
uint64_t copyNb;
time_t tapeFileCreationTime;
uint64_t archiveFileId;
std::string diskInstanceName;
uint64_t diskFileId;
uint64_t diskFileIdWhenDeleted;
uint64_t diskFileUid;
uint64_t diskFileGid;
uint64_t sizeInBytes;
checksum::ChecksumBlob checksumBlob;
uint32_t checksumAdler32;
uint64_t storageClassId;
time_t archiveFileCreationTime;
time_t reconciliationTime;
std::string collocationHint;
std::string diskFilePath;
std::string reasonLog;
time_t recycleLogTime;
};
}}
......@@ -19,6 +19,7 @@
#include "catalogue/ArchiveFileRow.hpp"
#include "catalogue/OracleCatalogue.hpp"
#include "catalogue/retryOnLostConnection.hpp"
#include "catalogue/InsertFileRecycleLog.hpp"
#include "common/exception/Exception.hpp"
#include "common/exception/LostDatabaseConnection.hpp"
#include "common/exception/TapeFseqMismatch.hpp"
......@@ -581,53 +582,24 @@ void OracleCatalogue::filesWrittenToTape(const std::set<TapeItemWrittenPointer>
stmt.executeNonQuery();
}
insertOldCopiesOfFilesIfAnyOnFileRecycleLog(conn, fileEvents);
{
//DELETE the TAPE_FILEs that come from a tape to repack
/*const char *const sql =
"DELETE FROM TAPE_FILE WHERE (ARCHIVE_FILE_ID, COPY_NB, VID) IN "
"("
"SELECT "
"TF.ARCHIVE_FILE_ID,"
"TF.COPY_NB,"
"TF.VID "
// Using MAX(FSEQ) to cover the same tape copy being written more than
// once. The last one written supersedes the previous ones.
"FROM "
"TAPE_FILE TF JOIN "
"TEMP_TAPE_FILE_INSERTION_BATCH TTFIB "
"ON TF.ARCHIVE_FILE_ID = TTFIB.ARCHIVE_FILE_ID AND TF.COPY_NB = TTFIB.COPY_NB "
std::list<InsertFileRecycleLog> recycledFiles = insertOldCopiesOfFilesIfAnyOnFileRecycleLog(conn);
for(auto & recycledFile: recycledFiles){
const char *const sql =
"DELETE FROM "
"TAPE_FILE "
"WHERE "
"TF.VID != TTFIB.VID "
")";*/
const char * const sql = "MERGE INTO" "\n"
"TAPE_FILE" "\n"
"USING(" "\n"
"SELECT" "\n"
"ARCHIVE_FILE_ID," "\n"
"COPY_NB," "\n"
"VID," "\n"
// Using MAX(FSEQ) to cover the same tape copy being written more than
// once. The last one written supersedes the previous ones.
"MAX(FSEQ) AS MAX_FSEQ" "\n"
"FROM" "\n"
"TEMP_TAPE_FILE_INSERTION_BATCH" "\n"
"GROUP BY" "\n"
"ARCHIVE_FILE_ID, COPY_NB, VID" "\n"
") TEMP" "\n"
"ON(" "\n"
"TAPE_FILE.ARCHIVE_FILE_ID = TEMP.ARCHIVE_FILE_ID AND" "\n"
"TAPE_FILE.COPY_NB = TEMP.COPY_NB)" "\n"
"WHEN MATCHED THEN" "\n"
"UPDATE SET" "\n"
"TAPE_FILE.SUPERSEDED_BY_VID = TEMP.VID," "\n"
"TAPE_FILE.SUPERSEDED_BY_FSEQ = TEMP.MAX_FSEQ" "\n"
"WHERE" "\n"
"NOT(TAPE_FILE.VID = TEMP.VID AND TAPE_FILE.FSEQ = TEMP.MAX_FSEQ)";
conn.setAutocommitMode(rdbms::AutocommitMode::AUTOCOMMIT_ON);
"TAPE_FILE.VID = :VID AND TAPE_FILE.FSEQ = :FSEQ";
auto stmt = conn.createStmt(sql);
stmt.bindString(":VID",recycledFile.vid);
stmt.bindUint64(":FSEQ",recycledFile.fseq);
stmt.executeNonQuery();
}
{
conn.setAutocommitMode(rdbms::AutocommitMode::AUTOCOMMIT_ON);
conn.commit();
}
} catch(exception::UserError &) {
throw;
......@@ -789,8 +761,117 @@ void OracleCatalogue::idempotentBatchInsertArchiveFiles(rdbms::Conn &conn, const
}
}
void OracleCatalogue::insertOldCopiesOfFilesIfAnyOnFileRecycleLog(rdbms::Conn& conn, const std::set<TapeFileWritten>& events) {
//TODO: A CONTINUER
std::list<cta::catalogue::InsertFileRecycleLog> OracleCatalogue::insertOldCopiesOfFilesIfAnyOnFileRecycleLog(rdbms::Conn& conn) {
std::list<cta::catalogue::InsertFileRecycleLog> fileRecycleLogsToInsert;
try {
//Get the TAPE_FILE entry to put on the file recycle log
{
const char *const sql =
"SELECT "
"TAPE_FILE.VID AS VID,"
"TAPE_FILE.FSEQ AS FSEQ,"
"TAPE_FILE.BLOCK_ID AS BLOCK_ID,"
"TAPE_FILE.LOGICAL_SIZE_IN_BYTES AS LOGICAL_SIZE_IN_BYTES,"
"TAPE_FILE.COPY_NB AS COPY_NB,"
"TAPE_FILE.CREATION_TIME AS TAPE_FILE_CREATION_TIME,"
"TAPE_FILE.ARCHIVE_FILE_ID AS ARCHIVE_FILE_ID "
"FROM "
"TAPE_FILE "
"JOIN "
"TEMP_TAPE_FILE_INSERTION_BATCH "
"ON "
"TEMP_TAPE_FILE_INSERTION_BATCH.ARCHIVE_FILE_ID = TAPE_FILE.ARCHIVE_FILE_ID AND TEMP_TAPE_FILE_INSERTION_BATCH.COPY_NB = TAPE_FILE.COPY_NB "