نمایش نتایج 1 تا 1 از 1

نام تاپیک: attach a MDF without LDF

  1. #1
    کاربر جدید آواتار ehsan_882000
    تاریخ عضویت
    اردیبهشت 1386
    محل زندگی
    eden
    سن
    39
    پست
    20

    attach a MDF without LDF

    attach a MDF without LDF

    Create a new database with the same name and same MDF and LDF files
    Stop sql server and rename the existing MDF to a new one and copy the original MDF
    to this location and delete the LDF files

    Start SQL Server
    Now your database will be marked suspect
    Update the sysdatabases to update to Emergency mode. This will not use LOG files in start up

    Sp_configure "allow updates", 1
    go
    Reconfigure with override
    GO
    Update sysdatabases set status = 32768 where name = "BadDbName"
    go
    Sp_configure "allow updates", 0
    go
    Reconfigure with override
    GO

    Restart sql server. now the database will be in emergency mode
    Now execute the undocumented DBCC to create a log file
    DBCC REBUILD_LOG(dbname,'c:\dbname.ldf') -- Undocumented step to create a new log file

    (replace the dbname and log file name based on ur requirement)

    Execute sp_resetstatus

    Restart SQL server and see the database is online
    آخرین ویرایش به وسیله ehsan_882000 : سه شنبه 02 شهریور 1389 در 11:45 صبح

قوانین ایجاد تاپیک در تالار

  • شما نمی توانید تاپیک جدید ایجاد کنید
  • شما نمی توانید به تاپیک ها پاسخ دهید
  • شما نمی توانید ضمیمه ارسال کنید
  • شما نمی توانید پاسخ هایتان را ویرایش کنید
  •