How to manually reduce the size of SecureWave Logs

  • 3273262
  • 18-Jul-2007
  • 30-Apr-2012

Environment

SecureWave 4

Situation

Transaction log grows too large.

Resolution

Follow the steps below to manually reduce the log size.

Additional Information

First look to see what kind of logging is enabled. Then look at what log data is being generated.

The following methods are to decrease the size of the database for version 4.x.
It is recommended to use the Database Maintenance option (Tools->Database Maintenance) in the SMC. These methods are for extreme cases.

Method one will delete the historical data in the database. The other methods are more precise but still are resource intensive for the SQL server which will delete data based on time or criteria. It is HIGHLY recommended to make sure there is a WORKING backup of the sx database before these methods are run.

* Before applying one of the following steps please make sure to have a working backup of the sx database and the DataFileDirectory.

* Please make sure the SecureWave Application Server service is Stopped

There are different ways to delete the logging information:

Method 1:If you want to delete all the logging information that are present on the server you could run the following SQL syntaxes:

=======

use sx

Truncate table logref

Truncate table logdata

Truncate table logentry

Truncate table shadowfiles

Truncate table alp

Truncate table scans

Truncate table migratealp

Truncate table migratelogs

Truncate table migrateshadow

=======

Now delete all the content of the DataFileDirectory excepted the History Folder

Method 2:If you want to delete only different logging information from the sx database you can run the following syntax. For example: EXEC-GRANTED.

======

use sx

delete from logentry where id in ( SELECT logentry.id FROM logdata RIGHT OUTER JOIN logref ON logdata.did = logref.did RIGHT OUTER JOIN logentry ON logref.id = logentry.id WHERE (logdata.[value] = 'EXEC-GRANTED') )

delete from logref where id not in ( select id from logentry ) delete from logdata where did not in ( select did from logref ) ======

Method 3:Use filetime in the following format filetime.exe -dx"2007-01-11 16:00:00"

Example for this:

Value from filetime.exe is 0x01C735998C180000

To delete all the log entries until the date and time that you have inserted in the filetime ====== use sx declare @bincutoff binary(8) select @bincutoff = 0x01C735998C180000 set nocount on set transaction isolation level serializable begin tran delete from logentry where local < @bincutoff and id not in ( select id from shadowlocation ) delete from logref where id not in ( select id from logentry ) delete from logdata where did not in ( select did from logref ) commit tran ======

After this you could run the following SQL syntax in order to increase the size of the MDF and LDF file ====== use sx dbcc shrinkdatabase ('sx') ======