cancel
Showing results for 
Search instead for 
Did you mean: 

How to avoid execution of DatabaseStart Event

thomas_duemesnil
Participant
3,534

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 😉

Accepted Solutions (1)

Accepted Solutions (1)

thomas_duemesnil
Participant

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

Breck_Carter
Participant
0 Kudos

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

Breck_Carter
Participant

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

johnsmirnios
Advisor
Advisor

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."

🙂

Answers (1)

Answers (1)

johnsmirnios
Advisor
Advisor

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

Breck_Carter
Participant
0 Kudos

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.

johnsmirnios
Advisor
Advisor
0 Kudos

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.