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.
- Sybase Data Warehouse Dapeng securities application case (1)
- Sybase Database Engine running methods
- Sybase data backup-BCP usage Overview
- Several configuration problems of Sybase Database
- How to Set Sybase user permissions to process Processes