zoukankan      html  css  js  c++  java
  • Sqlserver修改文件目录,包括系统数据库

    转载: https://blog.csdn.net/zengcong2013/article/details/50354546/

    修改系统数据库SQL

     
    alter database master modify file ( name = master, filename ='C:\Program Files (x86)\Microsoft SQL Server\MSSQL.1\MSSQL\Data1\master.mdf');
    alter database master modify file ( name = mastlog, filename ='C:\Program Files (x86)\Microsoft SQL Server\MSSQL.1\MSSQL\Data1\mastlog.ldf');
    
    alter database model modify file ( name = modeldev, filename ='C:\Program Files (x86)\Microsoft SQL Server\MSSQL.1\MSSQL\Data1\model.mdf');
    alter database model modify file ( name = modellog, filename ='C:\Program Files (x86)\Microsoft SQL Server\MSSQL.1\MSSQL\Data1\modellog.ldf');
     
    alter database msdb modify file ( name = MSDBData, filename ='C:\Program Files (x86)\Microsoft SQL Server\MSSQL.1\MSSQL\Data1\MSDBData.mdf');
    alter database msdb modify file ( name = MSDBLog, filename ='C:\Program Files (x86)\Microsoft SQL Server\MSSQL.1\MSSQL\Data1\MSDBLog.ldf');
      
    alter database tempdb modify file ( name = tempdev, filename ='C:\Program Files (x86)\Microsoft SQL Server\MSSQL.1\MSSQL\Data1\tempdb.mdf');
    alter database tempdb modify file ( name = templog, filename ='C:\Program Files (x86)\Microsoft SQL Server\MSSQL.1\MSSQL\Data1\templog.ldf');
     
     
    

      

    注意: 执行完成后,由于系统权限问题,必须将SQL服务改为管理员登录

  • 相关阅读:
    [LeetCode 049] Group Anagrams
    [LeetCode 033] Search in Rotated Sorted Array
    [LeetCode 024] Swap Nodes in Pairs
    [LeetCode 016] 3Sum Closest
    [LeetCode 015] 3Sum
    [LeetCode 013] Roman to Integer
    [LeetCode 008] String to Integer (atoi)
    [LeetCode 007] Reverse Integer
    第四课:文件操作【解密】
    第三课:文件操作【逐步浅入,深入加解法】
  • 原文地址:https://www.cnblogs.com/lhlong/p/15660757.html
Copyright © 2011-2022 走看看