cancel
Showing results for 
Search instead for 
Did you mean: 

How do we truncate the Log when running stand-alone?

glenn_barber
Participant
3,603

We often work with databases that have come off server environments (some have the Truncate Log at Checkpoint Option set on the Server). When we do, we are usually connecting to them stand alone as a local ODBC Source in Sybase SQL Central (opening the file rather than a server).

In version 9 of SqlAnywhere stopping and starting the database in this mode would truncate the log. In version 11 the log continues to grow.

How do we Truncate the log when we are connected as a local ODBC source?

Thanks

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member

When you connect to a database that is not currently running, it will be auto-started if it is configured to do so. I suspect that when you explicity start the database without auto-starting, that the command line parameters differ causing the change in behavior.

If you want to configure the auto-start to truncate the transaction log on checkpoint, you should be able to accomplish this by setting the appropriate -m switch in the DSN, or alternatively passing the START or DBS connection parameters when you connect to the database:

START connection parameter

DBS connection parameter

As an alternative, the transaction log can be manually truncated by issuing the appropriate backup statement.

I.e.

BACKUP DATABASE DIRECTORY '' TRANSACTION LOG ONLY TRANSACTION LOG TRUNCATE;

BACKUP statement

glenn_barber
Participant
0 Kudos

If I am to understand this - this approach would require us to modify the Additional Connection Parameters in the ODBC - we are using SQL Central to Connect and our only choice is the ODBC.

We would prefer a command which we can optionally execute when we are already connected using SQL Central. Does something like that exist?

Former Member
0 Kudos

Yes, there is a command you can execute against the database to truncate the transaction log. You will need to spawn an Interactive SQL session from Sybase Central to execute it though. I've edited my answer to include an example and link.

glenn_barber
Participant
0 Kudos

Thanks - Thats exactly what I was looking for.