RSS

How to Change the Default Database Location

20 Mar

Problem :

After I Create Cluster and I make 2 Share Disk one for Data and the another for Logs I forget to Customize the location For the database What can I do to Change this Location ?

Salutation : 

You have two ways the first by T-SQL and the Second is Wizard Steps :

First Way:

A- Change the Default location for data file :

EXEC xp_instance_regwrite

N’HKEY_LOCAL_MACHINE’,

N’Software\Microsoft\MSSQLServer\MSSQLServer’,

N’DefaultData’,

REG_SZ

,N’F:\MSSQL10_50.MSSQLSERVER\MSSQL\DATA’

GO

B- Change the Default location for Logs file :

EXEC xp_instance_regwrite

N’HKEY_LOCAL_MACHINE’,

N’Software\Microsoft\MSSQLServer\MSSQLServer’,

N’DefaultLog’,

REG_SZ

,N’G:\MSSQL10_50.MSSQLSERVER\MSSQL\Log’

GO

Second Way:

Open the management Studio >>> Write Click on the Server >>> Select properties

Change1

Then Select Database Setting >>> you Will See Database Default Location

Change2

 

Tags:

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s