Showing posts with label adatabase. Show all posts
Showing posts with label adatabase. Show all posts

Sunday, March 25, 2012

Attach a read-only restored database

hi all
can i attach a read only restored database. I restored a
database Test in Stand by Mode. After that i detached that database and
while restoring i m getting msg "Cannot attach a database that was
being restored.". Is it o that i can not attach a readonly restored
detached database ?
Parveen BeniwalHi
A read only database will remain read only if you restore it with the
RESTORE WITH RECOVERY option, you do not need to put it into standby as you
will not be restoring any transaction logs.
John
"Parv" wrote:

> hi all
> can i attach a read only restored database. I restored a
> database Test in Stand by Mode. After that i detached that database and
> while restoring i m getting msg "Cannot attach a database that was
> being restored.". Is it o that i can not attach a readonly restored
> detached database ?
> Parveen Beniwal
>|||Hi,
I think I have the same question, worded differently:
We are using our SAN to make snapshot copies of the database files of a
log-shipped copy of a database (of course these copies are in read-only
mode). We want to then use those copies. However, we cannot get those
files to attach. We get the same error "Cannot attach a database that was
being restored".
Is there some trick to attaching database files that are in read-only mode?
Note that it is ok if the database copy loses it's read-only status during
the attach process, since we don't plan to restore additional logs to that
copy.
Thanks!
--Chip Matthes
"John Bell" wrote:
[vbcol=seagreen]
> Hi
> A read only database will remain read only if you restore it with the
> RESTORE WITH RECOVERY option, you do not need to put it into standby as yo
u
> will not be restoring any transaction logs.
> John
> "Parv" wrote:
>|||Hi
This works fine! With restore the database stays read only, with attach it
gets reset
CREATE DATABASE [MyReadOnlyDatabase]
ON
( NAME = 'MyReadOnlyDatabase_data',
FILENAME = 'C:\Program Files\Microsoft SQL
Server\MSSQL.1\MSSQL\DATA\MyReadOnlyDatabase.mdf',
SIZE = 10,
MAXSIZE = 50,
FILEGROWTH = 5 )
LOG ON
( NAME = 'MyReadOnlyDatabase_log',
FILENAME = 'C:\Program Files\Microsoft SQL
Server\MSSQL.1\MSSQL\DATA\MyReadOnlyDatabase.ldf',
SIZE = 5MB,
MAXSIZE = 25MB,
FILEGROWTH = 5MB )
GO
ALTER DATABASE [MyReadOnlyDatabase] SET READ_ONLY
GO
EXEC sp_helpdb [MyReadOnlyDatabase]
GO
EXEC sp_detach_db [MyReadOnlyDatabase]
GO
EXEC sp_attach_db 'MyReadOnlyDatabase',
'C:\Program Files\Microsoft SQL
Server\MSSQL.1\MSSQL\DATA\MyReadOnlyDatabase.mdf',
'C:\Program Files\Microsoft SQL
Server\MSSQL.1\MSSQL\DATA\MyReadOnlyDatabase.ldf'
GO
EXEC sp_helpdb [MyReadOnlyDatabase]
GO
ALTER DATABASE [MyReadOnlyDatabase] SET READ_ONLY
GO
EXEC sp_helpdb [MyReadOnlyDatabase]
GO
BACKUP DATABASE [MyReadOnlyDatabase]
TO DISK = 'C:\Program Files\Microsoft SQL
Server\MSSQL.1\MSSQL\Backup\MyReadOnlyDatabase.bak'
GO
DROP DATABASE [MyReadOnlyDatabase]
GO
RESTORE DATABASE [MyReadOnlyDatabase]
FROM DISK = 'C:\Program Files\Microsoft SQL
Server\MSSQL.1\MSSQL\Backup\MyReadOnlyDatabase.bak'
GO
EXEC sp_helpdb [MyReadOnlyDatabase]
GO
HTH
John
"Chip Matthes" wrote:
[vbcol=seagreen]
> Hi,
> I think I have the same question, worded differently:
> We are using our SAN to make snapshot copies of the database files of a
> log-shipped copy of a database (of course these copies are in read-only
> mode). We want to then use those copies. However, we cannot get those
> files to attach. We get the same error "Cannot attach a database that was
> being restored".
> Is there some trick to attaching database files that are in read-only mode
?
> Note that it is ok if the database copy loses it's read-only status during
> the attach process, since we don't plan to restore additional logs to that
> copy.
> Thanks!
> --Chip Matthes
> "John Bell" wrote:
>

Sunday, February 19, 2012

ASPNET as db owner

Using Management Studio in SS 2005 on XP when I'm adding a user to a
database and I browse for objects (logins) I see MACHINENAME\ASPNET as a
choice and I am allowed to make ASPNET a user.
But in Server2003, MACHINENAME\ASPNET does not show up as a user.
Why? Can't aspnet be a user on server2003?
Regards,
Gary Blakely
Hello
Yes, I think you can't use machine\aspnet in windows 2003. And you may not
need it. aspnet process may run as network-services account, anonymous, or
something another according to your environment. It depends on that the
connection is remote or not, and the existence of active directory.
Why not first check the asp.net process's account executing arbitrary
asp.net file on your server? If you know it, you can grant the account. Or
alternatively you can impersonate the asp.net process first and grant the
impersonated account.
"GaryDean" <GaryDean@.newsgroups.nospam> wrote in message
news:ep3vihSMHHA.4928@.TK2MSFTNGP06.phx.gbl...
> Using Management Studio in SS 2005 on XP when I'm adding a user to a
> database and I browse for objects (logins) I see MACHINENAME\ASPNET as a
> choice and I am allowed to make ASPNET a user.
> But in Server2003, MACHINENAME\ASPNET does not show up as a user.
> Why? Can't aspnet be a user on server2003?
> --
> Regards,
> Gary Blakely
>
|||Hi Gary,
I know that you could not see MACHINENAME\ASPNET on your Windows Server
2003.
If I have misunderstood, please let me know.
Per my test, ASPNET is still existed as a user on Windows Server 2003.
Please check if the ASP.NET component had been installed on your computer.
In SQL Server Management Studio, I also can add it as a SQL Server login.
I would like to provide some links here for your reference:
How to configure the process identity for the ASPNET account in ASP.NET 1.1
when you use IIS 5 Isolation mode in IIS 6.0 on Windows Server 2003
http://support.microsoft.com/kb/895967/
Process and request identity in ASP.NET
http://support.microsoft.com/kb/317012/
FIX: ASP.NET does not work with the default ASPNET account on a domain
controller
http://support.microsoft.com/kb/315158
This should be related to IIS. If this issue perstis, it is recommended
that you have a new post at ASP.NET community for wider audience.
Please feel free to let me know if you have any other questions or concerns.
Charles Wang
Microsoft Online Community Support
================================================== ====
When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from this issue.
================================================== ====
This posting is provided "AS IS" with no warranties, and confers no rights.
================================================== ====
|||Hi Gary,
Just check with you to see if you need further assistance on this issue. If
you have any other questions or concerns, please feel free to contact us.
We are always very glad for further assistance.
Have a good day!
Sincerely yours,
Charles Wang
Microsoft Online Community Support

ASPNET as db owner

Using Management Studio in SS 2005 on XP when I'm adding a user to a
database and I browse for objects (logins) I see MACHINENAME\ASPNET as a
choice and I am allowed to make ASPNET a user.
But in Server2003, MACHINENAME\ASPNET does not show up as a user.
Why? Can't aspnet be a user on server2003?
Regards,
Gary BlakelyHello
Yes, I think you can't use machine\aspnet in windows 2003. And you may not
need it. aspnet process may run as network-services account, anonymous, or
something another according to your environment. It depends on that the
connection is remote or not, and the existence of active directory.
Why not first check the asp.net process's account executing arbitrary
asp.net file on your server? If you know it, you can grant the account. Or
alternatively you can impersonate the asp.net process first and grant the
impersonated account.
"GaryDean" <GaryDean@.newsgroups.nospam> wrote in message
news:ep3vihSMHHA.4928@.TK2MSFTNGP06.phx.gbl...
> Using Management Studio in SS 2005 on XP when I'm adding a user to a
> database and I browse for objects (logins) I see MACHINENAME\ASPNET as a
> choice and I am allowed to make ASPNET a user.
> But in Server2003, MACHINENAME\ASPNET does not show up as a user.
> Why? Can't aspnet be a user on server2003?
> --
> Regards,
> Gary Blakely
>|||Hi Gary,
I know that you could not see MACHINENAME\ASPNET on your Windows Server
2003.
If I have misunderstood, please let me know.
Per my test, ASPNET is still existed as a user on Windows Server 2003.
Please check if the ASP.NET component had been installed on your computer.
In SQL Server Management Studio, I also can add it as a SQL Server login.
I would like to provide some links here for your reference:
How to configure the process identity for the ASPNET account in ASP.NET 1.1
when you use IIS 5 Isolation mode in IIS 6.0 on Windows Server 2003
http://support.microsoft.com/kb/895967/
Process and request identity in ASP.NET
http://support.microsoft.com/kb/317012/
FIX: ASP.NET does not work with the default ASPNET account on a domain
controller
http://support.microsoft.com/kb/315158
This should be related to IIS. If this issue perstis, it is recommended
that you have a new post at ASP.NET community for wider audience.
Please feel free to let me know if you have any other questions or concerns.
Charles Wang
Microsoft Online Community Support
========================================
==============
When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from this issue.
========================================
==============
This posting is provided "AS IS" with no warranties, and confers no rights.
========================================
==============|||Hi Gary,
Just check with you to see if you need further assistance on this issue. If
you have any other questions or concerns, please feel free to contact us.
We are always very glad for further assistance.
Have a good day!
Sincerely yours,
Charles Wang
Microsoft Online Community Support