Showing posts with label attach. Show all posts
Showing posts with label attach. Show all posts

Friday, March 23, 2012

Minimum permission to attach / detach databases

Hi group,
I've got a problem determining permissions for users. I got one group
of users which only should have the abilitiy to attach / detach any
database to the SQL Server.
I just thought the SQL server wide user role dbcreator seems to be
sufficient for them but if I try to attach a database on which this
group does not have any permission within (its a database from an
external vendor), attaching the database fails.
Any hints on this?
Thanks,
HeikoHeiko
Can you elaborate a little bit?
>but if I try to attach a database on which this
> group does not have any permission within (its a database from an
> external vendor), attaching the database fails.
>
"Heiko Schuler" <hschuler@.gmail.com> wrote in message
news:1192693343.587584.291710@.v29g2000prd.googlegroups.com...
> Hi group,
> I've got a problem determining permissions for users. I got one group
> of users which only should have the abilitiy to attach / detach any
> database to the SQL Server.
> I just thought the SQL server wide user role dbcreator seems to be
> sufficient for them but if I try to attach a database on which this
> group does not have any permission within (its a database from an
> external vendor), attaching the database fails.
>
> Any hints on this?
>
> Thanks,
>
> Heiko
>|||> Can you elaborate a little bit?
Sure - I got one user which has the database role "dbcreator". When I
now try to attach a database, I got an error. the strange thing is - I
got 2 different depending using the GUI or T-SQL.
When I use the GUI, after selecting the mdf file, I got the following
error:
"User 'guest' does not have permission to run DBCC checkprimeryfile.
OK, this error message itself is clear because only members of the
sysadmin or server admin role can run DBCC commands. But why does the
GUI wants to run DBCC checkprimeryfile?
When I try to attach the database via T-SQL with sp_attach_db in Query
Analyzer, I got the following error:
"Unable to open the physical fiel <path to the mdf>. Operating system
error 5 (error not found).
Depending on the message error message above I first thougt it was a
permisson error on the file system. But if I put the user in the
sysadmin server role - everything works fine. So NTFS permission on
the file system is OK.
Heiko

Friday, March 9, 2012

Migration replication jobs

Hi all,
I will be migrating a production database to a new box. I will be using
detach and attach db method to migrate, but I forsee that my replication job
will break. Can anyone advise me on how to migrate the replication jobs over
to the new db? Here is the sencario:
DB-1 in Box A detach and move over to Box B to be reattached,
DB-1 in Box A has some publications and subscriptions, and the distribution
is in Box C.
Let say Box B will resume the ip of Box A but different hostname.
You will be unable to detach replicated databases. You have to script out
the publications, edit them for the new server, remove all job names, and
then drop the publications, unpublish the databases and detach them. Attach
them on the new server, run the publication script and do a non sync.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"YK" <YK@.discussions.microsoft.com> wrote in message
news:25A6D0F1-6C2C-4B95-84F5-C96B963335D0@.microsoft.com...
> Hi all,
> I will be migrating a production database to a new box. I will be using
> detach and attach db method to migrate, but I forsee that my replication
job
> will break. Can anyone advise me on how to migrate the replication jobs
over
> to the new db? Here is the sencario:
> DB-1 in Box A detach and move over to Box B to be reattached,
> DB-1 in Box A has some publications and subscriptions, and the
distribution
> is in Box C.
> Let say Box B will resume the ip of Box A but different hostname.
>