Novell Home

Log Tables and Size Limits

Novell Cool Solutions: Tip
By Jason Doering

Digg This - Slashdot This

Posted: 31 Aug 2005
 

A reader asked:

"Anyone know how to manually create a new log table without using the SQL expiration commands? Sometimes my table fills up before the expiration interval, and I want to create one manually without having to redo my expiration time and re-loading lengine."

And here's the reply from Forum expert Jason Doering ...


Lengine will automatically create a new table at startup if the designated table does not exist. In order to manually move the table the way you describe, you must unload lengine so that it will not be writing to the table while you are moving it.

If you really want to manually move the log table, here are your steps:
  1. Stop Auditing: unload lengine
  2. Open MySQL console: mysql -u auditusr -p
  3. Enter the auditusr password.
  4. Select the Audit database: use naudit;
  5. Move the table: rename table <old table> to <new table>;
  6. Leave MySQL console: exit
  7. Start Auditing: load lengine -d

Long term, you are better off allowing for larger tables. MySQL tables default to a 4GB limit, but you can go bigger. See the documentation:
http://dev.mysql.com/doc/mysql/en/table-size.html

To allow for larger tables with Audit, you must set the AVG_ROW_LENGTH and MAX_ROWS options in the "create table options" field, just above the expiration command field. I use these settings:

MAX_ROWS=10000000 AVG_ROW_LENGTH=225

Note: The parameters must be entered in the format shown here - no spaces around the "=" and no carriage returns.

This gives me plenty of room for a week's data from my ~250 users. The average row length for a table is shown in the "show table status;" command at the MySQL console. Maximum rows really depends on your user count and auditing selections.

A MySQL table file can grow huge on NetWare. You just need to set the average row size and maximum rows parameters to allow MySQL to tune the internal structures. Before I set these parameters, if lengine filled a table to 4GB, that table became badly corrupted. Since I set the parameters, I have not had any issues. The limit is the maximum size of a single file on NSS.


Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions. www.webwiseone.com

© 2014 Novell