zoukankan      html  css  js  c++  java
  • Sql server restore script(还原数据库正确的步骤)

    Database YourDB has full backup YourBaackUpFile.bak. It can be restored using following two steps.

    Step 1: Retrive the Logical file name of the database from backup.
    RESTORE FILELISTONLY
    FROM DISK = 'D:BackUpYourBaackUpFile.bak'
    GO

    Step 2: Use the values in the LogicalName Column in following Step.
    ----Make Database to single user Mode
    ALTER DATABASE YourDB
    SET SINGLE_USER WITH
    ROLLBACK
    IMMEDIATE

    ----Restore Database
    RESTORE DATABASE YourDB
    FROM DISK = 'D:BackUpYourBaackUpFile.bak'
    WITH MOVE 'YourMDFLogicalName' TO 'D:DataYourMDFFile.mdf',
    MOVE 'YourLDFLogicalName' TO 'D:DataYourLDFFile.ldf'

    /*If there is no error in statement before database will be in multiuser
    mode.
    If error occurs please execute following command it will convert
    database in multi user.*/
    ALTER DATABASE YourDB SET MULTI_USER
    GO

  • 相关阅读:
    websocket 工作原理
    Flask中的wtforms使用
    DBUtils
    Django模板语言与视图(view)
    Django之图书管理系统
    Django的安装创建与连接数据库
    pymyspl模块
    多表查询与索引
    表的关系与查询
    mysql的数据类型与表约束
  • 原文地址:https://www.cnblogs.com/jinzhao/p/2728018.html
Copyright © 2011-2022 走看看