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

惠民ssl適用于網(wǎng)站、小程序/APP、API接口等需要進行數(shù)據(jù)傳輸應用場景,ssl證書未來市場廣闊!成為創(chuàng)新互聯(lián)的ssl證書銷售渠道,可以享受市場價格4-6折優(yōu)惠!如果有意向歡迎電話聯(lián)系或者加微信:028-86922220(備注:SSL證書合作)期待與您的合作!
正常方式下,我們要備份一個數(shù)據(jù)庫,首先要先將該數(shù)據(jù)庫從運行的數(shù)據(jù)服務器中斷開,或者停掉整個數(shù)據(jù)庫服務器,然后復制文件。
卸下數(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′
使用此方法可以正確恢復SQL Sever7.0和SQL Server 2000的數(shù)據(jù)庫文件,要點是備份的時候一定要將mdf和ldf兩個文件都備份下來,mdf文件是數(shù)據(jù)庫數(shù)據(jù)文件,ldf是數(shù)據(jù)庫日志文件。
數(shù)據(jù)庫修復包括:sql數(shù)據(jù)庫修復 sql數(shù)據(jù)庫恢復sql server修復 文件修復 raid數(shù)據(jù)恢復 sql數(shù)據(jù)庫修復 raid磁盤陣列 sql恢復 sql server恢復 假設數(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管理相關的注冊表技巧
SQL Server服務器角色簡介
SQL Server對象許可管理
SQL Server用戶帳號管理
名稱欄目:正?;謴蚐QLServer數(shù)據(jù)庫用到的語句
本文URL:http://m.5511xx.com/article/codgcoe.html


咨詢
建站咨詢
