Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 7 of 7 total
Thread Drop Dayabase via script?
Mon, Mar 2 2009 2:31 PMPermanent Link

darrell
I am trying to run:

SCRIPT
BEGIN

EXECUTE IMMEDIATE 'DROP Database "BrainMan"';

EXECUTE IMMEDIATE 'CREATE Database "BrainMan" PATH ''C:\ElevateSoft\Databases\''';
...

The database is closed at that point, yet I receive error #300 Cannot lock database .. for exclusive access.

How do I resolve this?

TIA
Darrell
Wed, Mar 4 2009 10:39 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Darrell,

<< I am trying to run:

SCRIPT
BEGIN

EXECUTE IMMEDIATE 'DROP Database "BrainMan"';

EXECUTE IMMEDIATE 'CREATE Database "BrainMan" PATH
''C:\ElevateSoft\Databases\''';
..

The database is closed at that point, yet I receive error #300 Cannot lock
database .. for exclusive access. >>

How are you running the script - in the EDB Manager or in an application ?
What database is the active database when you run the script ?

--
Tim Young
Elevate Software
www.elevatesoft.com

Wed, Mar 4 2009 1:00 PMPermanent Link

Kai
"Tim Young [Elevate Software]" wrote:

Darrell,

<< I am trying to run:

SCRIPT
BEGIN

EXECUTE IMMEDIATE 'DROP Database "BrainMan"';

EXECUTE IMMEDIATE 'CREATE Database "BrainMan" PATH
''C:\ElevateSoft\Databases\''';
..

The database is closed at that point, yet I receive error #300 Cannot lock
database .. for exclusive access. >>

How are you running the script - in the EDB Manager or in an application ?
What database is the active database when you run the script ?

--
Tim Young
Elevate Software
www.elevatesoft.com



In EDB Manager.

I only have one database, so I guess it can be closed and be the active one?

Darrell
Wed, Mar 4 2009 1:20 PMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Kai


Are you running it in the context of the session or the database?

Roy Lambert [Team Elevate]
Wed, Mar 4 2009 4:20 PMPermanent Link

Darrell
Roy Lambert wrote:

Are you running it in the context of the session or the database?

Roy Lambert [Team Elevate]

Roy:

I don't know what you mean by that - how can I tell?

Darrell
Thu, Mar 5 2009 3:24 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Darrell


This is one that I fail on frequently Smiley

Look at the status bar at the bottom. Third in from the right will be a database icon and the name of the current database. If its showing one of your database names then you're executing it from the context of the database, if it shows Configuration then its from the context of the session (the session is shown in the next box right) and if its blank you're at the context of the engine.

Roy Lambert [Team Elevate]
Thu, Mar 5 2009 3:24 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Darrell,

<< I only have one database, so I guess it can be closed and be the active
one? >>

See Roy's response - you want the active database in the EDB Manager to say
"Configuration", not the name of your database, when you run that script.
Otherwise, the EDB Manager will implicitly open the active database when you
execute the script, thus causing the lock error.

--
Tim Young
Elevate Software
www.elevatesoft.com

Image