How do I cleanup SmartStor data?

Document ID : KB000056953
Last Modified Date : 14/02/2018
Show Technical Document Details

Description:

How do I cleanup Smartstor data?

 

Solution:

SmartStor is an embedded database in the Enterprise Manager server. (Hereafter called the EM.) It holds both the live and historical metric data which can be used for future analysis. SmartStor holds huge amount of data when Introscope starts to monitor ‘n’ number of agents. Note, there is no automated purging activity to remove unnecessary metrics from SmartStor database.

To avoid performance problems and to increase the capacity of Smartstor, SmartStor has to be cleansed on a quarterly basis. This work has to be done based on amount of historical metrics stored in SmartStor. If the historical metrics is crossing the threshold set by implementer, then SmartStor has to be pruned.

 

Step-1: Shutdown Enterprise Manger

Explanation: SmartStor continues to store live metrics data if the EM is up and running. Stopping the EM will stop Smartstor from storing data. Also if data is removed when EM is running, the results will be unpredictable and we will lose some amount of data.

Command:

cd /EM_HOME/bin

./EMCtrl.sh stop

 

Step 2: Backup SmartStor Source directory

Explanation: Always it’s good to take backup of SmartStor source directory to avoid troublesome situations before trimming the unnecessary metrics.

Command:

Navigate to up one level <data> directory

Run the below command

cp –r data <Backup_Dir_Name>

 

Step 3: Check Individual Metrics Count

Explanation:  Before removal, checking the individual metrics count gives us a proper idea to understand the amount of metrics. Also we can find out if needed which metrics are occupying more space in Smartstor. By seeing this, we can conclude which metrics has to be removed.

 

Command:

Navigate to smarstor tools directory

cd EM_HOME/tools

./SmartStorTools.sh test_regex -metrics \(.*\) -src /u01/ca/data/collector/data | grep '|'.* | awk -F'|' '{print $1}' | sort | uniq –c

 

Step 4: Remove unnecessary metrics(Usually backends(SQL),Sockets, JMX metrics)

Explanation:  Removing unnecessary metrics will improve the performance of smartStor

Command:

Navigate to smarstor tools directory

cd EM_HOME/tools

./SmartStorTools.sh remove_metrics -metrics  “(.*)SQL(.*)” -src /u01/ca/data/collector/data -dest <Output destination directory>

Note: The output destination directory has to be created before running above command to store the SQL removed metrics other than source directory.

 

Step 5: Move the contents of destination directory to the source directory

Explanation:  Only the destination directory is having the metrics with SQL removed. But the Enterprise Manager refers to actual SmarStor source directory with all metrics. Replacing the source directory with destination directory contents will make the source directory having the metrics with SQL is removed.

Command:

Use basic Unix command to perform below steps:

Navigate to the SmartStor source directory and delete the source directory contents

Move the output destination directory contents to the source directory

Repeat the Step 4 and Step 5 to remove any other metrics(Sockets, JMX) based on the size of metrics count.

 

Step 6:  Prune metrics

Explanation:  Removing the unnecessary metrics will remove the data values associated with each metric. But pruning metrics will remove the metric names, metric category, etc.. Only if pruning metrics will the size be reduced.

Command:

cd EM_HOME/tools

./SmartStorTools.sh prune –src /u01/ca/data/collector/data –dest <Output destination directory>

Note: The output destination directory has to be created before running the above command to prune metrics other than source directory.

 

Once the above step is done, Repeat Step 5 to replace the source directory contents

 

Step 7:  Confirm individual metrics count

Explanation:  Check the individual metrics count again to confirm the metrics have been removed properly. Also this will help confirm whether the SmartStor size has been reduced

Command:

Navigate to SmarStor tools directory

cd EM_HOME/tools

./SmartStorTools.sh test_regex -metrics \(.*\) -src /u01/ca/data/collector/data | grep '|'.* | awk -F'|' '{print $1}' | sort | uniq –c

After confirming, start Enterprise Manager by using below command

cd /EM_HOME/bin

./EMCtrl.sh start

 

 

The following Technical Document on our support site also provided with SmartStor help and details:

http://www.ca.com/us/support/ca-support-online/product-content/knowledgebase-articles/tec609741.aspx