ful56_uk Posted April 15, 2011 Posted April 15, 2011 (edited) Hello i want to move the database and the log files onto a different partition on the sims server, i used dbattch to detach the database then i moved thhe log files and database to were i want them, then used sql management studio to re attach the db but it appears it has lost logins, lucky enough i snap shot it first whats the correct way of doing this? mark Edited April 15, 2011 by ful56_uk
glennda Posted April 15, 2011 Posted April 15, 2011 you will need to reinstall sql to the partition you require - for example if you need to install sql on the E: drive AFAIK - so follow the migration guides on the Supportnet its the same process although you don't actually move server just reinstall sql to the other drive.
ChrisMiles Posted April 15, 2011 Posted April 15, 2011 You won't need to reinstall SQL to move it at all. All you need to do is execute the following statement: USE Master ALTER DATABASE sims MODIFY FILE ( NAME = sims_log, FILENAME = 'E:\SQL Logs\sims\sims_log.ldf' ) GO Where 'sims' is the name of the database, 'sims_log' is the logical name of the database file, and the path is obviously the full path to the log file. Make sure you check these values are correct for your install. After that shutdown the SQL services, move the log file to the new location (and ensure the file name is correct) and the start the SQL services again. For more information see: Moving User Databases
vikpaw Posted April 16, 2011 Posted April 16, 2011 Yep, just need to run the right commands. Attaching the database will only copy it back to the default location (allocated when SQL instance was installed). However if you need to detach the DB.... PLEASE USE DBATTACH TO DETACH AND ALSO REATTACH THE DB FILES. It does special magic with the logins. Not using it might be the reason for losing logins. If you had restored a file it would have been fine and any logins stored in the db previously should still work. Not sure what happens when you just attach using management studio.
jinnantonnixx Posted April 16, 2011 Posted April 16, 2011 If you're just moving the database files, the logins won't be affected as long as you keep the database name the same, so no need for the magic commands!
GREED Posted April 28, 2011 Posted April 28, 2011 PLEASE USE DBATTACH TO DETACH AND ALSO REATTACH THE DB FILES. It does special magic with the logins. As per previous lengthy discussions!
matt40k Posted April 28, 2011 Posted April 28, 2011 Or just run SIMS_Transfer_Logins.exe before creating a backup.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now