Showing posts with label attaching. Show all posts
Showing posts with label attaching. Show all posts

Monday, March 26, 2012

problem with attaching mdf file

Bob wrote:
> Hi,
> i installed sql server 2005 express on a windows xp prof. sp2 system.
> i also installed the 2005 studio management tool.
> I can connect to the sql server (sqlcmd -S), i can create a new database in
> the 2005 studio management tool, but i can't attach a mdf file. I'm
> administrator so have all rights. I have several mdf (and ldf) files on the
> disc.
> I did this:
> rightclick on Databases, then Attach: i see right an empty windows with an
> ADD button.
> When i click on that button, i get the error:
> c:\myapp\app_data\
> cannot access the specified path or file. Verify that you have the necessary
> privileges ...
> If you know that the service account a specific file, type the path ...
> The sevice account is NT AUTHORITY\NetworkService, but when i see the list
> of the accounts, i can't find it into that list.
>
> Any help would be appreciated.
> Thanks
> Bob
>
>
>
>
Create an actual user to be used as the service account, then make sure
that user has read/write permissions in your data directory.
Tracy McKibben
MCDBA
http://www.realsqlguy.com
Bob wrote:
> Thanks for replying.
> Can you tell me how to do that? Do you mean: a windows xp account? And how
> to link it to NT AUTHORITY\Network? I can't even find it in the list of the
> windows accounts.
>
Yes, a Windows XP account or a domain account, whichever is appropriate
for your environment. You don't "link" this new user to NT
AUTHORITY\Network, you'll configure the SQL Server services to run as
the new user that you create. NT AUTHORITY\Network isn't a real user
account.
You could also configure the SQL Server services to run as "Local
System", which will give SQL system-level access to your machine.
Tracy McKibben
MCDBA
http://www.realsqlguy.com

problem with attaching mdf file

Bob wrote:
> Hi,
> i installed sql server 2005 express on a windows xp prof. sp2 system.
> i also installed the 2005 studio management tool.
> I can connect to the sql server (sqlcmd -S), i can create a new database in
> the 2005 studio management tool, but i can't attach a mdf file. I'm
> administrator so have all rights. I have several mdf (and ldf) files on the
> disc.
> I did this:
> rightclick on Databases, then Attach: i see right an empty windows with an
> ADD button.
> When i click on that button, i get the error:
> c:\myapp\app_data\
> cannot access the specified path or file. Verify that you have the necessary
> privileges ...
> If you know that the service account a specific file, type the path ...
> The sevice account is NT AUTHORITY\NetworkService, but when i see the list
> of the accounts, i can't find it into that list.
>
> Any help would be appreciated.
> Thanks
> Bob
>
>
>
>
Create an actual user to be used as the service account, then make sure
that user has read/write permissions in your data directory.
Tracy McKibben
MCDBA
http://www.realsqlguy.com
Bob wrote:
> Thanks for replying.
> Can you tell me how to do that? Do you mean: a windows xp account? And how
> to link it to NT AUTHORITY\Network? I can't even find it in the list of the
> windows accounts.
>
Yes, a Windows XP account or a domain account, whichever is appropriate
for your environment. You don't "link" this new user to NT
AUTHORITY\Network, you'll configure the SQL Server services to run as
the new user that you create. NT AUTHORITY\Network isn't a real user
account.
You could also configure the SQL Server services to run as "Local
System", which will give SQL system-level access to your machine.
Tracy McKibben
MCDBA
http://www.realsqlguy.com
sql

problem with attaching mdf file

Hi,
i installed sql server 2005 express on a windows xp prof. sp2 system.
i also installed the 2005 studio management tool.
I can connect to the sql server (sqlcmd -S), i can create a new database in
the 2005 studio management tool, but i can't attach a mdf file. I'm
administrator so have all rights. I have several mdf (and ldf) files on the
disc.
I did this:
rightclick on Databases, then Attach: i see right an empty windows with an
ADD button.
When i click on that button, i get the error:
c:\myapp\app_data\
cannot access the specified path or file. Verify that you have the necessary
privileges ...
If you know that the service account a specific file, type the path ...
The sevice account is NT AUTHORITY\NetworkService, but when i see the list
of the accounts, i can't find it into that list.
Any help would be appreciated.
Thanks
BobBob wrote:
> Hi,
> i installed sql server 2005 express on a windows xp prof. sp2 system.
> i also installed the 2005 studio management tool.
> I can connect to the sql server (sqlcmd -S), i can create a new database in
> the 2005 studio management tool, but i can't attach a mdf file. I'm
> administrator so have all rights. I have several mdf (and ldf) files on the
> disc.
> I did this:
> rightclick on Databases, then Attach: i see right an empty windows with an
> ADD button.
> When i click on that button, i get the error:
> c:\myapp\app_data\
> cannot access the specified path or file. Verify that you have the necessary
> privileges ...
> If you know that the service account a specific file, type the path ...
> The sevice account is NT AUTHORITY\NetworkService, but when i see the list
> of the accounts, i can't find it into that list.
>
> Any help would be appreciated.
> Thanks
> Bob
>
>
>
>
Create an actual user to be used as the service account, then make sure
that user has read/write permissions in your data directory.
Tracy McKibben
MCDBA
http://www.realsqlguy.com|||Thanks for replying.
Can you tell me how to do that? Do you mean: a windows xp account? And how
to link it to NT AUTHORITY\Network? I can't even find it in the list of the
windows accounts.
"Tracy McKibben" <tracy@.realsqlguy.com> schreef in bericht
news:459BF31D.9050605@.realsqlguy.com...
> Bob wrote:
>> Hi,
>> i installed sql server 2005 express on a windows xp prof. sp2 system.
>> i also installed the 2005 studio management tool.
>> I can connect to the sql server (sqlcmd -S), i can create a new database
>> in the 2005 studio management tool, but i can't attach a mdf file. I'm
>> administrator so have all rights. I have several mdf (and ldf) files on
>> the disc.
>> I did this:
>> rightclick on Databases, then Attach: i see right an empty windows with
>> an ADD button.
>> When i click on that button, i get the error:
>> c:\myapp\app_data\
>> cannot access the specified path or file. Verify that you have the
>> necessary privileges ...
>> If you know that the service account a specific file, type the path ...
>> The sevice account is NT AUTHORITY\NetworkService, but when i see the
>> list of the accounts, i can't find it into that list.
>>
>> Any help would be appreciated.
>> Thanks
>> Bob
>>
>>
>>
> Create an actual user to be used as the service account, then make sure
> that user has read/write permissions in your data directory.
>
> --
> Tracy McKibben
> MCDBA
> http://www.realsqlguy.com|||Thanks for replying.
I copied mydb.mdf and .ldf to the directory where i created a new database,
but in Management Studio, it's the same: i don't see it in the list of the
databases and can't attach it.
"Hari Prasad" <HariPrasad@.discussions.microsoft.com> schreef in bericht
news:7601E1FD-2A85-496E-A92F-06189BC57855@.microsoft.com...
> Easy way is copy the required MDF and LDF files to the default data
> directory
> (The place where you create the new database)
> using the windows explorer and then try attaching the database. This will
> defenetely work out.
> The issue is you have full access to machine but once you login to SQL
> Server you will have access rights only belong to
> account "NT AUTHORITY\NetworkService". The account may not have access to
> folder c:\myapp\app_data\.
> My best suggestion is copy the file to the folder where the new database
> is
> created and attach it.
> Thanks
> Hari
> "Bob" wrote:
>> Hi,
>> i installed sql server 2005 express on a windows xp prof. sp2 system.
>> i also installed the 2005 studio management tool.
>> I can connect to the sql server (sqlcmd -S), i can create a new database
>> in
>> the 2005 studio management tool, but i can't attach a mdf file. I'm
>> administrator so have all rights. I have several mdf (and ldf) files on
>> the
>> disc.
>> I did this:
>> rightclick on Databases, then Attach: i see right an empty windows with
>> an
>> ADD button.
>> When i click on that button, i get the error:
>> c:\myapp\app_data\
>> cannot access the specified path or file. Verify that you have the
>> necessary
>> privileges ...
>> If you know that the service account a specific file, type the path ...
>> The sevice account is NT AUTHORITY\NetworkService, but when i see the
>> list
>> of the accounts, i can't find it into that list.
>>
>> Any help would be appreciated.
>> Thanks
>> Bob
>>
>>
>>
>>|||Bob wrote:
> Thanks for replying.
> Can you tell me how to do that? Do you mean: a windows xp account? And how
> to link it to NT AUTHORITY\Network? I can't even find it in the list of the
> windows accounts.
>
Yes, a Windows XP account or a domain account, whichever is appropriate
for your environment. You don't "link" this new user to NT
AUTHORITY\Network, you'll configure the SQL Server services to run as
the new user that you create. NT AUTHORITY\Network isn't a real user
account.
You could also configure the SQL Server services to run as "Local
System", which will give SQL system-level access to your machine.
Tracy McKibben
MCDBA
http://www.realsqlguy.com|||Thanks it works now
"Tracy McKibben" <tracy@.realsqlguy.com> schreef in bericht
news:459C069B.5080403@.realsqlguy.com...
> Bob wrote:
>> Thanks for replying.
>> Can you tell me how to do that? Do you mean: a windows xp account? And
>> how to link it to NT AUTHORITY\Network? I can't even find it in the list
>> of the windows accounts.
> Yes, a Windows XP account or a domain account, whichever is appropriate
> for your environment. You don't "link" this new user to NT
> AUTHORITY\Network, you'll configure the SQL Server services to run as the
> new user that you create. NT AUTHORITY\Network isn't a real user account.
> You could also configure the SQL Server services to run as "Local System",
> which will give SQL system-level access to your machine.
>
> --
> Tracy McKibben
> MCDBA
> http://www.realsqlguy.com

problem with attaching mdf file

Hi,
i installed sql server 2005 express on a Windows XP prof. sp2 system.
i also installed the 2005 studio management tool.
I can connect to the sql server (sqlcmd -S), i can create a new database in
the 2005 studio management tool, but i can't attach a mdf file. I'm
administrator so have all rights. I have several mdf (and ldf) files on the
disc.
I did this:
rightclick on Databases, then Attach: i see right an empty windows with an
ADD button.
When i click on that button, i get the error:
c:\myapp\app_data\
cannot access the specified path or file. Verify that you have the necessary
privileges ...
If you know that the service account a specific file, type the path ...
The sevice account is NT AUTHORITY\NetworkService, but when i see the list
of the accounts, i can't find it into that list.
Any help would be appreciated.
Thanks
BobBob wrote:
> Hi,
> i installed sql server 2005 express on a Windows XP prof. sp2 system.
> i also installed the 2005 studio management tool.
> I can connect to the sql server (sqlcmd -S), i can create a new database i
n
> the 2005 studio management tool, but i can't attach a mdf file. I'm
> administrator so have all rights. I have several mdf (and ldf) files on th
e
> disc.
> I did this:
> rightclick on Databases, then Attach: i see right an empty windows with an
> ADD button.
> When i click on that button, i get the error:
> c:\myapp\app_data\
> cannot access the specified path or file. Verify that you have the necessa
ry
> privileges ...
> If you know that the service account a specific file, type the path ...
> The sevice account is NT AUTHORITY\NetworkService, but when i see the list
> of the accounts, i can't find it into that list.
>
> Any help would be appreciated.
> Thanks
> Bob
>
>
>
>
Create an actual user to be used as the service account, then make sure
that user has read/write permissions in your data directory.
Tracy McKibben
MCDBA
http://www.realsqlguy.com|||Easy way is copy the required MDF and LDF files to the default data director
y
(The place where you create the new database)
using the windows explorer and then try attaching the database. This will
defenetely work out.
The issue is you have full access to machine but once you login to SQL
Server you will have access rights only belong to
account "NT AUTHORITY\NetworkService". The account may not have access to
folder c:\myapp\app_data\.
My best suggestion is copy the file to the folder where the new database is
created and attach it.
Thanks
Hari
"Bob" wrote:

> Hi,
> i installed sql server 2005 express on a Windows XP prof. sp2 system.
> i also installed the 2005 studio management tool.
> I can connect to the sql server (sqlcmd -S), i can create a new database i
n
> the 2005 studio management tool, but i can't attach a mdf file. I'm
> administrator so have all rights. I have several mdf (and ldf) files on th
e
> disc.
> I did this:
> rightclick on Databases, then Attach: i see right an empty windows with an
> ADD button.
> When i click on that button, i get the error:
> c:\myapp\app_data\
> cannot access the specified path or file. Verify that you have the necessa
ry
> privileges ...
> If you know that the service account a specific file, type the path ...
> The sevice account is NT AUTHORITY\NetworkService, but when i see the list
> of the accounts, i can't find it into that list.
>
> Any help would be appreciated.
> Thanks
> Bob
>
>
>
>|||Thanks for replying.
Can you tell me how to do that? Do you mean: a Windows XP account? And how
to link it to NT AUTHORITY\Network? I can't even find it in the list of the
windows accounts.
"Tracy McKibben" <tracy@.realsqlguy.com> schreef in bericht
news:459BF31D.9050605@.realsqlguy.com...
> Bob wrote:
> Create an actual user to be used as the service account, then make sure
> that user has read/write permissions in your data directory.
>
> --
> Tracy McKibben
> MCDBA
> http://www.realsqlguy.com|||Thanks for replying.
I copied mydb.mdf and .ldf to the directory where i created a new database,
but in Management Studio, it's the same: i don't see it in the list of the
databases and can't attach it.
"Hari Prasad" <HariPrasad@.discussions.microsoft.com> schreef in bericht
news:7601E1FD-2A85-496E-A92F-06189BC57855@.microsoft.com...[vbcol=seagreen]
> Easy way is copy the required MDF and LDF files to the default data
> directory
> (The place where you create the new database)
> using the windows explorer and then try attaching the database. This will
> defenetely work out.
> The issue is you have full access to machine but once you login to SQL
> Server you will have access rights only belong to
> account "NT AUTHORITY\NetworkService". The account may not have access to
> folder c:\myapp\app_data\.
> My best suggestion is copy the file to the folder where the new database
> is
> created and attach it.
> Thanks
> Hari
> "Bob" wrote:
>|||Bob wrote:
> Thanks for replying.
> Can you tell me how to do that? Do you mean: a Windows XP account? And how
> to link it to NT AUTHORITY\Network? I can't even find it in the list of th
e
> windows accounts.
>
Yes, a Windows XP account or a domain account, whichever is appropriate
for your environment. You don't "link" this new user to NT
AUTHORITY\Network, you'll configure the SQL Server services to run as
the new user that you create. NT AUTHORITY\Network isn't a real user
account.
You could also configure the SQL Server services to run as "Local
System", which will give SQL system-level access to your machine.
Tracy McKibben
MCDBA
http://www.realsqlguy.com|||Thanks it works now
"Tracy McKibben" <tracy@.realsqlguy.com> schreef in bericht
news:459C069B.5080403@.realsqlguy.com...
> Bob wrote:
> Yes, a Windows XP account or a domain account, whichever is appropriate
> for your environment. You don't "link" this new user to NT
> AUTHORITY\Network, you'll configure the SQL Server services to run as the
> new user that you create. NT AUTHORITY\Network isn't a real user account.
> You could also configure the SQL Server services to run as "Local System",
> which will give SQL system-level access to your machine.
>
> --
> Tracy McKibben
> MCDBA
> http://www.realsqlguy.com

Problem with attaching database on network share (SQL Server 2005)

I'm trying to execute following command:
DBCC TRACEON (1807, -1);
sp_attach_db @.dbname = N'PGDT', @.filename1 = N'\\Server\D\SQL
DataBase\PGDT\PGDT.mdf', @.filename2 = '\\Server\D\SQL
DataBase\PGDT\PGDT_log.ldf'
and I get following error:
Msg 5133, Level 16, State 1, Line 1
Directory lookup for the file "\\Server\D\SQL DataBase\PGDT\PGDT.mdf" failed
with the operating system error 5(error not found).
Note: this file exists and I have full permissions
Any help appreciated.
Hi
Do you have permission to this path?
Why would you want to do that? RESTORE , doesn't help you?
"D" <destro@.mail.com> wrote in message news:dmedq5$sv8$1@.ss405.t-com.hr...
> I'm trying to execute following command:
> DBCC TRACEON (1807, -1);
> sp_attach_db @.dbname = N'PGDT', @.filename1 = N'\\Server\D\SQL
> DataBase\PGDT\PGDT.mdf', @.filename2 = '\\Server\D\SQL
> DataBase\PGDT\PGDT_log.ldf'
> and I get following error:
> Msg 5133, Level 16, State 1, Line 1
> Directory lookup for the file "\\Server\D\SQL DataBase\PGDT\PGDT.mdf"
> failed with the operating system error 5(error not found).
>
> Note: this file exists and I have full permissions
> Any help appreciated.
>
|||Solved!
I had to start sql server under Administrator account, and not local
account.
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:euzNHQ$8FHA.2040@.TK2MSFTNGP14.phx.gbl...
> Hi
> Do you have permission to this path?
> Why would you want to do that? RESTORE , doesn't help you?
>
> "D" <destro@.mail.com> wrote in message news:dmedq5$sv8$1@.ss405.t-com.hr...
>
|||Yup - worked like that in SQL 2000 as well (for remote backups and
restores). You will probably need to check that other services e.g.
agent can still work with SQL running on the domain account. Agree with
above - a remote ATTACH sounds like a pretty risky idea - performance
will likely be lousy and could be fragile as network issues will
destabilise?

Problem with attaching database on network share (SQL Server 2005)

I'm trying to execute following command:
DBCC TRACEON (1807, -1);
sp_attach_db @.dbname = N'PGDT', @.filename1 = N'\\Server\D\SQL
DataBase\PGDT\PGDT.mdf', @.filename2 = '\\Server\D\SQL
DataBase\PGDT\PGDT_log.ldf'
and I get following error:
Msg 5133, Level 16, State 1, Line 1
Directory lookup for the file "\\Server\D\SQL DataBase\PGDT\PGDT.mdf" failed
with the operating system error 5(error not found).
Note: this file exists and I have full permissions
Any help appreciated.Hi
Do you have permission to this path?
Why would you want to do that? RESTORE , doesn't help you?
"D" <destro@.mail.com> wrote in message news:dmedq5$sv8$1@.ss405.t-com.hr...
> I'm trying to execute following command:
> DBCC TRACEON (1807, -1);
> sp_attach_db @.dbname = N'PGDT', @.filename1 = N'\\Server\D\SQL
> DataBase\PGDT\PGDT.mdf', @.filename2 = '\\Server\D\SQL
> DataBase\PGDT\PGDT_log.ldf'
> and I get following error:
> Msg 5133, Level 16, State 1, Line 1
> Directory lookup for the file "\\Server\D\SQL DataBase\PGDT\PGDT.mdf"
> failed with the operating system error 5(error not found).
>
> Note: this file exists and I have full permissions
> Any help appreciated.
>|||Solved!
I had to start sql server under Administrator account, and not local
account.
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:euzNHQ$8FHA.2040@.TK2MSFTNGP14.phx.gbl...
> Hi
> Do you have permission to this path?
> Why would you want to do that? RESTORE , doesn't help you?
>
> "D" <destro@.mail.com> wrote in message news:dmedq5$sv8$1@.ss405.t-com.hr...
>|||Yup - worked like that in SQL 2000 as well (for remote backups and
restores). You will probably need to check that other services e.g.
agent can still work with SQL running on the domain account. Agree with
above - a remote ATTACH sounds like a pretty risky idea - performance
will likely be lousy and could be fragile as network issues will
destabilise?

Problem with attaching database on network share (SQL Server 2005)

I'm trying to execute following command:
DBCC TRACEON (1807, -1);
sp_attach_db @.dbname = N'PGDT', @.filename1 = N'\\Server\D\SQL
DataBase\PGDT\PGDT.mdf', @.filename2 = '\\Server\D\SQL
DataBase\PGDT\PGDT_log.ldf'
and I get following error:
Msg 5133, Level 16, State 1, Line 1
Directory lookup for the file "\\Server\D\SQL DataBase\PGDT\PGDT.mdf" failed
with the operating system error 5(error not found).
Note: this file exists and I have full permissions
Any help appreciated.Hi
Do you have permission to this path?
Why would you want to do that? RESTORE , doesn't help you?
"D" <destro@.mail.com> wrote in message news:dmedq5$sv8$1@.ss405.t-com.hr...
> I'm trying to execute following command:
> DBCC TRACEON (1807, -1);
> sp_attach_db @.dbname = N'PGDT', @.filename1 = N'\\Server\D\SQL
> DataBase\PGDT\PGDT.mdf', @.filename2 = '\\Server\D\SQL
> DataBase\PGDT\PGDT_log.ldf'
> and I get following error:
> Msg 5133, Level 16, State 1, Line 1
> Directory lookup for the file "\\Server\D\SQL DataBase\PGDT\PGDT.mdf"
> failed with the operating system error 5(error not found).
>
> Note: this file exists and I have full permissions
> Any help appreciated.
>|||Solved!
I had to start sql server under Administrator account, and not local
account.
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:euzNHQ$8FHA.2040@.TK2MSFTNGP14.phx.gbl...
> Hi
> Do you have permission to this path?
> Why would you want to do that? RESTORE , doesn't help you?
>
> "D" <destro@.mail.com> wrote in message news:dmedq5$sv8$1@.ss405.t-com.hr...
>> I'm trying to execute following command:
>> DBCC TRACEON (1807, -1);
>> sp_attach_db @.dbname = N'PGDT', @.filename1 = N'\\Server\D\SQL
>> DataBase\PGDT\PGDT.mdf', @.filename2 = '\\Server\D\SQL
>> DataBase\PGDT\PGDT_log.ldf'
>> and I get following error:
>> Msg 5133, Level 16, State 1, Line 1
>> Directory lookup for the file "\\Server\D\SQL DataBase\PGDT\PGDT.mdf"
>> failed with the operating system error 5(error not found).
>>
>> Note: this file exists and I have full permissions
>> Any help appreciated.
>|||Yup - worked like that in SQL 2000 as well (for remote backups and
restores). You will probably need to check that other services e.g.
agent can still work with SQL running on the domain account. Agree with
above - a remote ATTACH sounds like a pretty risky idea - performance
will likely be lousy and could be fragile as network issues will
destabilise?sql

Problem with attaching database

I try to attach a db by running the following command:

EXEC sp_attach_single_file_db @.dbname = 'test',

@.physname = 'C:\Documents and Settings\renee.wilson\My Documents\PD DD 2.nvp'

But I get the following error message:

File activation failure. The physical file name "C:\Documents and Settings\renee.wilson\My Documents\PD DD 2_log.LDF" may be incorrect.

The log cannot be rebuilt because the database was not cleanly shut down.

It looks like that the db was not detached from the server properly. I know that .LDF file does not exist, therefore, I was hoping by running the sp_attach_single_file_db, a new .LDF file can be created.

Any body has any idea on how to fix the problem? Thanks in advance.

Hi,

one last chance left, here are some instructions for the crashd database:

http://groups.google.de/group/microsoft.public.sqlserver.server/browse_frm/thread/f584b644548cd68f

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de

|||

Thanks, Jens.

But, I tried both suggestions in

http://groups.google.de/group/microsoft.public.sqlserver.server/browse_frm/thread/f584b644548cd68f

without much luck.

I am having the following problems:

1. DBCC rebuilt_log does not exist in SQL Server 2005 Express which I am using.

2. When the database is in emergency mode, which I can see via the tool(Microsoft SQL Server Management Studio Express) I am using, I can not view any of its object, for example, I click on Tables(try to see the tables), I get error msg: Could not continue scan with NOLOCK due to data movement, (Microsoft SQL Server, Error:601). For the same reason, I can not generate scripts as suggested.

Any further suggestion? Thanks in advance.