Wednesday, March 21, 2012

Reinstall operating system without loosing SQL data?

If I have SQL server installed on one partition(D:) and the OS installed on
another(C:), if I need to re-install the OS is it possible to re-install SQL
server without loosing my already created databases?
The drive with the OS got corrupted somehow over the weekend, but the SQL
server drive still seems to be working just fine.As long as the database data and log files are on a DIFFERENT physical
drive, you can re-install SQL Server, then use sp_attach_db to re-attach the
physical files to the new SQL Server..
Look for sp_attach_db in the SQL Books.
--
Wayne Snyder, MCDBA, SQL Server MVP
Computer Education Services Corporation (CESC), Charlotte, NC
www.computeredservices.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Russ" <russ@.acordiamn.com> wrote in message
news:%23e2DsMVcDHA.2572@.TK2MSFTNGP12.phx.gbl...
> If I have SQL server installed on one partition(D:) and the OS installed
on
> another(C:), if I need to re-install the OS is it possible to re-install
SQL
> server without loosing my already created databases?
> The drive with the OS got corrupted somehow over the weekend, but the SQL
> server drive still seems to be working just fine.
>|||You can use 'sp_change_users_login' to (find unconnected
users through 'report' option and ) link existing logins
with database permissions. Now, the logins are maintained
in master and will be lost upon new installation or master
rebuild. You have to re-enter all login/password
information. Alternatively, you can keep list of passwords
with you through this script generator
select 'EXEC sp_addlogin '''+name+''', ', CONVERT(VARBINARY
(32), password), ', @.encryptopt = ''skip_encryption'''
from syslogins
where dbname='test' -- database name
and name <> 'sa' -- exclusion list
order by name
(replace TABS with space on the resulting script and
execute it to create logins)
Happy computing,
Muhammad Zeeshan
>--Original Message--
>If I backup the Data files (mdf & ldf) before
reinstalling can I avoid
>having to redo all the permissions for the various
databases?
>I also have tape back-ups, but using them to restore
would lose the last
>weeks worth of data, so I would rather not have to do
that if it can be
>avoided.
>
>"Russ" <russ@.acordiamn.com> wrote in message
>news:%23e2DsMVcDHA.2572@.TK2MSFTNGP12.phx.gbl...
>> If I have SQL server installed on one partition(D:) and
the OS installed
>on
>> another(C:), if I need to re-install the OS is it
possible to re-install
>SQL
>> server without loosing my already created databases?
>> The drive with the OS got corrupted somehow over the
weekend, but the SQL
>> server drive still seems to be working just fine.
>>
>
>.
>sql

No comments:

Post a Comment