AppD Archive

Table repair

CommunityUser
Splunk Employee
Splunk Employee

I hope this is the correct board. We are getting the error:

java.sql.SQLException: Table '.\dbtuna\statistics' is marked as crashed and should be repaired

How do we go about addressing this issue?

Thanks!!

0 Karma
1 Solution

Arun_Dasetty
Super Champion

Hi,

Thanks for writing to appsphere community forum. From the provided stacktrace we understood that statistics table is corruped/not exist, let us know if any disconnect, if the above said is right, please find the steps to drop and re-create table statistics table under dbtuna database , we request you to stop the dbtuanUI service before executing the following query and restart both dbtunaUI and dbtunaDB services after the following changes:

1) please do change the mysql user password if any in the below command as per mysql database properties under mysql.properties file located under <APPD4DB|Dbtuna_INSTALL_DIR>\apache-tomcat\webapps\ROOT\shared directory:

<APPD4DB|Dbtuna_INSTALL_DIR>\mysql\bin>mysql --user=pw --password=pw  --port=8091
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4422
Server version: 5.0.91-classic-nt MySQL Enterprise Server - Classic Edition (Commercial)

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> use dbtuna;
Database changed

2) check whether statistics tables related files exists in dbutna installation directory,
please be sure to check whether the following files exists under directory <APPD4DB|Dbtuna_INSTALL_DIR>mysql\data\dbtuna ,
take a backup of all the three files and delete the 3 files from that location:

statistics.frm, statistics.MYD, statistics.MYI

3) the following steps will try to drop the table if exists and then re-create table statistics table:

mysql> truncate table statistics;
mysql> drop table statistics;
mysql> CREATE TABLE `statistics` (   `statistic_id` smallint(5) unsigned default NULL,   `host` varchar(20) character set utf8 default NULL,   `timeslice` timestamp NOT NULL default CURRENT_TIMESTAMP,   `statistic_value` double default NULL,   `keep` tinyint(1) default '0',   KEY `stats_idx` (`timeslice`,`host`,`statistic_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1;

Let us know if the above information helps to resolve the issue. Let us know how it goes.

Yes you are in right forum, But we request you to file appdynamics for database/dbtuna releated queries under section:
http://appsphere.appdynamics.com/t5/forums/postpage/board-id/PRO_DB so that you will response from the corresponding team.

Thanks,

Arun

View solution in original post

0 Karma

Arun_Dasetty
Super Champion

Hi,

Thanks for writing to appsphere community forum. From the provided stacktrace we understood that statistics table is corruped/not exist, let us know if any disconnect, if the above said is right, please find the steps to drop and re-create table statistics table under dbtuna database , we request you to stop the dbtuanUI service before executing the following query and restart both dbtunaUI and dbtunaDB services after the following changes:

1) please do change the mysql user password if any in the below command as per mysql database properties under mysql.properties file located under <APPD4DB|Dbtuna_INSTALL_DIR>\apache-tomcat\webapps\ROOT\shared directory:

<APPD4DB|Dbtuna_INSTALL_DIR>\mysql\bin>mysql --user=pw --password=pw  --port=8091
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4422
Server version: 5.0.91-classic-nt MySQL Enterprise Server - Classic Edition (Commercial)

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> use dbtuna;
Database changed

2) check whether statistics tables related files exists in dbutna installation directory,
please be sure to check whether the following files exists under directory <APPD4DB|Dbtuna_INSTALL_DIR>mysql\data\dbtuna ,
take a backup of all the three files and delete the 3 files from that location:

statistics.frm, statistics.MYD, statistics.MYI

3) the following steps will try to drop the table if exists and then re-create table statistics table:

mysql> truncate table statistics;
mysql> drop table statistics;
mysql> CREATE TABLE `statistics` (   `statistic_id` smallint(5) unsigned default NULL,   `host` varchar(20) character set utf8 default NULL,   `timeslice` timestamp NOT NULL default CURRENT_TIMESTAMP,   `statistic_value` double default NULL,   `keep` tinyint(1) default '0',   KEY `stats_idx` (`timeslice`,`host`,`statistic_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1;

Let us know if the above information helps to resolve the issue. Let us know how it goes.

Yes you are in right forum, But we request you to file appdynamics for database/dbtuna releated queries under section:
http://appsphere.appdynamics.com/t5/forums/postpage/board-id/PRO_DB so that you will response from the corresponding team.

Thanks,

Arun

0 Karma

CommunityUser
Splunk Employee
Splunk Employee

After recreating the table it looks like we are back up and running.

Thanks much!

0 Karma
Get Updates on the Splunk Community!

See just what you’ve been missing | Observability tracks at Splunk University

Looking to sharpen your observability skills so you can better understand how to collect and analyze data from ...

Weezer at .conf25? Say it ain’t so!

Hello Splunkers, The countdown to .conf25 is on-and we've just turned up the volume! We're thrilled to ...

How SC4S Makes Suricata Logs Ingestion Simple

Network security monitoring has become increasingly critical for organizations of all sizes. Splunk has ...