Fixing file system space allocation issues for the Symantec Mail Security for SMTP 5 MySQL database.

Article:TECH85653  |  Created: 2007-01-09  |  Updated: 2010-09-04  |  Article URL http://www.symantec.com/docs/TECH85653
Article Type
Technical Solution


Environment

Issue



After Symantec Mail Security for SMTP 5 software has been installed and allowed to run for a period of time, there is little hard drive space available. Investigation shows that the MySQL database appears to be the reason for the apparent lack of drive space.

Symptoms
Hard drive space was plentiful immediately following installation of Symantec Mail Security

  • After a period of time has passed the available space on the hard drive starts to get smaller and smaller.
  • The <drive:\...\SMSSMTP\MySQL\ directory and sub-directories show as being unusually large for the given environment.

Cause



This is typically caused by settings within the control center, however this can also be caused by the "MySQL tables." A good rule to use when working on "MySQL tables" is that the myd files should never exceed 1 GB in size a piece. The .myi files should not cumulatively exceed the machines maximum amount of RAM. If the files have exceeded this limit, the system will utilize the swap file when reading/writing to the database and this can cause an excess of additional resources to be used.


Solution



To solve this issue, the size of the SQL tables must be reduced.

Note: Before doing this, make a backup of the files that contain the table data in question. (These files are the .myi, .myd, and .frm)
 

  1. Make a MySQL table structure on the file system.
  2. After the backup you will need to perform two MySQL checks which will repair and optimize the MySQL database.



If optimizing the tables does not reduce their file size, then you will need to contact your Symantec Support representative as more detailed troubleshooting will be needed at this point.

To backup the file-system tables:

1. Right click the myd or myi file in question and click copy.
2. Paste the file to a different location, (another drive, CD, DVD, et al.)


To run MySQLcheck on Windows

  1. Open a command prompt.
  2. Change to the folder:
     \Program Files\Symantec\SMSSMTP \MySQL\bin
  3. At the command prompt, type:
    mysqlcheck -h127.0.0.1 --auto-repair -ubrightmailuser -p<password> brightmail >check.txt

    Where <password> is the value found in the Brightmailuser file. This file is located in the folder:  \Program Files\Symantec\SMSSMTP

    This command checks and repairs the tables and outputs the results to the file Check.txt. The time to output the results to the file check.txt depends on the size of the MySQL database. The larger the database, the longer the time.

     
  4. Once the MySQLcheck is finished, to see the results, type: Notepad check.txt 
  5. All tables should have the message of OK or Table is already up-to-date next to them. 
    If they do not, you may need to manually repair them.
      • To do this , run the  following command at the \Program Files\Symantec\SMSSMTP \MySQL\bin prompt: 
        mysql -h127.0.0.1 -ubrightmailuser -p<password> brightmail

      • You will receive a message welcoming you to the MySQL monitor and a MySQL> prompt.
      • At the prompt type the command: repair table <tablename> ;

        Note: Where <tablename> is the name of the corrupt table minus the Brightmail prefix.  (Note the semicolon at the end of the command.  If you run the command and receive a prompt symbol
        ( -> ), you did not use a semicolon. Enter a semicolon to get out of the command and retype it using the semicolon.)

         
  6. Once the repair of the table finishes, a table will be displayed, check to ensure that the status field contains the word OK.
  7. Repeat the above command for each corrupted table. 



To run MySQLcheck on Linux or Solaris

  1. Open a command prompt.
  2. Change to the /opt/Symantec/SMSSMTP/MySQL/bin
  3. At the prompt, type:

    ./mysqlcheck -h127.0.0.1 -ubrightmailuser -p`cat /opt/Symantec/SMSSMTP/.brightmailuser` brightmail --auto-repair >check.txt

    Note: The ` are left leaning single quotes is the key with the tilde ( ~) and is not the single quote character which is under the double quotes.

     
  4. Once the MySQLcheck has finished, open the file check.txt with a text editor to see the results.
  5. This command checks and repairs the tables and outputs the results to the file Check.txt.
    • Note: The time to output the results to the file check.txt depends on the size of the MySQL database. The larger the database, the longer the time.

       
  6. Once the MySQLcheck is finished, to see the results, type:
    <text editor> check.txt

    Note: Where <text editor> is an editor other than Notepad.

     
  7. All tables should have the message of OK or Table is already up-to-date next to them. 
    If they do not, you may need to manually repair them.
    • To do this , run the  following command at the \Program Files\Symantec\SMSSMTP \MySQL\bin prompt: 
      mysql -h127.0.0.1 -ubrightmailuser -p`cat /opt/Symantec/SMSSMTP/.brightmailuser` brightmail

       
    • You will receive a message welcoming you to the MySQL monitor and a MySQL> prompt. At the prompt type the command:
      repair table <tablename> ;

      Note: Where <tablename> is the name of the corrupt table minus the Brightmail prefix.  Also please note the semicolon at the end of the command.  If you run the command and receive a prompt symbol ( -> ), you did not use a semicolon.  Enter a semicolon to get out of the command and retype it using the semicolon. 

       
  8. Once the repair of the table finishes, a table will be displayed, check and ensure that the status field contains the word OK.
  9. Repeat the above command for each corrupted table.


Legacy ID



2007100914213754


Article URL http://www.symantec.com/docs/TECH85653


Terms of use for this information are found in Legal Notices