adminbd

Записи по mssql,oracle,windows и linux

Have a Question?

If you have any question you can ask below or enter what you are looking for!

Перенос базы tempdb на другой диск

Запускаем sql при сбои:

NET START MSSQLSERVER /f /T3608

 

Проверяем где находится база tempdb

SELECT name, physical_name AS CurrentLocation

FROM sys.master_files

WHERE database_id = DB_ID(N'tempdb');

GO

Меняем путь

use master

alter database tempdb

modify file(

name = tempdev,

filename = N'C:\Новое_место\tempdb.mdf')

go

 

alter database tempdb

modify file(

name = templog,

filename = N'C:\Новое_место\templog.ldf')

go

Перенос множества файлов tempdb на другие диски(на разные)

use master

alter database tempdb

modify file(

name = tempdev,

filename = N'E:\TEMPDB\tempdb.mdf')

go
alter database tempdb

modify file(

name = tempdev1,

filename = N'E:\TEMPDB\tempdb1.mdf')

GO

alter database tempdb

modify file(

name = tempdev2,

filename = N'E:\TEMPDB\tempdb2.mdf')


GO

alter database tempdb

modify file(

name = tempdev3,

filename = N'E:\TEMPDB\tempdb3.mdf')


GO

alter database tempdb

modify file(

name = tempdev4,

filename = N'l:\TEMPDB\tempdb4.mdf')
GO

alter database tempdb

modify file(

name = tempdev5,

filename = N'l:\TEMPDB\tempdb5.mdf')
GO

alter database tempdb

modify file(

name = tempdev6,

filename = N'l:\TEMPDB\tempdb6.mdf')
GO

alter database tempdb

modify file(

name = tempdev5,

filename = N'l:\TEMPDB\tempdb5.mdf')
GO

alter database tempdb

modify file(

name = tempdev7,

filename = N'l:\TEMPDB\tempdb7.mdf')

go
 
 
 
alter database tempdb
 
modify file(
 
name = templog,
 
filename = N'l:\TEMPDB\templog.ldf')
 
go

 

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *

You can use these HTML tags and attributes <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>