Applied to Maria DB


Problem: Cannot see the event logs in BioStar 2 monitoring for certain month


Related Problem:


Cause 

 - The schema of Maria DB has been corrupted.



How to check the issue


1. Confirm if you have the table information for the month.

i.e. Let's say, we cannot see the logs of March.


2. Run Heidi SQL or MySQL workbench


3. Run the query below

SELECT * FROM biostar2_ac.t_lg202003

*Please check the month and update the query.


4. Confirm if there is error code:1033. Incorrect information in file:


5. If there is the same error, you should try to restore the corrupted scheme.



How to resolve the case



1. Just in case, make a backup DB first.


2. Stop BioStar2 Server


3. Run MySQL Worbench


4. Delete all data raw from the table "t_lstlog"



5. Create a temporary DB name. 


6. Create same table name of t_lg202003.

*Please check the month and update the query.


CREATE TABLE IF NOT EXISTS `T_LG202003` (

  `EVTLGUID` int(11) NOT NULL AUTO_INCREMENT,

  `SRVDT` Datetime,

  `DEVDT` INT,

  `DEVUID` INT NOT NULL,

  `PKTDEVID` INT NOT NULL,

  `DEVLGIDX` DECIMAL(38,0) NOT NULL,

  `IMGLGUID` CHAR(32),

  `USRID` CHAR(32),

  `USRGRUID` INT,

  `EVT` INT,

  `CRDSL` INT,

  `TNAKEY` INT,

  `DRUID` INT,

  `ZNUID` INT,

  `ELVTUID` INT,

  `DRUID1` INT,

  `DRUID2` INT,

  `DRUID3` INT,

  `IS_DST` INT,

  `TMZN_HALF` INT,

  `TMZN_HOUR` INT,

  `TMZN_NEGTV` INT,

  `USRUDTBYDEV` CHAR(1),

  `HINT` VARCHAR(50),

  PRIMARY KEY (`EVTLGUID`),

  UNIQUE KEY `UNIQUE_DEVLOG` (`PKTDEVID`,`DEVLGIDX`),

  KEY `IDX_USRID` (`USRID`),

  KEY `IDX_USRGRUID` (`USRGRUID`),

  KEY `IDX_EVT` (`EVT`),

  KEY `IDX_DEVUID` (`DEVUID`),

  KEY `IDX_HINT` (`HINT`),

  KEY `DEVDT_UID_DT_T_LG202003_IX` (`DEVDT`),

  KEY `IX_TN_DYN_T_LG202003_LG` (`IMGLGUID`)

)



6-1. Stop Maria DB Server


7. Go to the directory of Maria DB (C:\Program Files\BioStar 2(x64)\ta\mariadb-10.1.10-winx64\data\NEW DB NAME\)



8. Copy t_lg202003.frm and paste it to C:\Program Files\BioStar 2(x64)\ta\mariadb-10.1.10-winx64\data\biostar2_ac\


8.1 Start Maria DB Server


9. Start BioStar2 Server


10. Confirm if the logs on March are updated to BioStar2 Server


11. Delete the temporary DB information if you do not want to have the DB