Showing posts with label mapped. Show all posts
Showing posts with label mapped. Show all posts

Monday, March 26, 2012

restore database users-logins mapping lost

i have a DB with DB users that are mapped to server logins
after backing the databasr and restoring on other server (with the same
logins defined)
the logins are not mapped to the sql user
wanting to do this from the security folder in enterprise manager, pressing
the login
in database access tab checking the required checkbox for the newly restored
database
(and the DB user correct name mapping appears)
pressing OK button gives the error Error 21002: [SQL-DMO]User 'appUser'
already exists.
what is the best way to achive the mapping from the login to the user
without deleteing anything and re-defining database permissions for the
user?
thanks.
My preference is to use sp_SidMap. You can get it here
http://download.microsoft.com/downlo...us/Mapsids.exe
The accompanying KB article is here
INF: How to Resolve Permission Issues When a Database is Moved Between SQL
Servers
http://support.microsoft.com/default...;en-us;Q240872
Some other KB articles that may be useful are
PRB: User Logon and/or Permission Errors After Restoring Dump
http://support.microsoft.com/default...;en-us;Q168001
PRB: "Troubleshooting Orphaned Users" Topic in Books Online is Incomplete
http://support.microsoft.com/default...;en-us;Q274188
HTH,
Jasper Smith (SQL Server MVP)
http://www.sqldbatips.com
"z f" <nospam@.nospam.com> wrote in message
news:eJ2jd$LWGHA.4484@.TK2MSFTNGP02.phx.gbl...
>i have a DB with DB users that are mapped to server logins
> after backing the databasr and restoring on other server (with the same
> logins defined)
> the logins are not mapped to the sql user
> wanting to do this from the security folder in enterprise manager,
> pressing the login
> in database access tab checking the required checkbox for the newly
> restored database
> (and the DB user correct name mapping appears)
> pressing OK button gives the error Error 21002: [SQL-DMO]User 'appUser'
> already exists.
> what is the best way to achive the mapping from the login to the user
> without deleteing anything and re-defining database permissions for the
> user?
> thanks.
>
>
>
|||http://www.databasejournal.com/featu...le.php/2228611
http://vyaskn.tripod.com/troubleshoo...phan_users.htm
|||Sorry meant to type a little description as well =P First link is for
migrating users from one server to another, It will create a script of
the accounts on the old server that you can run on the new server which
will create the correct sids etc.. so when you roll over a database
from the server1 to server2, u wont have orphaned users in the db on
server2 that dont have physical sql logins associated with them. That
should fix your problem. Make sure if youve added new users server2 to
remove them before running the script on server2 after u have it
created on server1 from the first link above
|||thanks
it is a killer script for me
i found something simpler:
sp_change_users_login (built in with SQL Server)
where did it hide?
"Jasper Smith" <jasper_smith9@.hotmail.com> wrote in message
news:%23hf6DFMWGHA.1228@.TK2MSFTNGP02.phx.gbl...
> My preference is to use sp_SidMap. You can get it here
> http://download.microsoft.com/downlo...us/Mapsids.exe
> The accompanying KB article is here
> INF: How to Resolve Permission Issues When a Database is Moved Between SQL
> Servers
> http://support.microsoft.com/default...;en-us;Q240872
> Some other KB articles that may be useful are
> PRB: User Logon and/or Permission Errors After Restoring Dump
> http://support.microsoft.com/default...;en-us;Q168001
> PRB: "Troubleshooting Orphaned Users" Topic in Books Online is Incomplete
> http://support.microsoft.com/default...;en-us;Q274188
> --
> HTH,
> Jasper Smith (SQL Server MVP)
> http://www.sqldbatips.com
>
> "z f" <nospam@.nospam.com> wrote in message
> news:eJ2jd$LWGHA.4484@.TK2MSFTNGP02.phx.gbl...
>

Friday, March 23, 2012

Restore database from a network drive

Hi guys,
I have Windows 2003 server and SQL2005 Oct. CPT running. I have backed up
file .BAK on a network. So in my SQL server, I mapped the folder and try to
restore database from there, I have gotten an error. So i thought might be
the backup file is bad. So I copied my model backedup file to the network
drive and ran FilelistOnly. I got exact same error return,
Msg 3201, Level 16, State 2, Line 1
Cannot open backup device 'q:\model_backup_200601240100.bak'. Operating
system error 3(The system cannot find the path specified.).
Msg 3013, Level 16, State 1, Line 1
RESTORE FILELIST is terminating abnormally.
Has any one seem this error? I don't think I have restored a database from
network drive but I know I can access to the network drive without an issue.
Below is the simple steps what I did on my sql server.
on dos prompt win, net use q: \\myserver\backupfile.bak
q:
dir *.bak
I saw the backup file.
In query windows, 2005 SQL management studio.
restore filelistonly from disk = 'q:\mybackupfile.bak'
Is it not possible to restore it from network drive?
Any input will be appreciated.
Sunny,
Restoring TO and FROM NETWORK drives is possible, but rather than
mapped drives you should use the UNC drives rather than mapped driver
letters. This has many implications, one of them is that you have to
make sure that if e.g. you use the SQL Agent you have to make sure that
the sevrice account has the driver letter mapped in his logon script
(which is a hazzle). So rather use a UNC path with the appropiate
permissions.
HTH, Jens Suessmeyer.
|||Hi Jens
Thanks for the input. I just realized that the SQL server serive is running
as LocalSystem. I thought I changed all SQL services to run as a domain user
ID.
I think that's why. I have to wait until 5 PM and try it if that's the case
or not.
Will post once I find out.
Thanks,
"Jens" wrote:

> Restoring TO and FROM NETWORK drives is possible, but rather than
> mapped drives you should use the UNC drives rather than mapped driver
> letters. This has many implications, one of them is that you have to
> make sure that if e.g. you use the SQL Agent you have to make sure that
> the sevrice account has the driver letter mapped in his logon script
> (which is a hazzle). So rather use a UNC path with the appropiate
> permissions.
> HTH, Jens Suessmeyer.
>

Restore database from a network drive

Hi guys,
I have Windows 2003 server and SQL2005 Oct. CPT running. I have backed up
file .BAK on a network. So in my SQL server, I mapped the folder and try to
restore database from there, I have gotten an error. So i thought might be
the backup file is bad. So I copied my model backedup file to the network
drive and ran FilelistOnly. I got exact same error return,
Msg 3201, Level 16, State 2, Line 1
Cannot open backup device 'q:\model_backup_200601240100.bak'. Operating
system error 3(The system cannot find the path specified.).
Msg 3013, Level 16, State 1, Line 1
RESTORE FILELIST is terminating abnormally.
Has any one seem this error? I don't think I have restored a database from
network drive but I know I can access to the network drive without an issue.
Below is the simple steps what I did on my sql server.
on dos prompt win, net use q: \\myserver\backupfile.bak
q:
dir *.bak
I saw the backup file.
In query windows, 2005 SQL management studio.
restore filelistonly from disk = 'q:\mybackupfile.bak'
Is it not possible to restore it from network drive'
Any input will be appreciated.
Sunny,Restoring TO and FROM NETWORK drives is possible, but rather than
mapped drives you should use the UNC drives rather than mapped driver
letters. This has many implications, one of them is that you have to
make sure that if e.g. you use the SQL Agent you have to make sure that
the sevrice account has the driver letter mapped in his logon script
(which is a hazzle). So rather use a UNC path with the appropiate
permissions.
HTH, Jens Suessmeyer.|||Hi Jens
Thanks for the input. I just realized that the SQL server serive is running
as LocalSystem. I thought I changed all SQL services to run as a domain use
r
ID.
I think that's why. I have to wait until 5 PM and try it if that's the case
or not.
Will post once I find out.
Thanks,
"Jens" wrote:

> Restoring TO and FROM NETWORK drives is possible, but rather than
> mapped drives you should use the UNC drives rather than mapped driver
> letters. This has many implications, one of them is that you have to
> make sure that if e.g. you use the SQL Agent you have to make sure that
> the sevrice account has the driver letter mapped in his logon script
> (which is a hazzle). So rather use a UNC path with the appropiate
> permissions.
> HTH, Jens Suessmeyer.
>sql

Restore database from a network drive

Hi guys,
I have Windows 2003 server and SQL2005 Oct. CPT running. I have backed up
file .BAK on a network. So in my SQL server, I mapped the folder and try to
restore database from there, I have gotten an error. So i thought might be
the backup file is bad. So I copied my model backedup file to the network
drive and ran FilelistOnly. I got exact same error return,
Msg 3201, Level 16, State 2, Line 1
Cannot open backup device 'q:\model_backup_200601240100.bak'. Operating
system error 3(The system cannot find the path specified.).
Msg 3013, Level 16, State 1, Line 1
RESTORE FILELIST is terminating abnormally.
Has any one seem this error? I don't think I have restored a database from
network drive but I know I can access to the network drive without an issue.
Below is the simple steps what I did on my sql server.
on dos prompt win, net use q: \\myserver\backupfile.bak
q:
dir *.bak
I saw the backup file.
In query windows, 2005 SQL management studio.
restore filelistonly from disk = 'q:\mybackupfile.bak'
Is it not possible to restore it from network drive'
Any input will be appreciated.
Sunny,Restoring TO and FROM NETWORK drives is possible, but rather than
mapped drives you should use the UNC drives rather than mapped driver
letters. This has many implications, one of them is that you have to
make sure that if e.g. you use the SQL Agent you have to make sure that
the sevrice account has the driver letter mapped in his logon script
(which is a hazzle). So rather use a UNC path with the appropiate
permissions.
HTH, Jens Suessmeyer.|||Hi Jens
Thanks for the input. I just realized that the SQL server serive is running
as LocalSystem. I thought I changed all SQL services to run as a domain user
ID.
I think that's why. I have to wait until 5 PM and try it if that's the case
or not.
Will post once I find out.
Thanks,
"Jens" wrote:
> Restoring TO and FROM NETWORK drives is possible, but rather than
> mapped drives you should use the UNC drives rather than mapped driver
> letters. This has many implications, one of them is that you have to
> make sure that if e.g. you use the SQL Agent you have to make sure that
> the sevrice account has the driver letter mapped in his logon script
> (which is a hazzle). So rather use a UNC path with the appropiate
> permissions.
> HTH, Jens Suessmeyer.
>