sql anywhere 11.0.1.2044.

I have a mobilink installation and my customer just called and said they have a 600m log file with a 90m database. I have the event setup like this:

CREATE EVENT LogLimit
TYPE GrowLog
WHERE event_condition( 'LogSize' ) > 10
HANDLER
BEGIN
  IF EVENT_PARAMETER( 'NumActive' ) = 1 THEN 
   BACKUP DATABASE
   DIRECTORY ''
   TRANSACTION LOG ONLY
   TRANSACTION LOG RENAME MATCH;
  END IF;
END;

It appears like the event is not firing. This seems to be happening at more than one location. I have another customer setup the same way and it is working fine. Not sure what to look for???

Thanks.

asked 20 Mar '15, 14:07

jimboidaho's gravatar image

jimboidaho
111141422
accept rate: 0%

edited 20 Mar '15, 14:12

Mark%20Culp's gravatar image

Mark Culp
23.3k9132274

2

If the BACKUP failed with an exception, that exception message will appear in the dbsrv11 -o log.txt file.

MESSAGE TO CONSOLE statements are highly recommended to record when an event starts, and whether it works or not. Also recommended are EXCEPTION WHEN OTHERS THEN blocks to capture and record exceptions, again using MESSAGE TO CONSOLE statements. These suggestions help deal with the enormous drawback of events that they leave no trace by default.

The account being used to run the engine may have security issues doing the log file operations.

(20 Mar '15, 14:52) Breck Carter

You should run through a number of checks for this. The first thing to check is to see if the event is enabled or disabled. You can issue an "alter event .... enable" statement to re-enable it if it was disabled.

While the 'match' clause plays no role since you do not have a target backup directory that backup statement should be able to run as-is. That should only leave your event_condition and event_parameter checks.

It may be possible you have an earlier, stuck event blocking the action. You should be able to clear that by cycling the database server in that event. Something that could be easy to do to check this possibility out.

You can try manually triggering it to see if it runs ... you can also add message statements to log when the event fires and can even add checks for when numactive>1 (for example) to diagnose this possibility.

I do need to note that you are running the initial/first release of 11.0.1 and could be experiencing some issue around events not firing as expected. If you can you should check out one of the last EBFs that were posted.

Otherwise the syntax is working for me with a newer version. Is it possible the customer is just looking at an old copy of a transaction log that was never cleaned up after if it was located to another drive/directory?

permanent link

answered 20 Mar '15, 15:04

Nick%20Elson%20SAP%20SQL%20Anywhere's gravatar image

Nick Elson S...
7.3k35107
accept rate: 31%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×72
×35
×4
×1

question asked: 20 Mar '15, 14:07

question was seen: 473 times

last updated: 20 Mar '15, 15:04