您的位置:首页 > 运维架构

Unable to open the physical file xxxx. Operating system error 2

2015-05-27 17:19 549 查看
在新UAT服务器上,需要将tempdb放置在SSD(固态硬盘)上。由于SSD(固态硬盘)特性,所以tempdb的文件只能放置在D盘下面,而不能是D盘下的某一个目录下面。

ALTERDATABASEtempdb
MODIFYFILE(name='tempdev',filename='D:\tempdb.mdf');
GO
ALTERDATABASEtempdb
MODIFYFILE(name='templog',filename='D:\templog.ldf');
GO

修改了tempdb的目录后,重启数据库服务,结果出现错误信息:“FCB::Openfailed:CouldnotopenfileD:\tempdb.mdfforfilenumber1.OSerror:2(Thesystemcannotfindthefilespecified.)",具体错误信息如下所示:

2015-05-27;11:56:44.88spid9sTheresourcedatabasebuildversionis12.00.2000.Thisisaninformationalmessageonly.Nouseractionisrequired.
2015-05-27;11:56:45.49spid9sStartingupdatabase'model'.
2015-05-27;11:56:45.67ServerTheSQLServerNetworkInterfacelibrarysuccessfullyregisteredtheServicePrincipalName(SPN)[MSSQLSvc/GEK-MIS01UAT.gfg1.esquel.com]fortheSQLServerservice.
2015-05-27;11:56:45.67ServerTheSQLServerNetworkInterfacelibrarysuccessfullyregisteredtheServicePrincipalName(SPN)[MSSQLSvc/GEK-MIS01UAT.gfg1.esquel.com:1433]fortheSQLServerservice.
2015-05-27;11:56:45.83spid9sClearingtempdbdatabase.
2015-05-27;11:56:45.84spid9sError:5123,Severity:16,State:1.
2015-05-27;11:56:45.84spid9sCREATEFILEencounteredoperatingsystemerror5(Accessisdenied.)whileattemptingtoopenorcreatethephysicalfile'D:\tempdb.mdf'.
2015-05-27;11:56:45.94spid9sError:17204,Severity:16,State:1.
2015-05-27;11:56:45.94spid9sFCB::Openfailed:CouldnotopenfileD:\tempdb.mdfforfilenumber1.OSerror:2(Thesystemcannotfindthefilespecified.).
2015-05-27;11:56:45.94spid9sError:5120,Severity:16,State:101.
2015-05-27;11:56:45.94spid9sUnabletoopenthephysicalfile"D:\tempdb.mdf".Operatingsystemerror2:"2(Thesystemcannotfindthefilespecified.)".
2015-05-27;11:56:45.94spid9sError:1802,Severity:16,State:4.
2015-05-27;11:56:45.94spid9sCREATEDATABASEfailed.Somefilenameslistedcouldnotbecreated.Checkrelatederrors.
2015-05-27;11:56:45.94spid9sCouldnotcreatetempdb.Youmaynothaveenoughdiskspaceavailable.FreeadditionaldiskspacebydeletingotherfilesonthetempdbdriveandthenrestartSQLServer.Checkforadditionalerrorsintheeventlogthatmayindicatewhythetempdbfilescouldnotbeinitialized.
2015-05-27;11:56:45.94spid9sSQLTracewasstoppedduetoservershutdown.TraceID='1'.Thisisaninformationalmessageonly;nouseractionisrequired.
2015-05-27;11:56:46.20spid16sTheSQLServerNetworkInterfacelibrarycouldnotderegistertheServicePrincipalName(SPN)[MSSQLSvc/xxxx.xxxx.xxxx.com]fortheSQLServerservice.Error:0x2af9,state:61.AdministratorshouldderegisterthisSPNmanuallytoavoidclientauthenticationerrors.
2015-05-2711:56:46.20spid16sTheSQLServerNetworkInterfacelibrarycouldnotderegistertheServicePrincipalName(SPN)[MSSQLSvc/xxxx.xxx.xxxx.com:1433]fortheSQLServerservice.Error:0x2af9,state:61.AdministratorshouldderegisterthisSPNmanuallytoavoidclientauthenticationerrors.

我猜测是系统权限问题导致,于是我右键单击D盘的属性选项,在”Security“里面找到Users(xxxx\Users),授予用户”FullControl“权限,然后重启数据库实例,问题解决。我后面测试了一下,其实在WindowsServer2012下,将任何数据库文件放置在磁盘根目录下都有这个权限问题.


内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐