When your Database contains a EVENT of type DatabaseStart and you are able to crash the Database Engine during startup with your fabulous code.

How would you fix the database to come up again.

I have seen that -gf is implemented to disable triggers. Is there somthing like -xyz to disable events from the command line ?

Think of the posibilities. Implement a bogus DatabaseStart event and when you bring up your server 3 Month later it is blocked. And you did not try to start you backup database ;-)

asked 25 Feb '10, 12:06

Thomas%20Duemesnil's gravatar image

Thomas Dueme...
2.5k243560
accept rate: 15%

Seems like a deadlock situation...Do you know what exactly crashes the server? May it be possible to connect VERY FAST to the database and drop the event connection or use a somewhat blocking query that could block event execution?

(25 Feb '10, 13:07) Volker Barth

Just to add: Breck has requested an option to disallow connections while DatabaseStart is running, c.f. news://forums.sybase.com:119/iapgv2t5e0ti7of4bbdqcpe7bovhugr8cg@4ax.com. Now imagine you had chosen that option, too :(

(25 Feb '10, 13:09) Volker Barth

Excellent question! FWIW Foxhound actually contains a STOP ENGINE statement in the DatabaseStart event that (gosh, I hope!) only gets executed under certain specific circumstances :)

(25 Feb '10, 14:28) Breck Carter

After I read http://sqlanywhere.blogspot.com/2008/02/defragmenting-temporary-file.html I played with my development environment. If I remember correctly I had a CALL xp_cmdshell( 'NOWHERE_TO_FIND.EXE') in that event.

(25 Feb '10, 15:50) Thomas Dueme...

You should have a safety belt in place when you are working with the DatabaseStart Event.

Enclose the risky part of your event in a if clause that checks the Name of your server instance.

-- Process this Part only if my SafetyBelt is not active 
IF property ( 'Name' ) <> 'SafetyBelt' then
   --Execute risky Stuff
END IF;

So when your database is not starting up correctly you can start the server with a special Name to avoid execution of the event

dbengxx.exe -n SafetyBelt database.db

Then you are able to drop or fix the DatabaseStart Event

permanent link

answered 18 Mar '10, 10:51

Thomas%20Duemesnil's gravatar image

Thomas Dueme...
2.5k243560
accept rate: 15%

Excellent idea! It just went into the Foxhound to do list. Even easier to add code without indenting: IF ... = 'SafetyBelt" THEN RETURN

(18 Mar '10, 11:03) Breck Carter
Comment Text Removed
2

@future Foxhound customers: It won't be called "SafetyBelt" :)

(18 Mar '10, 11:05) Breck Carter
2

Although it is a good idea, it doesn't help the user with the situation they are actually in.

"Hello, 911? Yeah, I've shot myself in my foot."

"Oh, I see. Next time you should wear safety boots. Thanks for calling."

:)

(19 Mar '10, 15:38) John Smirnios

Contact tech support -- suppressing events can be done. -john.

permanent link

answered 16 Mar '10, 13:54

John%20Smirnios's gravatar image

John Smirnios
8.9k377112
accept rate: 39%

Sooooo... I'm guessing (hoping?) you regard it on the same level as recovering the DBA password; i.e., not something to be done lightly. As the creator of a commercial embedded database, the DatabaseStart event is definitely something I don't want bypassed. But... if someone has a DBA password, then IMO they should have the ability.

(16 Mar '10, 14:35) Breck Carter

More or less, yes. I think adding the ability to disable the events in the field if you provide the dba password (directly on the command line or with an option to prompt for it) might be a good one.

(17 Mar '10, 11:59) John Smirnios
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:

×137
×114
×107
×35
×23

question asked: 25 Feb '10, 12:06

question was seen: 1,242 times

last updated: 18 Mar '10, 10:51