Wednesday, March 28, 2012

Problem in Database Restore

Hi
I am facing the following issue when trying to restore a database from a log
in that has 'dbcreator' role.
While restore, i get the following error :
'Processed 104 pages for database 'Testsql', file 'TestSQL_Data' on file 1.
Processed 1 pages for database 'Testsql', file 'TestSQL_Log' on file 1.
Server: Msg 916, Level 14, State 1, Line 1
Server user 'TestSQl' is not a valid user in database 'Testsql'.
Server: Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.'
If i login with a role of 'sysadmin', i find that the data has been restored
completely
but the link with the login and sysusers in the database has been broken.
The problem is that, i don't have the sysadmin role in the production server
and i have to restore my database with the 'dbcreator' role only.
Should i have the 'sysadmin' role for database restore to be complete?
With Thanks,
Jeyalakshmi.b> If i login with a role of 'sysadmin', i find that the data has been
restored completely
> but the link with the login and sysusers in the database has been broken.
This is normal when restoring/attaching a database from another server. You
can resync logins and users with sp_change_users_login. See the Books
Online <"tsqlref.chm::/ts_sp_ca-cz_8qzy.htm"> for details.

> The problem is that, i don't have the sysadmin role in the production
server
> and i have to restore my database with the 'dbcreator' role only.
>
To restore the database with only dbcreator, the login either needs to be
the original database owner or a user in the source database. Also, the
login's SID needs to be the same on both servers. The SID will be always be
the same on both servers with Windows authentication but not with SQL
authentication. With SQL authentication, you can specify the desired SQL
login SID with the sp_addlogin @.sid parameter.

> Should i have the 'sysadmin' role for database restore to be complete?
Restores are bit easier with sysadmin role membership since you don't have
sync the dbcreator login on both servers. However, it's not a requirement
to be a sysadmin role member as described above.
Hope this helps.
Dan Guzman
SQL Server MVP
"Jeyalakshmi" <anonymous@.discussions.microsoft.com> wrote in message
news:5D0837F5-2FB5-4899-89A4-B4FDA2B33F47@.microsoft.com...
> Hi
> I am facing the following issue when trying to restore a database from a
login that has 'dbcreator' role.
> While restore, i get the following error :
> 'Processed 104 pages for database 'Testsql', file 'TestSQL_Data' on file
1.
> Processed 1 pages for database 'Testsql', file 'TestSQL_Log' on file 1.
> Server: Msg 916, Level 14, State 1, Line 1
> Server user 'TestSQl' is not a valid user in database 'Testsql'.
> Server: Msg 3013, Level 16, State 1, Line 1
> RESTORE DATABASE is terminating abnormally.'
> If i login with a role of 'sysadmin', i find that the data has been
restored completely
> but the link with the login and sysusers in the database has been broken.
> The problem is that, i don't have the sysadmin role in the production
server
> and i have to restore my database with the 'dbcreator' role only.
> Should i have the 'sysadmin' role for database restore to be complete?
> With Thanks,
> Jeyalakshmi.b
>
>
>
>

No comments:

Post a Comment