今天早上同事让我将SQL Server的数据文件和系统文件迁移到存储上面,盘符等都修改,迁移数据文件和Mater/error log之后,将之前的磁盘从dependency中去掉,旧的盘OFFLIEN,然后做Failover测试发现SQL Agent没起来,突然想到SQL Agent也有路径要修改。当时已经不记得怎么改了,网上搜到下面这篇文章,希望以后带大家也有帮助。
Recently came across a customer scenario, wherein the 'ask' was to change the current location of SQL Server Errorlog files to a different location. Here’s a simple way to get this done:
Steps to change Location of SQL Svr Errorlog files
Step 1. First, identify the current location of SQL Server Errorlog files.
Refer my previous post on How to: Verify path for SQL Server Error Log Files
Step 2. For error log parameter "-e", change the current path to new location.
-e<New_Errorlog_location_here>\ERRORLOG
WARNING: Make sure that correct folder exists else consecutive attempt to start SQL Server service will fail with error “The request failed or the service did not respond in a timely fashion….”
Step 3. Re-cycle the SQL Server service for changes to take effect.
Step…
Steps to change Location of SQL Svr Agent Errorlog
Step 1. This is relatively simple and can be done using below code:
USE msdb
GO
EXEC msdb.dbo.sp_set_sqlagent_properties @errorlog_file=N'<New_Errorlog_Location>\SQLAGENT.OUT'
GO