Restore SQL Server databases without log files

Source: Internet
Author: User
SQLServer is a relational database management system. It was initially developed by three companies, Microsoft Sybase and Ashton-Tate. In 1988, it launched the first OS2 version. After the launch of WindowsNT, Microsoft and Sybase have separated themselves in the Development of SQLServer, Microsoft port SQLServer to Windows

SQL Server is a relational database management system. It was initially developed by Microsoft Sybase and Ashton-Tate, and launched the first OS/2 version in 1988. After the launch of Windows NT, Microsoft and Sybase were separated in the Development of SQL Server. Microsoft transplanted SQL Server to Windows

SQL Server is a relational management system. It was initially developed by Microsoft Sybase and Ashton-Tate, and launched the first OS/2 version in 1988. After the launch of Windows NT, Microsoft and Sybase were separated in the Development of SQL Server. Microsoft transplanted SQL Server to Windows NT, focus on developing and promoting the Windows NT version of SQL Server. Sybase is more focused on SQL Server Applications on UNIX operating systems.

SQL Server 2000 is an SQL Server database management system launched by Microsoft. It inherits the advantages of SQL Server 7.0 and adds many more advanced functions than it. It has the advantages of convenient scalability, high degree of integration with related software, and can be used across a variety of platforms from laptops running Microsoft Windows 98 to large multi-processor running Microsoft Windows 2000.

SQL Server 2005 is a comprehensive database platform that provides enterprise-level data management using integrated BI tools. SQL Server 2005 database engine provides more secure and reliable storage for relational and structured data, allowing you to build and manage high-availability and high-performance data applications for your business. SQL Server 2005 data engine is the core of the enterprise data management solution. In addition, SQL Server 2005 integrates the Analysis, Report, integration, and notification functions. This allows your enterprise to build and deploy cost-effective BI solutions that help your team push data applications to various business areas through the scorecard, Dashboard, Web services, and mobile devices.

Tightly integrated with Microsoft Visual Studio, Microsoft Office System, and new Development kits (including Business Intelligence Development Studio) make SQL Server 2005 different. Whether you are a developer, database administrator, information worker, or decision maker, SQL Server 2005 provides you with innovative solutions to help you benefit more from data.

Cause
  
Yesterday, the system administrator told me that the disk space of an internal application database is insufficient. I noticed that the database Event Log File XXX_Data.ldf has grown to 3 GB, so I decided to narrow down the log file. After failing to contract the database, I made the biggest and most stupid mistake since I entered the industry: I accidentally deleted this log file! Later, I saw all the articles about database Restoration: "It is critical to ensure the existence of database log files no matter what the situation is ", microsoft even has an article in KB about how to restore a database only by using log files. I really don't know what I thought at that time ?!
  
This is broken! The database cannot be connected, and the enterprise manager says "(doubt)" next to it )". And the most terrible thing is that this database has never been backed up. The only thing I can find is another database server that was migrated six months ago. The application is usable, but many records, tables, and stored procedures are missing. I really hope this is just a nightmare!
  
Accidental deletion of database log files or other causes of Database Log damage
  
Method 1
  
1. Create a database with the same name
  
2. Stop SQL server again (do not detach the database)
  
3. overwrite the new database with the data file of the original database.
  
4. Restart SQL server.
  
5. When you open the Enterprise Manager, there will be a doubt. Ignore it and execute the following statement (note that you must modify the database name)
  
6. After completion, You can generally access the data in the database. At this time, the database itself usually needs problems. The solution is to use
  
The database script creates a new database and imports the data.
  
USE MASTER
  
GO
  
SP_CONFIGURE 'Allow updates', 1 RECONFIGURE WITH OVERRIDE
  
GO
  
Update sysdatabases set status = 32768 where name = 'suspicious database name'
  
Go
  
Sp_dboption 'questionable database name', 'single user', 'true'
  
Go
  
Dbcc checkdb ('questionable database name ')
  
Go
  
Update sysdatabases set status = 28 where name = 'questionable database name'
  
Go
  
Sp_configure 'Allow updates', 0 reconfigure with override
  
Go
  
Sp_dboption 'questionable database name', 'single user', 'false'
  
Go

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.