[sql 2005] Autorizzazioni Database

venerdì 26 febbraio 2010 - 19.54

tankian Profilo | Junior Member

Ciao, ricevo questo errore quando tento di effettuare un restore di un DB in un nuovo DB da una postazione remota rispetto al DB SQL Server 2005 Professional:

Il codice sorgente non è stato renderizzato qui
perchè non c'è sufficiente spazio.
Clicca qui per visualizzarlo in una nuova finestra

Errore:

Interruzione anomala di RESTORE DATABASE in corso. Autorizzazione CREATE DATABASE negata nel database 'master'.

L'utente che effettua la query accede con la windows authentication, ha le autorizzazioni di leggere-scrivere la directory " C:\ " e " C:\Data " e l'ho mappato come db_owner pure nel DB master....avete qualche suggerimento?

lbenaglia Profilo | Guru

>RESTORE DATABASE DBNUOVO FROM DISK = C:\bckp.bak' WITH RECOVERY,
>MOVE 'DBVECCHIO_Data' TO 'C:\Data\DBNUOVO_data.mdf', MOVE 'DBVECCHIO_Log'
>TO 'C:\Data\DBNUOVO_Log.ldf'
>
>Errore:
>
>Interruzione anomala di RESTORE DATABASE in corso.
>Autorizzazione CREATE DATABASE negata nel database 'master'.
>
>L'utente che effettua la query accede con la windows authentication,
>ha le autorizzazioni di leggere-scrivere la directory " C:\ "
>e " C:\Data " e l'ho mappato come db_owner pure nel DB master....avete
>qualche suggerimento?
Si, rimuovi IMMEDIATAMENTE quell'utente dalla database role db_owner nel master
Queste sono le permission necessarie per eseguire il comando di RESTORE (prelevate dai BOL):

If the database being restored does not exist, the user must have CREATE DATABASE permissions to be able to execute RESTORE. If the database exists, RESTORE permissions default to members of the sysadmin and dbcreator fixed server roles and the owner (dbo) of the database (for the FROM DATABASE_SNAPSHOT option, the database always exists).

RESTORE permissions are given to roles in which membership information is always readily available to the server. Because fixed database role membership can be checked only when the database is accessible and undamaged, which is not always the case when RESTORE is executed, members of the db_owner fixed database role do not have RESTORE permissions.

L'utente soddisfa quei prerequisiti?

Ciao!
--
Lorenzo Benaglia
Microsoft MVP - SQL Server
http://blogs.dotnethell.it/lorenzo/
http://italy.mvps.org

tankian Profilo | Junior Member

Ciao,

Ho provato ad utilizzare questa sintassi con un utente sysadmin:

GRANT CREATE DATABASE TO [DOMINIO\NOMEUTENTE]

e mi diceva:

Il codice sorgente non è stato renderizzato qui
perchè non c'è sufficiente spazio.
Clicca qui per visualizzarlo in una nuova finestra

Comunque per ora ho risolto meno elegantemente, mettendo l'utente come dbcreator

Partecipa anche tu! Registrati!
Hai bisogno di aiuto ?
Perchè non ti registri subito?

Dopo esserti registrato potrai chiedere
aiuto sul nostro Forum oppure aiutare gli altri

Consulta le Stanze disponibili.

Registrati ora !
Copyright © dotNetHell.it 2002-2024
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5