Tuesday, February 14, 2012

Create Database gives Device Activation Error (5105)

Hello NG,
Creating a new database using T-SQL Create Database [MyName] used to work on
my customer's installation.
Now, it gives a Device Activation Error with error nr 5105, indicating that
MyName.mdf may be incorrect.
Nothing has changed (they claim), and I don't know why this message shows up
nor how to correct the situation.
Any help will be appreciated.
Thanks,
Hans van Leth.Hi Hans.
Can you post the full message please?
Sure - they all say "nothing's changed"!! I don't mean to question your
client's integrity, but perhaps they don't realise that a change on a non
SQL Server component might actually affect SQL Server. For example,
permissions might have changed either locally or on the AD perhaps.
If you've performed this before & it now suddenly fails, it's more than
likely that SOMETHING has changed!
Regards,
Greg Linwood
SQL Server MVP
"Hans van Leth" <hans.v.l bij xs4all.nl> wrote in message
news:evH#BqNgDHA.1760@.TK2MSFTNGP09.phx.gbl...
> Hello NG,
> Creating a new database using T-SQL Create Database [MyName] used to work
on
> my customer's installation.
> Now, it gives a Device Activation Error with error nr 5105, indicating
that
> MyName.mdf may be incorrect.
> Nothing has changed (they claim), and I don't know why this message shows
up
> nor how to correct the situation.
> Any help will be appreciated.
> Thanks,
> Hans van Leth.
>
>|||Hello Greg,
Executing "Create database test1" in QA gives:
Server: Msg 5105, Level 16, State 2, Line 1
Device activation error. The physical file name '\test1.mdf' may be
incorrect.
Server: Msg 1802, Level 16, State 1, Line 1
CREATE DATABASE failed. Some file names listed could not be created.
Check previous errors.
Creating a new database test1 in EM does work however. In Profiler I can see
that EM sends the full Create statement, i.e. including the filename as in:
CREATE DATABASE [test1] ON (NAME = N'test1_Data', FILENAME = N'C:\Program
Files\Microsoft SQL Server\MSSQL\Data\test1_Data.MDF')
The user uses an accounting package and for each company a new database is
created using the statement as mentioned.
This used to work and now it doesn't...
If I had the sources to the package I would change the Create statement to
include the filename but unfortunately it doesn't...
BOL states that including the filesnames is not required.
SQL Server default file locations are set to the ..\MSSQL\Data directory as
above.
Thanks for your time!
Hans van Leth.
"Greg Linwood" <g_linwood@.hotmail.com> schreef in bericht
news:OoB5edQgDHA.3200@.tk2msftngp13.phx.gbl...
> Hi Hans.
> Can you post the full message please?
> Sure - they all say "nothing's changed"!! I don't mean to question your
> client's integrity, but perhaps they don't realise that a change on a non
> SQL Server component might actually affect SQL Server. For example,
> permissions might have changed either locally or on the AD perhaps.
> If you've performed this before & it now suddenly fails, it's more than
> likely that SOMETHING has changed!
> Regards,
> Greg Linwood
> SQL Server MVP
> "Hans van Leth" <hans.v.l bij xs4all.nl> wrote in message
> news:evH#BqNgDHA.1760@.TK2MSFTNGP09.phx.gbl...
> > Hello NG,
> >
> > Creating a new database using T-SQL Create Database [MyName] used to
work
> on
> > my customer's installation.
> > Now, it gives a Device Activation Error with error nr 5105, indicating
> that
> > MyName.mdf may be incorrect.
> > Nothing has changed (they claim), and I don't know why this message
shows
> up
> > nor how to correct the situation.
> > Any help will be appreciated.
> >
> > Thanks,
> >
> > Hans van Leth.
> >
> >
> >
> >
>|||Do you have a way of examining the directories involved? Perhaps there's an
existing .MDF/.LDF file with the name you intend to use?
Are you trying to create the device on C:? Have you checked your server
properties (right-click server name in EM) for the default database/log
locations and verified that they are OK ("Database Settings" tab in that
"SQL Server Properties" dialog box).
I reproduced a 5105 by inserting an incorrect device letter at the beginning
of the string - I expect any malformed or incorrect filespec would give the
same result.
"Hans van Leth" <hans.v.l bij xs4all.nl> wrote in message
news:epVGfzQgDHA.632@.TK2MSFTNGP10.phx.gbl...
> Hello Greg,
> Executing "Create database test1" in QA gives:
> Server: Msg 5105, Level 16, State 2, Line 1
> Device activation error. The physical file name '\test1.mdf' may be
> incorrect.
> Server: Msg 1802, Level 16, State 1, Line 1
> CREATE DATABASE failed. Some file names listed could not be created.
> Check previous errors.
> Creating a new database test1 in EM does work however. In Profiler I can
see
> that EM sends the full Create statement, i.e. including the filename as
in:
> CREATE DATABASE [test1] ON (NAME = N'test1_Data', FILENAME = N'C:\Program
> Files\Microsoft SQL Server\MSSQL\Data\test1_Data.MDF')
> The user uses an accounting package and for each company a new database is
> created using the statement as mentioned.
> This used to work and now it doesn't...
> If I had the sources to the package I would change the Create statement to
> include the filename but unfortunately it doesn't...
> BOL states that including the filesnames is not required.
> SQL Server default file locations are set to the ..\MSSQL\Data directory
as
> above.
> Thanks for your time!
> Hans van Leth.
>
> "Greg Linwood" <g_linwood@.hotmail.com> schreef in bericht
> news:OoB5edQgDHA.3200@.tk2msftngp13.phx.gbl...
> > Hi Hans.
> >
> > Can you post the full message please?
> >
> > Sure - they all say "nothing's changed"!! I don't mean to question your
> > client's integrity, but perhaps they don't realise that a change on a
non
> > SQL Server component might actually affect SQL Server. For example,
> > permissions might have changed either locally or on the AD perhaps.
> >
> > If you've performed this before & it now suddenly fails, it's more than
> > likely that SOMETHING has changed!
> >
> > Regards,
> > Greg Linwood
> > SQL Server MVP
> >
> > "Hans van Leth" <hans.v.l bij xs4all.nl> wrote in message
> > news:evH#BqNgDHA.1760@.TK2MSFTNGP09.phx.gbl...
> > > Hello NG,
> > >
> > > Creating a new database using T-SQL Create Database [MyName] used to
> work
> > on
> > > my customer's installation.
> > > Now, it gives a Device Activation Error with error nr 5105, indicating
> > that
> > > MyName.mdf may be incorrect.
> > > Nothing has changed (they claim), and I don't know why this message
> shows
> > up
> > > nor how to correct the situation.
> > > Any help will be appreciated.
> > >
> > > Thanks,
> > >
> > > Hans van Leth.
> > >
> > >
> > >
> > >
> >
> >
>|||This is a bug. Here's what caused your error; if you go to the server
properties and specify a default location for the database\log files in
EM (Enterprise Manager), a registry entry is made on the server called
'DEFAULTDATA' & 'DEFAULTLOG' under
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\MSSQLServer.
If you ever delete the default data\log locations EM doesn't clean up
the registry correctly, it deletes the values in the keys, when if needs
to delete the keys (DEFAULTDATA & DEFAULTLOG) altogether.
So, if you delete the keys manually and restart the SQL Server
instance you'll be back in business. If you delete the keys but don't
restart the service the error is still present. Restart of the
service is required.
Posted via http://dbforums.com

No comments:

Post a Comment