Two cases of Sybase Database repair

Source: Internet
Author: User
Tags sybase database

Sybase Database repair is divided into two situations:

1. The device used by the database is normal, and the demodb status of the database is suspect..

1) register with sa

Isql-u sa-P

1>

2) modify the server attribute and set the system table to allow modification.

1> sp_configure "allow updates", 1

2> go

3> recofigure with override

4> go

3) the Sybase Database is repaired. Modify the database status and set the database status to not be detected when the server is started.

1> update master. sysdatabases set status =-32768

2> where name = "demodb"

3> go

4) restart the server.

5) modify the database status and set the database status to normal.

1> update master. sysdatabases set status = 0

2> where name = "demodb"

3> go

6) modify the server attribute and make the system table unchangeable.

1> sp_configure "allowupdates", 0

2> go

3> reconfigure with override

4> go

7) restart the server again.

So far, if the database can be normal, the recovery is complete, and so far, the Sybase Database has been repaired.

In the preceding steps, you can also start the server in single-user mode. The command is startserver-m without modifying the "allow updates" attribute of the server. You only need to restart the server of SYBASE 11 and later versions, and do not need to execute reconfigure with override. If the above method still cannot restore the database, you can only use the dbcc command to delete the database and then re-create it.

2. The device used by the database is abnormal.The database status is suspect. Use the sp_helpdb and sp_helpdevice commands to find the logical name, physical name, device number, and size of the database device. If the preceding command cannot find information about the database device, you can use select * from master. sydatabases and select * from master. sysdevices. Then, use disk reinit to reconstruct the device. Finally, follow the steps 1 to restore the database.

In the first case, the database is slightly damaged and can be used after the database content is checked. In the second case, if the database logs are created on different devices, but the Log Device of the database is damaged, the damage to the database will be lighter. During the Sybase Database repair process, however, some transactions cannot be recovered. If the device in the database is damaged, all contents of the entire database will be lost, and the contents of tables and stored procedures must be rebuilt. Therefore, it is recommended that the logs of the database and the database be created on different devices.

The System Error Log errorlog file contains the error information of the SYBASE Database System. When a system error occurs, check the file to identify the cause of the error and find a solution to avoid misoperation.

  1. Sybase Data Warehouse Dapeng securities application case (1)
  2. Sybase Database Engine running methods
  3. Sybase data backup-BCP usage Overview
  4. Several configuration problems of Sybase Database
  5. How to Set Sybase user permissions to process Processes

Related Article

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.