新聞中心
恢復(fù)SQL Server數(shù)據(jù)庫是每一個DBA都需要掌握的技能,下面就為您介紹一些正?;謴?fù)SQL Server數(shù)據(jù)庫用到的語句,希望對您學(xué)習(xí)恢復(fù)SQL Server方面能有所幫助。

惠民ssl適用于網(wǎng)站、小程序/APP、API接口等需要進行數(shù)據(jù)傳輸應(yīng)用場景,ssl證書未來市場廣闊!成為創(chuàng)新互聯(lián)的ssl證書銷售渠道,可以享受市場價格4-6折優(yōu)惠!如果有意向歡迎電話聯(lián)系或者加微信:028-86922220(備注:SSL證書合作)期待與您的合作!
正常方式下,我們要備份一個數(shù)據(jù)庫,首先要先將該數(shù)據(jù)庫從運行的數(shù)據(jù)服務(wù)器中斷開,或者停掉整個數(shù)據(jù)庫服務(wù)器,然后復(fù)制文件。
卸下數(shù)據(jù)庫的命令:Sp_detach_db 數(shù)據(jù)庫名
連接數(shù)據(jù)庫的命令:
Sp_attach_db或者sp_attach_single_file_db
s_attach_db [@dbname =] ′dbname′, [@filename1 =] ′filename_n′ [,...16]
sp_attach_single_file_db [@dbname =] ′dbname′, [@physname =] ′physical_name′
使用此方法可以正確恢復(fù)SQL Sever7.0和SQL Server 2000的數(shù)據(jù)庫文件,要點是備份的時候一定要將mdf和ldf兩個文件都備份下來,mdf文件是數(shù)據(jù)庫數(shù)據(jù)文件,ldf是數(shù)據(jù)庫日志文件。
數(shù)據(jù)庫修復(fù)包括:sql數(shù)據(jù)庫修復(fù) sql數(shù)據(jù)庫恢復(fù)sql server修復(fù) 文件修復(fù) raid數(shù)據(jù)恢復(fù) sql數(shù)據(jù)庫修復(fù) raid磁盤陣列 sql恢復(fù) sql server恢復(fù) 假設(shè)數(shù)據(jù)庫為test,其數(shù)據(jù)文件為test_data.mdf,日志文件為test_log.ldf。
卸下數(shù)據(jù)庫:sp_detach_db 'test'
連接數(shù)據(jù)庫:sp_attach_db 'test','C:\Program Files\Microsoft SQL Server\MSSQL\Data\test_data.mdf','C:\Program Files\Microsoft SQL Server\MSSQL\Data\test_log.ldf'
sp_attach_single_file_db 'test','C:\Program Files\Microsoft SQL Server\MSSQL\Data\test_data.mdf'
【編輯推薦】
SQL Server連接錯誤的處理方法
SQL Server管理相關(guān)的注冊表技巧
SQL Server服務(wù)器角色簡介
SQL Server對象許可管理
SQL Server用戶帳號管理
名稱欄目:正?;謴?fù)SQLServer數(shù)據(jù)庫用到的語句
網(wǎng)頁鏈接:http://fisionsoft.com.cn/article/codgcoe.html


咨詢
建站咨詢
