Sql serverDatabase Backup還原另一方法_PHP教程

來源:互聯網
上載者:User
直接拷貝資料檔案把資料庫的資料檔案(*.mdf)和記錄檔(*.ldf)都拷貝到目的伺服器,在SQL Server Query Analyzer中用語句進行恢複: EXEC sp_attach_db @dbname = 'test', @filename1 = 'd:mssql7dataest_data.mdf', @filename2 = 'd:mssql7dataest_log.ldf' 這樣就把test資料庫附加到SQL Server中,可以照常使用。如果不想用原來的記錄檔,可以用如下的命令: EXEC sp_detach_db @dbname = 'test' EXEC sp_attach_single_file_db @dbname = 'test', @physname = 'd:mssql7dataest_data.mdf' 這個語句的作用是僅僅載入資料檔案,記錄檔可以由SQL Server資料庫自動添加,但是原來的記錄檔中記錄的資料就丟失了。

http://www.bkjia.com/PHPjc/631237.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/631237.htmlTechArticle直接拷貝資料檔案把資料庫的資料檔案(*.mdf)和記錄檔(*.ldf)都拷貝到目的伺服器,在SQL Server Query Analyzer中用語句進行恢複: EXEC sp_a...

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.