Jump to content

Recommended Posts

Posted (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 by ful56_uk
Posted
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.
Posted

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

Posted

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.

  • 2 weeks later...
Posted

PLEASE USE DBATTACH TO DETACH AND ALSO REATTACH THE DB FILES. It does special magic with the logins.

 

As per previous lengthy discussions!

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 account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...