Home Database Mysql Tutorial 数据库文件损坏的恢复方法

数据库文件损坏的恢复方法

Jun 07, 2016 pm 04:19 PM
recover database document method

说明如下:SQL Server 2000文件损坏的恢复 1、建一个测试数据库test(数据库类型为完全)。 2、建一个表,插入点记录。 create table a(c1 varchar(2)) go insert into a values('aa') go insert into a values('bb') go 3、作完全备份,到文件test_1.bak。 4

   说明如下:SQL Server 2000文件损坏的恢复

  1、建一个测试数据库test(数据库类型为完全)。

  2、建一个表,插入点记录。

  create table a(c1 varchar(2)) go insert into a values('aa') go insert into a values('bb') go

  3、作完全备份,到文件test_1.bak。

  4、在作一点修改。

  insert into a values('cc') go create table b(c1 int) go insert into b values(1) go insert into b values(2) go

  5、shutdown 数据库服务器。

  SQL Server 2000文件损坏的恢复6、用ultraedit编辑数据库文件test_data.mdf,随便修改点字节内容,相当于数据库遭到致命的损坏。

  7、启动数据库,并且运行企业管理器,点开数据库,看到test变成灰色,而且显示置疑。

  8、运行isql -SLocalhost -Usa -P。

  1> backup log test TO DISK=' D:Program FilesMicrosoft SQL ServerMSSQLBACKUP est_2.bak' WITH NO_TRUNCATE 2>go

  已处理2页,这些页属于数据库 'test' 的文件 'TEST_Log'(位于文件 1 上)。

  BACKUP LOG 操作成功地处理了 2 页,花费了 0.111 秒(0.087 MB/秒)。

  SQL Server 2000文件损坏的恢复9、进行恢复最老的完全备份。

  1> RESTORE DATABASE test FROM DISK=' D:Program FilesMicrosoft SQL ServerMSSQL BACKUP est_1.bak' WITH NORECOVERY 2> go

  已处理96页,这些页属于数据库 'test' 的文件 'TEST_Data'(位于文件 1 上)。已处理1页,这些页属于数据库 'test' 的文件 'TEST_Log'(位于文件 1 上)。

  RESTORE DATABASE 操作成功地处理了 97 页,花费了 0.107 秒(7.368 MB/秒)。

  10、恢复最近的日志。

  1> RESTORE LOG test FROM DISK=' D:Program FilesMicrosoft SQL ServerMSSQLBACKU P est_2.bak' WITH RECOVERY 2> go

  已处理 2 页,这些页属于数据库 'test' 的文件 'TEST_Log'(位于文件 1 上)。

  RESTORE LOG 操作成功地处理了 2 页,花费了 0.056 秒(0.173 MB/秒)。

  数据已经完全恢复了,可以使用了。

  select * from a go

  总结,,DBA应该有一个完善的数据库备份计划。本例中,如果没有一个完全备份的话,数据库的恢复就不可能。

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1670
14
PHP Tutorial
1276
29
C# Tutorial
1256
24
How to set font size on mobile phone (easily adjust font size on mobile phone) How to set font size on mobile phone (easily adjust font size on mobile phone) May 07, 2024 pm 03:34 PM

Setting font size has become an important personalization requirement as mobile phones become an important tool in people's daily lives. In order to meet the needs of different users, this article will introduce how to improve the mobile phone use experience and adjust the font size of the mobile phone through simple operations. Why do you need to adjust the font size of your mobile phone - Adjusting the font size can make the text clearer and easier to read - Suitable for the reading needs of users of different ages - Convenient for users with poor vision to use the font size setting function of the mobile phone system - How to enter the system settings interface - In Find and enter the "Display" option in the settings interface - find the "Font Size" option and adjust it. Adjust the font size with a third-party application - download and install an application that supports font size adjustment - open the application and enter the relevant settings interface - according to the individual

iOS 18 adds a new 'Recovered' album function to retrieve lost or damaged photos iOS 18 adds a new 'Recovered' album function to retrieve lost or damaged photos Jul 18, 2024 am 05:48 AM

Apple's latest releases of iOS18, iPadOS18 and macOS Sequoia systems have added an important feature to the Photos application, designed to help users easily recover photos and videos lost or damaged due to various reasons. The new feature introduces an album called "Recovered" in the Tools section of the Photos app that will automatically appear when a user has pictures or videos on their device that are not part of their photo library. The emergence of the "Recovered" album provides a solution for photos and videos lost due to database corruption, the camera application not saving to the photo library correctly, or a third-party application managing the photo library. Users only need a few simple steps

How to handle database connection errors in PHP How to handle database connection errors in PHP Jun 05, 2024 pm 02:16 PM

To handle database connection errors in PHP, you can use the following steps: Use mysqli_connect_errno() to obtain the error code. Use mysqli_connect_error() to get the error message. By capturing and logging these error messages, database connection issues can be easily identified and resolved, ensuring the smooth running of your application.

Detailed tutorial on establishing a database connection using MySQLi in PHP Detailed tutorial on establishing a database connection using MySQLi in PHP Jun 04, 2024 pm 01:42 PM

How to use MySQLi to establish a database connection in PHP: Include MySQLi extension (require_once) Create connection function (functionconnect_to_db) Call connection function ($conn=connect_to_db()) Execute query ($result=$conn->query()) Close connection ( $conn->close())

How to choose a mobile phone screen protector to protect your mobile phone screen (several key points and tips for purchasing mobile phone screen protectors) How to choose a mobile phone screen protector to protect your mobile phone screen (several key points and tips for purchasing mobile phone screen protectors) May 07, 2024 pm 05:55 PM

Mobile phone film has become one of the indispensable accessories with the popularity of smartphones. To extend its service life, choose a suitable mobile phone film to protect the mobile phone screen. To help readers choose the most suitable mobile phone film for themselves, this article will introduce several key points and techniques for purchasing mobile phone film. Understand the materials and types of mobile phone films: PET film, TPU, etc. Mobile phone films are made of a variety of materials, including tempered glass. PET film is relatively soft, tempered glass film has good scratch resistance, and TPU has good shock-proof performance. It can be decided based on personal preference and needs when choosing. Consider the degree of screen protection. Different types of mobile phone films have different degrees of screen protection. PET film mainly plays an anti-scratch role, while tempered glass film has better drop resistance. You can choose to have better

How to save JSON data to database in Golang? How to save JSON data to database in Golang? Jun 06, 2024 am 11:24 AM

JSON data can be saved into a MySQL database by using the gjson library or the json.Unmarshal function. The gjson library provides convenience methods to parse JSON fields, and the json.Unmarshal function requires a target type pointer to unmarshal JSON data. Both methods require preparing SQL statements and performing insert operations to persist the data into the database.

How to use database callback functions in Golang? How to use database callback functions in Golang? Jun 03, 2024 pm 02:20 PM

Using the database callback function in Golang can achieve: executing custom code after the specified database operation is completed. Add custom behavior through separate functions without writing additional code. Callback functions are available for insert, update, delete, and query operations. You must use the sql.Exec, sql.QueryRow, or sql.Query function to use the callback function.

Quickly learn how to unlock PUK (easily solve the problem of mobile phone lock screen) Quickly learn how to unlock PUK (easily solve the problem of mobile phone lock screen) Jun 01, 2024 pm 01:38 PM

We often encounter the embarrassing situation of forgetting the password or entering the wrong password and being unable to unlock the phone while using the phone. Let us regain the right to use our mobile phones, and PUK unlocking techniques can help us easily solve these problems. It also provides some practical tips to help readers better deal with mobile phone lock screen problems. This article will teach you the simplest method to unlock PUK and introduce the basic concepts and steps of PUK unlocking. Paragraph 1. What is PUK unlocking? The PUK code is a special code on the mobile phone card. PUK unlocking is a technology used to solve the problem of mobile phone lock screen and is used to unlock the PIN code of the SIM card. Understanding the basic concepts of PUK unlocking is the first step in learning this technique. 2. How to obtain the PUK code? The phone screen will display

See all articles