IQ truncate transaction log file

From SybaseWiki
Revision as of 11:42, 11 August 2007 by Psap (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This page describes how you can truncate the transaction log file in Sybase IQ (so not for ASE !). The procedure is only described for a simplex environment.

According to the Sybase documentation you should truncate the IQ transaction log file once a month or when it's size is more than 100 Mb. Unfortunately, this requires some down-time, although it's just a few minutes.

Find the location of the transaction log file by looking in the server log file. An example of the name of that file is "IQ1.025.srvlog". Look for the text "Transaction log:".

(The location of the transaction log is specified with the "create database" command.)

Go to the directory where the cfg file for IQ is located, for example:

cd /opt/sybase/admin/IQ1

Shutdown IQ

stop_asiq

Modify the configuration file for the IQ server (example: IQ1.cfg) and add the -m flag to it. You should put that flag somewhere in the top of the file, not at the end.

-n IQ1
-m

-c 48M
-s none
<cut>

Start IQ as you normally do

start_asiq @IQ1.cfg IQ1.db

Then shut it down again.

stop_asiq

You will now notice that the transaction log file no longer exists. Modify the cfg file and remove the -m flag.

Restart IQ. A new transaction log file is automatically created.

Note: Sybase recommends that you keep a copy of the old transaction log file around for diagnostic purposes.